the easisiest way to find gradient of $\frac{1}{\mathrm{cosh^3}(kr)}$

128 Views Asked by At

So I have to find:

$$\mathrm{grad}f = \frac{1}{\mathrm{cosh^3}(kr)}$$

where $$r = \sqrt{x^2+y^2+z^2}$$

the main problem is that I got really strange components, like for $x$:

$$-\frac{3k\mathrm{tanh}(kr)\mathrm{sech^3}(kr)}{r}$$

is there posibility that I am right with calculus?

5

There are 5 best solutions below

0
On BEST ANSWER

Simply using the chain rule $\nabla f(g(\vec r))=f'(g(\vec r))\nabla g(\vec r)$ yields

$$\nabla \left(\frac{1}{\cosh^3(kr)}\right)=-3\frac{k\sinh(kr)}{\cosh^4(kr)}\nabla (r)=-3\vec r\frac{k\sinh(kr)}{r\cosh^4(kr)}$$

3
On

Your function is radially symmetric (it only depends on $r$), and so is its gradient. Using spherical coordinates (correct me if you are using anything else), the gradient is simply given by

$$ \nabla f = \partial_r (f) \, \mathbf{e}_r = - 3 k \operatorname{sech}^3{(k r)} \, \tanh{(k r)} \, \mathbf{e}_r $$

If you want to express this using Cartesian coordinates you only need to know how to express $\mathbf{e}_r$ in terms of $\mathbf{e}_{x,y,z}$. From Wikipedia:

$$\begin{bmatrix}\boldsymbol{\hat\rho} \\ \boldsymbol{\hat\theta} \\ \boldsymbol{\hat\phi} \end{bmatrix} = \begin{bmatrix} \sin\theta\cos\phi & \sin\theta\sin\phi & \cos\theta \\ \cos\theta\cos\phi & \cos\theta\sin\phi & -\sin\theta \\ -\sin\phi & \cos\phi & 0 \end{bmatrix} \begin{bmatrix} \mathbf{\hat x} \\ \mathbf{\hat y} \\ \mathbf{\hat z} \end{bmatrix}$$

0
On

Suppose the value of a function depends solely on $r$. Noting that $$\frac{\partial r}{\partial x} = \frac{x}{\sqrt{x^2+y^2+z^2}} = \frac{x}{r}$$ and similar for $y$ and $z$, we have that $$\frac{\partial f}{\partial x} = \frac{\partial r}{\partial x}\frac{df}{dr} = \frac{x}{r}\frac{df}{dr}$$ and so $$\nabla f = \frac{\vec{r}}{r}\frac{df}{dr} = f' \hat{r}$$ Consequently, for your $f$, $$\nabla f = -\frac{3k\cosh^2(kr)\sinh(kr)}{\cosh^6(kr)}\hat{r}$$ which is almost equivalent to your expression. The $x$ component would be $$-\frac{3k\sinh(kr)}{\cosh^4(kr)} \frac{x}{r}$$ So, you merely forgot the $x$ there.

0
On

It is not only possible that you are right, but you are exactly right, except for a factor of $x$. The thing that you could note is that the gradient is everywhere proportional to $(x,y,z)$. That is because of the hyperspherical symmetry of the function, causing all normals to pass through the origin.

Of course, in you answer the gradient is always proportional to $(1,1,1)$ and that violates the symmetry of the original function, so you were right to worry.

0
On

For any sufficiently differentiable function

$F:(x, y, z): \Bbb R^3 \to \Bbb R \tag{1}$

which may be written as a function of $r = \sqrt{x^2 + y^2 + z^2}$ alone, we have the general formula

$\nabla F(r) = \dfrac{dF(r)}{dr} \nabla r \tag{2}$

which follows directly from the chain rule, viz.

$\dfrac{\partial F}{\partial x} = \dfrac{dF(r)}{dr} \dfrac{\partial r}{\partial x}, \tag{3}$

with corresponding epxpressions for the $y$ and $z$ derivatives. Also,

$\dfrac{\partial r}{\partial x} = \dfrac{\partial \sqrt{x^2 + y^2 + z^2}}{\partial x} = \dfrac{1}{2 \sqrt{x^2 + y^2 + z^2}}(2x) = \dfrac{x}{\sqrt{x^2 + y^2 + z^2}} =\dfrac{x}{r}, \tag{4}$

and similarly

$\dfrac{\partial r}{\partial y} =\dfrac{y}{r}, \tag{5}$

$\dfrac{\partial r}{\partial z} =\dfrac{z}{r}. \tag{6}$

Thus we have

$\nabla r = (\dfrac{\partial r}{\partial x}, \dfrac{\partial r}{\partial y}, \dfrac{\partial r}{\partial z}) = \dfrac{1}{r}(x, y, z). \tag{7}$

In performing the above calculations we of course assume we are staying away from the point $(0, 0, 0)$, where $r$ is not differentiable.

It then follows from (2) and (7) that

$\nabla F(r) = \dfrac{dF(r)}{dr} \dfrac{1}{r}(x, y, z). \tag{8}$

Taking

$F(r) = f(r) = \dfrac{1}{\cosh^3 (kr)} = \cosh^{-3}(kr) \tag{9}$

we have

$f'(r) = \dfrac{df(r)}{dr} = -3k \cosh^{-4}(kr) \sinh(kr)$ $ = -3k \cosh^{-3}(kr) \dfrac{\sinh (kr)}{\cosh (kr)} = -3k \cosh^{-3}(kr) \tanh (kr) = -3k \tanh (kr) \mathrm{sech^3}(kr); \tag{10}$

it now follows from (8)-(10) that

$\nabla f(r) = -\dfrac{3k \tanh (kr) \mathrm{sech^3}(kr)}{r}(x, y, z) = -3k \tanh (kr) \mathrm{sech^3}(kr) \dfrac{(x, y, z)}{r}; \tag{11}$

we see that the $x$-component of $\nabla f$ contains a factor of $x$ etc.

It is perhaps worth noting that the expression

$\dfrac{(x, y, z)}{r} = \dfrac{(x, y, z)}{\sqrt{x^2 + y^2 + z^2}} \tag{12}$

occurring in (11) is in fact $\vec{e}_r$, the unit vector in the radial direction:

$\vec{e}_r = \dfrac{(x, y, z)}{\sqrt{x^2 + y^2 + z^2}}; \tag{13}$

thus (8) may be written

$\nabla F(r) = \dfrac{dF(r)}{dr} \vec{e}_r, \tag{14}$

a useful general formula.

In closing, we note there is nothing especially three-dimensional about these formulas. Indeed, with $F:\Bbb R^n \to \Bbb R$ and coordinates $x_1, x_2, \dots, x_n$ we have $r = \sqrt{\sum_{i = 1}^n x_i^2}$ and

$\vec{e}_r = \dfrac{(x_1, x_2, \ldots, x_n)}{r}; \tag{15}$

then (14) still binds.