\(\int (x+\cosh (x))^2 \, dx\) [333]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (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 = 6, antiderivative size = 30 \[ \int (x+\cosh (x))^2 \, dx=\frac {x}{2}+\frac {x^3}{3}-2 \cosh (x)+2 x \sinh (x)+\frac {1}{2} \cosh (x) \sinh (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {6874, 3377, 2718, 2715, 8} \[ \int (x+\cosh (x))^2 \, dx=\frac {x^3}{3}+\frac {x}{2}+2 x \sinh (x)-2 \cosh (x)+\frac {1}{2} \sinh (x) \cosh (x) \]

[In]

Int[(x + Cosh[x])^2,x]

[Out]

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

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2715

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

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[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]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

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

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int (x+\cosh (x))^2 \, dx=\frac {1}{6} \left (3 \cosh (x) (-4+\sinh (x))+x \left (3+2 x^2+12 \sinh (x)\right )\right ) \]

[In]

Integrate[(x + Cosh[x])^2,x]

[Out]

(3*Cosh[x]*(-4 + Sinh[x]) + x*(3 + 2*x^2 + 12*Sinh[x]))/6

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.83

method result size
default \(\frac {x}{2}+\frac {x^{3}}{3}-2 \cosh \left (x \right )+2 x \sinh \left (x \right )+\frac {\cosh \left (x \right ) \sinh \left (x \right )}{2}\) \(25\)
parts \(\frac {x}{2}+\frac {x^{3}}{3}-2 \cosh \left (x \right )+2 x \sinh \left (x \right )+\frac {\cosh \left (x \right ) \sinh \left (x \right )}{2}\) \(25\)
parallelrisch \(\frac {x^{3}}{3}+\frac {x}{2}-2+2 x \sinh \left (x \right )+\frac {\sinh \left (2 x \right )}{4}-2 \cosh \left (x \right )\) \(26\)
risch \(\frac {x^{3}}{3}+\frac {x}{2}+\frac {{\mathrm e}^{2 x}}{8}+\left (-1+x \right ) {\mathrm e}^{x}+\left (-1-x \right ) {\mathrm e}^{-x}-\frac {{\mathrm e}^{-2 x}}{8}\) \(38\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.77 \[ \int (x+\cosh (x))^2 \, dx=\frac {1}{3} \, x^{3} + \frac {1}{2} \, {\left (4 \, x + \cosh \left (x\right )\right )} \sinh \left (x\right ) + \frac {1}{2} \, x - 2 \, \cosh \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.37 \[ \int (x+\cosh (x))^2 \, dx=\frac {x^{3}}{3} - \frac {x \sinh ^{2}{\left (x \right )}}{2} + 2 x \sinh {\left (x \right )} + \frac {x \cosh ^{2}{\left (x \right )}}{2} + \frac {\sinh {\left (x \right )} \cosh {\left (x \right )}}{2} - 2 \cosh {\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.20 \[ \int (x+\cosh (x))^2 \, dx=\frac {1}{3} \, x^{3} - {\left (x + 1\right )} e^{\left (-x\right )} + {\left (x - 1\right )} e^{x} + \frac {1}{2} \, x + \frac {1}{8} \, e^{\left (2 \, x\right )} - \frac {1}{8} \, e^{\left (-2 \, x\right )} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.20 \[ \int (x+\cosh (x))^2 \, dx=\frac {1}{3} \, x^{3} - {\left (x + 1\right )} e^{\left (-x\right )} + {\left (x - 1\right )} e^{x} + \frac {1}{2} \, x + \frac {1}{8} \, e^{\left (2 \, x\right )} - \frac {1}{8} \, e^{\left (-2 \, x\right )} \]

[In]

integrate((x+cosh(x))^2,x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.80 \[ \int (x+\cosh (x))^2 \, dx=\frac {x}{2}-2\,\mathrm {cosh}\left (x\right )+\frac {\mathrm {cosh}\left (x\right )\,\mathrm {sinh}\left (x\right )}{2}+2\,x\,\mathrm {sinh}\left (x\right )+\frac {x^3}{3} \]

[In]

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

[Out]

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