Differentiating $x = \sec^2{3y}$ for $d^2y/dx^2$ I want to ask a question about differentiating trigonometric functions. 
I am trying to find $\frac{d^2y}{dx^2}$ for $x = \sec^2{3y}$
Now, this is what I did. 
$$\frac{dx}{dy} = 6\sec^2{3y}\tan{3y} = 6x(x-1)^{\frac{1}{2}}$$
I got the $(x-1)^{\frac{1}{2}}$ term as follows:
$$\sin^2{3y} + \cos^2{3y} = 1$$
$$\tan^2{3y} + 1 = \sec^2{3y} $$
$$\tan^2{3y} + 1 = x $$
$$\tan^2{3y} = x - 1$$
$$\tan{3y} = (x - 1)^{\frac{1}{2}}$$
hence $$\frac{dy}{dx} = \frac{1}{6x(x-1)^{\frac{1}{2}}}$$
Now, to differentiate again for $\frac{d^2y}{dx^2}$, I use the quotient property of differentiation:
$$\frac{d^2y}{dx^2} = \frac{-\left(6(x-1)^\frac{1}{2} + 3x(x-1)^{-\frac{1}{2}} \right)}{36x^2(x-1)}$$
$$= \frac{-\left(6(x-1) + 3x \right)}{36x^2(x-1)^{\frac{3}{2}}}$$
$$= \frac{6-9x}{36x^2(x-1)^{\frac{3}{2}}}$$
$$= \frac{3-2x}{12x^2(x-1)^{\frac{3}{2}}}$$
But what I did originally was find the second derivative for $\frac{d^2x}{dy^2}$ as follows:
$$\frac{dx}{dy} = 6x(x-1)^{\frac{1}{2}}$$
$$\frac{d^2x}{dy^2} = 6(x-1)^\frac{1}{2} + 3x(x-1)^{-\frac{1}{2}}$$
so why is it that $\frac{1}{\frac{d^2x}{dy^2}}$ is not the same as $\frac{d^2y}{dx^2}$ when in the first part, $\frac{1}{\frac{dx}{dy}} = \frac{dy}{dx}$?

Because in general, $\dfrac{d^2 x}{dy^2}\dfrac{d^2 y}{dx^2}\ne 1$. To take a much simpler example, if $y=x^3$ then $x=y^{1/3}$ and $$\dfrac{d^2 x}{dy^2}=-\dfrac{2}{9}y^{-5/3}=-\dfrac{2}{9}x^{-5},\,\dfrac{d^2 y}{dx^2}=6x.$$In general, $$\frac{d^2 x}{dy^2}=\frac{d}{dy}((\frac{dy}{dx})^{-1})=-(\frac{dy}{dx})^{-2}\frac{d}{dy}\frac{dy}{dx}=-(\frac{dy}{dx})^{-3}\frac{d}{dx}\frac{dy}{dx}=-(\frac{dy}{dx})^{-3}\frac{d^2 y}{dx^2}.$$Going back to my example, both sides are $-\frac{2}{9}x^{-5}$.
