# How do you differentiate f(x)=sin^2(lnx)xcos^2(x^2) using the chain rule?

May 15, 2017

#=-4x^2sin^2(lnx)sin(x^2)cos(x^2)+sin^2(lnx)cos^2(x^2)+xsin(2lnx)cos^2(x^2)

#### Explanation:

$= \left[{\sin}^{2} \left(\ln x\right)\right] \left[\frac{d}{\mathrm{dx}} \left(x {\cos}^{2} \left({x}^{2}\right)\right)\right] + \left[\frac{d}{\mathrm{dx}} \left({\sin}^{2} \left(\ln x\right)\right)\right] \left[x {\cos}^{2} \left({x}^{2}\right)\right]$
$= \left[{\sin}^{2} \left(\ln x\right)\right] \left[\left(x\right) \left(\frac{d}{\mathrm{dx}} \left({\cos}^{2} \left({x}^{2}\right)\right)\right) + \left(1\right) \left({\cos}^{2} \left({x}^{2}\right)\right)\right] + \left[\frac{2 \sin \left(\ln x\right) \cos \left(\ln x\right)}{x}\right] \left[{\cos}^{2} \left({x}^{2}\right)\right]$
$= \left[{\sin}^{2} \left(\ln x\right)\right] \left[\left(x\right) \left(- 2 \sin \left({x}^{2}\right) \cos \left({x}^{2}\right) \left(2 x\right)\right) + {\cos}^{2} \left({x}^{2}\right)\right] + \left[\sin \left(2 \ln x\right) {\cos}^{2} \left({x}^{2}\right)\right]$
$= - 4 {x}^{2} {\sin}^{2} \left(\ln x\right) \sin \left({x}^{2}\right) \cos \left({x}^{2}\right) + {\sin}^{2} \left(\ln x\right) {\cos}^{2} \left({x}^{2}\right) + x \sin \left(2 \ln x\right) {\cos}^{2} \left({x}^{2}\right)$

The chain rule is very messy here but this should guide you:
For ${\sin}^{2} \left(\ln x\right)$, differentiate the quadratic term, triginometric term, $\ln$ term and lastly the $x$ term.

For $x {\sin}^{2} \left({x}^{2}\right)$ Use Product Rule to separate $x$. Differentiate the quadratic term, then the trigonometric term then the inside $\left({x}^{2}\right)$ term.
$\frac{d}{\mathrm{dx}} \left[{\cos}^{2} \left({x}^{2}\right)\right] \to 2 \cos \left({x}^{2}\right) \to - 2 \cos \left({x}^{2}\right) \sin \left({x}^{2}\right) \to - 4 x \sin \left({x}^{2}\right) \cos \left({x}^{2}\right)$