# What is the derivative of y = x^cos(x)?

Jan 15, 2017

$\frac{\mathrm{dy}}{\mathrm{dx}} = {x}^{\cos} x \left(- \sin x \ln x + \cos \frac{x}{x}\right)$

#### Explanation:

$y = {x}^{\cos} x$

Take the natural logarithm of both sides.

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

Use the logarithm law for powers, which states that $\log {a}^{n} = n \log a$

$\ln y = \cos x \ln x$

Use the product rule to differentiate the right hand side. $\frac{d}{\mathrm{dx}} \left(\cos x\right) = - \sin x$ and $\frac{d}{\mathrm{dx}} \left(\ln x\right)$.

$\frac{1}{y} \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) = - \sin x \left(\ln x\right) + \cos x \left(\frac{1}{x}\right)$

$\frac{1}{y} \left(\frac{\mathrm{dy}}{\mathrm{dx}}\right) = - \sin x \ln x + \cos \frac{x}{x}$

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{- \sin x \ln x + \cos \frac{x}{x}}{\frac{1}{y}}$

$\frac{\mathrm{dy}}{\mathrm{dx}} = {x}^{\cos} x \left(- \sin x \ln x + \cos \frac{x}{x}\right)$

Hopefully this helps!

Jan 15, 2017

$\frac{d}{\mathrm{dx}} {x}^{\cos x} = {x}^{\cos x} \left(\cos \frac{x}{x} - \sin x \ln x\right)$

#### Explanation:

You can write:

${x}^{\cos x} = {\left({e}^{\ln} x\right)}^{\cos x} = {e}^{\ln x \cos x}$

so:

$\frac{d}{\mathrm{dx}} {x}^{\cos x} = \frac{d}{\mathrm{dx}} \left({e}^{\ln x \cos x}\right)$

using the chain rule:

$\frac{d}{\mathrm{dx}} {x}^{\cos x} = {e}^{\ln x \cos x} \frac{d}{\mathrm{dx}} \left(\ln x \cos x\right)$

then the product rule:

$\frac{d}{\mathrm{dx}} {x}^{\cos x} = {x}^{\cos x} \left(\cos \frac{x}{x} - \sin x \ln x\right)$