<s>[INST] Indefinite Integral with "sin" and "cos": $\int\frac{3\sin(x) + 2\cos(x)}{2\sin(x) + 3\cos(x)} \; dx $ Indefinite Integral with sin/cos
I can't find a good way to integrate: $$\int\dfrac{3\sin(x) + 2\cos(x)}{2\sin(x) + 3\cos(x)} \; dx $$
 [/INST] We can split this into two integrals:
$$3 \int \frac{\sin(x)}{2\sin(x)+3\cos(x)}dx + 2 \int \frac{\cos(x)}{2\sin(x)+3\cos(x)}dx.$$
Focusing on the second integral we find:
$$\int \frac{\cos(x)}{2\sin(x)+3\cos(x)}dx = \int \frac{1}{2\tan(x)+3}dx$$
Make the substitution $u=2\tan(x)+3$ which makes $$du = 2\sec^2(x)dx = 2(\tan^2(x)+1)dx = 2(u^2+1)dx.$$
Thus we have 
$$\int \frac{\cos(x)}{2\sin(x)+3\cos(x)}dx = \frac12 \int \frac{1}{u(u^2+1)} du = \frac12 \int \left(\frac{1}{u} - \frac{u}{u^2+1}\right) du.$$
This integral can be computed by another substitution: 
$$\int \frac{\cos(x)}{2\sin(x)+3\cos(x)}dx=\frac12 \left(\ln|2\tan(x)+3| - \frac12 \ln|(2\tan(x)+3)^2+1|\right) + C.$$
That completes the second integral. The first can be handled in a similar manner.
</s>