How to apply chain rule when there is mixed dependencies

68 Views Asked by At

When i have the function $r=\sqrt{x^2+y^2+z^2}$ and I want to take it's second derivative with respect to x, I have $r_x=\frac{x}{r}$, and if I try to apply chain rule $\frac{d}{dx}r_x=(r_x)_r \cdot r_x+r_{xx}$ because of total derivative. Refering to the last term $r_{xx}$, if I calculate it with r as constant w.r.t. x, it gives the correct answer $\frac{1}{r}$, but for that I should ignore the dependency of r as function of x. How I am allowed to go over this and just ignore I am back at the same problem again?

Thanks in advance.

2

There are 2 best solutions below

1
On

$$r^2=x^2+y^2+z^2 $$

Taking the partial with respect ot $x$ of $r^2$ gives

\begin{eqnarray} 2r\frac{\partial r}{\partial x}&=&2x\\ r\frac{\partial r}{\partial x}&=&x\label{1}\tag{1}\\ \frac{\partial r}{\partial x}&=&\frac{x}{r}\label{2}\tag{2}\\ \end{eqnarray}

Taking the partial with respect to $x$ of equation \eqref{1} gives

\begin{eqnarray} \left(\frac{\partial r}{\partial x}\right)^2+r\frac{\partial^2r}{\partial x^2}&=&1\\ \left(\frac{x}{r}\right)^2+r\frac{\partial^2r}{\partial x^2}&=&1\\ \frac{\partial^2r}{\partial x^2}&=&\frac{r^2-x^2}{r^3}\\ \frac{\partial^2r}{\partial x^2}&=&\frac{y^2+z^2}{r^3} \end{eqnarray}

0
On

$\frac{d}{dx}r_x=(r_x)_r \cdot r_x+r_{xx}$

You seem to be mangling the chain and product rules, as well as blending the notation.

$r_{xx}$ is what you are trying to find: the second partial derivative of $r$ with respect to $x$ (while holding $y$ and $z$ as independents).

Since you already know the first derivative, us that. Next use the product rule to obtain a sum, and then use the chain rule on an appropriate term. Finally clean it up.

$\qquad\begin{align} r_x &= x/r & \dfrac{\partial r}{\partial x} &= \dfrac xr \\r_{xx} &= (x/r)_x & \dfrac{\partial^2 r}{\partial x~^2}&=\dfrac{\partial~~}{\partial x}\left(\dfrac xr\right) \\&=(x)_x/r+ x\cdot(1/r)_x &&=\dfrac{\partial x}{\partial x}\dfrac 1r+\dfrac x~\dfrac{\partial(1/r)}{\partial x}&&\text{product rule} \\&=(x)_x/r+ x\cdot(1/r)_r\cdot r_x&&=\dfrac{\partial x}{\partial x}\dfrac 1r+\dfrac x~\dfrac{\mathrm d(1/r)}{\mathrm d r}\dfrac{\partial r}{\partial x}&&\text{chain rule}\\&=1/r-x\cdot(1/r^2)\cdot(x/r)&&=\dfrac 1r-\dfrac{x^2}{r^3} \\&=\dfrac{y^2+z^2}{(x^2+y^2+z^2)^{3/2}} \end{align}$