3.2.45 \(\int \frac {1}{b^2 \cos ^2(x)+a^2 \sin ^2(x)} \, dx\) [145]

Optimal. Leaf size=15 \[ \frac {\tan ^{-1}\left (\frac {a \tan (x)}{b}\right )}{a b} \]

[Out]

arctan(a*tan(x)/b)/a/b

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {211} \begin {gather*} \frac {\tan ^{-1}\left (\frac {a \tan (x)}{b}\right )}{a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(b^2*Cos[x]^2 + a^2*Sin[x]^2)^(-1),x]

[Out]

ArcTan[(a*Tan[x])/b]/(a*b)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin {align*} \int \frac {1}{b^2 \cos ^2(x)+a^2 \sin ^2(x)} \, dx &=\text {Subst}\left (\int \frac {1}{b^2+a^2 x^2} \, dx,x,\tan (x)\right )\\ &=\frac {\tan ^{-1}\left (\frac {a \tan (x)}{b}\right )}{a b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 15, normalized size = 1.00 \begin {gather*} \frac {\tan ^{-1}\left (\frac {a \tan (x)}{b}\right )}{a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(b^2*Cos[x]^2 + a^2*Sin[x]^2)^(-1),x]

[Out]

ArcTan[(a*Tan[x])/b]/(a*b)

________________________________________________________________________________________

Mathics [F(-1)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[1/(a^2*Sin[x]^2 + b^2*Cos[x]^2),x]')

[Out]

Timed out

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 16, normalized size = 1.07

method result size
default \(\frac {\arctan \left (\frac {a \tan \left (x \right )}{b}\right )}{a b}\) \(16\)
risch \(\frac {i \ln \left ({\mathrm e}^{2 i x}-\frac {a +b}{a -b}\right )}{2 a b}-\frac {i \ln \left ({\mathrm e}^{2 i x}-\frac {a -b}{a +b}\right )}{2 a b}\) \(58\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(b^2*cos(x)^2+a^2*sin(x)^2),x,method=_RETURNVERBOSE)

[Out]

arctan(a*tan(x)/b)/a/b

________________________________________________________________________________________

Maxima [A]
time = 0.38, size = 15, normalized size = 1.00 \begin {gather*} \frac {\arctan \left (\frac {a \tan \left (x\right )}{b}\right )}{a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b^2*cos(x)^2+a^2*sin(x)^2),x, algorithm="maxima")

[Out]

arctan(a*tan(x)/b)/(a*b)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (15) = 30\).
time = 0.35, size = 43, normalized size = 2.87 \begin {gather*} -\frac {\arctan \left (\frac {{\left (a^{2} + b^{2}\right )} \cos \left (x\right )^{2} - a^{2}}{2 \, a b \cos \left (x\right ) \sin \left (x\right )}\right )}{2 \, a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b^2*cos(x)^2+a^2*sin(x)^2),x, algorithm="fricas")

[Out]

-1/2*arctan(1/2*((a^2 + b^2)*cos(x)^2 - a^2)/(a*b*cos(x)*sin(x)))/(a*b)

________________________________________________________________________________________

Sympy [F(-1)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b**2*cos(x)**2+a**2*sin(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 25, normalized size = 1.67 \begin {gather*} \frac {2 \left (\arctan \left (\frac {a \tan x}{b}\right )+\pi \left \lfloor \frac {x}{\pi }+\frac 1{2}\right \rfloor \right )}{2 a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(b^2*cos(x)^2+a^2*sin(x)^2),x)

[Out]

(pi*floor(x/pi + 1/2) + arctan(a*tan(x)/b))/(a*b)

________________________________________________________________________________________

Mupad [B]
time = 0.46, size = 15, normalized size = 1.00 \begin {gather*} \frac {\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (x\right )}{b}\right )}{a\,b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(b^2*cos(x)^2 + a^2*sin(x)^2),x)

[Out]

atan((a*tan(x))/b)/(a*b)

________________________________________________________________________________________