\(\int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx\) [97]

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

Optimal result

Integrand size = 15, antiderivative size = 20 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=-B x-\frac {(A+B) \sinh (x)}{1-\cosh (x)} \]

[Out]

-B*x-(A+B)*sinh(x)/(1-cosh(x))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {2814, 2727} \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=-\frac {(A+B) \sinh (x)}{1-\cosh (x)}-B x \]

[In]

Int[(A + B*Cosh[x])/(1 - Cosh[x]),x]

[Out]

-(B*x) - ((A + B)*Sinh[x])/(1 - Cosh[x])

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rubi steps \begin{align*} \text {integral}& = -B x-(-A-B) \int \frac {1}{1-\cosh (x)} \, dx \\ & = -B x-\frac {(A+B) \sinh (x)}{1-\cosh (x)} \\ \end{align*}

Mathematica [B] (verified)

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

Time = 0.19 (sec) , antiderivative size = 42, normalized size of antiderivative = 2.10 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=\sinh (x) \left (\frac {A+B}{-1+\cosh (x)}-\frac {2 B \arcsin \left (\sqrt {-\sinh ^2\left (\frac {x}{2}\right )}\right )}{\sqrt {-\sinh ^2(x)}}\right ) \]

[In]

Integrate[(A + B*Cosh[x])/(1 - Cosh[x]),x]

[Out]

Sinh[x]*((A + B)/(-1 + Cosh[x]) - (2*B*ArcSin[Sqrt[-Sinh[x/2]^2]])/Sqrt[-Sinh[x]^2])

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95

method result size
parallelrisch \(\frac {-x \tanh \left (\frac {x}{2}\right ) B +A +B}{\tanh \left (\frac {x}{2}\right )}\) \(19\)
risch \(-B x +\frac {2 A}{{\mathrm e}^{x}-1}+\frac {2 B}{{\mathrm e}^{x}-1}\) \(24\)
default \(-\frac {-A -B}{\tanh \left (\frac {x}{2}\right )}+B \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-B \ln \left (\tanh \left (\frac {x}{2}\right )+1\right )\) \(36\)

[In]

int((A+B*cosh(x))/(1-cosh(x)),x,method=_RETURNVERBOSE)

[Out]

(-x*tanh(1/2*x)*B+A+B)/tanh(1/2*x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.55 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=-\frac {B x \cosh \left (x\right ) + B x \sinh \left (x\right ) - B x - 2 \, A - 2 \, B}{\cosh \left (x\right ) + \sinh \left (x\right ) - 1} \]

[In]

integrate((A+B*cosh(x))/(1-cosh(x)),x, algorithm="fricas")

[Out]

-(B*x*cosh(x) + B*x*sinh(x) - B*x - 2*A - 2*B)/(cosh(x) + sinh(x) - 1)

Sympy [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.75 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=\frac {A}{\tanh {\left (\frac {x}{2} \right )}} - B x + \frac {B}{\tanh {\left (\frac {x}{2} \right )}} \]

[In]

integrate((A+B*cosh(x))/(1-cosh(x)),x)

[Out]

A/tanh(x/2) - B*x + B/tanh(x/2)

Maxima [A] (verification not implemented)

none

Time = 0.17 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.35 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=-B {\left (x + \frac {2}{e^{\left (-x\right )} - 1}\right )} - \frac {2 \, A}{e^{\left (-x\right )} - 1} \]

[In]

integrate((A+B*cosh(x))/(1-cosh(x)),x, algorithm="maxima")

[Out]

-B*(x + 2/(e^(-x) - 1)) - 2*A/(e^(-x) - 1)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.80 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=-B x + \frac {2 \, {\left (A + B\right )}}{e^{x} - 1} \]

[In]

integrate((A+B*cosh(x))/(1-cosh(x)),x, algorithm="giac")

[Out]

-B*x + 2*(A + B)/(e^x - 1)

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.95 \[ \int \frac {A+B \cosh (x)}{1-\cosh (x)} \, dx=\frac {2\,A+2\,B}{{\mathrm {e}}^x-1}-B\,x \]

[In]

int(-(A + B*cosh(x))/(cosh(x) - 1),x)

[Out]

(2*A + 2*B)/(exp(x) - 1) - B*x