Understanding if the integral expression obtained is correct and if its (incorrect ) mistake in the approach to get that result The integral was:

$$\int_{0}^{\frac{\pi}{2}} \frac{\cos^2x}{(a^2+b^2\sin^2x)^{3/2}}\;dx= \frac{\pi}{2ab^2} (1-\frac{a}{\sqrt{a^2+b^2}}).$$


*

*I encountered this integral while trying to show amperes law working in an EM (electromagntism) problem .


My progess: I tried substituting $a^2 + b^2 \sin^2x = t^2 $ but that doesnt help much. Next I tried writing $\cos^2x$ in terms of $\sin^2x$ and then separately do the integration for two parts in the expression but that I wasnt able to show. Any help greatly appreciated.


The setup was this (figure added )  : a semi infinite wire straight current $I$ being given to a plane sheet ( current flows radially there )  .


*

*Find magnetic field at a general point .


(By some symmetry reasons one compute it to be $B = \frac{u_°I}{2\pi r}$ $\hat{k}$ at a point $(r,h,0)$ by Amperes Law,  the plane being $y=0$ and semi infinite line being the y axis , current direction in that in $-y$ direction .


Now by integration approach ( figure added )  i first find the magentic field due to a current dI = $\frac{I}{2\pi} d\theta$  between $\theta$ and $\theta +d\theta$ angle in the plane at that point,  it comes out to be


*

*$\frac{u_°I}{4\pi(h^2 + r^2sin^2\theta)} (1+ \frac{rcos\theta}{\sqrt(h^2 + r^2 sin^2\theta)})$ ($hsin\theta \hat{i} - rsin\theta \hat{j} + hcos\theta \hat{k})$

*Now integrating in limits $0$ to $2\pi$ the $\hat{i}$ and $\hat{j}$ components goes to zero and we are left with.

*$\int_{0}^{\pi}\frac{u_°I}{4\pi(h^2 + r^2sin^2\theta)} (1+ \frac{rcos\theta}{\sqrt(h^2 + r^2 sin^2\theta)}) (2 hcos\theta \hat{k})$

This with the straight wire current magentic field which is standard integral ( means easily evalualted) should result in what we get from amperes law as net magnetic field at that point . On comparing we arrived at the result i mentioned at first . Now if there is any mistake in my approach that would also be fine as acceptable answer . If the calculation and approach is fine then only share the method for evaluating that integral .

 A: As I commented earlier, the rhs corresponds to an exponent equal to $1$ and not $\frac 32$.
For the lhs, you face elliptic integrals. Concerning the antiderivative, if $0 \leq x \leq \frac \pi 2$,
$$\int \frac{\cos^2(x)}{\left(a^2+b^2\sin^2(x)\right)^{\frac 32}}\,dx=\frac{E\left(x\left|-\frac{b^2}{a^2}\right.\right)-F\left(x\left|-\frac
   {b^2}{a^2}\right.\right)}{a b^2} +\frac{\sin (2 x)}{\sqrt{2} a^2 \sqrt{2 a^2-b^2 \cos (2 x)+b^2}}$$ where appear the incomplete elliptic integrals of the second and first kinds.
For the integral over the given bounds, the last term disappears and the results write
$$\int_0^{\frac \pi 2} \frac{\cos^2(x)}{\left(a^2+b^2\sin^2(x)\right)^{\frac 32}}\,dx=\frac{E\left(-\frac{b^2}{a^2}\right)-K\left(-\frac{b^2}{a^2}\right)}{a
   b^2}$$ where appears the complete elliptic integrals of the second and first kinds.
This answer is also dimensionally correct.
A: $$I=\int\limits_0^{\large\frac\pi2}\dfrac{\cos^2x\,\text dx}{(a^2+b^2\sin^2x)^{\large\frac32}}
=\dfrac1{b^2}\int\limits_0^{\large\frac\pi2}\dfrac{a^2+b^2-(a^2+b^2\sin^2x)}{(a^2+b^2\sin^2x)^{\large\frac32}}\,\text dx$$
$$=\dfrac{a^2+b^2}{b^2}\int\limits_0^{\large\frac\pi2}\dfrac{\text dx}{(a^2+b^2\sin^2x)^{\large\frac32}}
-\dfrac1{b^2}\int\limits_0^{\large\frac\pi2}\dfrac{\text dx}{\sqrt{a^2+b^2\sin^2x}}.$$
Since
$$\int\limits_0^{\large\frac\pi2}\dfrac{\text dx}{(a^2+b^2\sin^2x)^{\large\frac32}}
= \dfrac1{|a|(a^2+b^2)}E\left(-\dfrac{b^2}{a^2}\right),$$
$$\int\limits_0^{\large\frac\pi2}\dfrac{\text dx}{\sqrt{a^2+b^2\sin^2x}}
= \dfrac1{|a|}K\left(-\dfrac{b^2}{a^2}\right),$$
then
$$I=\dfrac{E\left(-\dfrac{b^2}{a^2}\right)-K\left(-\dfrac{b^2}{a^2}\right)}{|a|b^2}.\tag1$$
Taking in account the series representations $$E(x)=\dfrac\pi2\left(1+\left(\dfrac12\right)^2\,x+\left(\dfrac12\cdot\dfrac34\right)^2\,x^2+\left(\dfrac12\cdot\dfrac34\cdot\dfrac56\right)^2\,x^3+\dots\right),\qquad |x|\le 1,$$
$$K(x)=\dfrac\pi2\left(1-\left(\dfrac12\right)^2\,\dfrac x1 -\left(\dfrac12\cdot\dfrac34\right)^2\,\dfrac{x^2}3-\left(\dfrac12\cdot\dfrac34\cdot\dfrac56\right)^2\,\dfrac{x^3}5-\dots\right),\qquad |x|\le 1,$$
easily to see that the obtained solution $(1)$ does not correspond with the expression
$$\dfrac\pi{2ab^2}\left(1-\dfrac a{\sqrt{a^2+b^2}}\right),$$
proposed in OP.
