Integrating a partial fraction How do I compute the integral
$$\int_0^{\pi/2} \cfrac 1 {12\cos x + 9 \sin x} dx?$$
Please can you help.
 A: HINT
Rewrite $12 \cos(x) + 9 \sin(x)$ as $$15 \left(\dfrac{12}{15} \cos(x) + \dfrac{9}{15} \sin(x) \right) = 15 \cos(x + \theta)$$ where $\tan(\theta) = - \dfrac9{12}$. (Note that $15 = \sqrt{9^2 + 12^2}$.) This is similar to the problem here.
A: This is a solution from WolframAlpha, I still don't know if this kind of thing is allowed here on MSE.
The solution is indefinite, you can compute the definite integral after.

A: If all else fails, the Weierstrass substitution will do it.
However, let's try something that begins with what Marvin suggested in his answer.  First notice that $12^2+9^2=15^2$, so $\left(\frac{12}{15}\right)^2+\left(\frac{9}{15}\right)^2=1$.  Hence we can find $\theta$ such that $\cos\theta=12/15$ and $\sin\theta=9/15$.  Then
$$
12\cos x + 9\sin x = 15\left(\frac{12}{15}\cos x+\frac{9}{15}\sin x\right) = 15(\cos\theta\cos x + \sin\theta\sin x) = 15\cos(x-\theta).
$$
Therefore
$$
\int\frac{dx}{12\cos x+9\sin x} = \int \frac{dx}{15\cos(x-\theta)}= \int \frac{\cos(x-\theta)\,dx}{15(\cos(x-\theta))^2} = \frac{1}{15}\int \frac{\cos(x-\theta)\,dx}{1- (\sin(x-\theta))^2}
$$
$$
= \frac{1}{15}\int \frac{du}{1-u^2} = \frac{1}{15}\int \frac{A}{1-u} + \frac{B}{1+u} \, du.
$$
Then use partial fractions.
