# Easy Differentiating Twice question?

So, this is the question:

But, how can it be $\cos^2x?$ Doesn't it mean to be just $cosx$? Do you think it is a typo?

Let $f(x) = \cos x,\quad g(x)=\frac{\mathrm d y}{\mathrm dz}.$ Then $\frac{\mathrm d y}{\mathrm dx} = f(x)g(x)$ and so if we differentiate we get \begin{align} \frac{\mathrm d^2 y}{\mathrm dx^2} &= f'(x)g(x)+f(x)g'(x)\\ &=-\sin x\frac{\mathrm d y}{\mathrm dz} + \cos x \frac{\mathrm d }{\mathrm dx}\frac{\mathrm d y}{\mathrm dz}\\ &=-\sin x\frac{\mathrm d y}{\mathrm dz} + \cos x \frac{\mathrm d }{\mathrm dz}\frac{\mathrm d y}{\mathrm dx}\\ &=-\sin x\frac{\mathrm d y}{\mathrm dz} + \cos x \frac{\mathrm d }{\mathrm dz}\frac{\mathrm d y}{\mathrm dz}\cos x\\ &=-\sin x\frac{\mathrm d y}{\mathrm dz} + \frac{\mathrm d^2 y}{\mathrm dz^2}\cos^2 x\\ \end{align}
• You're missing a negative sign, should be ${-\sin{x}}$. I tried to edit it in, but it's only 4 characters and you need at least 10 :) Jun 1, 2015 at 19:21
• Opps, I had $-\sin x$ but must have dropped it by mistake Jun 1, 2015 at 19:23