# How do you find the derivative of (ln tan(x))^2?

Mar 22, 2015

How? Use the chain rule -- twice.
And simplify the answer. (Often simplifying is the tricky part.)

The derivative of some stuff squared is two times the stuff, times the derivative of that stuff.
Formally : the derivative of ${\left[g \left(x\right)\right]}^{2}$ is $2 \left[g \left(x\right)\right] \cdot g ' \left(x\right)$

In this case the "inside stuff", the $g \left(x\right)$ is itself, the $\ln$ of some stuff. So to find the derivative, we'll need the chain rule again.
The derivative of the $l a$ of some stuff is $1$ over the stuff, times the derivative of that stuff.
Formally : the derivative of $\ln \left[f \left(x\right)\right]$ is $\frac{1}{f} \left(x\right) \cdot f ' \left(x\right)$

Finally, we need to know the derivative of $\tan x$.

The derivative of ${\left(\ln \tan \left(x\right)\right)}^{2}$ is

$2 \left(\ln \tan \left(x\right)\right) \cdot \frac{1}{\tan} \left(x\right) \cdot {\sec}^{2} \left(x\right)$

Now, we've finished the calculus, but we can re-write our answer in simpler form.
$\frac{1}{\tan} \left(x\right) = \cot \left(x\right)$
and $\cot \left(x\right) = \cos \frac{x}{\sin} \left(x\right)$.

The second equality wouldn't be helpful, except that $\sec \left(x\right) = \frac{1}{\cos} \left(x\right)$.

Therefore we can re-write the derivative using:

$\frac{1}{\tan} \left(x\right) \cdot {\sec}^{2} \left(x\right) = \cot \left(x\right) {\sec}^{2} \left(x\right) = \cos \frac{x}{\sin} \left(x\right) \cdot \frac{1}{\cos} ^ 2 \left(x\right) = \frac{1}{\sin} \left(x\right) \cdot \frac{1}{\cos} \left(x\right)$

Which is surely more simply written as $\csc \left(x\right) \sec \left(x\right)$

So
The derivative of ${\left(\ln \tan \left(x\right)\right)}^{2}$ is

$2 \left(\ln \tan \left(x\right)\right) \csc \left(x\right) \sec \left(x\right)$

(If there's any advantage to it, we could also re-write $\ln \tan \left(x\right)$ as $\ln \left(\sin x\right) - \ln \left(\cos x\right)$.)