Integration of this weird integral Okay so I've racked my brains through and I've not been able to progress.I need to integrate this expression 
$$\int{ \frac{dx}{5 \cos x-12 \sin x}}$$
Guys any hint would be a life saver!! Thanks in anticipation. 
Could there be anything with making a triangle and finding respective trigonometric ratios from there? 
 A: Use $\sin(x)=2t/(1+t^2)$ and $\cos(x)=(1-t^2)/(1+t^2)$ where $t=\tan(x/2)$. 
Then $dx=2 dt/(1+t^2)$ and
$$\int{ \frac{dx}{5\cos x-12\sin x} }=\int{ \frac{2dt}{5(1-t^2)-12(2t)} }=\\=-2\int{ \frac{dt}{(t+5)(5t-1)} }
=\frac{1}{13}\int{ \frac{dt}{t+5} }-\frac{1}{13}\int{ \frac{5dt}{5t-1} }
\\=\frac{\ln|t+5|}{13}-\frac{\ln|5t-1|}{13}+C.$$
A: Hint:
$$ 5 \cos x-12\sin x = 13 \sin\left(x-\arctan\frac{5}{12}\right) $$
hence it is enough to prove that
$$ \int\frac{d\theta}{\sin\theta} = C+\log\tan\frac{\theta}{2}.$$
A: Hint:
Take $$5=r\sin(t), -12=r\cos(t)$$ where $r^2=(5)^2+(-12)^2$ and $\tan(t)=\frac{5}{-12}$.
A: It's a standard trick for simplifying expressions like $A\cos t+B\sin t$.  If $r=\sqrt{A^2+B^2}$ you can rewrite as $r((A/r)\cos t+(B/r)\sin t).$  Then $A,B,$ and $r$ are sides of a right triangle.  If $s$ is the angle between the $B$ and $r$ sides, then $\cos s = B/r$ and $\sin s = A/r$.  Now your expression looks like $r(\sin s\cos t+\cos s\sin t) = r\cos(s+t).$  Your expression has a minus sign, so you'll have to do something to get $s$ in the right quadrant.
A: These sorts of integrals often boil down to what I think Spivak calls the sneakiest substitution (but also the substitution of last resort):
$$
\arctan(t)=x/2
$$
Which is what at least one of the answers is referencing. You then will have to draw a triangle to figure out what $\sin x$ and $\cos x$ are.
