3.693 \(\int \sec ^2(x) (a+b \tan (x))^n \, dx\)

Optimal. Leaf size=19 \[ \frac {(a+b \tan (x))^{n+1}}{b (n+1)} \]

[Out]

(a+b*tan(x))^(1+n)/b/(1+n)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3506, 32} \[ \frac {(a+b \tan (x))^{n+1}}{b (n+1)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(a + b*Tan[x])^(1 + n)/(b*(1 + n))

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3506

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*} \int \sec ^2(x) (a+b \tan (x))^n \, dx &=\frac {\operatorname {Subst}\left (\int (a+x)^n \, dx,x,b \tan (x)\right )}{b}\\ &=\frac {(a+b \tan (x))^{1+n}}{b (1+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.19, size = 18, normalized size = 0.95 \[ \frac {(a+b \tan (x))^{n+1}}{b n+b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(a + b*Tan[x])^(1 + n)/(b + b*n)

________________________________________________________________________________________

fricas [A]  time = 1.06, size = 37, normalized size = 1.95 \[ \frac {{\left (a \cos \relax (x) + b \sin \relax (x)\right )} \left (\frac {a \cos \relax (x) + b \sin \relax (x)}{\cos \relax (x)}\right )^{n}}{{\left (b n + b\right )} \cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a*cos(x) + b*sin(x))*((a*cos(x) + b*sin(x))/cos(x))^n/((b*n + b)*cos(x))

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Unab
le to divide, perhaps due to rounding error%%%{1,[0,1,0]%%%} / %%%{1,[0,0,1]%%%} Error: Bad Argument Value

________________________________________________________________________________________

maple [A]  time = 0.08, size = 20, normalized size = 1.05 \[ \frac {\left (a +b \tan \relax (x )\right )^{n +1}}{b \left (n +1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2*(a+b*tan(x))^n,x)

[Out]

(a+b*tan(x))^(n+1)/b/(n+1)

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 19, normalized size = 1.00 \[ \frac {{\left (b \tan \relax (x) + a\right )}^{n + 1}}{b {\left (n + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(b*tan(x) + a)^(n + 1)/(b*(n + 1))

________________________________________________________________________________________

mupad [B]  time = 3.56, size = 37, normalized size = 1.95 \[ \left \{\begin {array}{cl} \frac {\ln \left (a+b\,\mathrm {tan}\relax (x)\right )}{b} & \text {\ if\ \ }n=-1\\ \frac {{\left (a+b\,\mathrm {tan}\relax (x)\right )}^{n+1}}{b\,\left (n+1\right )} & \text {\ if\ \ }n\neq -1 \end {array}\right . \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

piecewise(n == -1, log(a + b*tan(x))/b, n ~= -1, (a + b*tan(x))^(n + 1)/(b*(n + 1)))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan {\relax (x )}\right )^{n} \sec ^{2}{\relax (x )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________