Differentiation

If $y=\sec x - \tan x$, show that $\cos x \dfrac{d^2 y}{dx^2}=y^2$


$\dfrac{dy}{dx} = \sec x \tan x - \sec^2 x = \sec x \left(\tan x - \sec x\right)$
$ \begin{aligned} \therefore \dfrac{d^2 y}{dx^2} & = \sec x \left(\sec^2 x - \sec x \tan x\right) + \left(\tan x - \sec x\right) \sec x \tan x \\ & = \sec^3 x - \sec^2 x \tan x + \tan^2 x \sec x - \sec^2 x \tan x \\ & = \sec^3 x - 2 \sec^2 x \tan x + \tan^2 \sec x \\ & = \sec x \left(\sec^2 x - 2 \sec x \tan x + \tan^2 x\right) \\ & = \sec x \left(\sec x - \tan x\right)^2 \\ \therefore \dfrac{1}{\sec x} \dfrac{d^2 y}{dx^2} & = \left(\sec x - \tan x\right)^2 \\ \text{i.e. } \cos x \dfrac{d^2 y}{dx^2} & = y^2 \end{aligned} $