# How do you differentiate f(x)=cos(sqrt((cosx^2)))  using the chain rule?

Nov 10, 2015

$f ' \left(x\right) = \frac{\sin \left(\sqrt{\cos {x}^{2}}\right)}{\sqrt{\cos {x}^{2}}} \cdot \left(\sin {x}^{2}\right) \cdot x$

#### Explanation:

Use progressively the chain rule which says :
$\frac{d F \left(u \left(x\right)\right)}{\mathrm{dx}} = F ' \left(u \left(x\right)\right) \cdot u ' \left(x\right)$.

$f ' \left(x\right) = \cos ' \left(\sqrt{\cos {x}^{2}}\right) \cdot \frac{d \sqrt{\cos {x}^{2}}}{\mathrm{dx}}$
so,
$f ' \left(x\right) = - \sin \left(\sqrt{\cos {x}^{2}}\right) \cdot \frac{1}{2 \sqrt{\cos {x}^{2}}} \cdot \frac{d \cos {x}^{2}}{\mathrm{dx}}$
because $\cos ' = - \sin$ and $\frac{d \setminus \sqrt{X}}{\mathrm{dX}} = \frac{1}{2 \sqrt{X}}$.
Therefore;
$f ' \left(x\right) = - \frac{\sin \left(\sqrt{\cos {x}^{2}}\right)}{2 \sqrt{\cos {x}^{2}}} \cdot \left(- \left(\sin {x}^{2}\right) \cdot \frac{d {x}^{2}}{\mathrm{dx}}\right)$
Finally,
$f ' \left(x\right) = \frac{\sin \left(\sqrt{\cos {x}^{2}}\right)}{\sqrt{\cos {x}^{2}}} \cdot \left(\sin {x}^{2}\right) \cdot x$
because $\frac{d {x}^{2}}{\mathrm{dx}} = 2 x$.

Nov 10, 2015

dy/dx = f^'(x) = (sin(sqrt(cos(x^2)))sin(x^2)x)/(sqrt(cos(x^2))

#### Explanation:

I'll be using Leibniz notation because I think it's easier to understand more complicated chain rule applications with this.

The chain rule, in said notation goes as follows,

For $y = f \left(x\right)$ such that $f \left(x\right) = g \left(u\right)$ then $\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{d}{\mathrm{du}} \left(g \left(u\right)\right) \frac{\mathrm{du}}{\mathrm{dx}}$,

Or, if we can say that a function $f \left(x\right)$ is a simpler function $g \left(u\right)$ for a defined relationship between $x$ and $u$, we can derive $g \left(u\right)$ wrt $u$ and multiply by the derivative of $u$.

In this case we have

$y = \cos \left(\sqrt{\cos \left({x}^{2}\right)}\right)$

By saying $\sqrt{\cos \left({x}^{2}\right)} = u$ we have

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{d}{\mathrm{du}} \cos \left(u\right) \frac{\mathrm{du}}{\mathrm{dx}}$

Or

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \left(u\right) \frac{\mathrm{du}}{\mathrm{dx}}$

Now, if we say that $\cos \left({x}^{2}\right) = v$ we can say that

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \left(u\right) \frac{d}{\mathrm{dv}} \left(\sqrt{v}\right) \frac{\mathrm{dv}}{\mathrm{dx}}$

Or

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{u}{2 \sqrt{v}} \frac{\mathrm{dv}}{\mathrm{dx}} = - \sin \frac{u}{2 u} \frac{\mathrm{dv}}{\mathrm{dx}}$

If we say ${x}^{2} = w$ we have

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{u}{2 u} \frac{d}{\mathrm{dw}} \cos \left(w\right) \frac{\mathrm{dw}}{\mathrm{dx}}$

Or

$\frac{\mathrm{dy}}{\mathrm{dx}} = - \sin \frac{u}{2 u} \left(- \sin \left(w\right)\right) \frac{\mathrm{dw}}{\mathrm{dx}} = \frac{\sin \left(u\right) \sin \left(w\right)}{2 u} \frac{\mathrm{dw}}{\mathrm{dx}}$

Or, finally

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\sin \left(u\right) \sin \left(w\right)}{2 u} \frac{d}{\mathrm{dx}} \left({x}^{2}\right)$
$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\sin \left(u\right) \sin \left(w\right) x}{u}$

And now we subsitute everything back to terms of $x$

dy/dx = f^'(x) = (sin(sqrt(cos(x^2)))sin(x^2)x)/(sqrt(cos(x^2))