### 3.51 $$\int \sinh ^2(c+d x) (a+b \tanh ^3(c+d x)) \, dx$$

Optimal. Leaf size=100 $\frac{(a+4 b) \log (1-\tanh (c+d x))}{4 d}-\frac{(a-4 b) \log (\tanh (c+d x)+1)}{4 d}+\frac{\sinh ^2(c+d x) (a \tanh (c+d x)+b)}{2 d}+\frac{a \tanh (c+d x)}{2 d}+\frac{b \tanh ^2(c+d x)}{2 d}$

[Out]

((a + 4*b)*Log[1 - Tanh[c + d*x]])/(4*d) - ((a - 4*b)*Log[1 + Tanh[c + d*x]])/(4*d) + (a*Tanh[c + d*x])/(2*d)
+ (b*Tanh[c + d*x]^2)/(2*d) + (Sinh[c + d*x]^2*(b + a*Tanh[c + d*x]))/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.117426, antiderivative size = 100, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 21, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.238, Rules used = {3663, 1804, 1802, 633, 31} $\frac{(a+4 b) \log (1-\tanh (c+d x))}{4 d}-\frac{(a-4 b) \log (\tanh (c+d x)+1)}{4 d}+\frac{\sinh ^2(c+d x) (a \tanh (c+d x)+b)}{2 d}+\frac{a \tanh (c+d x)}{2 d}+\frac{b \tanh ^2(c+d x)}{2 d}$

Antiderivative was successfully veriﬁed.

[In]

Int[Sinh[c + d*x]^2*(a + b*Tanh[c + d*x]^3),x]

[Out]

((a + 4*b)*Log[1 - Tanh[c + d*x]])/(4*d) - ((a - 4*b)*Log[1 + Tanh[c + d*x]])/(4*d) + (a*Tanh[c + d*x])/(2*d)
+ (b*Tanh[c + d*x]^2)/(2*d) + (Sinh[c + d*x]^2*(b + a*Tanh[c + d*x]))/(2*d)

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rule 1804

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x
^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x
], x, 1]}, Simp[((c*x)^m*(a + b*x^2)^(p + 1)*(a*g - b*f*x))/(2*a*b*(p + 1)), x] + Dist[c/(2*a*b*(p + 1)), Int[
(c*x)^(m - 1)*(a + b*x^2)^(p + 1)*ExpandToSum[2*a*b*(p + 1)*x*Q - a*g*m + b*f*(m + 2*p + 3)*x, x], x], x]] /;
FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && LtQ[p, -1] && GtQ[m, 0]

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 633

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[-(a*c), 2]}, Dist[e/2 + (c*d)/(2*q),
Int[1/(-q + c*x), x], x] + Dist[e/2 - (c*d)/(2*q), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[-(a*c)]

Rule 31

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

Rubi steps

\begin{align*} \int \sinh ^2(c+d x) \left (a+b \tanh ^3(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2 \left (a+b x^3\right )}{\left (1-x^2\right )^2} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac{\sinh ^2(c+d x) (b+a \tanh (c+d x))}{2 d}+\frac{\operatorname{Subst}\left (\int \frac{x \left (-2 b-a x-2 b x^2\right )}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac{\sinh ^2(c+d x) (b+a \tanh (c+d x))}{2 d}+\frac{\operatorname{Subst}\left (\int \left (a+2 b x-\frac{a+4 b x}{1-x^2}\right ) \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac{a \tanh (c+d x)}{2 d}+\frac{b \tanh ^2(c+d x)}{2 d}+\frac{\sinh ^2(c+d x) (b+a \tanh (c+d x))}{2 d}-\frac{\operatorname{Subst}\left (\int \frac{a+4 b x}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{2 d}\\ &=\frac{a \tanh (c+d x)}{2 d}+\frac{b \tanh ^2(c+d x)}{2 d}+\frac{\sinh ^2(c+d x) (b+a \tanh (c+d x))}{2 d}+\frac{(a-4 b) \operatorname{Subst}\left (\int \frac{1}{-1-x} \, dx,x,\tanh (c+d x)\right )}{4 d}-\frac{(a+4 b) \operatorname{Subst}\left (\int \frac{1}{1-x} \, dx,x,\tanh (c+d x)\right )}{4 d}\\ &=\frac{(a+4 b) \log (1-\tanh (c+d x))}{4 d}-\frac{(a-4 b) \log (1+\tanh (c+d x))}{4 d}+\frac{a \tanh (c+d x)}{2 d}+\frac{b \tanh ^2(c+d x)}{2 d}+\frac{\sinh ^2(c+d x) (b+a \tanh (c+d x))}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.106663, size = 69, normalized size = 0.69 $\frac{a (-c-d x)}{2 d}+\frac{a \sinh (2 (c+d x))}{4 d}-\frac{b \left (-\sinh ^2(c+d x)+\text{sech}^2(c+d x)+4 \log (\cosh (c+d x))\right )}{2 d}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Sinh[c + d*x]^2*(a + b*Tanh[c + d*x]^3),x]

[Out]

(a*(-c - d*x))/(2*d) - (b*(4*Log[Cosh[c + d*x]] + Sech[c + d*x]^2 - Sinh[c + d*x]^2))/(2*d) + (a*Sinh[2*(c + d
*x)])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.041, size = 79, normalized size = 0.8 \begin{align*}{\frac{a\cosh \left ( dx+c \right ) \sinh \left ( dx+c \right ) }{2\,d}}-{\frac{ax}{2}}-{\frac{ac}{2\,d}}+{\frac{b \left ( \sinh \left ( dx+c \right ) \right ) ^{4}}{2\,d \left ( \cosh \left ( dx+c \right ) \right ) ^{2}}}-2\,{\frac{b\ln \left ( \cosh \left ( dx+c \right ) \right ) }{d}}+{\frac{b \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{d}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(sinh(d*x+c)^2*(a+b*tanh(d*x+c)^3),x)

[Out]

1/2/d*a*cosh(d*x+c)*sinh(d*x+c)-1/2*a*x-1/2/d*a*c+1/2/d*b*sinh(d*x+c)^4/cosh(d*x+c)^2-2*b*ln(cosh(d*x+c))/d+b*
tanh(d*x+c)^2/d

________________________________________________________________________________________

Maxima [A]  time = 1.58441, size = 190, normalized size = 1.9 \begin{align*} -\frac{1}{8} \, a{\left (4 \, x - \frac{e^{\left (2 \, d x + 2 \, c\right )}}{d} + \frac{e^{\left (-2 \, d x - 2 \, c\right )}}{d}\right )} - \frac{1}{8} \, b{\left (\frac{16 \,{\left (d x + c\right )}}{d} - \frac{e^{\left (-2 \, d x - 2 \, c\right )}}{d} + \frac{16 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} - \frac{2 \, e^{\left (-2 \, d x - 2 \, c\right )} - 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 1}{d{\left (e^{\left (-2 \, d x - 2 \, c\right )} + 2 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(d*x+c)^2*(a+b*tanh(d*x+c)^3),x, algorithm="maxima")

[Out]

-1/8*a*(4*x - e^(2*d*x + 2*c)/d + e^(-2*d*x - 2*c)/d) - 1/8*b*(16*(d*x + c)/d - e^(-2*d*x - 2*c)/d + 16*log(e^
(-2*d*x - 2*c) + 1)/d - (2*e^(-2*d*x - 2*c) - 15*e^(-4*d*x - 4*c) + 1)/(d*(e^(-2*d*x - 2*c) + 2*e^(-4*d*x - 4*
c) + e^(-6*d*x - 6*c))))

________________________________________________________________________________________

Fricas [B]  time = 2.35088, size = 2453, normalized size = 24.53 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(d*x+c)^2*(a+b*tanh(d*x+c)^3),x, algorithm="fricas")

[Out]

1/8*((a + b)*cosh(d*x + c)^8 + 8*(a + b)*cosh(d*x + c)*sinh(d*x + c)^7 + (a + b)*sinh(d*x + c)^8 - 2*(2*(a - 4
*b)*d*x - a - b)*cosh(d*x + c)^6 - 2*(2*(a - 4*b)*d*x - 14*(a + b)*cosh(d*x + c)^2 - a - b)*sinh(d*x + c)^6 +
4*(14*(a + b)*cosh(d*x + c)^3 - 3*(2*(a - 4*b)*d*x - a - b)*cosh(d*x + c))*sinh(d*x + c)^5 - 2*(4*(a - 4*b)*d*
x + 7*b)*cosh(d*x + c)^4 + 2*(35*(a + b)*cosh(d*x + c)^4 - 4*(a - 4*b)*d*x - 15*(2*(a - 4*b)*d*x - a - b)*cosh
(d*x + c)^2 - 7*b)*sinh(d*x + c)^4 + 8*(7*(a + b)*cosh(d*x + c)^5 - 5*(2*(a - 4*b)*d*x - a - b)*cosh(d*x + c)^
3 - (4*(a - 4*b)*d*x + 7*b)*cosh(d*x + c))*sinh(d*x + c)^3 - 2*(2*(a - 4*b)*d*x + a - b)*cosh(d*x + c)^2 + 2*(
14*(a + b)*cosh(d*x + c)^6 - 15*(2*(a - 4*b)*d*x - a - b)*cosh(d*x + c)^4 - 2*(a - 4*b)*d*x - 6*(4*(a - 4*b)*d
*x + 7*b)*cosh(d*x + c)^2 - a + b)*sinh(d*x + c)^2 - 16*(b*cosh(d*x + c)^6 + 6*b*cosh(d*x + c)*sinh(d*x + c)^5
+ b*sinh(d*x + c)^6 + 2*b*cosh(d*x + c)^4 + (15*b*cosh(d*x + c)^2 + 2*b)*sinh(d*x + c)^4 + 4*(5*b*cosh(d*x +
c)^3 + 2*b*cosh(d*x + c))*sinh(d*x + c)^3 + b*cosh(d*x + c)^2 + (15*b*cosh(d*x + c)^4 + 12*b*cosh(d*x + c)^2 +
b)*sinh(d*x + c)^2 + 2*(3*b*cosh(d*x + c)^5 + 4*b*cosh(d*x + c)^3 + b*cosh(d*x + c))*sinh(d*x + c))*log(2*cos
h(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 4*(2*(a + b)*cosh(d*x + c)^7 - 3*(2*(a - 4*b)*d*x - a - b)*cosh(
d*x + c)^5 - 2*(4*(a - 4*b)*d*x + 7*b)*cosh(d*x + c)^3 - (2*(a - 4*b)*d*x + a - b)*cosh(d*x + c))*sinh(d*x + c
) - a + b)/(d*cosh(d*x + c)^6 + 6*d*cosh(d*x + c)*sinh(d*x + c)^5 + d*sinh(d*x + c)^6 + 2*d*cosh(d*x + c)^4 +
(15*d*cosh(d*x + c)^2 + 2*d)*sinh(d*x + c)^4 + 4*(5*d*cosh(d*x + c)^3 + 2*d*cosh(d*x + c))*sinh(d*x + c)^3 + d
*cosh(d*x + c)^2 + (15*d*cosh(d*x + c)^4 + 12*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^5
+ 4*d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tanh ^{3}{\left (c + d x \right )}\right ) \sinh ^{2}{\left (c + d x \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(d*x+c)**2*(a+b*tanh(d*x+c)**3),x)

[Out]

Integral((a + b*tanh(c + d*x)**3)*sinh(c + d*x)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.26631, size = 192, normalized size = 1.92 \begin{align*} -\frac{4 \,{\left (a - 4 \, b\right )} d x -{\left (2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 8 \, b e^{\left (2 \, d x + 2 \, c\right )} - a + b\right )} e^{\left (-2 \, d x - 2 \, c\right )} -{\left (a e^{\left (2 \, d x + 10 \, c\right )} + b e^{\left (2 \, d x + 10 \, c\right )}\right )} e^{\left (-8 \, c\right )} + 16 \, b \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac{8 \,{\left (3 \, b e^{\left (4 \, d x + 4 \, c\right )} + 4 \, b e^{\left (2 \, d x + 2 \, c\right )} + 3 \, b\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}}{8 \, d} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(sinh(d*x+c)^2*(a+b*tanh(d*x+c)^3),x, algorithm="giac")

[Out]

-1/8*(4*(a - 4*b)*d*x - (2*a*e^(2*d*x + 2*c) - 8*b*e^(2*d*x + 2*c) - a + b)*e^(-2*d*x - 2*c) - (a*e^(2*d*x + 1
0*c) + b*e^(2*d*x + 10*c))*e^(-8*c) + 16*b*log(e^(2*d*x + 2*c) + 1) - 8*(3*b*e^(4*d*x + 4*c) + 4*b*e^(2*d*x +
2*c) + 3*b)/(e^(2*d*x + 2*c) + 1)^2)/d