Q. Evaluate -$$\int\limits_0^\pi {{{x\,dx} \over {{a^2}{{\cos }^2}x + {b^2}{{\sin }^2}x}}} $$
My Try - $$\eqalign{ & Let\,I\, = \,\int\limits_0^\pi {\frac{{x\,dx}}{{{a^2}{{\cos }^2}x + {b^2}{{\sin }^2}x}}} \cr & \,\,\,\,\,\,\,\,\,\,\, = \int\limits_0^\pi {\frac{{\left( {\pi - x} \right)\,dx}}{{{a^2}{{\cos }^2}\left( {\pi - x} \right) + {b^2}{{\sin }^2}\left( {\pi - x} \right)}}} \cr & \,\,\,\,\,\,\,\,\,\,\, = \pi \int\limits_0^\pi {\frac{{dx}}{{{a^2}{{\cos }^2}x + {b^2}{{\sin }^2}x}}} \,\, - \,\,I \cr & \,\,\,\,\,\,\,I = \frac{\pi }{2}\int\limits_0^\pi {\frac{{dx}}{{{a^2}{{\cos }^2}x + {b^2}{{\sin }^2}x}}} \cr & {\text{Now}}\,{\text{divide}}\,{\text{numerator}}\,{\text{and}}\,{\text{denominator}}\,{\text{by}}\,\,{{\text{b}}^{\text{2}}}{\text{co}}{{\text{s}}^{\text{2}}}{\text{x,}}\,\,\,\, \to \,\,\boxed1 \cr & \,\,\,\,\,\,\,\,\,\, = \frac{\pi }{{2{b^2}}}\int\limits_0^\pi {\frac{{{{\sec }^2}x\,\,dx}}{{\frac{{{a^2}}}{{{b^2}}} + {{\tan }^2}x}}} \cr & Let\,\,t = \tan x,\,\,dt = {\sec ^2}x\,dx\,\,and\, \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,when\,\,x = 0,\,\,t = 0 \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,and\,\,x = \pi ,\,\,t = 0 \cr & \,\,\,\,\,\,\,I = \frac{\pi }{{2{b^2}}}\int\limits_0^0 {\frac{{dt}}{{\frac{{{a^2}}}{{{b^2}}} + {t^2}}}} = 0 \cr} $$
First Question - $$\eqalign{ & {\text{Infact,}}\,\,{\text{the}}\,{\text{answer}}\,{\text{is}}\,{\text{not}}\,{\text{0}}\,{\text{and}}\,{\text{is}}\,{\text{obtained}}\,{\text{by}}\,{\text{splitting}}\,{\text{the}}\,{\text{integral}}\,{\text{further}}\,{\text{in}}\,step\,\boxed1{\text{.}}\, \cr & {\text{What}}\,{\text{mistake}}\,{\text{have}}\,{\text{I}}\,{\text{committed}}\,{\text{here?}} \cr} $$
$$\eqalign{ & {\text{Instead,}}\,{\text{in}}\,step\,\boxed1\,{\text{,}}\,\,{\text{if}}\,{\text{we}}\,{\text{divide}}\,{\text{by}}\,{{\text{a}}^{\text{2}}}{\text{si}}{{\text{n}}^{\text{2}}}{\text{x}}\,{\text{and}}\,{\text{perform}}\,{\text{similar}}\,{\text{substitution,}} \cr & = \frac{\pi }{{2{a^2}}}\int\limits_0^\pi {\frac{{\cos e{c^2}x\,\,dx}}{{\frac{{{b^2}}}{{{a^2}}} + {{\cot }^2}x}}} \cr & Let\,\,t = \cot x,\,\,dt = \cos e{c^2}x\,dx\,\,and\, \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,when\,\,x = 0,\,\,t = not\,defined \cr & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,and\,\,x = \pi ,\,\,t = not\,defined \cr} $$
Second Question -$${\text{So,}}\,{\text{why}}\,{\text{can't}}\,{\text{we}}\,{\text{say}}\,{\text{the}}\,{\text{value}}\,{\text{of}}\,{\text{the}}\,{\text{integral}}\,{\text{is}}\,{\text{not}}\,{\text{defined?}}$$
When you divide by $\cos^2x$, you are diving by a function which takes the value $0$ (when $x=\frac\pi2$). Therefore, after that you are not computing the integral of a continuous function from $[0,\pi]$ into $\mathbb R$ anymore.
But the integral is defined, of course. The original integral is the integral of a continuous function from $[0,\pi]$ into $\mathbb R$, and such functions are always Riemann-integrable.