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

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

Optimal result

Integrand size = 13, antiderivative size = 11 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log (a+b \tan (x))}{b} \]

[Out]

ln(a+b*tan(x))/b

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3587, 31} \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log (a+b \tan (x))}{b} \]

[In]

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

[Out]

Log[a + b*Tan[x]]/b

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (x)\right )}{b} \\ & = \frac {\log (a+b \tan (x))}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log (a+b \tan (x))}{b} \]

[In]

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

[Out]

Log[a + b*Tan[x]]/b

Maple [A] (verified)

Time = 1.53 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09

method result size
derivativedivides \(\frac {\ln \left (a +b \tan \left (x \right )\right )}{b}\) \(12\)
default \(\frac {\ln \left (a +b \tan \left (x \right )\right )}{b}\) \(12\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{b}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i b +a}{i b -a}\right )}{b}\) \(44\)

[In]

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

[Out]

ln(a+b*tan(x))/b

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (11) = 22\).

Time = 0.25 (sec) , antiderivative size = 40, normalized size of antiderivative = 3.64 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}\right ) - \log \left (\cos \left (x\right )^{2}\right )}{2 \, b} \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log \left (b \tan \left (x\right ) + a\right )}{b} \]

[In]

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

[Out]

log(b*tan(x) + a)/b

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\log \left ({\left | b \tan \left (x\right ) + a \right |}\right )}{b} \]

[In]

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

[Out]

log(abs(b*tan(x) + a))/b

Mupad [B] (verification not implemented)

Time = 26.48 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^2(x)}{a+b \tan (x)} \, dx=\frac {\ln \left (a+b\,\mathrm {tan}\left (x\right )\right )}{b} \]

[In]

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

[Out]

log(a + b*tan(x))/b