<s>[INST] How to solve $\int_{0}^{\frac{π}{2}} \frac{dx}{4\sin^2(x) +5\cos^2(x)} $ $?$ I apply the substitutions:
$$t=\tan(x), \sin(x)=\frac{t}{\sqrt{1+t^2}}, \cos(x)=\frac{1}{\sqrt{1+t^2}}\ \&\ dx=\frac{dt}{1+t^2}$$
(using $t=\tan(x)$ you can draw a right angled triangle to find the other substitutions)
So we get:
$$\int_{0}^{\frac{π}{2}} \frac{1}{\frac{4t^2}{1+t^2}+\frac{5}{1+t^2}}\frac{dt}{1+t^2}=\frac{1}{4}\int_{0}^{\frac{π}{2}} \frac{1}{t^2+\Big(\frac{\sqrt{5}}{2}\Big)^2} dt$$
This is in a standard integral form, thus:
$$\frac{1}{4}\cdot\frac{2}{\sqrt{5}}\tan^{-1}\Bigg(\frac{2t}{\sqrt{5}}\Bigg)=\frac{1}{2\sqrt{5}}\tan^{-1}\Bigg(\frac{2\tan(x)}{\sqrt{5}}\Bigg)$$
this is from $0$ to $π/2$.
But I can't substitute for $π/2$, because $\tan(x)$ is undefined for $π/2$. If I input this integral into Mathcad I get $\frac{π\sqrt{5}}{20}$. How can I get the right answer out of this? Thanks in advance!
 [/INST] Let $$\displaystyle I = \int_{0}^{\frac{\pi}{2}}\frac{1}{4\sin^2 x+5\cos^2 x}dx$$
Now Divide both $\bf{N_{r}}$ and $\bf{D_{r}}$ by $\cos^2 x\;,$ We get
$$\displaystyle I = \int_{0}^{\frac{\pi}{2}}\frac{\sec^2 x}{4\tan^2 x+5}dx\;,$$
Now Put $\displaystyle 2\tan x=t\;,$ Then $\displaystyle 2\sec^2 xdx =dt\Rightarrow \sec^2 xdx = \frac{1}{2}dt$
and Changing Limit , We get
$$\displaystyle I = \frac{1}{2}\int_{0}^{\infty}\frac{1}{t^2+5}dt = \frac{1}{2\sqrt{5}}\left[\tan^{-1}\left(\frac{t}{\sqrt{5}}\right)\right]_{0}^{\infty}=\frac{1}{2\sqrt{5}}\cdot \frac{\pi}{2}=\frac{\pi}{4\sqrt{5}}.$$
</s>