<s>[INST] Integrating trigonometric function problem $\int \frac{3\sin x+2\cos x}{2\sin x+3\cos x}dx$ \begin{eqnarray*}
\int \frac{3\sin x+2\cos x}{2\sin x+3\cos x}dx &=&  \int \frac{(3\sin x+2\cos x)/\cos x}{(2\sin x+3\cos x)/\cos x}dx\\ \\
&=& \int \frac{3\tan x +2}{2\tan x +3} dx\\
&& u = \tan x \text{ and } du = \sec^2 x \ dx 
\end{eqnarray*}
Am I going in the right direction with this one? It seems like not. 
 [/INST] Since the integrand has the form
$$\frac{a\sin(x) + b\cos(x)}{c\sin(x) + d\cos(x)},$$
if we write it as
$$\frac{P(x)}{Q(x)} = \frac{a\sin(x) + b\cos(x)}{c\sin(x) + d\cos(x)},$$
then we should be able to find constants $A$ and $B$ such that $P(x) \equiv A Q(x) + B Q'(x)$, so that the integral is simply
$$\int A + B\frac{Q'(x)}{Q(x)} \, dx,$$
where the second term $Q'(x)/Q(x)$ contributes $\log\left (Q(x)\right )$ to the integral.
In our case, we have
$$3\sin(x) + 2\cos(x) \equiv A\left ( 2\sin(x) + 3\cos(x) \right ) + B\left ( 2\cos(x) - 3\sin(x) \right ).$$
Equating coefficients of $\sin(x)$ and $\cos(x)$ yields $2A - 3B = 3$ and $3A + 2B = 2$, and thus $A = \frac{12}{13}$ and $B=-\frac{5}{13}$ (you should check this).
Therefore the integral is just
$$\int \frac{3\sin(x)+2\cos(x)}{2\sin(x)+3\cos(x)} \, dx = \frac{12}{13}x - \frac{5}{13}\log \left ( 2\sin(x)+3\cos(x) \right ) + C.$$
</s>