$\tan(\frac{\pi}{2}) = \infty~$? 
Evaluate $\displaystyle \int\nolimits^{\pi}_{0} \frac{dx}{5 + 4\cos{x}}$ by using the substitution $t = \tan{\frac{x}{2}}$

For the question above, by changing variables, the integral can be rewritten as $\displaystyle \int \frac{\frac{2dt}{1+t^2}}{5 + 4\cos{x}}$, ignoring the upper and lower limits. 
However, after changing variables from $dx$ to $dt$, when $x = 0~$,$~t = \tan{0} = 0~$ but when $ x = \frac{\pi}{2}~$, $~t = \tan{\frac{\pi}{2}}~$, so can the integral technically be written as $\displaystyle \int^{\tan{\frac{\pi}{2}}}_{0} \frac{\frac{2dt}{1+t^2}}{5 + 4\cos{x}}~$, and if so, is it also reasonable to write it as $\displaystyle \int^{\infty}_{0} \frac{\frac{2dt}{1+t^2}}{5 + 4\cos{x}}$
EDIT: In response to confusion, my question is: Is it technically correct to write the above integral in the form with an upper limit of $\tan{\frac{\pi}{2}}$ and furthermore, is it is reasonable to equate $\tan{\frac{\pi}{2}}$ with $\infty$ and substitute it on the upper limit?
 A: Yes, and you can work with limits if you're uncomfortable with an unbounded integral :
Obviously, $\int_0^\pi f(x)dx = \lim_{a \to \pi} \int_0^a f(x)dx$.
By a change of variable, you get $\int_0^a f(x)dx = \int_0^{\tan \frac a2} g(t)dt$.
Since $\lim_{a \to \pi} \tan \frac a2 = + \infty$, the limit $\lim_{b \to \infty} \int_0^b g(t)dt$ exists, and we call it $\int_0^\infty g(t)dt$.
Usually, we define $\int_0^\infty g(t)dt$ only when $\lim_{b \to \infty} \int_0^b |g(t)|dt$ exists, otherwise some strange things can happen. Here, $f$ and $g$ are positive so there is no difference.
A: Continuing from my comment, you have 
$$\cos(t) = \cos^2(t/2) - \sin^2(t/2) = {1-t^2\over 1+ t^2}.$$
Restating the integral with the transformation gives
$$\int_0^\infty {1\over 5 + 4\left({1-t^2 \over 1 + t^2}\right)}{2\, dt\over 1 + t^2} = 2\int_0^\infty {dt\over 9 + t^2}.$$
A: Well, In my opinion it is correct to write what you have stated. But for the sake of convenience we don't actually write in that way. For example if your integral had some substitution in which the limit's after substitution changes to $t = \sin\frac{\pi}{3} = \frac{\sqrt{3}}{2}$, it is better we write the limit as it's value instead of writing $\sin\frac{\pi}{3}$. 
A: This standard substitution is used for finding integrals of rational functions of sine and cosine.  Here's the Wikipedia article about it:
https://en.wikipedia.org/wiki/Tangent_half-angle_substitution
Postscript: The conclusion that you should get $\displaystyle \int_\cdots^\infty$ is correct because $\tan(x/2)\to+\infty$ as $x\uparrow\dfrac\pi2$. But you should also replace $\cos x$ with $(1-t^2)/(1+t^2).$
