<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] First, note that
$$\sin(x) + \sin(3x) = 4 \sin(x) \cos^2(x)$$
by the uncommonly-used triple angle identity for sine and the Pythagorean identity:
$$\begin{align*}
\sin(3x) 
&= 3 \sin(x) - 4 \sin^3(x) \\
&= \sin(x) \Big( 3 - 4 \sin^2(x) \Big) \\
&= \sin(x) \Big( 3 - 4 \Big( 1 - \cos^2(x) \Big) \Big) \\
&= \sin(x) \Big( 3 - 4 + 4 \cos^2(x)  \Big) \\
&= \sin(x) \Big( 4 \cos^2(x) - 1 \Big) \\
&=  4 \sin(x) \cos^2(x) - \sin(x)
\end{align*} $$
Then
$$\mathcal{I} := \int \frac{\cos(2x)}{\sin(x) + \sin(3x)} \, dx = \frac 1 4 \int \frac{\cos(2x)}{\sin(x)\cos^2(x)} \, dx$$
Then using a double-angle formula for cosine,
$$\cos(2x) = 2 \cos^2(x) - 1$$
we get
$$\mathcal{I} = \frac 1 2 \int \csc(x) \, dx - \frac 1 4 \int \frac{1}{\sin(x) \cos^2(x)} \, dx$$
The former is well-known. The second integral may be rewritten with basic trigonometry identities (turn it into $\csc(x) \sec^2(x)$,  use Pythagoras, use linearity) and solved easily.
</s>