### 3.140 $$\int \coth ^2(c+d x) (a+b \tanh ^2(c+d x)) \, dx$$

Optimal. Leaf size=18 $x (a+b)-\frac{a \coth (c+d x)}{d}$

[Out]

(a + b)*x - (a*Coth[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0290586, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 21, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.095, Rules used = {3629, 8} $x (a+b)-\frac{a \coth (c+d x)}{d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(a + b)*x - (a*Coth[c + d*x])/d

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \coth ^2(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=-\frac{a \coth (c+d x)}{d}-\int (-a-b) \, dx\\ &=(a+b) x-\frac{a \coth (c+d x)}{d}\\ \end{align*}

Mathematica [C]  time = 0.0259963, size = 32, normalized size = 1.78 $b x-\frac{a \coth (c+d x) \, _2F_1\left (-\frac{1}{2},1;\frac{1}{2};\tanh ^2(c+d x)\right )}{d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

b*x - (a*Coth[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, Tanh[c + d*x]^2])/d

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 28, normalized size = 1.6 \begin{align*}{\frac{a \left ( dx+c-{\rm coth} \left (dx+c\right ) \right ) + \left ( dx+c \right ) b}{d}} \end{align*}

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

[In]

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

[Out]

1/d*(a*(d*x+c-coth(d*x+c))+(d*x+c)*b)

________________________________________________________________________________________

Maxima [A]  time = 1.04148, size = 42, normalized size = 2.33 \begin{align*} a{\left (x + \frac{c}{d} + \frac{2}{d{\left (e^{\left (-2 \, d x - 2 \, c\right )} - 1\right )}}\right )} + b x \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.9345, size = 97, normalized size = 5.39 \begin{align*} -\frac{a \cosh \left (d x + c\right ) -{\left ({\left (a + b\right )} d x + a\right )} \sinh \left (d x + c\right )}{d \sinh \left (d x + c\right )} \end{align*}

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

[In]

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

[Out]

-(a*cosh(d*x + c) - ((a + b)*d*x + a)*sinh(d*x + c))/(d*sinh(d*x + c))

________________________________________________________________________________________

Sympy [B]  time = 60.3678, size = 49, normalized size = 2.72 \begin{align*} a \left (\begin{cases} x \coth ^{2}{\left (c \right )} & \text{for}\: d = 0 \\\tilde{\infty } x & \text{for}\: c = \log{\left (- e^{- d x} \right )} \vee c = \log{\left (e^{- d x} \right )} \\x - \frac{1}{d \tanh{\left (c + d x \right )}} & \text{otherwise} \end{cases}\right ) + b \left (\begin{cases} x & \text{for}\: \left |{x}\right | < 1 \\{G_{2, 2}^{1, 1}\left (\begin{matrix} 1 & 2 \\1 & 0 \end{matrix} \middle |{x} \right )} +{G_{2, 2}^{0, 2}\left (\begin{matrix} 2, 1 & \\ & 1, 0 \end{matrix} \middle |{x} \right )} & \text{otherwise} \end{cases}\right ) \end{align*}

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

[In]

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

[Out]

a*Piecewise((x*coth(c)**2, Eq(d, 0)), (zoo*x, Eq(c, log(exp(-d*x))) | Eq(c, log(-exp(-d*x)))), (x - 1/(d*tanh(
c + d*x)), True)) + b*Piecewise((x, Abs(x) < 1), (meijerg(((1,), (2,)), ((1,), (0,)), x) + meijerg(((2, 1), ()
), ((), (1, 0)), x), True))

________________________________________________________________________________________

Giac [A]  time = 1.21697, size = 43, normalized size = 2.39 \begin{align*} \frac{{\left (d x + c\right )}{\left (a + b\right )}}{d} - \frac{2 \, a}{d{\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}} \end{align*}

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

[In]

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

[Out]

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