Find y''' for y = cos²x
Find $y'''$ for $y = \cos^{2}x$.
Explanation of Method
The double-angle identity turns a square into a single cosine.
Step 1: First derivative
Chain rule on $\bigl(\cos x\bigr)^{2}$, then the double-angle identity $2\sin x\cos x = \sin2x$: \[y' = 2\cos x\cdot\bigl(-\sin x\bigr) = -2\sin x\cos x = -\sin2x.\]
Step 2: Second and third derivatives
Each further step brings out a factor $2$ from the inner function: \[y'' = -2\cos2x, \qquad y''' = -2\cdot\bigl(-\sin2x\bigr)\cdot2 = 4\sin2x.\]
Step 3: A cleaner route
Using $\cos^{2}x = \dfrac{1+\cos2x}{2}$ from the outset removes the product rule entirely: \[y = \frac12+\frac{\cos2x}{2} \;\Longrightarrow\; y' = -\sin2x,\quad y'' = -2\cos2x,\quad y''' = 4\sin2x.\]
Step 4: The general $n$-th derivative
Differentiating $\tfrac12\cos2x$ repeatedly shifts the argument by $\tfrac{\pi}{2}$ each time and multiplies by $2$, so
\[ y^{(n)} = \frac12\cdot2^{n}\cos\!\left(2x+\frac{n\pi}{2}\right) = 2^{\,n-1}\cos\!\left(2x+\frac{n\pi}{2}\right), \qquad n\ge1. \]
The function inside is a cosine, not a sine: the constant $\tfrac12$ contributes nothing after the first step, and what is being differentiated is $\cos 2x$.
Step 5: Verification
\[\begin{array}{c|c|c} n & 2^{\,n-1}\cos\!\left(2x+\frac{n\pi}{2}\right) & \text{direct} \\ \hline 1 & \cos\!\left(2x+\frac{\pi}{2}\right) = -\sin2x & -\sin2x \\ 2 & 2\cos\bigl(2x+\pi\bigr) = -2\cos2x & -2\cos2x \\ 3 & 4\cos\!\left(2x+\frac{3\pi}{2}\right) = 4\sin2x & 4\sin2x \\ 4 & 8\cos\bigl(2x+2\pi\bigr) = 8\cos2x & 8\cos2x \end{array}\]
\[\text{All four rows agree} \;\;\checkmark\]
\[x = \frac{\pi}{4}:\ y''' = 4\sin\frac{\pi}{2} = 4; \text{ and } y = \cos^{2}\frac{\pi}{4} = \frac12 \;\;\checkmark\]
Result
Final answer:
\[\boxed{\,y''' = 4\sin2x\,}\]
Remark
Remark. Replacing the sine by a sine in the general formula would be wrong at every order: $2^{\,n-1}\sin\!\left(2x+\tfrac{n\pi}{2}\right)$ gives $\cos2x$ at $n = 1$, whereas $y' = -\sin2x$. The cosine form is forced by the fact that the function being differentiated is $\tfrac12\cos2x$, and $\bigl(\cos u\bigr)^{(n)} = \cos\!\left(u+\tfrac{n\pi}{2}\right)$ — Problem 291.