# Integral $\int \frac{3}{{5\cos(x)-5\sin(x)+7}} \, dx$

In school, we solve this integral with substitution. But the substitution is

$$t = \tan\left(\frac{x}{2}\right)$$

$$\int \frac{3}{{5\cos(x)-5\sin(x)+7}} \, \mathrm{d}x$$

And I don't understand why. Can somebody please explain it to me?

But the substitution is

$$t = \tan\left(\frac{x}{2}\right)$$

With this relation between $$t$$ and $$x$$, you also have: $$\cos x = \frac{1-t^2}{1+t^2} \quad\mbox{and}\quad \sin x = \frac{2t}{1+t^2}$$ and furthermore since $$x=2\arctan t$$: $$\frac{\mbox{d}x}{\mbox{d}t}=\frac{2}{1+t^2}$$ This means that this substitution turns a rational function of $$\cos x$$ and $$\sin x$$ into a rational function of $$t$$: $$\int f\left(\cos x,\sin x\right)\,\mbox{d}x = \int f\left(\frac{1-t^2}{1+t^2},\frac{2t}{1+t^2}\right)\frac{2}{1+t^2}\,\mbox{d}t$$ You can then use the integration techniques for rational functions.

This is a very popular substitution called the Weierstrass Substitution used for integrating rational functions of trigonometric functions, $$R(\sin\theta,\cos\theta)$$. This converts the rational function of trigonometric functions into a rational function in the variable $$t$$.

In integral calculus, the tangent half-angle substitution is a substitution used for finding antiderivatives, and hence definite integrals, of rational functions of trigonometric functions. No generality is lost by taking these to be rational functions of the sine and cosine. Michael Spivak wrote that "The world's sneakiest substitution is undoubtedly" this technique.

\begin{align*}t\mapsto\tan\left(\dfrac{x}{2}\right)\implies \int\dfrac{3}{5\cos x-5\sin x+7}\mathrm dx\mapsto \int\dfrac{3}{5\left(\frac{1-t^2}{1+t^2}\right)-5\left(\frac{2t}{1+t^2}\right)+7}\dfrac{2\mathrm dt}{1+t^2}\end{align*}

This reduces the integral to the following integral which can be dealt with by Partial Fraction Decomposition easily: $$3\int\dfrac{1}{(t-2)(t-3)}\mathrm dt$$