### 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[a + b*x]^(1 + n)/(b*(1 + n)) - Tanh[a + b*x]^(3 + n)/(b*(3 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.0442714, antiderivative size = 40, normalized size of antiderivative = 1., 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 veriﬁed.

[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 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])

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]]

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.904107, 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 veriﬁed.

[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))

________________________________________________________________________________________

Maple [C]  time = 0.204, size = 535, normalized size = 13.4 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation 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*n*exp(2*b*x+2*a)-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*(1+exp(b*x+a))/(1+exp(2*b*x+2*a)))^3-I*Pi*csgn(I*(1+exp(b*x+a))/(1+e
xp(2*b*x+2*a)))^2*csgn(I*(1+exp(b*x+a)))-I*Pi*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a)))^2*csgn(I/(1+exp(2*b*x+
2*a)))+I*Pi*csgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a)))*csgn(I*(1+exp(b*x+a)))*csgn(I/(1+exp(2*b*x+2*a)))-I*Pi*c
sgn(I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a)))*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a))*(1+exp(b*x+a)))^2+I*Pi*csgn(
I*(1+exp(b*x+a))/(1+exp(2*b*x+2*a)))*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a))*(1+exp(b*x+a)))*csgn(I*(exp(b*x+
a)-1))+I*Pi*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x+2*a))*(1+exp(b*x+a)))^3-I*Pi*csgn(I*(exp(b*x+a)-1)/(1+exp(2*b*x
+2*a))*(1+exp(b*x+a)))^2*csgn(I*(exp(b*x+a)-1))-2*ln(1+exp(b*x+a))-2*ln(exp(b*x+a)-1)+2*ln(1+exp(2*b*x+2*a))))

________________________________________________________________________________________

Maxima [B]  time = 1.64752, size = 680, normalized size = 17. \begin{align*} \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} \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Fricas [B]  time = 1.9202, size = 477, normalized size = 11.92 \begin{align*} \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 )} \end{align*}

Veriﬁcation 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))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \tanh ^{n}{\left (a + b x \right )} \operatorname{sech}^{4}{\left (a + b x \right )}\, dx \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \tanh \left (b x + a\right )^{n} \operatorname{sech}\left (b x + a\right )^{4}\,{d x} \end{align*}

Veriﬁcation 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)