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

Feb 20, 2018

$\frac{\mathrm{dy}}{\mathrm{dx}} = {\left(\cos \left(7 x\right)\right)}^{x} \cdot \left(\ln \left(\cos \left(7 x\right)\right) - 7 x \left(\tan \left(7 x\right)\right)\right)$

Explanation:

This is nasty.

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

Start by taking the natural logarithm of either side, and bring the exponent $x$ down to be the coefficient of the right hand side:

$\Rightarrow \ln y = x \ln \left(\cos \left(7 x\right)\right)$

Now differentiate each side with respect to $x$, using the product rule on the right hand side. Remember the rule of implicit differentiation: $\frac{d}{\mathrm{dx}} \left(f \left(y\right)\right) = f ' \left(y\right) \cdot \frac{\mathrm{dy}}{\mathrm{dx}}$

$\therefore \frac{1}{y} \cdot \frac{\mathrm{dy}}{\mathrm{dx}} = \frac{d}{\mathrm{dx}} \left(x\right) \cdot \ln \left(\cos \left(7 x\right)\right) + \frac{d}{\mathrm{dx}} \left(\ln \left(\cos \left(7 x\right)\right)\right) \cdot x$

Using the chain rule for natural logarithm functions - $\frac{d}{\mathrm{dx}} \left(\ln \left(f \left(x\right)\right)\right) = \frac{f ' \left(x\right)}{f} \left(x\right)$ - we can differentiate the $\ln \left(\cos \left(7 x\right)\right)$

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

Returning to the original equation:

$\frac{1}{y} \cdot \frac{\mathrm{dy}}{\mathrm{dx}} = \ln \left(\cos \left(7 x\right)\right) - 7 x \tan \left(7 x\right)$

Now we can substitute the original $y$ as a function of $x$ value from the start back in, so as to remove the errant $y$ on the left hand side. Multiplying both sides by $y$:

$\frac{\mathrm{dy}}{\mathrm{dx}} = {\left(\cos \left(7 x\right)\right)}^{x} \cdot \left(\ln \left(\cos \left(7 x\right)\right) - 7 x \left(\tan \left(7 x\right)\right)\right)$