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

Optimal. Leaf size=18 \[ B x+\frac {(A-B) \sinh (x)}{1+\cosh (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2814, 2727} \begin {gather*} \frac {(A-B) \sinh (x)}{\cosh (x)+1}+B x \end {gather*}

Antiderivative was successfully verified.

[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*} \int \frac {A+B \cosh (x)}{1+\cosh (x)} \, dx &=B x-(-A+B) \int \frac {1}{1+\cosh (x)} \, dx\\ &=B x+\frac {(A-B) \sinh (x)}{1+\cosh (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 23, normalized size = 1.28 \begin {gather*} \frac {\left (A-B+B x \coth \left (\frac {x}{2}\right )\right ) \sinh (x)}{1+\cosh (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.35, size = 34, normalized size = 1.89

method result size
risch \(B x -\frac {2 A}{{\mathrm e}^{x}+1}+\frac {2 B}{{\mathrm e}^{x}+1}\) \(23\)
default \(A \tanh \left (\frac {x}{2}\right )-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 )\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 26, normalized size = 1.44 \begin {gather*} B {\left (x - \frac {2}{e^{\left (-x\right )} + 1}\right )} + \frac {2 \, A}{e^{\left (-x\right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 29, normalized size = 1.61 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.13, size = 15, normalized size = 0.83 \begin {gather*} A \tanh {\left (\frac {x}{2} \right )} + B x - B \tanh {\left (\frac {x}{2} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 17, normalized size = 0.94 \begin {gather*} B x - \frac {2 \, {\left (A - B\right )}}{e^{x} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.05, size = 19, normalized size = 1.06 \begin {gather*} B\,x-\frac {2\,A-2\,B}{{\mathrm {e}}^x+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________