# How to evaluate an integral that comes out as undefined

How do I evaluate $$\int_0^{\pi}\frac{1}{5+3\cos{x}}dx$$? Because for this type of integral I would normally use the substitution $$t=\tan{\frac{x}{2}}$$ but $$\tan{\frac{\pi}{2}}$$ is undefined. How can I evaluate this integral still using this method (I want to still use this method because it is the method my school expects me to use)?

• Break it in two and use limits... Sep 24, 2021 at 4:38
• Note that $\lim_{x\to\pi^-}t=+\infty$, so you get $\int_0^{+\infty}\dots\,\mathrm{d}t$, etc. Sep 24, 2021 at 4:45
• @Quippy I'll have to think about this : I'm also thinking about whether the $+\infty$ causes a problem at all. You see, forgetting about the limits of the integral which are $0$ and $\pi$, the indefinite integral $\int \frac 1{5 + 3 \cos x}$ can be evaluated using the substitution $u= \tan \frac x2$ to equal $\frac{-1}{2} \tan^{-1}(2 \cot(\frac x2))$. The point is that $0$ and $\pi$ can be substituted into this anti-derivative , even if there's infinities lurking, because $\tan^{-1}(\infty) = \frac \pi 2$. For a 2 mark question I'd say realizing this reflects the marking scheme better. Sep 24, 2021 at 5:30
• @TeresaLisbon If it helps, they gave you the graph of $y=\frac{1}{5+3\cos{x}}$, I tried to use symmetry by instead evaluating up to the limit of $2\pi$ then having it but when I substituted those limits it came out as $0$ because I left my indefinite form as $\frac12\tan^{-1}\left(\frac12\tan\left(\frac{x}{2}\right)\right)$. Sep 24, 2021 at 5:48
• @Quippy The graph doesn't help get the exact value, beyond the fact that it might show some symmetries (the same symmetries that I used to create my earlier decomposition, if you like). I think Jean-Claude's link is the key that explains why the $2 \pi$ issue arises. Basically, your substitution has to be a bijective substitution on the interval, and $\tan \frac x2$ has this property on $[0,\pi]$ but not $[0,2 \pi]$. So that's something to keep in mind. I think the hacky method, unfortunately, seems to be the 2-mark method here. Sep 24, 2021 at 6:05

Use $$\cos x=\frac{1-\tan^2(x/2)}{1+\tan^2(x/2)}$$, then $$I=\int_{0}^{\pi} \frac{dx}{5+3\cos x}=\int_{0}^{\pi}\frac{\sec^2(x/2) dx}{8+2\tan^2(x/2)}.$$ $$\tan(x/2)=t \implies \sec^2(x/2)dx=2dt$$ $$I=\int_{0}^{\infty} \frac{dt}{4+ t^2}=\frac{1}{2} \tan^{-1} t/2|_0^{\infty}=\frac{\pi}{4}.$$

$$\int_0^{\pi}\frac{1}{5+3\cos{x}}dx=\int_0^{+\infty}\frac{1}{5+3\left(\frac{1-t^2}{1+t^2}\right)}\frac{2}{1+t^2}dt$$ after the substitution of $$t=\tan\left(\frac{x}{2}\right)$$
$$=\int_0^{+\infty}\frac{2}{8+2t^2}dt$$
$$=\sqrt{2}\int_0^{+\infty}\frac{\sqrt{2}}{(2\sqrt{2})^2+(\sqrt2t)^2}dt$$
$$=\frac{\sqrt{2}}{2\sqrt2}\tan^{-1}\left(\frac{\sqrt2\times\infty}{2\sqrt2}\right)-\frac{\sqrt{2}}{2\sqrt2}\tan^{-1}\left(\frac{\sqrt2\times0}{2\sqrt2}\right)$$
$$=\frac12\tan^{-1}{(+\infty)}$$
$$=\frac{\pi}{4}\because\tan^{-1}{(+\infty)}=\frac{\pi}{2}$$