If $x=\frac{1}{z}$ and $y=f(x)$ then $\frac{d^2f}{dx^2}=2z^3.\frac{dy}{dz}+z^4.\frac{d^2y}{dz^2}$ If $x=\frac{1}{z}$ and $y=f(x)$ then prove that:

$$\frac{d^2f}{dx^2}=2z^3.\frac{dy}{dz}+z^4.\frac{d^2y}{dz^2}$$

How should I approach this? I don't know how to eliminate $f'$  term.
 A: Write down
$$
y(z)=f\Bigl(\frac1z\Bigr)\text{ resp. }f(x)=y\Bigl(\frac1x\Bigr)
$$
and apply the differentiation theorems, Alexandre Chain's rule etc.
$$
y'(z)=f'\Bigl(\frac1z\Bigr)·\Bigl(-\frac1{z^2}\Bigr),\quad y''(z)=f''\Bigl(\frac1z\Bigr)·\Bigl(-\frac1{z^2}\Bigr)^2+f'\Bigl(\frac1z\Bigr)·\Bigl(\frac2{z^3}\Bigr)
$$
resp.
$$
f'(x)=y'\Bigl(\frac1x\Bigr)·\Bigl(-\frac1{x^2}\Bigr),\quad f''(x)=y''\Bigl(\frac1x\Bigr)·\Bigl(-\frac1{x^2}\Bigr)^2+y'\Bigl(\frac1x\Bigr)·\Bigl(\frac2{x^3}\Bigr).
$$
Partially replacing $\frac1x$ by $z$ gives then
$$
f''(x)=z^4·y''(z)+2z^3·y'(z)
$$
A: You should use the chain rule. Suppose that $y=f(x)$ and $x=g(z)$. Then we have
$$y=f \circ g$$
and hence chain rule for the first derivative will be
$$\frac{dy}{dz} = \left( \frac{df}{dx}\circ g \right) \frac{dg}{dz}$$
and then using the product rule and chain rule again we will get
$$\frac{d^2y}{dz^2} = \left( \frac{d^2f}{dx^2}\circ g \right) \left( \frac{dg}{dz} \right)^2 + \left( \frac{df}{dx}\circ g \right) \frac{d^2g}{dz^2}$$
