\(\int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx\) [162]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 33, antiderivative size = 40 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\arctan \left (\frac {\sqrt {b+c} \tan (c+d x)}{\sqrt {a+c}}\right )}{\sqrt {a+c} \sqrt {b+c} d} \]

[Out]

arctan((b+c)^(1/2)*tan(d*x+c)/(a+c)^(1/2))/d/(a+c)^(1/2)/(b+c)^(1/2)

Rubi [A] (verified)

Time = 0.72 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.030, Rules used = {211} \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\arctan \left (\frac {\sqrt {b+c} \tan (c+d x)}{\sqrt {a+c}}\right )}{d \sqrt {a+c} \sqrt {b+c}} \]

[In]

Int[Sec[c + d*x]^2/(a + c*Sec[c + d*x]^2 + b*Tan[c + d*x]^2),x]

[Out]

ArcTan[(Sqrt[b + c]*Tan[c + d*x])/Sqrt[a + c]]/(Sqrt[a + c]*Sqrt[b + c]*d)

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*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{a+c+(b+c) x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\arctan \left (\frac {\sqrt {b+c} \tan (c+d x)}{\sqrt {a+c}}\right )}{\sqrt {a+c} \sqrt {b+c} d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.97 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\arctan \left (\frac {\sqrt {b+c} \tan (c+d x)}{\sqrt {a+c}}\right )}{\sqrt {a+c} \sqrt {b+c} d} \]

[In]

Integrate[Sec[c + d*x]^2/(a + c*Sec[c + d*x]^2 + b*Tan[c + d*x]^2),x]

[Out]

ArcTan[(Sqrt[b + c]*Tan[c + d*x])/Sqrt[a + c]]/(Sqrt[a + c]*Sqrt[b + c]*d)

Maple [A] (verified)

Time = 2.05 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.85

method result size
derivativedivides \(\frac {\arctan \left (\frac {\left (b +c \right ) \tan \left (d x +c \right )}{\sqrt {\left (a +c \right ) \left (b +c \right )}}\right )}{d \sqrt {\left (a +c \right ) \left (b +c \right )}}\) \(34\)
default \(\frac {\arctan \left (\frac {\left (b +c \right ) \tan \left (d x +c \right )}{\sqrt {\left (a +c \right ) \left (b +c \right )}}\right )}{d \sqrt {\left (a +c \right ) \left (b +c \right )}}\) \(34\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i b a +2 i a c +2 i c b +2 i c^{2}+a \sqrt {-a b -a c -c b -c^{2}}+b \sqrt {-a b -a c -c b -c^{2}}+2 c \sqrt {-a b -a c -c b -c^{2}}}{\sqrt {-a b -a c -c b -c^{2}}\, \left (a -b \right )}\right )}{2 \sqrt {-a b -a c -c b -c^{2}}\, d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i b a +2 i a c +2 i c b +2 i c^{2}-a \sqrt {-a b -a c -c b -c^{2}}-b \sqrt {-a b -a c -c b -c^{2}}-2 c \sqrt {-a b -a c -c b -c^{2}}}{\sqrt {-a b -a c -c b -c^{2}}\, \left (a -b \right )}\right )}{2 \sqrt {-a b -a c -c b -c^{2}}\, d}\) \(311\)

[In]

int(sec(d*x+c)^2/(a+c*sec(d*x+c)^2+b*tan(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d/((a+c)*(b+c))^(1/2)*arctan((b+c)*tan(d*x+c)/((a+c)*(b+c))^(1/2))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (32) = 64\).

Time = 0.30 (sec) , antiderivative size = 300, normalized size of antiderivative = 7.50 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\left [-\frac {\sqrt {-a b - {\left (a + b\right )} c - c^{2}} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2} + 8 \, {\left (a + b\right )} c + 8 \, c^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (3 \, a b + b^{2} + {\left (3 \, a + 5 \, b\right )} c + 4 \, c^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left ({\left (a + b + 2 \, c\right )} \cos \left (d x + c\right )^{3} - {\left (b + c\right )} \cos \left (d x + c\right )\right )} \sqrt {-a b - {\left (a + b\right )} c - c^{2}} \sin \left (d x + c\right ) + b^{2} + 2 \, b c + c^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (a b - b^{2} + {\left (a - b\right )} c\right )} \cos \left (d x + c\right )^{2} + b^{2} + 2 \, b c + c^{2}}\right )}{4 \, {\left (a b + {\left (a + b\right )} c + c^{2}\right )} d}, -\frac {\arctan \left (\frac {{\left (a + b + 2 \, c\right )} \cos \left (d x + c\right )^{2} - b - c}{2 \, \sqrt {a b + {\left (a + b\right )} c + c^{2}} \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right )}{2 \, \sqrt {a b + {\left (a + b\right )} c + c^{2}} d}\right ] \]

[In]

integrate(sec(d*x+c)^2/(a+c*sec(d*x+c)^2+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

[-1/4*sqrt(-a*b - (a + b)*c - c^2)*log(((a^2 + 6*a*b + b^2 + 8*(a + b)*c + 8*c^2)*cos(d*x + c)^4 - 2*(3*a*b +
b^2 + (3*a + 5*b)*c + 4*c^2)*cos(d*x + c)^2 + 4*((a + b + 2*c)*cos(d*x + c)^3 - (b + c)*cos(d*x + c))*sqrt(-a*
b - (a + b)*c - c^2)*sin(d*x + c) + b^2 + 2*b*c + c^2)/((a^2 - 2*a*b + b^2)*cos(d*x + c)^4 + 2*(a*b - b^2 + (a
 - b)*c)*cos(d*x + c)^2 + b^2 + 2*b*c + c^2))/((a*b + (a + b)*c + c^2)*d), -1/2*arctan(1/2*((a + b + 2*c)*cos(
d*x + c)^2 - b - c)/(sqrt(a*b + (a + b)*c + c^2)*cos(d*x + c)*sin(d*x + c)))/(sqrt(a*b + (a + b)*c + c^2)*d)]

Sympy [F]

\[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\int \frac {\sec ^{2}{\left (c + d x \right )}}{a + b \tan ^{2}{\left (c + d x \right )} + c \sec ^{2}{\left (c + d x \right )}}\, dx \]

[In]

integrate(sec(d*x+c)**2/(a+c*sec(d*x+c)**2+b*tan(d*x+c)**2),x)

[Out]

Integral(sec(c + d*x)**2/(a + b*tan(c + d*x)**2 + c*sec(c + d*x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.08 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\arctan \left (\frac {{\left (b + c\right )} \tan \left (d x + c\right )}{\sqrt {a b + {\left (a + b\right )} c + c^{2}}}\right )}{\sqrt {a b + {\left (a + b\right )} c + c^{2}} d} \]

[In]

integrate(sec(d*x+c)^2/(a+c*sec(d*x+c)^2+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

arctan((b + c)*tan(d*x + c)/sqrt(a*b + (a + b)*c + c^2))/(sqrt(a*b + (a + b)*c + c^2)*d)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (32) = 64\).

Time = 0.67 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.90 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, b + 2 \, c\right ) + \arctan \left (\frac {b \tan \left (d x + c\right ) + c \tan \left (d x + c\right )}{\sqrt {a b + a c + b c + c^{2}}}\right )}{\sqrt {a b + a c + b c + c^{2}} d} \]

[In]

integrate(sec(d*x+c)^2/(a+c*sec(d*x+c)^2+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

(pi*floor((d*x + c)/pi + 1/2)*sgn(2*b + 2*c) + arctan((b*tan(d*x + c) + c*tan(d*x + c))/sqrt(a*b + a*c + b*c +
 c^2)))/(sqrt(a*b + a*c + b*c + c^2)*d)

Mupad [B] (verification not implemented)

Time = 26.76 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.12 \[ \int \frac {\sec ^2(c+d x)}{a+c \sec ^2(c+d x)+b \tan ^2(c+d x)} \, dx=\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (b+c\right )}{\sqrt {a\,b+a\,c+b\,c+c^2}}\right )}{d\,\sqrt {a\,b+a\,c+b\,c+c^2}} \]

[In]

int(1/(cos(c + d*x)^2*(a + c/cos(c + d*x)^2 + b*tan(c + d*x)^2)),x)

[Out]

atan((tan(c + d*x)*(b + c))/(a*b + a*c + b*c + c^2)^(1/2))/(d*(a*b + a*c + b*c + c^2)^(1/2))