# Nonsensical result in the midst of calculating an integral via substitution.

I was just calculating an integral via a trigonometric substitution and ended up with $\color{red}{ \text{something pretty nonsensical} }$ but $\color{blue}{ \text{reversing the substitution} }$ seemed to clean it up. \begin{aligned} \int_{0}^{\frac{\pi}{2}} \dfrac{\text{d}\theta}{3+5\cos \theta} \ & \overset{t=\tan \frac{\theta}{2}}= \ \dfrac{1}{4} \color{red}{ \log \left| \dfrac{2+t}{2-t} \right| \Bigg|}_{\color{red}{0}}^{ \color{purple}{\infty }} \\ & \ \ = \dfrac{1}{4} \color{blue}{ \log \left| \dfrac{2+\tan\frac{\theta}{2}}{2-\tan\frac{\theta}{2}} \right| \Bigg|_{0}^{\frac{\pi}{2}} } \end{aligned} Why is that the case? Is it something to do with the nature of the substitution? Is there something I'm not considering when performing the substitution?

Any help would be much appreciated.

Thank you.

Edit: It turns out that $\color{purple}{\tan\frac{\pi}{4} =1}$. Problem solved!

• Why do you think it's nonsensical? (It may be, but it doesn't immediately seem wrong to me.) – Semiclassical Aug 27 '14 at 15:45
• Probably because it doesn't look natural (compared to the things I've already seen) to me. It doesn't look well defined. It's essentially taking the logarithm of an infinitely large number which is divided by an infinitely large number, @Semiclassical. – Khallil Aug 27 '14 at 15:47
• $\tan\theta/2$ goes from $0$ to $1$ when $\theta$ goes from $0$ to $\pi/2$. – Thomas Andrews Aug 27 '14 at 15:50
• WA gives a final answer of $\frac{1}{4}\log 3$, which is consistent your second expression if you account for with ThomasAndrew's remark above. – Semiclassical Aug 27 '14 at 15:52
• @Semiclassical The integrand is clearly positive, but the (red) right side is zero at $t=0$ and $t=\infty$. – Thomas Andrews Aug 27 '14 at 16:06

When $\theta$ goes from $0$ to $\frac{\pi}2$, $\frac{\theta}2$ goes from $0$ to $\frac{\pi}4$ so $\tan\frac{\theta}2$ goes from $0$ t0 $1$, not $0$ to $\infty$.