<s>[INST] $\int \frac{\cos 4x}{4 \sin 2x} dx$ $\int \frac{\cos 4x}{4 \sin 2x} dx$
Let $u=2x$, $dx = 1/2 du$
$\int \frac{\cos 2u}{4 \sin u} \frac{1}{2} du = \frac{1}{8} \int \frac{1-2\sin^2 u}{\sin u}du \frac{1}{8} \int \frac{1}{\sin u} du - \frac{1}{8} \int 2 \sin u$
How do I integrate $\int \frac{1}{\sin u} du$ to get $\ln (\tan x)$ ?
The online calculator told me to use Weierstrass Substitution which I have not learnt before. Is there any other way to solve this ?
 [/INST] Hint Rewrite the standard integration formula
$$\int \cot u \,du = - \log\left\vert\csc u + \cot u\right\vert + C$$
using a half-angle identity for cotangent,
$$\csc u + \cot u = \frac{1 + \cos u}{\sin u} = \cot \frac{u}{2} = \cot x .$$
</s>