# $\mathbf{g}(\mathbf{r})=-\boldsymbol{\nabla}\psi(\mathbf r)$: searching for a minus sign error

Consider the following figure where $R=\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}=|\mathbf{r}-\mathbf{r}'|$ is the module of the $\mathbf{R}$ vector depends not only on the location of the $P$ point but also on the location $P'$ where the $dV'$ volume is located (fixed once located in the volume $\mathcal{V}$). Obviously if you change $P'=(x',y',z')$ it will also change $\mathbf{R}$. Since the potential \begin{equation} \psi(\mathbf{r})=-G\iiint_{\mathcal{V}} \frac{\rho(x',y',z')dx'dy'dz'}{|\mathbf{r}-\mathbf{r}'|} \end{equation}

we calculate the gradient of the quantity

\begin{equation} \boldsymbol{\nabla}_{(\mathbf r)}\frac{1}{|\mathbf r-\mathbf r'|} \end{equation}

Calculating, respectively, the partial derivatives $\partial_x=\partial/\partial x$, $\partial_y=\partial/\partial y$ and $\partial_z=\partial/\partial z$ compared to the function $1/|\mathbf{r}-\mathbf{r}'|$, we will have

\begin{align*} \frac{\partial}{\partial x}\frac{1}{\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}} & = \frac{\partial}{\partial x}\left((x-x')^2+(y-y')^2+(z-z')^2\right)^{-\frac 12}= && \\ &=\left(-\frac 12\right)\Bigl[\ldots\ldots\Bigr]^{-\frac32}\cdot 2\cdot (x-x')= && \\ &=-\frac{x-x'}{R^3} && \\ \end{align*}

Similarly $$\frac{\partial}{\partial y}\frac{1}{\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}}=-\frac{y-y'}{R^3}$$ $$\frac{\partial}{\partial z}\frac{1}{\sqrt{(x-x')^2+(y-y')^2+(z-z')^2}}=-\frac{z-z'}{R^3}$$

Hence

$$\boldsymbol{\nabla}_{(\mathbf r)}\frac{1}{|\mathbf r-\mathbf r'|}=-\frac{\mathbf r-\mathbf r'}{|\mathbf r-\mathbf r'|^3}.$$ from which

\begin{align} \boldsymbol{\nabla}_{(\mathbf{r})}\psi(\mathbf{r}) & = {\mathbf \nabla}_{(\mathbf{r})}\left(-G\iiint_{\mathcal{V}} \frac{\rho(x',y',z')\,dx'dy'dz'}{|\mathbf{r}-\mathbf{r}'|}\right) = && \tag{*}\\ &= -G\iiint_{\mathcal{V}}\left( {\mathbf \nabla}_{(\mathbf{r})}\frac{1}{|\mathbf{r}-\mathbf{r}'|}\right)\rho(x',y',z')\,dx'dy'dz'= && \\ &= -G\iiint_{\mathcal{V}} \left(-\frac{\mathbf{r}-\mathbf{r}'}{|\mathbf{r}-\mathbf{r}'|^3}\right)\rho(x',y',z')\,dx'dy'dz' = && \nonumber\\ &= G\iiint_{\mathcal{V}} \frac{\rho(x',y',z') \, dx'dy'dz'}{R^2}\,\mathbf{\widehat R}=\mathbf{g}(\mathbf{r}) && \nonumber\\ \nonumber \end{align}

I ask with such kindness, considering that I have to prove that $\mathbf{g}(\mathbf{r})=-\boldsymbol{\nabla}\psi(\mathbf r)$ I was not able to find the error of a less missing sign in the various steps of the $(^*)$.

I hope you will appreciate my effort and my question is clear.

• You should be careful about the derivative of $1/R$, and the explicit definition of $\mathbf{R}$. Is it $\mathbf{r}-\mathbf{r}'$ or $\mathbf{r}'-\mathbf{r}$? – Oktay Doğangün Jul 18 '18 at 20:26
• @OktayDoğangün $\mathbf R=\mathbf r-\mathbf r'$ certainly. If it had been the other way round, the minus sign would have been found. Thank you very much for your comment. – Sebastiano Jul 18 '18 at 20:29
• Please note that homework-like questions and check-my-work questions are generally considered off-topic here. We intend our questions to be potentially useful to a broader set of users than just the one asking, and prefer conceptual questions over those just asking for a specific computation. Additionally, it is unclear what you are actually doing because except for the tag "newtonian-gravity" there is nothing to go on what some of your symbols - like the potential - actually mean. – ACuriousMind Jul 19 '18 at 19:40
• @ACuriousMind For me it was important to understand better also the question of the user who gave me an unclear answer. Evidently I realized that the spirit of this site is different from how I think. Thank you so much. – Sebastiano Jul 19 '18 at 19:44

The expression for the gravitational field induced by the collection of masses $P'$ on the point P reads
$\mathbf{g}(\mathbf{r})=G\iiint_{\mathcal{V}} \left(-\frac{\mathbf{r}-\mathbf{r}'}{|\mathbf{r}-\mathbf{r}'|^3}\right)\rho(x',y',z')\,dx'dy'dz'$.
This solves the sign problem as you can easily see from line 3 of (*). Had the minus sign in the expression not been there, the gravitational field would be pointing along the direction of $\mathbf{R}$ which would make the force repulsive, instead of attractive, as gravity is to our knowledge so far.