# What is the derivative of cosx^tanx?

First find the derivative of $y = {x}^{\tan \left(x\right)}$ by taking the natural log of both sides to get $\ln \left(y\right) = \ln \left({x}^{\tan \left(x\right)}\right) = \tan \left(x\right) \ln \left(x\right)$ and then differentiating with the Chain Rule (on the left) and Product Rule (on the right to get $\setminus \frac{1}{y} \setminus \frac{\mathrm{dy}}{\mathrm{dx}} = {\sec}^{2} \left(x\right) \ln \left(x\right) + \frac{\tan \left(x\right)}{x}$. Now multiply both sides by $y = {x}^{\tan \left(x\right)}$ to get $\frac{\mathrm{dy}}{\mathrm{dx}} = {x}^{\tan \left(x\right)} \left({\sec}^{2} \left(x\right) \ln \left(x\right) + \frac{\tan \left(x\right)}{x}\right)$.
Now let $z = \cos \left({x}^{\tan \left(x\right)}\right) = \cos \left(y\right)$ and compute, with the Chain Rule,
$\frac{\mathrm{dz}}{\mathrm{dx}} = - \sin \left(y\right) \frac{\mathrm{dy}}{\mathrm{dx}}$
$= - \sin \left({x}^{\tan \left(x\right)}\right) {x}^{\tan \left(x\right)} \left({\sec}^{2} \left(x\right) \ln \left(x\right) + \frac{\tan \left(x\right)}{x}\right)$