### 3.251 $$\int \frac{1}{b^2 \cos ^2(x)+a^2 \sin ^2(x)} \, dx$$

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.024756, antiderivative size = 15, normalized size of antiderivative = 1., 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 = {205} $\frac{\tan ^{-1}\left (\frac{a \tan (x)}{b}\right )}{a b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, 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 &=\operatorname{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.0417648, size = 15, normalized size = 1. $\frac{\tan ^{-1}\left (\frac{a \tan (x)}{b}\right )}{a b}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0., size = 16, normalized size = 1.1 \begin{align*}{\frac{1}{ab}\arctan \left ({\frac{a\tan \left ( x \right ) }{b}} \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.44672, size = 20, normalized size = 1.33 \begin{align*} \frac{\arctan \left (\frac{a \tan \left (x\right )}{b}\right )}{a b} \end{align*}

Veriﬁcation 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]  time = 2.52294, size = 99, normalized size = 6.6 \begin{align*} -\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{align*}

Veriﬁcation 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 [A]  time = 40.2914, size = 2866, normalized size = 191.07 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo*tan(x/2)/(tan(x/2)**2 - 1), Eq(a, 0) & Eq(b, 0)), ((tan(x/2)/2 - 1/(2*tan(x/2)))/a**2, Eq(b, 0)
), (-2*tan(x/2)/(b**2*(tan(x/2)**2 - 1)), Eq(a, 0)), (-16*a**5*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2
+ 1)*log(-sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a*
*2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 16*a**5*sqrt(-2*a**2/b**2 - 2*a*sqrt(a
**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a
**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 16*a**4*sqrt(a**2 - b*
*2)*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 +
1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) +
2*a*b**6) - 16*a**4*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b*
*2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4
+ 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 20*a**3*b**2*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1
)*log(-sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2
- b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) - 20*a**3*b**2*sqrt(-2*a**2/b**2 - 2*a*sqrt
(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16
*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) - 4*a**3*b**2*sqrt(-2*
a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2
))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) +
4*a**3*b**2*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)
/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 -
b**2) + 2*a*b**6) - 12*a**2*b**2*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-s
qrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2)
- 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 12*a**2*b**2*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2
- 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5
*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 4*a**2*b**
2*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2
- b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqr
t(a**2 - b**2) + 2*a*b**6) - 4*a**2*b**2*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)
*log(sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 -
b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) - 5*a*b**4*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2
- b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4
*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 5*a*b**4*sqrt(-2*a**2/b**
2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a*
*5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) + 3*a*b**4
*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)
+ tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*
a*b**6) - 3*a*b**4*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 -
b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(
a**2 - b**2) + 2*a*b**6) + b**4*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqr
t(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) -
16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) - b**4*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 - 2*a*sqrt
(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 - 2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16
*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6) - b**4*sqrt(a**2 - b**
2)*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(-sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1
) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8*a**2*b**4*sqrt(a**2 - b**2) +
2*a*b**6) + b**4*sqrt(a**2 - b**2)*sqrt(-2*a**2/b**2 + 2*a*sqrt(a**2 - b**2)/b**2 + 1)*log(sqrt(-2*a**2/b**2 +
2*a*sqrt(a**2 - b**2)/b**2 + 1) + tan(x/2))/(16*a**5*b**2 - 16*a**4*b**2*sqrt(a**2 - b**2) - 16*a**3*b**4 + 8
*a**2*b**4*sqrt(a**2 - b**2) + 2*a*b**6), True))

________________________________________________________________________________________

Giac [A]  time = 1.06591, size = 35, normalized size = 2.33 \begin{align*} \frac{\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{a \tan \left (x\right )}{b}\right )}{a b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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