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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 4, antiderivative size = 14 \[ \int \cosh ^2(x) \, dx=\frac {x}{2}+\frac {1}{2} \cosh (x) \sinh (x) \]

[Out]

1/2*x+1/2*cosh(x)*sinh(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {2715, 8} \[ \int \cosh ^2(x) \, dx=\frac {x}{2}+\frac {1}{2} \sinh (x) \cosh (x) \]

[In]

Int[Cosh[x]^2,x]

[Out]

x/2 + (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]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \cosh ^2(x) \, dx=\frac {x}{2}+\frac {1}{4} \sinh (2 x) \]

[In]

Integrate[Cosh[x]^2,x]

[Out]

x/2 + Sinh[2*x]/4

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.79

method result size
default \(\frac {x}{2}+\frac {\cosh \left (x \right ) \sinh \left (x \right )}{2}\) \(11\)
parallelrisch \(\frac {x}{2}+\frac {\sinh \left (2 x \right )}{4}\) \(11\)
risch \(\frac {x}{2}+\frac {{\mathrm e}^{2 x}}{8}-\frac {{\mathrm e}^{-2 x}}{8}\) \(17\)

[In]

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

[Out]

1/2*x+1/2*cosh(x)*sinh(x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

1/2*cosh(x)*sinh(x) + 1/2*x

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 24 vs. \(2 (10) = 20\).

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 24 vs. \(2 (10) = 20\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \cosh ^2(x) \, dx=\frac {x}{2}+\frac {\mathrm {sinh}\left (2\,x\right )}{4} \]

[In]

int(cosh(x)^2,x)

[Out]

x/2 + sinh(2*x)/4