\(\int \cosh ^2(a+b x) \coth (a+b x) \, dx\) [105]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 27 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\frac {\log (\sinh (a+b x))}{b}+\frac {\sinh ^2(a+b x)}{2 b} \]

[Out]

ln(sinh(b*x+a))/b+1/2*sinh(b*x+a)^2/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2670, 14} \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\frac {\sinh ^2(a+b x)}{2 b}+\frac {\log (\sinh (a+b x))}{b} \]

[In]

Int[Cosh[a + b*x]^2*Coth[a + b*x],x]

[Out]

Log[Sinh[a + b*x]]/b + Sinh[a + b*x]^2/(2*b)

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 2670

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1-x^2}{x} \, dx,x,-i \sinh (a+b x)\right )}{b} \\ & = \frac {\text {Subst}\left (\int \left (\frac {1}{x}-x\right ) \, dx,x,-i \sinh (a+b x)\right )}{b} \\ & = \frac {\log (\sinh (a+b x))}{b}+\frac {\sinh ^2(a+b x)}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.93 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\frac {2 \log (\sinh (a+b x))+\sinh ^2(a+b x)}{2 b} \]

[In]

Integrate[Cosh[a + b*x]^2*Coth[a + b*x],x]

[Out]

(2*Log[Sinh[a + b*x]] + Sinh[a + b*x]^2)/(2*b)

Maple [A] (verified)

Time = 0.50 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85

method result size
derivativedivides \(\frac {\frac {\cosh \left (b x +a \right )^{2}}{2}+\ln \left (\sinh \left (b x +a \right )\right )}{b}\) \(23\)
default \(\frac {\frac {\cosh \left (b x +a \right )^{2}}{2}+\ln \left (\sinh \left (b x +a \right )\right )}{b}\) \(23\)
risch \(-x +\frac {{\mathrm e}^{2 b x +2 a}}{8 b}+\frac {{\mathrm e}^{-2 b x -2 a}}{8 b}-\frac {2 a}{b}+\frac {\ln \left ({\mathrm e}^{2 b x +2 a}-1\right )}{b}\) \(55\)

[In]

int(cosh(b*x+a)^2*coth(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*(1/2*cosh(b*x+a)^2+ln(sinh(b*x+a)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 203 vs. \(2 (25) = 50\).

Time = 0.25 (sec) , antiderivative size = 203, normalized size of antiderivative = 7.52 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=-\frac {8 \, b x \cosh \left (b x + a\right )^{2} - \cosh \left (b x + a\right )^{4} - 4 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{3} - \sinh \left (b x + a\right )^{4} + 2 \, {\left (4 \, b x - 3 \, \cosh \left (b x + a\right )^{2}\right )} \sinh \left (b x + a\right )^{2} - 8 \, {\left (\cosh \left (b x + a\right )^{2} + 2 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + \sinh \left (b x + a\right )^{2}\right )} \log \left (\frac {2 \, \sinh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right ) + 4 \, {\left (4 \, b x \cosh \left (b x + a\right ) - \cosh \left (b x + a\right )^{3}\right )} \sinh \left (b x + a\right ) - 1}{8 \, {\left (b \cosh \left (b x + a\right )^{2} + 2 \, b \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + b \sinh \left (b x + a\right )^{2}\right )}} \]

[In]

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

[Out]

-1/8*(8*b*x*cosh(b*x + a)^2 - cosh(b*x + a)^4 - 4*cosh(b*x + a)*sinh(b*x + a)^3 - sinh(b*x + a)^4 + 2*(4*b*x -
 3*cosh(b*x + a)^2)*sinh(b*x + a)^2 - 8*(cosh(b*x + a)^2 + 2*cosh(b*x + a)*sinh(b*x + a) + sinh(b*x + a)^2)*lo
g(2*sinh(b*x + a)/(cosh(b*x + a) - sinh(b*x + a))) + 4*(4*b*x*cosh(b*x + a) - cosh(b*x + a)^3)*sinh(b*x + a) -
 1)/(b*cosh(b*x + a)^2 + 2*b*cosh(b*x + a)*sinh(b*x + a) + b*sinh(b*x + a)^2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 105 vs. \(2 (20) = 40\).

Time = 0.83 (sec) , antiderivative size = 105, normalized size of antiderivative = 3.89 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \\x \cosh ^{2}{\left (a \right )} \coth {\left (a \right )} & \text {for}\: b = 0 \\\tilde {\infty } x & \text {for}\: a = - b x \\- \frac {x \sinh ^{2}{\left (a + b x \right )} \coth {\left (a + b x \right )}}{2} + \frac {x \cosh ^{2}{\left (a + b x \right )} \coth {\left (a + b x \right )}}{2} - \frac {x \cosh {\left (a + b x \right )}}{2 \sinh {\left (a + b x \right )}} + \frac {\log {\left (\sinh {\left (a + b x \right )} \right )}}{b} + \frac {\sinh {\left (a + b x \right )} \cosh {\left (a + b x \right )} \coth {\left (a + b x \right )}}{2 b} & \text {otherwise} \end {cases} \]

[In]

integrate(cosh(b*x+a)**2*coth(b*x+a),x)

[Out]

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0)), (x*cosh(a)**2*coth(a), Eq(b, 0)), (zoo*x, Eq(a, -b*x)), (-x*sinh(a + b
*x)**2*coth(a + b*x)/2 + x*cosh(a + b*x)**2*coth(a + b*x)/2 - x*cosh(a + b*x)/(2*sinh(a + b*x)) + log(sinh(a +
 b*x))/b + sinh(a + b*x)*cosh(a + b*x)*coth(a + b*x)/(2*b), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (25) = 50\).

Time = 0.19 (sec) , antiderivative size = 70, normalized size of antiderivative = 2.59 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\frac {b x + a}{b} + \frac {e^{\left (2 \, b x + 2 \, a\right )}}{8 \, b} + \frac {e^{\left (-2 \, b x - 2 \, a\right )}}{8 \, b} + \frac {\log \left (e^{\left (-b x - a\right )} + 1\right )}{b} + \frac {\log \left (e^{\left (-b x - a\right )} - 1\right )}{b} \]

[In]

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

[Out]

(b*x + a)/b + 1/8*e^(2*b*x + 2*a)/b + 1/8*e^(-2*b*x - 2*a)/b + log(e^(-b*x - a) + 1)/b + log(e^(-b*x - a) - 1)
/b

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (25) = 50\).

Time = 0.27 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.33 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=-\frac {8 \, b x - {\left (4 \, e^{\left (2 \, b x + 2 \, a\right )} + 1\right )} e^{\left (-2 \, b x - 2 \, a\right )} + 8 \, a - e^{\left (2 \, b x + 2 \, a\right )} - 8 \, \log \left ({\left | e^{\left (2 \, b x + 2 \, a\right )} - 1 \right |}\right )}{8 \, b} \]

[In]

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

[Out]

-1/8*(8*b*x - (4*e^(2*b*x + 2*a) + 1)*e^(-2*b*x - 2*a) + 8*a - e^(2*b*x + 2*a) - 8*log(abs(e^(2*b*x + 2*a) - 1
)))/b

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.81 \[ \int \cosh ^2(a+b x) \coth (a+b x) \, dx=\frac {\ln \left ({\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}-1\right )}{b}-x+\frac {{\mathrm {e}}^{-2\,a-2\,b\,x}}{8\,b}+\frac {{\mathrm {e}}^{2\,a+2\,b\,x}}{8\,b} \]

[In]

int(cosh(a + b*x)^2*coth(a + b*x),x)

[Out]

log(exp(2*a)*exp(2*b*x) - 1)/b - x + exp(- 2*a - 2*b*x)/(8*b) + exp(2*a + 2*b*x)/(8*b)