\(\int (a \cosh (x)+b \sinh (x))^3 \, dx\) [582]

   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 = 11, antiderivative size = 35 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=\left (a^2-b^2\right ) (b \cosh (x)+a \sinh (x))+\frac {1}{3} (b \cosh (x)+a \sinh (x))^3 \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3151} \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=\left (a^2-b^2\right ) (a \sinh (x)+b \cosh (x))+\frac {1}{3} (a \sinh (x)+b \cosh (x))^3 \]

[In]

Int[(a*Cosh[x] + b*Sinh[x])^3,x]

[Out]

(a^2 - b^2)*(b*Cosh[x] + a*Sinh[x]) + (b*Cosh[x] + a*Sinh[x])^3/3

Rule 3151

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

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

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.80 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=\frac {1}{12} \left (9 b \left (a^2-b^2\right ) \cosh (x)+b \left (3 a^2+b^2\right ) \cosh (3 x)+9 a \left (a^2-b^2\right ) \sinh (x)+a \left (a^2+3 b^2\right ) \sinh (3 x)\right ) \]

[In]

Integrate[(a*Cosh[x] + b*Sinh[x])^3,x]

[Out]

(9*b*(a^2 - b^2)*Cosh[x] + b*(3*a^2 + b^2)*Cosh[3*x] + 9*a*(a^2 - b^2)*Sinh[x] + a*(a^2 + 3*b^2)*Sinh[3*x])/12

Maple [A] (verified)

Time = 5.91 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.37

method result size
default \(a^{3} \left (\frac {2}{3}+\frac {\cosh \left (x \right )^{2}}{3}\right ) \sinh \left (x \right )+a^{2} b \cosh \left (x \right )^{3}+a \,b^{2} \sinh \left (x \right )^{3}+b^{3} \left (-\frac {2}{3}+\frac {\sinh \left (x \right )^{2}}{3}\right ) \cosh \left (x \right )\) \(48\)
parts \(a^{3} \left (\frac {2}{3}+\frac {\cosh \left (x \right )^{2}}{3}\right ) \sinh \left (x \right )+a^{2} b \cosh \left (x \right )^{3}+a \,b^{2} \sinh \left (x \right )^{3}+b^{3} \left (-\frac {2}{3}+\frac {\sinh \left (x \right )^{2}}{3}\right ) \cosh \left (x \right )\) \(48\)
risch \(\frac {{\mathrm e}^{3 x} a^{3}}{24}+\frac {{\mathrm e}^{3 x} a^{2} b}{8}+\frac {{\mathrm e}^{3 x} a \,b^{2}}{8}+\frac {{\mathrm e}^{3 x} b^{3}}{24}+\frac {3 a^{3} {\mathrm e}^{x}}{8}+\frac {3 a^{2} b \,{\mathrm e}^{x}}{8}-\frac {3 \,{\mathrm e}^{x} b^{2} a}{8}-\frac {3 b^{3} {\mathrm e}^{x}}{8}-\frac {3 \,{\mathrm e}^{-x} a^{3}}{8}+\frac {3 \,{\mathrm e}^{-x} a^{2} b}{8}+\frac {3 \,{\mathrm e}^{-x} a \,b^{2}}{8}-\frac {3 \,{\mathrm e}^{-x} b^{3}}{8}-\frac {{\mathrm e}^{-3 x} a^{3}}{24}+\frac {{\mathrm e}^{-3 x} a^{2} b}{8}-\frac {{\mathrm e}^{-3 x} a \,b^{2}}{8}+\frac {{\mathrm e}^{-3 x} b^{3}}{24}\) \(146\)

[In]

int((a*cosh(x)+b*sinh(x))^3,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 97 vs. \(2 (33) = 66\).

Time = 0.26 (sec) , antiderivative size = 97, normalized size of antiderivative = 2.77 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=\frac {1}{12} \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right )^{3} + \frac {1}{4} \, {\left (3 \, a^{2} b + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{2} + \frac {1}{12} \, {\left (a^{3} + 3 \, a b^{2}\right )} \sinh \left (x\right )^{3} + \frac {3}{4} \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right ) + \frac {1}{4} \, {\left (3 \, a^{3} - 3 \, a b^{2} + {\left (a^{3} + 3 \, a b^{2}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right ) \]

[In]

integrate((a*cosh(x)+b*sinh(x))^3,x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (29) = 58\).

Time = 0.12 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.89 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=- \frac {2 a^{3} \sinh ^{3}{\left (x \right )}}{3} + a^{3} \sinh {\left (x \right )} \cosh ^{2}{\left (x \right )} + a^{2} b \cosh ^{3}{\left (x \right )} + a b^{2} \sinh ^{3}{\left (x \right )} + b^{3} \sinh ^{2}{\left (x \right )} \cosh {\left (x \right )} - \frac {2 b^{3} \cosh ^{3}{\left (x \right )}}{3} \]

[In]

integrate((a*cosh(x)+b*sinh(x))**3,x)

[Out]

-2*a**3*sinh(x)**3/3 + a**3*sinh(x)*cosh(x)**2 + a**2*b*cosh(x)**3 + a*b**2*sinh(x)**3 + b**3*sinh(x)**2*cosh(
x) - 2*b**3*cosh(x)**3/3

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 69 vs. \(2 (33) = 66\).

Time = 0.19 (sec) , antiderivative size = 69, normalized size of antiderivative = 1.97 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=a^{2} b \cosh \left (x\right )^{3} + a b^{2} \sinh \left (x\right )^{3} + \frac {1}{24} \, b^{3} {\left (e^{\left (3 \, x\right )} - 9 \, e^{\left (-x\right )} + e^{\left (-3 \, x\right )} - 9 \, e^{x}\right )} + \frac {1}{24} \, a^{3} {\left (e^{\left (3 \, x\right )} - 9 \, e^{\left (-x\right )} - e^{\left (-3 \, x\right )} + 9 \, e^{x}\right )} \]

[In]

integrate((a*cosh(x)+b*sinh(x))^3,x, algorithm="maxima")

[Out]

a^2*b*cosh(x)^3 + a*b^2*sinh(x)^3 + 1/24*b^3*(e^(3*x) - 9*e^(-x) + e^(-3*x) - 9*e^x) + 1/24*a^3*(e^(3*x) - 9*e
^(-x) - e^(-3*x) + 9*e^x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (33) = 66\).

Time = 0.26 (sec) , antiderivative size = 134, normalized size of antiderivative = 3.83 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx=\frac {1}{24} \, a^{3} e^{\left (3 \, x\right )} + \frac {1}{8} \, a^{2} b e^{\left (3 \, x\right )} + \frac {1}{8} \, a b^{2} e^{\left (3 \, x\right )} + \frac {1}{24} \, b^{3} e^{\left (3 \, x\right )} + \frac {3}{8} \, a^{3} e^{x} + \frac {3}{8} \, a^{2} b e^{x} - \frac {3}{8} \, a b^{2} e^{x} - \frac {3}{8} \, b^{3} e^{x} - \frac {1}{24} \, {\left (9 \, a^{3} e^{\left (2 \, x\right )} - 9 \, a^{2} b e^{\left (2 \, x\right )} - 9 \, a b^{2} e^{\left (2 \, x\right )} + 9 \, b^{3} e^{\left (2 \, x\right )} + a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} e^{\left (-3 \, x\right )} \]

[In]

integrate((a*cosh(x)+b*sinh(x))^3,x, algorithm="giac")

[Out]

1/24*a^3*e^(3*x) + 1/8*a^2*b*e^(3*x) + 1/8*a*b^2*e^(3*x) + 1/24*b^3*e^(3*x) + 3/8*a^3*e^x + 3/8*a^2*b*e^x - 3/
8*a*b^2*e^x - 3/8*b^3*e^x - 1/24*(9*a^3*e^(2*x) - 9*a^2*b*e^(2*x) - 9*a*b^2*e^(2*x) + 9*b^3*e^(2*x) + a^3 - 3*
a^2*b + 3*a*b^2 - b^3)*e^(-3*x)

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.51 \[ \int (a \cosh (x)+b \sinh (x))^3 \, dx={\mathrm {cosh}\left (x\right )}^3\,\left (a^2\,b-\frac {2\,b^3}{3}\right )+{\mathrm {sinh}\left (x\right )}^3\,\left (a\,b^2-\frac {2\,a^3}{3}\right )+a^3\,{\mathrm {cosh}\left (x\right )}^2\,\mathrm {sinh}\left (x\right )+b^3\,\mathrm {cosh}\left (x\right )\,{\mathrm {sinh}\left (x\right )}^2 \]

[In]

int((a*cosh(x) + b*sinh(x))^3,x)

[Out]

cosh(x)^3*(a^2*b - (2*b^3)/3) + sinh(x)^3*(a*b^2 - (2*a^3)/3) + a^3*cosh(x)^2*sinh(x) + b^3*cosh(x)*sinh(x)^2