3.1.96 \(\int \frac {A+B \cosh (x)}{(1+\cosh (x))^4} \, dx\) [96]

Optimal. Leaf size=75 \[ \frac {(A-B) \sinh (x)}{7 (1+\cosh (x))^4}+\frac {(3 A+4 B) \sinh (x)}{35 (1+\cosh (x))^3}+\frac {2 (3 A+4 B) \sinh (x)}{105 (1+\cosh (x))^2}+\frac {2 (3 A+4 B) \sinh (x)}{105 (1+\cosh (x))} \]

[Out]

1/7*(A-B)*sinh(x)/(1+cosh(x))^4+1/35*(3*A+4*B)*sinh(x)/(1+cosh(x))^3+2/105*(3*A+4*B)*sinh(x)/(1+cosh(x))^2+2/1
05*(3*A+4*B)*sinh(x)/(1+cosh(x))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {2829, 2729, 2727} \begin {gather*} \frac {2 (3 A+4 B) \sinh (x)}{105 (\cosh (x)+1)}+\frac {2 (3 A+4 B) \sinh (x)}{105 (\cosh (x)+1)^2}+\frac {(3 A+4 B) \sinh (x)}{35 (\cosh (x)+1)^3}+\frac {(A-B) \sinh (x)}{7 (\cosh (x)+1)^4} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((A - B)*Sinh[x])/(7*(1 + Cosh[x])^4) + ((3*A + 4*B)*Sinh[x])/(35*(1 + Cosh[x])^3) + (2*(3*A + 4*B)*Sinh[x])/(
105*(1 + Cosh[x])^2) + (2*(3*A + 4*B)*Sinh[x])/(105*(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 2729

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

Rule 2829

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

Rubi steps

\begin {align*} \int \frac {A+B \cosh (x)}{(1+\cosh (x))^4} \, dx &=\frac {(A-B) \sinh (x)}{7 (1+\cosh (x))^4}+\frac {1}{7} (3 A+4 B) \int \frac {1}{(1+\cosh (x))^3} \, dx\\ &=\frac {(A-B) \sinh (x)}{7 (1+\cosh (x))^4}+\frac {(3 A+4 B) \sinh (x)}{35 (1+\cosh (x))^3}+\frac {1}{35} (2 (3 A+4 B)) \int \frac {1}{(1+\cosh (x))^2} \, dx\\ &=\frac {(A-B) \sinh (x)}{7 (1+\cosh (x))^4}+\frac {(3 A+4 B) \sinh (x)}{35 (1+\cosh (x))^3}+\frac {2 (3 A+4 B) \sinh (x)}{105 (1+\cosh (x))^2}+\frac {1}{105} (2 (3 A+4 B)) \int \frac {1}{1+\cosh (x)} \, dx\\ &=\frac {(A-B) \sinh (x)}{7 (1+\cosh (x))^4}+\frac {(3 A+4 B) \sinh (x)}{35 (1+\cosh (x))^3}+\frac {2 (3 A+4 B) \sinh (x)}{105 (1+\cosh (x))^2}+\frac {2 (3 A+4 B) \sinh (x)}{105 (1+\cosh (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 57, normalized size = 0.76 \begin {gather*} \frac {(96 A+58 B+29 (3 A+4 B) \cosh (x)+8 (3 A+4 B) \cosh (2 x)+3 A \cosh (3 x)+4 B \cosh (3 x)) \sinh (x)}{210 (1+\cosh (x))^4} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((96*A + 58*B + 29*(3*A + 4*B)*Cosh[x] + 8*(3*A + 4*B)*Cosh[2*x] + 3*A*Cosh[3*x] + 4*B*Cosh[3*x])*Sinh[x])/(21
0*(1 + Cosh[x])^4)

________________________________________________________________________________________

Maple [A]
time = 0.46, size = 55, normalized size = 0.73

method result size
default \(-\frac {\left (A -B \right ) \left (\tanh ^{7}\left (\frac {x}{2}\right )\right )}{56}-\frac {\left (-3 A +B \right ) \left (\tanh ^{5}\left (\frac {x}{2}\right )\right )}{40}-\frac {\left (3 A +B \right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )}{24}+\frac {A \tanh \left (\frac {x}{2}\right )}{8}+\frac {B \tanh \left (\frac {x}{2}\right )}{8}\) \(55\)
risch \(-\frac {4 \left (70 B \,{\mathrm e}^{4 x}+105 A \,{\mathrm e}^{3 x}+70 B \,{\mathrm e}^{3 x}+63 A \,{\mathrm e}^{2 x}+84 B \,{\mathrm e}^{2 x}+21 A \,{\mathrm e}^{x}+28 B \,{\mathrm e}^{x}+3 A +4 B \right )}{105 \left ({\mathrm e}^{x}+1\right )^{7}}\) \(61\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/56*(A-B)*tanh(1/2*x)^7-1/40*(-3*A+B)*tanh(1/2*x)^5-1/24*(3*A+B)*tanh(1/2*x)^3+1/8*A*tanh(1/2*x)+1/8*B*tanh(
1/2*x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 449 vs. \(2 (67) = 134\).
time = 0.29, size = 449, normalized size = 5.99 \begin {gather*} \frac {8}{105} \, B {\left (\frac {14 \, e^{\left (-x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {42 \, e^{\left (-2 \, x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {35 \, e^{\left (-3 \, x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {35 \, e^{\left (-4 \, x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {2}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1}\right )} + \frac {4}{35} \, A {\left (\frac {7 \, e^{\left (-x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {21 \, e^{\left (-2 \, x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {35 \, e^{\left (-3 \, x\right )}}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1} + \frac {1}{7 \, e^{\left (-x\right )} + 21 \, e^{\left (-2 \, x\right )} + 35 \, e^{\left (-3 \, x\right )} + 35 \, e^{\left (-4 \, x\right )} + 21 \, e^{\left (-5 \, x\right )} + 7 \, e^{\left (-6 \, x\right )} + e^{\left (-7 \, x\right )} + 1}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

8/105*B*(14*e^(-x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) +
 1) + 42*e^(-2*x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) +
1) + 35*e^(-3*x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1
) + 35*e^(-4*x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1)
 + 2/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1)) + 4/35*A*
(7*e^(-x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1) + 21*
e^(-2*x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1) + 35*e
^(-3*x)/(7*e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1) + 1/(7*
e^(-x) + 21*e^(-2*x) + 35*e^(-3*x) + 35*e^(-4*x) + 21*e^(-5*x) + 7*e^(-6*x) + e^(-7*x) + 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (67) = 134\).
time = 0.37, size = 175, normalized size = 2.33 \begin {gather*} -\frac {4 \, {\left ({\left (3 \, A + 74 \, B\right )} \cosh \left (x\right )^{2} + {\left (3 \, A + 74 \, B\right )} \sinh \left (x\right )^{2} + 14 \, {\left (9 \, A + 7 \, B\right )} \cosh \left (x\right ) - 6 \, {\left ({\left (A - 22 \, B\right )} \cosh \left (x\right ) - 14 \, A - 7 \, B\right )} \sinh \left (x\right ) + 63 \, A + 84 \, B\right )}}{105 \, {\left (\cosh \left (x\right )^{5} + {\left (5 \, \cosh \left (x\right ) + 7\right )} \sinh \left (x\right )^{4} + \sinh \left (x\right )^{5} + 7 \, \cosh \left (x\right )^{4} + {\left (10 \, \cosh \left (x\right )^{2} + 28 \, \cosh \left (x\right ) + 21\right )} \sinh \left (x\right )^{3} + 21 \, \cosh \left (x\right )^{3} + {\left (10 \, \cosh \left (x\right )^{3} + 42 \, \cosh \left (x\right )^{2} + 63 \, \cosh \left (x\right ) + 36\right )} \sinh \left (x\right )^{2} + 36 \, \cosh \left (x\right )^{2} + {\left (5 \, \cosh \left (x\right )^{4} + 28 \, \cosh \left (x\right )^{3} + 63 \, \cosh \left (x\right )^{2} + 68 \, \cosh \left (x\right ) + 28\right )} \sinh \left (x\right ) + 42 \, \cosh \left (x\right ) + 21\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4/105*((3*A + 74*B)*cosh(x)^2 + (3*A + 74*B)*sinh(x)^2 + 14*(9*A + 7*B)*cosh(x) - 6*((A - 22*B)*cosh(x) - 14*
A - 7*B)*sinh(x) + 63*A + 84*B)/(cosh(x)^5 + (5*cosh(x) + 7)*sinh(x)^4 + sinh(x)^5 + 7*cosh(x)^4 + (10*cosh(x)
^2 + 28*cosh(x) + 21)*sinh(x)^3 + 21*cosh(x)^3 + (10*cosh(x)^3 + 42*cosh(x)^2 + 63*cosh(x) + 36)*sinh(x)^2 + 3
6*cosh(x)^2 + (5*cosh(x)^4 + 28*cosh(x)^3 + 63*cosh(x)^2 + 68*cosh(x) + 28)*sinh(x) + 42*cosh(x) + 21)

________________________________________________________________________________________

Sympy [A]
time = 0.95, size = 78, normalized size = 1.04 \begin {gather*} - \frac {A \tanh ^{7}{\left (\frac {x}{2} \right )}}{56} + \frac {3 A \tanh ^{5}{\left (\frac {x}{2} \right )}}{40} - \frac {A \tanh ^{3}{\left (\frac {x}{2} \right )}}{8} + \frac {A \tanh {\left (\frac {x}{2} \right )}}{8} + \frac {B \tanh ^{7}{\left (\frac {x}{2} \right )}}{56} - \frac {B \tanh ^{5}{\left (\frac {x}{2} \right )}}{40} - \frac {B \tanh ^{3}{\left (\frac {x}{2} \right )}}{24} + \frac {B \tanh {\left (\frac {x}{2} \right )}}{8} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-A*tanh(x/2)**7/56 + 3*A*tanh(x/2)**5/40 - A*tanh(x/2)**3/8 + A*tanh(x/2)/8 + B*tanh(x/2)**7/56 - B*tanh(x/2)*
*5/40 - B*tanh(x/2)**3/24 + B*tanh(x/2)/8

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 60, normalized size = 0.80 \begin {gather*} -\frac {4 \, {\left (70 \, B e^{\left (4 \, x\right )} + 105 \, A e^{\left (3 \, x\right )} + 70 \, B e^{\left (3 \, x\right )} + 63 \, A e^{\left (2 \, x\right )} + 84 \, B e^{\left (2 \, x\right )} + 21 \, A e^{x} + 28 \, B e^{x} + 3 \, A + 4 \, B\right )}}{105 \, {\left (e^{x} + 1\right )}^{7}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-4/105*(70*B*e^(4*x) + 105*A*e^(3*x) + 70*B*e^(3*x) + 63*A*e^(2*x) + 84*B*e^(2*x) + 21*A*e^x + 28*B*e^x + 3*A
+ 4*B)/(e^x + 1)^7

________________________________________________________________________________________

Mupad [B]
time = 0.92, size = 231, normalized size = 3.08 \begin {gather*} -\frac {\frac {4\,A}{35}+\frac {8\,B\,{\mathrm {e}}^x}{35}}{6\,{\mathrm {e}}^{2\,x}+4\,{\mathrm {e}}^{3\,x}+{\mathrm {e}}^{4\,x}+4\,{\mathrm {e}}^x+1}-\frac {8\,B}{105\,\left (3\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{3\,x}+3\,{\mathrm {e}}^x+1\right )}-\frac {\frac {16\,A\,{\mathrm {e}}^{3\,x}}{7}+\frac {8\,B\,{\mathrm {e}}^{2\,x}}{7}+\frac {8\,B\,{\mathrm {e}}^{4\,x}}{7}}{21\,{\mathrm {e}}^{2\,x}+35\,{\mathrm {e}}^{3\,x}+35\,{\mathrm {e}}^{4\,x}+21\,{\mathrm {e}}^{5\,x}+7\,{\mathrm {e}}^{6\,x}+{\mathrm {e}}^{7\,x}+7\,{\mathrm {e}}^x+1}-\frac {\frac {8\,B\,{\mathrm {e}}^x}{21}+\frac {8\,A\,{\mathrm {e}}^{2\,x}}{7}+\frac {16\,B\,{\mathrm {e}}^{3\,x}}{21}}{15\,{\mathrm {e}}^{2\,x}+20\,{\mathrm {e}}^{3\,x}+15\,{\mathrm {e}}^{4\,x}+6\,{\mathrm {e}}^{5\,x}+{\mathrm {e}}^{6\,x}+6\,{\mathrm {e}}^x+1}-\frac {\frac {8\,B}{105}+\frac {16\,A\,{\mathrm {e}}^x}{35}+\frac {16\,B\,{\mathrm {e}}^{2\,x}}{35}}{10\,{\mathrm {e}}^{2\,x}+10\,{\mathrm {e}}^{3\,x}+5\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{5\,x}+5\,{\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)^4,x)

[Out]

- ((4*A)/35 + (8*B*exp(x))/35)/(6*exp(2*x) + 4*exp(3*x) + exp(4*x) + 4*exp(x) + 1) - (8*B)/(105*(3*exp(2*x) +
exp(3*x) + 3*exp(x) + 1)) - ((16*A*exp(3*x))/7 + (8*B*exp(2*x))/7 + (8*B*exp(4*x))/7)/(21*exp(2*x) + 35*exp(3*
x) + 35*exp(4*x) + 21*exp(5*x) + 7*exp(6*x) + exp(7*x) + 7*exp(x) + 1) - ((8*B*exp(x))/21 + (8*A*exp(2*x))/7 +
 (16*B*exp(3*x))/21)/(15*exp(2*x) + 20*exp(3*x) + 15*exp(4*x) + 6*exp(5*x) + exp(6*x) + 6*exp(x) + 1) - ((8*B)
/105 + (16*A*exp(x))/35 + (16*B*exp(2*x))/35)/(10*exp(2*x) + 10*exp(3*x) + 5*exp(4*x) + exp(5*x) + 5*exp(x) +
1)

________________________________________________________________________________________