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

Optimal. Leaf size=25 $\frac{a \log (\sinh (c+d x))}{d}+\frac{b \log (\cosh (c+d x))}{d}$

[Out]

(b*Log[Cosh[c + d*x]])/d + (a*Log[Sinh[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0412611, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.105, Rules used = {3625, 3475} $\frac{a \log (\sinh (c+d x))}{d}+\frac{b \log (\cosh (c+d x))}{d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(b*Log[Cosh[c + d*x]])/d + (a*Log[Sinh[c + d*x]])/d

Rule 3625

Int[((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Dist[A, Int[1/Tan[e + f*x],
x], x] + Dist[C, Int[Tan[e + f*x], x], x] /; FreeQ[{e, f, A, C}, x] && NeQ[A, C]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.0396557, size = 33, normalized size = 1.32 $\frac{a (\log (\tanh (c+d x))+\log (\cosh (c+d x)))}{d}+\frac{b \log (\cosh (c+d x))}{d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(b*Log[Cosh[c + d*x]])/d + (a*(Log[Cosh[c + d*x]] + Log[Tanh[c + d*x]]))/d

________________________________________________________________________________________

Maple [A]  time = 0.041, size = 26, normalized size = 1. \begin{align*}{\frac{b\ln \left ( \cosh \left ( dx+c \right ) \right ) }{d}}+{\frac{a\ln \left ( \sinh \left ( dx+c \right ) \right ) }{d}} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.10261, size = 47, normalized size = 1.88 \begin{align*} \frac{b \log \left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}{d} + \frac{a \log \left (\sinh \left (d x + c\right )\right )}{d} \end{align*}

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

[In]

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

[Out]

b*log(e^(d*x + c) + e^(-d*x - c))/d + a*log(sinh(d*x + c))/d

________________________________________________________________________________________

Fricas [B]  time = 2.02863, size = 178, normalized size = 7.12 \begin{align*} -\frac{{\left (a + b\right )} d x - b \log \left (\frac{2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) - a \log \left (\frac{2 \, \sinh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{d} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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