3.3.76 \(\int x^2 \cosh (x) \, dx\) [276]

Optimal. Leaf size=16 \[ -2 x \cosh (x)+2 \sinh (x)+x^2 \sinh (x) \]

[Out]

-2*x*cosh(x)+2*sinh(x)+x^2*sinh(x)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3377, 2717} \begin {gather*} x^2 \sinh (x)+2 \sinh (x)-2 x \cosh (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*Cosh[x],x]

[Out]

-2*x*Cosh[x] + 2*Sinh[x] + x^2*Sinh[x]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int x^2 \cosh (x) \, dx &=x^2 \sinh (x)-2 \int x \sinh (x) \, dx\\ &=-2 x \cosh (x)+x^2 \sinh (x)+2 \int \cosh (x) \, dx\\ &=-2 x \cosh (x)+2 \sinh (x)+x^2 \sinh (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 14, normalized size = 0.88 \begin {gather*} -2 x \cosh (x)+\left (2+x^2\right ) \sinh (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*Cosh[x],x]

[Out]

-2*x*Cosh[x] + (2 + x^2)*Sinh[x]

________________________________________________________________________________________

Mathics [A]
time = 1.83, size = 16, normalized size = 1.00 \begin {gather*} -2 x \text {Cosh}\left [x\right ]+x^2 \text {Sinh}\left [x\right ]+2 \text {Sinh}\left [x\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[x^2*Cosh[x],x]')

[Out]

-2 x Cosh[x] + x ^ 2 Sinh[x] + 2 Sinh[x]

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 17, normalized size = 1.06

method result size
default \(-2 x \cosh \left (x \right )+2 \sinh \left (x \right )+x^{2} \sinh \left (x \right )\) \(17\)
risch \(\left (1-x +\frac {1}{2} x^{2}\right ) {\mathrm e}^{x}+\left (-1-x -\frac {1}{2} x^{2}\right ) {\mathrm e}^{-x}\) \(30\)
meijerg \(4 i \sqrt {\pi }\, \left (\frac {i x \cosh \left (x \right )}{2 \sqrt {\pi }}-\frac {i \left (\frac {3 x^{2}}{2}+3\right ) \sinh \left (x \right )}{6 \sqrt {\pi }}\right )\) \(32\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh(x),x,method=_RETURNVERBOSE)

[Out]

-2*x*cosh(x)+2*sinh(x)+x^2*sinh(x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 44 vs. \(2 (16) = 32\).
time = 0.27, size = 44, normalized size = 2.75 \begin {gather*} \frac {1}{3} \, x^{3} \cosh \left (x\right ) - \frac {1}{6} \, {\left (x^{3} + 3 \, x^{2} + 6 \, x + 6\right )} e^{\left (-x\right )} - \frac {1}{6} \, {\left (x^{3} - 3 \, x^{2} + 6 \, x - 6\right )} e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(x),x, algorithm="maxima")

[Out]

1/3*x^3*cosh(x) - 1/6*(x^3 + 3*x^2 + 6*x + 6)*e^(-x) - 1/6*(x^3 - 3*x^2 + 6*x - 6)*e^x

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 14, normalized size = 0.88 \begin {gather*} -2 \, x \cosh \left (x\right ) + {\left (x^{2} + 2\right )} \sinh \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(x),x, algorithm="fricas")

[Out]

-2*x*cosh(x) + (x^2 + 2)*sinh(x)

________________________________________________________________________________________

Sympy [A]
time = 0.10, size = 17, normalized size = 1.06 \begin {gather*} x^{2} \sinh {\left (x \right )} - 2 x \cosh {\left (x \right )} + 2 \sinh {\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cosh(x),x)

[Out]

x**2*sinh(x) - 2*x*cosh(x) + 2*sinh(x)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 30, normalized size = 1.88 \begin {gather*} \frac {\left (x^{2}-2 x+2\right ) \mathrm {e}^{x}+\left (-x^{2}-2 x-2\right ) \mathrm {e}^{-x}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*cosh(x),x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.18, size = 16, normalized size = 1.00 \begin {gather*} 2\,\mathrm {sinh}\left (x\right )+x^2\,\mathrm {sinh}\left (x\right )-2\,x\,\mathrm {cosh}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh(x),x)

[Out]

2*sinh(x) + x^2*sinh(x) - 2*x*cosh(x)

________________________________________________________________________________________