3.982 \(\int \text {sech}^2(x) (a+b \tanh (x))^n \, dx\)

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

[Out]

(a+b*tanh(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 \tanh (x))^{n+1}}{b (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[Sech[x]^2*(a + b*Tanh[x])^n,x]

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[Sech[x]^2*(a + b*Tanh[x])^n,x]

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 69, normalized size = 3.63 \[ \frac {{\left (a \cosh \relax (x) + b \sinh \relax (x)\right )} \cosh \left (n \log \left (\frac {a \cosh \relax (x) + b \sinh \relax (x)}{\cosh \relax (x)}\right )\right ) + {\left (a \cosh \relax (x) + b \sinh \relax (x)\right )} \sinh \left (n \log \left (\frac {a \cosh \relax (x) + b \sinh \relax (x)}{\cosh \relax (x)}\right )\right )}{{\left (b n + b\right )} \cosh \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((a*cosh(x) + b*sinh(x))*cosh(n*log((a*cosh(x) + b*sinh(x))/cosh(x))) + (a*cosh(x) + b*sinh(x))*sinh(n*log((a*
cosh(x) + b*sinh(x))/cosh(x))))/((b*n + b)*cosh(x))

________________________________________________________________________________________

giac [B]  time = 0.12, size = 39, normalized size = 2.05 \[ \frac {\left (\frac {a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b}{e^{\left (2 \, x\right )} + 1}\right )^{n + 1}}{b {\left (n + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

((a*e^(2*x) + b*e^(2*x) + a - b)/(e^(2*x) + 1))^(n + 1)/(b*(n + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(x)^2*(a+b*tanh(x))^n,x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.79, size = 54, normalized size = 2.84 \[ \frac {{\left (a+\frac {b\,\left ({\mathrm {e}}^{2\,x}-1\right )}{{\mathrm {e}}^{2\,x}+1}\right )}^n\,\left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{b\,\left ({\mathrm {e}}^{2\,x}+1\right )\,\left (n+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tanh(x))^n/cosh(x)^2,x)

[Out]

((a + (b*(exp(2*x) - 1))/(exp(2*x) + 1))^n*(a - b + a*exp(2*x) + b*exp(2*x)))/(b*(exp(2*x) + 1)*(n + 1))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)**2*(a+b*tanh(x))**n,x)

[Out]

Integral((a + b*tanh(x))**n*sech(x)**2, x)

________________________________________________________________________________________