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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2607, 14} \[ \frac {\tanh ^{n+1}(a+b x)}{b (n+1)}-\frac {\tanh ^{n+3}(a+b x)}{b (n+3)} \]

Antiderivative was successfully verified.

[In]

Int[Sech[a + b*x]^4*Tanh[a + b*x]^n,x]

[Out]

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

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2607

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

Rubi steps

\begin {align*} \int \text {sech}^4(a+b x) \tanh ^n(a+b x) \, dx &=-\frac {i \operatorname {Subst}\left (\int (-i x)^n \left (1+x^2\right ) \, dx,x,i \tanh (a+b x)\right )}{b}\\ &=-\frac {i \operatorname {Subst}\left (\int \left ((-i x)^n-(-i x)^{2+n}\right ) \, dx,x,i \tanh (a+b x)\right )}{b}\\ &=\frac {\tanh ^{1+n}(a+b x)}{b (1+n)}-\frac {\tanh ^{3+n}(a+b x)}{b (3+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.93, size = 73, normalized size = 1.82 \[ \frac {\tanh ^{n-1}(a+b x) \left (\tanh ^2(a+b x) \text {sech}^2(a+b x) (\cosh (2 (a+b x))+n+2)-2 \tanh ^2(a+b x)^{\frac {1-n}{2}}\right )}{b (n+1) (n+3)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sech[a + b*x]^4*Tanh[a + b*x]^n,x]

[Out]

(Tanh[a + b*x]^(-1 + n)*((2 + n + Cosh[2*(a + b*x)])*Sech[a + b*x]^2*Tanh[a + b*x]^2 - 2*(Tanh[a + b*x]^2)^((1
 - n)/2)))/(b*(1 + n)*(3 + n))

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 180, normalized size = 4.50 \[ \frac {2 \, {\left ({\left (\sinh \left (b x + a\right )^{3} + {\left (3 \, \cosh \left (b x + a\right )^{2} + 2 \, n + 3\right )} \sinh \left (b x + a\right )\right )} \cosh \left (n \log \left (\frac {\sinh \left (b x + a\right )}{\cosh \left (b x + a\right )}\right )\right ) + {\left (\sinh \left (b x + a\right )^{3} + {\left (3 \, \cosh \left (b x + a\right )^{2} + 2 \, n + 3\right )} \sinh \left (b x + a\right )\right )} \sinh \left (n \log \left (\frac {\sinh \left (b x + a\right )}{\cosh \left (b x + a\right )}\right )\right )\right )}}{{\left (b n^{2} + 4 \, b n + 3 \, b\right )} \cosh \left (b x + a\right )^{3} + 3 \, {\left (b n^{2} + 4 \, b n + 3 \, b\right )} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} + 3 \, {\left (b n^{2} + 4 \, b n + 3 \, b\right )} \cosh \left (b x + a\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*((sinh(b*x + a)^3 + (3*cosh(b*x + a)^2 + 2*n + 3)*sinh(b*x + a))*cosh(n*log(sinh(b*x + a)/cosh(b*x + a))) +
(sinh(b*x + a)^3 + (3*cosh(b*x + a)^2 + 2*n + 3)*sinh(b*x + a))*sinh(n*log(sinh(b*x + a)/cosh(b*x + a))))/((b*
n^2 + 4*b*n + 3*b)*cosh(b*x + a)^3 + 3*(b*n^2 + 4*b*n + 3*b)*cosh(b*x + a)*sinh(b*x + a)^2 + 3*(b*n^2 + 4*b*n
+ 3*b)*cosh(b*x + a))

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \tanh \left (b x + a\right )^{n} \operatorname {sech}\left (b x + a\right )^{4}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.69, size = 535, normalized size = 13.38 \[ \frac {2 \left ({\mathrm e}^{6 b x +6 a}+2 n \,{\mathrm e}^{4 b x +4 a}+3 \,{\mathrm e}^{4 b x +4 a}-2 \,{\mathrm e}^{2 b x +2 a} n -3 \,{\mathrm e}^{2 b x +2 a}-1\right ) {\mathrm e}^{\frac {n \left (-i \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{2} \mathrm {csgn}\left (i \left ({\mathrm e}^{b x +a}-1\right )\right )+i \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{2} \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 b x +2 a}}\right )-i \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right ) \mathrm {csgn}\left (i \left ({\mathrm e}^{b x +a}-1\right )\right ) \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 b x +2 a}}\right )+i \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right ) \mathrm {csgn}\left (\frac {i \left (1+{\mathrm e}^{b x +a}\right ) \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{2}-i \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right ) \mathrm {csgn}\left (\frac {i \left (1+{\mathrm e}^{b x +a}\right ) \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right ) \mathrm {csgn}\left (i \left (1+{\mathrm e}^{b x +a}\right )\right )-i \pi \mathrm {csgn}\left (\frac {i \left (1+{\mathrm e}^{b x +a}\right ) \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{3}+i \pi \mathrm {csgn}\left (\frac {i \left (1+{\mathrm e}^{b x +a}\right ) \left ({\mathrm e}^{b x +a}-1\right )}{1+{\mathrm e}^{2 b x +2 a}}\right )^{2} \mathrm {csgn}\left (i \left (1+{\mathrm e}^{b x +a}\right )\right )+2 \ln \left ({\mathrm e}^{b x +a}-1\right )-2 \ln \left (1+{\mathrm e}^{2 b x +2 a}\right )+2 \ln \left (1+{\mathrm e}^{b x +a}\right )\right )}{2}}}{b \left (n +1\right ) \left (n +3\right ) \left (1+{\mathrm e}^{2 b x +2 a}\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(exp(6*b*x+6*a)+2*n*exp(4*b*x+4*a)+3*exp(4*b*x+4*a)-2*exp(2*b*x+2*a)*n-3*exp(2*b*x+2*a)-1)/b/(n+1)/(n+3)/(1+
exp(2*b*x+2*a))^3*exp(1/2*n*(-I*Pi*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a)))^3+I*Pi*csgn(I*(exp(b*x+a)-1)/(1+e
xp(2*b*x+2*a)))^2*csgn(I*(exp(b*x+a)-1))+I*Pi*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a)))^2*csgn(I/(1+exp(2*b*x+
2*a)))-I*Pi*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a)))*csgn(I*(exp(b*x+a)-1))*csgn(I/(1+exp(2*b*x+2*a)))+I*Pi*c
sgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a)))*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a))*(exp(b*x+a)-1))^2-I*Pi*csgn(
I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a)))*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a))*(exp(b*x+a)-1))*csgn(I*(1+exp(b*
x+a)))-I*Pi*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a))*(exp(b*x+a)-1))^3+I*Pi*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x
+2*a))*(exp(b*x+a)-1))^2*csgn(I*(1+exp(b*x+a)))+2*ln(exp(b*x+a)-1)-2*ln(1+exp(2*b*x+2*a))+2*ln(1+exp(b*x+a))))

________________________________________________________________________________________

maxima [B]  time = 0.44, size = 504, normalized size = 12.60 \[ \frac {2 \, {\left (2 \, n + 3\right )} e^{\left (-2 \, b x + n \log \left (e^{\left (-b x - a\right )} + 1\right ) + n \log \left (-e^{\left (-b x - a\right )} + 1\right ) - n \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right ) - 2 \, a\right )}}{{\left (n^{2} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-4 \, b x - 4 \, a\right )} + {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-6 \, b x - 6 \, a\right )} + 4 \, n + 3\right )} b} - \frac {2 \, {\left (2 \, n + 3\right )} e^{\left (-4 \, b x + n \log \left (e^{\left (-b x - a\right )} + 1\right ) + n \log \left (-e^{\left (-b x - a\right )} + 1\right ) - n \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right ) - 4 \, a\right )}}{{\left (n^{2} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-4 \, b x - 4 \, a\right )} + {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-6 \, b x - 6 \, a\right )} + 4 \, n + 3\right )} b} - \frac {2 \, e^{\left (-6 \, b x + n \log \left (e^{\left (-b x - a\right )} + 1\right ) + n \log \left (-e^{\left (-b x - a\right )} + 1\right ) - n \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right ) - 6 \, a\right )}}{{\left (n^{2} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-4 \, b x - 4 \, a\right )} + {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-6 \, b x - 6 \, a\right )} + 4 \, n + 3\right )} b} + \frac {2 \, e^{\left (n \log \left (e^{\left (-b x - a\right )} + 1\right ) + n \log \left (-e^{\left (-b x - a\right )} + 1\right ) - n \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right )\right )}}{{\left (n^{2} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-2 \, b x - 2 \, a\right )} + 3 \, {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-4 \, b x - 4 \, a\right )} + {\left (n^{2} + 4 \, n + 3\right )} e^{\left (-6 \, b x - 6 \, a\right )} + 4 \, n + 3\right )} b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(2*n + 3)*e^(-2*b*x + n*log(e^(-b*x - a) + 1) + n*log(-e^(-b*x - a) + 1) - n*log(e^(-2*b*x - 2*a) + 1) - 2*a
)/((n^2 + 3*(n^2 + 4*n + 3)*e^(-2*b*x - 2*a) + 3*(n^2 + 4*n + 3)*e^(-4*b*x - 4*a) + (n^2 + 4*n + 3)*e^(-6*b*x
- 6*a) + 4*n + 3)*b) - 2*(2*n + 3)*e^(-4*b*x + n*log(e^(-b*x - a) + 1) + n*log(-e^(-b*x - a) + 1) - n*log(e^(-
2*b*x - 2*a) + 1) - 4*a)/((n^2 + 3*(n^2 + 4*n + 3)*e^(-2*b*x - 2*a) + 3*(n^2 + 4*n + 3)*e^(-4*b*x - 4*a) + (n^
2 + 4*n + 3)*e^(-6*b*x - 6*a) + 4*n + 3)*b) - 2*e^(-6*b*x + n*log(e^(-b*x - a) + 1) + n*log(-e^(-b*x - a) + 1)
 - n*log(e^(-2*b*x - 2*a) + 1) - 6*a)/((n^2 + 3*(n^2 + 4*n + 3)*e^(-2*b*x - 2*a) + 3*(n^2 + 4*n + 3)*e^(-4*b*x
 - 4*a) + (n^2 + 4*n + 3)*e^(-6*b*x - 6*a) + 4*n + 3)*b) + 2*e^(n*log(e^(-b*x - a) + 1) + n*log(-e^(-b*x - a)
+ 1) - n*log(e^(-2*b*x - 2*a) + 1))/((n^2 + 3*(n^2 + 4*n + 3)*e^(-2*b*x - 2*a) + 3*(n^2 + 4*n + 3)*e^(-4*b*x -
 4*a) + (n^2 + 4*n + 3)*e^(-6*b*x - 6*a) + 4*n + 3)*b)

________________________________________________________________________________________

mupad [B]  time = 1.61, size = 115, normalized size = 2.88 \[ \frac {{\mathrm {e}}^{-3\,a-3\,b\,x}\,\left (\frac {4\,{\mathrm {e}}^{3\,a+3\,b\,x}\,\mathrm {sinh}\left (3\,a+3\,b\,x\right )}{b\,\left (n^2+4\,n+3\right )}+\frac {2\,{\mathrm {e}}^{3\,a+3\,b\,x}\,\mathrm {sinh}\left (a+b\,x\right )\,\left (4\,n+6\right )}{b\,\left (n^2+4\,n+3\right )}\right )\,{\left (\frac {{\mathrm {e}}^{2\,a+2\,b\,x}-1}{{\mathrm {e}}^{2\,a+2\,b\,x}+1}\right )}^n}{8\,{\mathrm {cosh}\left (a+b\,x\right )}^3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(exp(- 3*a - 3*b*x)*((4*exp(3*a + 3*b*x)*sinh(3*a + 3*b*x))/(b*(4*n + n^2 + 3)) + (2*exp(3*a + 3*b*x)*sinh(a +
 b*x)*(4*n + 6))/(b*(4*n + n^2 + 3)))*((exp(2*a + 2*b*x) - 1)/(exp(2*a + 2*b*x) + 1))^n)/(8*cosh(a + b*x)^3)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________