How to take an integral using half angle trigonometric substitution. So i have this question which is asking to take the integral using a predefined trigonometric substitution which is $$u=\tan\frac{x}{2}$$
and the integral equation is $$\int\frac{\sin x\ dx}{(6\cos x-2)(3-2\sin x)}$$ How would i go on about this problem? Because to begin with i do not know how i would even use the given substitution method. Any help is appreciated thank you.
 A: This substitution is used for integrals involving only trigonometric expressions. This method is very useful as it transforms the trigonometric integral into just rational integral. You should know how to write $\sin x, \cos x, \tan x$ in terms of $\tan \frac{x}{2}$
(try proving)
$\sin x=\dfrac{2\tan \frac{x}{2}}{1+\tan^2 \frac{x}{2}}$
$\cos x=\dfrac{1-\tan^2 \frac{x}{2}}{1+\tan^2 \frac{x}{2}}$
$\tan x=\dfrac{2\tan \frac{x}{2}}{1-\tan^2 \frac{x}{2}}$
To find $dx$ in terms of $du$, differentiate both sides.
$u = \tan \dfrac{x}{2}$
$du = \sec^2 \dfrac{x}{2} \dfrac{1}{2} dx = (1+\tan^2 \dfrac{x}{2})\dfrac{1}{2} dx=(1+u^2)\dfrac{1}{2}dx \Rightarrow dx=\dfrac{2}{1+u^2}du$
For this example, The integral is converted to,
$$\int\dfrac{\sin x}{(6cosx-2)(3-2sinx)}dx=\int\dfrac{\dfrac{2u}{1+u^2}}{(6\dfrac{1-u^2}{1+u^2}-2 )(3-2\dfrac{2u}{1+u^2})}\dfrac{2}{1+u^2}du$$
$$=\int\dfrac{4u}{(1+u^2)(6-6u^2-2-2u^2)(3+3u^2-4u)}du$$
$$=\int\dfrac{-4u}{(1+u^2)(8u^2-4)(3u^2-4u+3)}du$$
$$=\int\dfrac{3u^2-4u+3-(3u^2+3)}{(1+u^2)(8u^2-4)(3u^2-4u+3)}du$$
$$=\int\dfrac{du}{(1+u^2)(8u^2-4)}-\int\dfrac{3\ du}{(8u^2-4)(3u^2-4u+3)}$$
and integrate using partial fractions and substitute again $u=\tan \dfrac{x}{2}$.
Look how nicely the trigonometric integral(which made no sense) is transformed to a rational integral(which can be solved at least by brute force).
Try more examples.
(
You will get to realize that some problems looks like can be solved using half angle substitutions but really can be solved without substitution. Example
$$\int\dfrac{\sin x}{(\cos x -2)(2\cos x +3)}dx$$ 
)
A: Consider a right triangle that has a side opposite angle $\frac{x}{2}$ of length $u=\tan\frac{x}{2}$ and an adjacent side of length 1. Obviously, $\tan \frac{x}{2} =\frac{opposite}{adjacent}= \frac{\tan\frac{x}{2}}{1}=\tan\frac{x}{2}=u$. What would the Hypotenuse be?

Having done that, its a simple matter to find expressions for $\cos\frac{x}{2}$ and $\sin\frac{x}{2}$ (using the same triangle).
Noting that $$\cos 2t=\cos^2 t - \sin^2t$$
and that
$$\sin2t = 2\sin t\cos t$$
we can make the substitution $t=\frac{x}{2}$ to find expressions (in terms of $u$) for $\cos x$ and $\sin x$.
Lastly we note that $$\frac{du}{dx}=\frac{d}{dx}\tan\frac{x}{2} = \frac{\sec^2\frac{x}{2}}{2}=\frac{\tan^2\frac{x}{2}+1}{2}=\frac{u^2+1}{2}$$
Putting all this information together yourself (as opposed to just parroting formulas) will give you a superior understanding of this substitution method.
A: We have $$x=2arctan(u)$$, that gives $$dx=\frac{2}{u^2+1}du$$
Furthermore, we have $$cos(x)=\frac{1-u^2}{1+u^2}$$
and $$sin(x)=\frac{2u}{u^2+1}$$
Inserting those terms, you get a rational function of $u$. Try it from here.
A: By letting $u=\tan\frac{x}2$, we get
$$\int\frac{\sin x}{(6\cos x-2)(3-2\sin x)}d x=\int\frac{u d u}{(1-2u^2)(3u^2-4u+3)}\\
=\frac{8}{49}\int\frac{(9u+4)du}{1-2u^2}+\frac{12}{49}\int\frac{(9u-8)du}{3u^2-4u+3},$$
the later two are both integration of rational functions.
$$\int\frac{(9u+4)du}{1-2u^2}=9\int\frac{udu}{1-2u^2}+4\int\frac{du}{1-2u^2}\\
=-\frac94\int\frac{d(1-2u^2)}{1-2u^2}+\sqrt2\int\left(\frac{1}{1-\sqrt2u}+\frac{1}{1-\sqrt2u}\right)du\\
=-\frac94\ln|1-2u^2|+\sqrt2\ln\frac{1+\sqrt2u}{1-\sqrt2u}+C_1$$
$$\int\frac{(9u-8)du}{3u^2-4u+3}=\frac13\int\frac{9\left(u-\frac23\right)-2}
{\left(u-\frac23\right)^2+\frac59}du=3\int\frac{\left(u-\frac23\right)}
{\left(u-\frac23\right)^2+\frac59}du+\frac23\int\frac{du}
{\left(u-\frac23\right)^2+\frac59}\\
=\frac32\int\frac{d\left(u-\frac23\right)^2}{\left(u-\frac23\right)^2+\frac59}
+\frac2{\sqrt5}\int\frac{d\frac3{\sqrt5}\left(u-\frac23\right)}{\left[\frac3{\sqrt5}\left(u-\frac23\right)\right]^2+1}\\
=\frac32\ln\left(u^2-\frac43u+1\right)-\frac2{\sqrt5}\arctan\left[\frac3{\sqrt5}\left(u-\frac23\right)\right]+C_2$$
