# Thread: integration of a cos function

1. ## integration of a cos function

Hey, I was wondering if anyone could help me with the following integration:

integrate 1/(1+tcosx) wrt x from 0 to pi. I know you have to make the substitution u=tan(x/2), but I've been trying for ages and can't seem to get the answer. =(

2. Is the $\displaystyle t$ supposed to be there? Otherwise you have $\displaystyle u=\tan\frac{x}{2},\ du=\frac{dx}{2\cos^2 \frac{x}{2}}=\frac{dx}{1+\cos x} \implies dx=(1+\cos x)du$

3. Hello, littlepig!

Is that $\displaystyle "t"$ a typo? .If it is, the problem is quite simple.
. . Otherwise, it's a nightmare!

$\displaystyle \int\frac{1}{1+\cos x}\,dx$

Multiply by $\displaystyle \frac{1-\cos x}{1-\cos x}\!:\quad \frac{1}{1 + \cos x}\cdot{\color{blue}\frac{1-\cos x}{1-\cos x}} \;\;=\;\;\frac{1-\cos x}{1-\cos^2\!x} \;\;=\;\;\frac{1-\cos x}{\sin^2\!x}$

. . $\displaystyle =\;\;\frac{1}{\sin^2\!x} - \frac{\cos x}{\sin^2\!x} \;\;=\;\;\frac{1}{\sin^2\!x} - \frac{1}{\sin x}\!\cdot\!\frac{\cos x}{\sin x} \;\;=\;\;\csc^2\!x - \csc x\cot x$

And we have: .$\displaystyle \int(\csc^2\!x - \csc x\cot x)\,dx \;\;=\;\;-\cot x + \csc x + C$

4. The 't' isn't a typo. But it's given that |t|<1. The answer according to the notes is supposed to be pi/root(1-t^2), I just don't know how to get to it =(

5. $\displaystyle \int\frac{1}{1+t\cos x}\,dx$

$\displaystyle \int \frac{1}{1+t \cos x}.\frac{1-t \cos x}{1-t \cos x}~dx$

$\displaystyle \int \frac{1-t \cos x}{1-t^2 \cos^2 x}~dx$

Let $\displaystyle u=1-t^2 \cos^2 x \Rightarrow \frac{du}{dx}=2t^2 \cos x \sin x$

Notice that $\displaystyle u=1-t^2(1-\sin^2x)=1-t^2+t^2 \sin^2 x$

$\displaystyle \frac{du}{dx}=2t^2 \left( \frac{1-u}{t^2} \right) \left( \frac{u+t^2-1}{t^2} \right)$

$\displaystyle \int \frac{1-t \left( \frac{1-u}{t^2} \right)}{u} \frac{t^4 }{2t^2(1-u)(u+t^2-1)}~du$

$\displaystyle \frac{1}{2t^2}\int \frac{t^4-t^3(1-u)}{u(1-u)(u+t^2-1)}~du$

$\displaystyle \frac{t}{2} \int \frac{t-1+u}{u(1-u)(u+t^2-1)}~du$

gah! this integral is harder than I first anticipated!

6. Hello,

Let $\displaystyle I=\int_0^\pi \frac{1}{1+t\cos(x)} ~dx$

By substituting $\displaystyle u=\pi-x$, we have :

$\displaystyle I=-\int_\pi^0 \frac{1}{1-t\cos(u)} ~du$ (because $\displaystyle \cos(x)=\cos(\pi-u)=-\cos(u)$)

So $\displaystyle I=\int_0^\pi \frac{1}{1-t\cos(x)} ~dx$ (u was just a dummy variable).

Then
\displaystyle \begin{aligned}2I &=\int_0^\pi \frac{1}{1-t\cos(x)}+\frac{1}{1+t\cos(x)} ~dx \\ &=\int_0^\pi \frac{1+t\cos(x)+1-t\cos(x)}{1-t^2\cos^2(x)} ~dx \\ &=\int_0^\pi \frac{2}{1-t^2\cos^2(x)} ~dx \end{aligned}

So finally, $\displaystyle I=\int_0^\pi \frac{1}{1-t^2\cos^2(x)} ~dx$

I have to think how to continue...

I think I finally found it (after multiple careless mistakes )

You can note that this latter integrand is symmetric with respect to $\displaystyle \pi/2$

Hence $\displaystyle I=2\int_0^{\pi/2} \frac{1}{1-t^2\cos^2(x)} ~dx$

We know that $\displaystyle \cos^2(x)=\frac{1+\cos(2x)}{2}$. So :

$\displaystyle I=4\int_0^{\pi/2} \frac{1}{(2-t^2)-t^2\cos(2x)} ~dx$

Now use Weierstrass substitution : $\displaystyle \cos(2x)=\frac{1-u^2}{1+u^2}$, where $\displaystyle u=\tan(x)$. --> $\displaystyle dx=\frac{du}{1+u^2}$

\displaystyle \begin{aligned}\Rightarrow I &=4\int_0^\infty \frac{du}{(2-t^2)(1+u^2)-t^2(1-u^2)} \\ &=4\int_0^\infty \frac{du}{2-t^2+2u^2-u^2t^2-t^2+u^2t^2} \\ &=4\int_0^\infty \frac{du}{2-2t^2+2u^2} \\ &=2\int_0^\infty \frac{du}{(1-t^2)+u^2} \end{aligned}

But then, we know that an antiderivative of $\displaystyle \frac{1}{a+u^2}$ is $\displaystyle \frac{1}{\sqrt{a}} \cdot \arctan\left(\tfrac{u}{\sqrt{a}}\right)$

Therefore :

$\displaystyle I=\frac{2}{\sqrt{1-t^2}} \cdot \left.\arctan\left(\tfrac{u}{\sqrt{1-t^2}}\right)\right|_{u=0}^{u=\infty}=\frac{2}{\sqr t{1-t^2}} \cdot\frac{\pi}{2}$

$\displaystyle \Longrightarrow \boxed{I=\frac{\pi}{\sqrt{1-t^2}}}$

Note that everything is okay because $\displaystyle |t|<1$