# How do you differentiate y = x^(2 cos x)?

Nov 6, 2016

The derivative for this is found by the chain rule.

#### Explanation:

Let, $y = f \left(x\right) = {x}^{2 \cos x}$.

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} = \frac{d}{\mathrm{dx}} \left({x}^{2 \cos x}\right) \cdot \frac{d}{\mathrm{dx}} \left(2 \cos x\right)$.

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} = \left(2 \cos x \cdot {x}^{2 \cos x - 1}\right) \cdot \left(- 2 \sin x\right)$.

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} = - 4 \sin x \cos x \cdot {x}^{2 \cos x - 1}$. (answer).

Nov 6, 2016

Use some version of logarithmic differentiation.

#### Explanation:

My current preferred form for logarithmic differfentiation is to rewrite as $e$ to a power.

$y = {x}^{2 \cos x} = {e}^{2 \cos x \ln x}$

Now use $\frac{d}{\mathrm{dx}} \left({e}^{u}\right) = {e}^{u} \frac{\mathrm{du}}{\mathrm{dx}}$ to get

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

$= {x}^{2 \cos x} \cdot \left[\frac{2 \cos x}{x} - 2 \sin x \ln x\right]$

Nov 6, 2016

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

#### Explanation:

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

$\ln \left(y\right) = 2 \cos \left(x\right) \ln \left(x\right)$

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

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

Substitute ${x}^{2 \cos \left(x\right)}$ for y:

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