### 3.24 $$\int x^2 \cosh ^2(\frac{1}{4}+x+x^2) \, dx$$

Optimal. Leaf size=68 $\frac{1}{16} \sqrt{\frac{\pi }{2}} \text{Erf}\left (\frac{2 x+1}{\sqrt{2}}\right )+\frac{x^3}{6}+\frac{1}{8} x \sinh \left (2 x^2+2 x+\frac{1}{2}\right )-\frac{1}{16} \sinh \left (2 x^2+2 x+\frac{1}{2}\right )$

[Out]

x^3/6 + (Sqrt[Pi/2]*Erf[(1 + 2*x)/Sqrt[2]])/16 - Sinh[1/2 + 2*x + 2*x^2]/16 + (x*Sinh[1/2 + 2*x + 2*x^2])/8

________________________________________________________________________________________

Rubi [A]  time = 0.0987121, antiderivative size = 68, normalized size of antiderivative = 1., number of steps used = 14, number of rules used = 8, integrand size = 15, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.533, Rules used = {5395, 5387, 5374, 2234, 2204, 2205, 5383, 5375} $\frac{1}{16} \sqrt{\frac{\pi }{2}} \text{Erf}\left (\frac{2 x+1}{\sqrt{2}}\right )+\frac{x^3}{6}+\frac{1}{8} x \sinh \left (2 x^2+2 x+\frac{1}{2}\right )-\frac{1}{16} \sinh \left (2 x^2+2 x+\frac{1}{2}\right )$

Antiderivative was successfully veriﬁed.

[In]

Int[x^2*Cosh[1/4 + x + x^2]^2,x]

[Out]

x^3/6 + (Sqrt[Pi/2]*Erf[(1 + 2*x)/Sqrt[2]])/16 - Sinh[1/2 + 2*x + 2*x^2]/16 + (x*Sinh[1/2 + 2*x + 2*x^2])/8

Rule 5395

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandTrigReduce
[(d + e*x)^m, Cosh[a + b*x + c*x^2]^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 1]

Rule 5387

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

Rule 5374

Int[Sinh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] - Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2205

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erf[(c + d*x)*Rt[-(b*Log[F]),
2]])/(2*d*Rt[-(b*Log[F]), 2]), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 5383

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*Sinh[a + b*x + c*x^2])/
(2*c), x] - Dist[(b*e - 2*c*d)/(2*c), Int[Cosh[a + b*x + c*x^2], x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b*
e - 2*c*d, 0]

Rule 5375

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rubi steps

\begin{align*} \int x^2 \cosh ^2\left (\frac{1}{4}+x+x^2\right ) \, dx &=\int \left (\frac{x^2}{2}+\frac{1}{2} x^2 \cosh \left (\frac{1}{2}+2 x+2 x^2\right )\right ) \, dx\\ &=\frac{x^3}{6}+\frac{1}{2} \int x^2 \cosh \left (\frac{1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac{x^3}{6}+\frac{1}{8} x \sinh \left (\frac{1}{2}+2 x+2 x^2\right )-\frac{1}{8} \int \sinh \left (\frac{1}{2}+2 x+2 x^2\right ) \, dx-\frac{1}{4} \int x \cosh \left (\frac{1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac{x^3}{6}-\frac{1}{16} \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{8} x \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{16} \int e^{-\frac{1}{2}-2 x-2 x^2} \, dx-\frac{1}{16} \int e^{\frac{1}{2}+2 x+2 x^2} \, dx+\frac{1}{8} \int \cosh \left (\frac{1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac{x^3}{6}-\frac{1}{16} \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{8} x \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{16} \int e^{-\frac{1}{8} (-2-4 x)^2} \, dx-\frac{1}{16} \int e^{\frac{1}{8} (2+4 x)^2} \, dx+\frac{1}{16} \int e^{-\frac{1}{2}-2 x-2 x^2} \, dx+\frac{1}{16} \int e^{\frac{1}{2}+2 x+2 x^2} \, dx\\ &=\frac{x^3}{6}+\frac{1}{32} \sqrt{\frac{\pi }{2}} \text{erf}\left (\frac{1+2 x}{\sqrt{2}}\right )-\frac{1}{32} \sqrt{\frac{\pi }{2}} \text{erfi}\left (\frac{1+2 x}{\sqrt{2}}\right )-\frac{1}{16} \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{8} x \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{16} \int e^{-\frac{1}{8} (-2-4 x)^2} \, dx+\frac{1}{16} \int e^{\frac{1}{8} (2+4 x)^2} \, dx\\ &=\frac{x^3}{6}+\frac{1}{16} \sqrt{\frac{\pi }{2}} \text{erf}\left (\frac{1+2 x}{\sqrt{2}}\right )-\frac{1}{16} \sinh \left (\frac{1}{2}+2 x+2 x^2\right )+\frac{1}{8} x \sinh \left (\frac{1}{2}+2 x+2 x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.202044, size = 99, normalized size = 1.46 $\frac{3 \sqrt{2 e \pi } \text{Erf}\left (\frac{2 x+1}{\sqrt{2}}\right )+16 \sqrt{e} x^3+6 e x \sinh (2 x (x+1))+6 x \sinh (2 x (x+1))-3 e \sinh (2 x (x+1))-3 \sinh (2 x (x+1))+3 (e-1) (2 x-1) \cosh (2 x (x+1))}{96 \sqrt{e}}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x^2*Cosh[1/4 + x + x^2]^2,x]

[Out]

(16*Sqrt[E]*x^3 + 3*(-1 + E)*(-1 + 2*x)*Cosh[2*x*(1 + x)] + 3*Sqrt[2*E*Pi]*Erf[(1 + 2*x)/Sqrt[2]] - 3*Sinh[2*x
*(1 + x)] - 3*E*Sinh[2*x*(1 + x)] + 6*x*Sinh[2*x*(1 + x)] + 6*E*x*Sinh[2*x*(1 + x)])/(96*Sqrt[E])

________________________________________________________________________________________

Maple [A]  time = 0.045, size = 77, normalized size = 1.1 \begin{align*}{\frac{{x}^{3}}{6}}-{\frac{x}{16}{{\rm e}^{-{\frac{ \left ( 1+2\,x \right ) ^{2}}{2}}}}}+{\frac{1}{32}{{\rm e}^{-{\frac{ \left ( 1+2\,x \right ) ^{2}}{2}}}}}+{\frac{\sqrt{\pi }\sqrt{2}}{32}{\it Erf} \left ( \sqrt{2}x+{\frac{\sqrt{2}}{2}} \right ) }+{\frac{x}{16}{{\rm e}^{{\frac{ \left ( 1+2\,x \right ) ^{2}}{2}}}}}-{\frac{1}{32}{{\rm e}^{{\frac{ \left ( 1+2\,x \right ) ^{2}}{2}}}}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*cosh(1/4+x+x^2)^2,x)

[Out]

1/6*x^3-1/16*x*exp(-1/2*(1+2*x)^2)+1/32*exp(-1/2*(1+2*x)^2)+1/32*Pi^(1/2)*2^(1/2)*erf(2^(1/2)*x+1/2*2^(1/2))+1
/16*x*exp(1/2*(1+2*x)^2)-1/32*exp(1/2*(1+2*x)^2)

________________________________________________________________________________________

Maxima [C]  time = 1.89651, size = 153, normalized size = 2.25 \begin{align*} \frac{1}{6} \, x^{3} + \frac{1}{32} \,{\left (2 \, x e^{\frac{1}{2}} - e^{\frac{1}{2}}\right )} e^{\left (2 \, x^{2} + 2 \, x\right )} - \frac{1}{64} i \, \sqrt{2}{\left (-\frac{2 i \,{\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac{3}{2}, \frac{1}{2} \,{\left (2 \, x + 1\right )}^{2}\right )}{{\left ({\left (2 \, x + 1\right )}^{2}\right )}^{\frac{3}{2}}} + \frac{i \, \sqrt{\pi }{\left (2 \, x + 1\right )}{\left (\operatorname{erf}\left (\sqrt{\frac{1}{2}} \sqrt{{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt{{\left (2 \, x + 1\right )}^{2}}} + 2 i \, \sqrt{2} e^{\left (-\frac{1}{2} \,{\left (2 \, x + 1\right )}^{2}\right )}\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*x^3 + 1/32*(2*x*e^(1/2) - e^(1/2))*e^(2*x^2 + 2*x) - 1/64*I*sqrt(2)*(-2*I*(2*x + 1)^3*gamma(3/2, 1/2*(2*x
+ 1)^2)/((2*x + 1)^2)^(3/2) + I*sqrt(pi)*(2*x + 1)*(erf(sqrt(1/2)*sqrt((2*x + 1)^2)) - 1)/sqrt((2*x + 1)^2) +
2*I*sqrt(2)*e^(-1/2*(2*x + 1)^2))

________________________________________________________________________________________

Fricas [B]  time = 2.1331, size = 859, normalized size = 12.63 \begin{align*} \frac{16 \, x^{3} \cosh \left (x^{2} + x + \frac{1}{4}\right )^{2} + 3 \,{\left (2 \, x - 1\right )} \cosh \left (x^{2} + x + \frac{1}{4}\right )^{4} + 12 \,{\left (2 \, x - 1\right )} \cosh \left (x^{2} + x + \frac{1}{4}\right ) \sinh \left (x^{2} + x + \frac{1}{4}\right )^{3} + 3 \,{\left (2 \, x - 1\right )} \sinh \left (x^{2} + x + \frac{1}{4}\right )^{4} + 2 \,{\left (8 \, x^{3} + 9 \,{\left (2 \, x - 1\right )} \cosh \left (x^{2} + x + \frac{1}{4}\right )^{2}\right )} \sinh \left (x^{2} + x + \frac{1}{4}\right )^{2} + 4 \,{\left (8 \, x^{3} \cosh \left (x^{2} + x + \frac{1}{4}\right ) + 3 \,{\left (2 \, x - 1\right )} \cosh \left (x^{2} + x + \frac{1}{4}\right )^{3}\right )} \sinh \left (x^{2} + x + \frac{1}{4}\right ) + 3 \, \sqrt{\pi }{\left (\sqrt{2} \cosh \left (x^{2} + x + \frac{1}{4}\right )^{2} \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) + 2 \, \sqrt{2} \cosh \left (x^{2} + x + \frac{1}{4}\right ) \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) \sinh \left (x^{2} + x + \frac{1}{4}\right ) + \sqrt{2} \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) \sinh \left (x^{2} + x + \frac{1}{4}\right )^{2}\right )} - 6 \, x + 3}{96 \,{\left (\cosh \left (x^{2} + x + \frac{1}{4}\right )^{2} + 2 \, \cosh \left (x^{2} + x + \frac{1}{4}\right ) \sinh \left (x^{2} + x + \frac{1}{4}\right ) + \sinh \left (x^{2} + x + \frac{1}{4}\right )^{2}\right )}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/96*(16*x^3*cosh(x^2 + x + 1/4)^2 + 3*(2*x - 1)*cosh(x^2 + x + 1/4)^4 + 12*(2*x - 1)*cosh(x^2 + x + 1/4)*sinh
(x^2 + x + 1/4)^3 + 3*(2*x - 1)*sinh(x^2 + x + 1/4)^4 + 2*(8*x^3 + 9*(2*x - 1)*cosh(x^2 + x + 1/4)^2)*sinh(x^2
+ x + 1/4)^2 + 4*(8*x^3*cosh(x^2 + x + 1/4) + 3*(2*x - 1)*cosh(x^2 + x + 1/4)^3)*sinh(x^2 + x + 1/4) + 3*sqrt
(pi)*(sqrt(2)*cosh(x^2 + x + 1/4)^2*erf(1/2*sqrt(2)*(2*x + 1)) + 2*sqrt(2)*cosh(x^2 + x + 1/4)*erf(1/2*sqrt(2)
*(2*x + 1))*sinh(x^2 + x + 1/4) + sqrt(2)*erf(1/2*sqrt(2)*(2*x + 1))*sinh(x^2 + x + 1/4)^2) - 6*x + 3)/(cosh(x
^2 + x + 1/4)^2 + 2*cosh(x^2 + x + 1/4)*sinh(x^2 + x + 1/4) + sinh(x^2 + x + 1/4)^2)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \cosh ^{2}{\left (x^{2} + x + \frac{1}{4} \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*cosh(1/4+x+x**2)**2,x)

[Out]

Integral(x**2*cosh(x**2 + x + 1/4)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.21525, size = 82, normalized size = 1.21 \begin{align*} \frac{1}{6} \, x^{3} + \frac{1}{32} \, \sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) + \frac{1}{32} \,{\left (2 \, x - 1\right )} e^{\left (2 \, x^{2} + 2 \, x + \frac{1}{2}\right )} - \frac{1}{32} \,{\left (2 \, x - 1\right )} e^{\left (-2 \, x^{2} - 2 \, x - \frac{1}{2}\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*x^3 + 1/32*sqrt(2)*sqrt(pi)*erf(1/2*sqrt(2)*(2*x + 1)) + 1/32*(2*x - 1)*e^(2*x^2 + 2*x + 1/2) - 1/32*(2*x
- 1)*e^(-2*x^2 - 2*x - 1/2)