Derivative of the Cosine Squared Function

In this tutorial we shall discuss the derivative of the cosine squared function and its related examples. It can be proved using the definition of differentiation.

We have a function of the form $y = f\left( x \right) = {\cos ^2}x$

By the definition of differentiation we have
$\frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \frac{{f\left( {x + \Delta x} \right) – f\left( x \right)}}{{\Delta x}}\,\,\,\,{\text{ – – – }}\left( {\text{i}} \right)$

Putting the value of the function in equation (i), we get
$\frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \frac{{{{\cos }^2}\left( {x + \Delta x} \right) – {{\cos }^2}x}}{{\Delta x}}$
$\frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \frac{{\left[ {\cos \left( {x + \Delta x} \right) + \cos x} \right]\left[ {\cos \left( {x + \Delta x} \right) – \cos x} \right]}}{{\Delta x}}$

Using the formula from trigonometry $\cos A – \cos B = – 2\sin \left( {\frac{{A + B}}{2}} \right)\sin \left( {\frac{{A – B}}{2}} \right)$
$\begin{gathered} \frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \frac{{\left[ {\cos \left( {x + \Delta x} \right) + \cos x} \right]\left[ { – 2\sin \left( {\frac{{x + \Delta x + x}}{2}} \right)\sin \left( {\frac{{x + \Delta x – x}}{2}} \right)} \right]}}{{\Delta x}} \\ \Rightarrow \frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \left[ {\cos \left( {x + \Delta x} \right) + \cos x} \right] \times – \frac{{\sin \left( {\frac{{2x + \Delta x}}{2}} \right)\sin \left( {\frac{{\Delta x}}{2}} \right)}}{{\frac{{\Delta x}}{2}}} \\ \Rightarrow \frac{{dy}}{{dx}} = \mathop {\lim }\limits_{\Delta x \to 0} \left[ {\cos \left( {x + \Delta x} \right) + \cos x} \right] \times – \mathop {\lim }\limits_{\Delta x \to 0} \sin \left( {\frac{{2x + \Delta x}}{2}} \right)\mathop {\lim }\limits_{\Delta x \to 0} \frac{{\sin \left( {\frac{{\Delta x}}{2}} \right)}}{{\frac{{\Delta x}}{2}}} \\ \Rightarrow \frac{{dy}}{{dx}} = – \left[ {\cos \left( {x + 0} \right) + \cos x} \right]\sin \left( {\frac{{2x + 0}}{2}} \right)\left( 1 \right) \\ \Rightarrow \frac{{dy}}{{dx}} = – 2\cos x\sin x \\ \end{gathered}$

Example: Find the derivative of $y = f\left( x \right) = {\cos ^2}\left( {{x^2} + 8} \right)$

We have the given function as
$y = {\cos ^2}\left( {{x^2} + 8} \right)$

Differentiating with respect to variable $x$, we get
$\frac{{dy}}{{dx}} = \frac{d}{{dx}}{\cos ^2}\left( {{x^2} + 8} \right)$

Using the rule $\frac{d}{{dx}}{\cos ^2}x = – 2\cos x\sin x$, we get
$\begin{gathered} \frac{{dy}}{{dx}} = 2\cos \left( {{x^2} + 8} \right)\frac{d}{{dx}}\cos \left( {{x^2} + 8} \right) \\ \frac{{dy}}{{dx}} = – 2\cos \left( {{x^2} + 8} \right)\sin \left( {{x^2} + 8} \right)\frac{d}{{dx}}\left( {{x^2} + 8} \right) \\ \frac{{dy}}{{dx}} = – 2\cos \left( {{x^2} + 8} \right)\sin \left( {{x^2} + 8} \right)\left( {2x + 0} \right) \\ \frac{{dy}}{{dx}} = – 4x\cos \left( {{x^2} + 8} \right)\sin \left( {{x^2} + 8} \right) \\ \end{gathered}$