# 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 $t$ supposed to be there? Otherwise you have $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 $"t"$ a typo? .If it is, the problem is quite simple.
. . Otherwise, it's a nightmare!

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

Multiply by $\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}$

. . $=\;\;\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: . $\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. $

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

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

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

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

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

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

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

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

$\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 $I=\int_0^\pi \frac{1}{1+t\cos(x)} ~dx$

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

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

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

Then
\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, $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 $\pi/2$

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

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

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

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

\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 $\frac{1}{a+u^2}$ is $\frac{1}{\sqrt{a}} \cdot \arctan\left(\tfrac{u}{\sqrt{a}}\right)$

Therefore :

$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}$

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

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