I am trying to find the scalar potential, $\phi(\vec r)$, of a conservative vector field $\vec a(\vec r)$. I am integrating along a straight line from $\vec r_0$ to $\vec r$ which is parametrised by $\vec r^\prime = \lambda\vec r$ with $0\le\lambda\le1$. Thus $d\vec r^\prime=d\lambda\vec r$ and hence:$$\phi(\vec r)=\int_0^\vec r \vec a(\vec r^\prime)\cdot d\vec r^\prime=\int_{\lambda=0}^{\lambda=1} \vec a(\lambda\vec r)\cdot \vec r d\lambda$$

The conservative vector field I am using is $\vec a=\vec rf(r)$ where $f(r)$ is an arbitrary function of $r=|\vec r|$.

Therefore, $$\phi(\vec r)=\int_{\lambda=0}^{\lambda=1} \vec a(\lambda\vec r)\cdot \vec r d\lambda=\int_{0}^{1} \lambda\vec rf(\lambda r)\cdot \vec r d\lambda\: [\star]$$ $$=\int_{0}^{1} \lambda^2(\vec r\cdot \vec r)f(r) d\lambda\:[\star\star]=(\vec r\cdot \vec r)f(r)\int_{0}^{1} \lambda^2 d\lambda $$ $$=\frac{1}{3}(\vec r\cdot \vec r)f(r)=\frac{1}{3}r^2f(r)$$

Next, in order to verify that I have obtained the correct scalar potential I use the fact that: $$\vec a=\nabla \phi (\vec r) $$ $$\vec a=\nabla(\frac{1}{3}r^2f(r))=\frac{1}{3}((\nabla r^2)f(r)+(\nabla f(r))r^2)$$ $$=\frac{1}{3}(\vec r f(r) + f^\prime (r)(\nabla r)r^2)=\frac{1}{3}(\vec r f(r) + f^\prime (r)(r^{-1}\vec r)r^2)$$ $$=\frac{1}{3}(\vec r f(r) + f^\prime (r)r^{-1}\vec r)$$

I am supposed to get back my vector $\vec a=\vec rf(r)$ but this is not the case. I believe that there is potentially something wrong at $[\star]$ or $[\star\star]$.

I would like to know where I have gone wrong in order to get back my original vector.


  • $\begingroup$ It seems that you lost a factor $\lambda$: $f(\lambda r) \rightarrow f(r)$ $\endgroup$ Apr 6, 2020 at 2:26
  • $\begingroup$ @Vadim I took the $\lambda$ out and put it into the $\lambda^2$ factor to be integrated. Have I treated the $\lambda$ wrong? How should I treat it? $\endgroup$
    – Σ baryon
    Apr 6, 2020 at 2:33
  • $\begingroup$ @Vadim Can you give me further guidance? $\endgroup$
    – Σ baryon
    Apr 6, 2020 at 3:44
  • $\begingroup$ Generally speaking this is incorrect, since $f(r)$ is an arbitrary function, $f(\lambda r)\neq \lambda f(r)$ $\endgroup$ Apr 6, 2020 at 5:32
  • $\begingroup$ @Vadim So do you know what I should do instead? I do not know how to correctly perform $$\int f(\lambda r)\:d\lambda$$. $\endgroup$
    – Σ baryon
    Apr 6, 2020 at 5:33

2 Answers 2


I would like to know where I have gone wrong in order to get back my original vector.

You went wrong at the step $[\star]$, when you substituted $f(\lambda r)\rightarrow \lambda f(r)$, because in principle we don't know if $f$ is linear or not. Therefore the only thing you can do is leave the potential as $$\phi(\vec{r})=r^2\int_0^1\lambda f(\lambda r)d\lambda\ .$$

From here you can recover the field taking the gradient. Don't let the fact that the expression depends on $\lambda$ intimidate you.

Since the potential actually depends only on $r=|\vec{r}|$, the gradient is $\nabla\phi=\hat{r}\displaystyle\frac{d\phi}{dr}$. Hence remembering the product rule for derivatives and the chain rule

\begin{align} \vec{a}&=\hat{r}\left[2r\int_0^1\lambda f(\lambda r)d\lambda+r^2\frac{d}{dr}\int_0^1\lambda f(\lambda r)d\lambda\right]\\ &=\hat{r}\left[r\int_0^12\lambda f(\lambda r)d\lambda+r^2\int_0^1\lambda^2 f'(\lambda r)d\lambda\right] \end{align}

If we now notice that $$\frac{d}{d\lambda}\left[\lambda^2 f(\lambda r)\right]=2\lambda f(\lambda r)+\lambda^2rf'(\lambda r)$$

it follows immediately that $$\vec{a}=\vec{r}\int_{\lambda=0}^{\lambda=1}d[\lambda^2f(\lambda r)]=\vec{r}f(r)\ .$$


Since $\vec a$ a conservative vector field, $\nabla \times \vec a=0 \iff$ $\vec a=\nabla \phi(\vec r)$ - and the intergal of $\nabla \phi(\vec r)$ is path independent: $\int_\gamma\nabla\phi(\vec r)\cdot d\vec r =\phi(\vec r_b)-\phi(\vec r_{a})$. The integral only depends upon the beginning and ending points.

Hence, $$\int^{r_b}_{r_a}\vec r f(r)\cdot d\vec r=\int^{r_b}_{r_a}\nabla\phi(\vec r)\cdot d\vec r =\phi(r_b)-\phi(r_{a})$$ or $$\int^{r_b}_{r_a} r f(r) dr=\int^{r_b}_{r_a}{\partial}_r\phi(r)dr=\phi(r_b)-\phi(r_{a})$$

where $f(r)$ is unknown.

  • $\begingroup$ When I perform the check on $rf(r)$ via $\vec a=\nabla \phi(\vec r)$ I get $f(r)\vec r r^{-1} + f^\prime (r)\vec r$, which is not the same as the original $\vec a$. Hence $\phi(\vec r) \ne rf(r)$. Can you explain how you got that potential? $\endgroup$
    – Σ baryon
    Apr 6, 2020 at 3:09
  • $\begingroup$ My main problem is knowing how to correctly treat the $f(\lambda r)$ when integrating $\endgroup$
    – Σ baryon
    Apr 6, 2020 at 3:33
  • $\begingroup$ @Σbaryon: I showed you how I got the potential. It's a piece of cake - look up the curl of conservative vector field. It gives you the potential directly. $\endgroup$ Apr 6, 2020 at 4:10
  • 2
    $\begingroup$ @CinaedSimoson I don't think your answer is correct - taking the gradient shows it: $\nabla (rf(r))= \mathbf{r}/r\partial_r(rf(r))= \mathbf{r}/r[f(r)+f'(r)]$ $\endgroup$ Apr 6, 2020 at 5:39
  • 1
    $\begingroup$ @CinaedSimson My understanding is that given is vector field: $\vec{a}=\vec{r}f(r)$. It is certainly a gradient, but not the gradient of $rf(r)$. $\endgroup$ Apr 6, 2020 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.