<s>[INST] How to integrate $\frac{\cos2x}{ \sin x + \sin 3x}$? I thought of using trig identities to get rid of $\cos2x$ and $\sin3x$, then use Weierstrass substitution, but I got myself into big trouble as the expression got too complicated.
Is there a simpler way to tackle this problem?
 [/INST] The method using the Weierstass substitution isn't so bad.
$$t=\tan\left(\frac x2\right) \implies \begin{cases}\sin(x) = \frac{2t}{1+t^2} \\ \cos(2x) = 2\left(\frac{1-t^2}{1+t^2}\right)^2 - 1 \\ \sin(3x) = \frac{6t(1-t^2)^2-8t^3}{(1+t^2)^3}\end{cases}$$
where we use the identities
$$\begin{cases}\sin(x) = 2\sin\left(\frac x2\right)\cos\left(\frac x2\right) \\ \cos(x) = \cos^2\left(\frac x2\right) - \sin^2\left(\frac x2\right) \\ \cos(2x) = 2\cos^2(x) - 1 \\ \sin(3x) = 3\cos^2(x)\sin(x) - \sin^3(x)\end{cases}$$
Now $dt = \frac12\sec^2\left(\frac x2\right)\,dx \iff dx = \frac{2\,dt}{1+t^2}$, so
$$\begin{align}
\int \frac{\cos(2x)}{\sin(x) + \sin(3x)} \, dx &= \int \frac{2\left(\frac{1-t^2}{1+t^2}\right)^2-1}{\frac{2t}{1+t^2} + \frac{6t(1-t^2)^2-8t^3}{(1+t^2)^3}} \frac2{1+t^2} \, dt \\[1ex]
&= 2 \int \frac{2(1-t^2)^2-(1+t^2)^2}{2t(1+t^2)^2 + 6t(1-t^2)^2-8t^3} \, dt \\[1ex]
&= \frac14 \int \frac{t^4-6t^2+1}{t^5-2t^3+t} \, dt \\[1ex]
&= \frac14 \int \left(\frac1t + \frac1{(t+1)^2} - \frac1{(t-1)^2}\right) \, dt \\[1ex]
\end{align}$$
</s>