= Solution
For the first <definite integral>, use <integration by substitution> $t=\tan x$, with $dx=dt/(1+t^2)$, $\cos^2x=1/(1+t^2)$ and $\sin^2x=t^2/(1+t^2)$. This gives
$$
I=\int_0^\infty\frac{dt}{p+qt^2}
=\frac1{\sqrt{pq}}\left[\arctan\left(t\sqrt{\frac qp}\right)\right]_0^\infty
=\boxed{\frac\pi{2\sqrt{pq}}.}
$$
For the second calculation, let $D=p\cos^2x+q\sin^2x$. Since $p,q>0$, this denominator is bounded away from zero; on compact positive parameter ranges the differentiated integrands have uniform bounds. Thus <differentiation under the integral sign> is justified and gives
$$
I_p=-\int_0^{\pi/2}\frac{\cos^2x}{D^2}\,dx=-\frac\pi{4p^{3/2}q^{1/2}},\qquad
I_q=-\int_0^{\pi/2}\frac{\sin^2x}{D^2}\,dx=-\frac\pi{4p^{1/2}q^{3/2}}.
$$
Adding the two equations and using the <Pythagorean trigonometric identity> in the numerators yields $J=-I_p-I_q$, hence
$$
\boxed{J=\frac{\pi(p+q)}{4(pq)^{3/2}}.}
$$
For $p=q$, this becomes $\pi/(2p^2)$, agreeing with direct integration of the constant integrand.
Back to article page