Welcome to our community

Be a part of something great, join today!

[SOLVED] Gradient

dwsmith

Well-known member
Feb 1, 2012
1,673
I have
$$
u(r,\theta) = r\cos(\theta)\left[1 - \left(\frac{1}{r}\right)^2\right]
$$
and the gradient is
$$
1 + \frac{2 x^2}{(x^2 + y^2)^2} - \frac{1}{x^2 + y^2}, \frac{2 x y}{(x^2 + y^2)^2}
$$
How was this obtained?
 

Sudharaka

Well-known member
MHB Math Helper
Feb 5, 2012
1,621
I have
$$
u(r,\theta) = r\cos(\theta)\left[1 - \left(\frac{1}{r}\right)^2\right]
$$
and the gradient is
$$
1 + \frac{2 x^2}{(x^2 + y^2)^2} - \frac{1}{x^2 + y^2}, \frac{2 x y}{(x^2 + y^2)^2}
$$
How was this obtained?
Hi dwsmith, :)

The gradient of a scalar field \(f\) in spherical coordinates is given by,

\[\nabla f(r, \theta, \phi) = \frac{\partial f}{\partial r}\mathbf{e}_r+\frac{1}{r}\frac{\partial f}{\partial \theta}\mathbf{e}_\theta+\frac{1}{r \sin\theta}\frac{\partial f}{\partial \phi}\mathbf{e}_\phi=\left(\frac{\partial f}{\partial r},\,\frac{1}{r}\frac{\partial f}{\partial \theta},\,\frac{1}{r \sin\theta}\frac{\partial f}{\partial \phi}\right)\]

Therefore,

\[\nabla u(r, \theta)=\left(\frac{\partial u}{\partial r},\,\frac{1}{r}\frac{\partial u}{\partial \theta},\,0\right)\]

Calculate the partial derivatives and convert them into Cartesian coordinates. Hope you can continue.

Kind Regards,
Sudharaka.
 

Jester

Well-known member
MHB Math Helper
Jan 26, 2012
183
Probably the easiest way is to switch u in terms of x and y, $\it{ i.e.}$

$u = x \left( 1 - \dfrac{1}{x^2+y^2}\right)$,

then calculate the gradient the usual way.