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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0541586, antiderivative size = 75, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 13, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.462, Rules used = {5395, 5383, 5375, 2234, 2204, 2205} $-\frac{1}{16} \sqrt{\frac{\pi }{2}} \text{Erf}\left (\frac{2 x+1}{\sqrt{2}}\right )-\frac{1}{16} \sqrt{\frac{\pi }{2}} \text{Erfi}\left (\frac{2 x+1}{\sqrt{2}}\right )+\frac{x^2}{4}+\frac{1}{8} \sinh \left (2 x^2+2 x+\frac{1}{2}\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

x^2/4 - (Sqrt[Pi/2]*Erf[(1 + 2*x)/Sqrt[2]])/16 - (Sqrt[Pi/2]*Erfi[(1 + 2*x)/Sqrt[2]])/16 + 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 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]

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]

Rubi steps

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

Mathematica [A]  time = 0.20472, size = 88, normalized size = 1.17 $\frac{-\sqrt{2 e \pi } \text{Erf}\left (\frac{2 x+1}{\sqrt{2}}\right )-\sqrt{2 e \pi } \text{Erfi}\left (\frac{2 x+1}{\sqrt{2}}\right )+8 \sqrt{e} x^2+2 (1+e) \sinh (2 x (x+1))+2 (e-1) \cosh (2 x (x+1))}{32 \sqrt{e}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(8*Sqrt[E]*x^2 + 2*(-1 + E)*Cosh[2*x*(1 + x)] - Sqrt[2*E*Pi]*Erf[(1 + 2*x)/Sqrt[2]] - Sqrt[2*E*Pi]*Erfi[(1 + 2
*x)/Sqrt[2]] + 2*(1 + E)*Sinh[2*x*(1 + x)])/(32*Sqrt[E])

________________________________________________________________________________________

Maple [C]  time = 0.046, size = 75, normalized size = 1. \begin{align*}{\frac{{x}^{2}}{4}}-{\frac{1}{16}{{\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{1}{16}{{\rm e}^{{\frac{ \left ( 1+2\,x \right ) ^{2}}{2}}}}}+{\frac{i}{32}}\sqrt{\pi }\sqrt{2}{\it Erf} \left ( i\sqrt{2}x+{\frac{i}{2}}\sqrt{2} \right ) \end{align*}

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

[In]

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

[Out]

1/4*x^2-1/16*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*exp(1/2*(1+2*x)^2)+1/32
*I*Pi^(1/2)*2^(1/2)*erf(I*2^(1/2)*x+1/2*I*2^(1/2))

________________________________________________________________________________________

Maxima [C]  time = 1.80211, size = 163, normalized size = 2.17 \begin{align*} \frac{1}{4} \, x^{2} - \frac{1}{32} \, \sqrt{2}{\left (\frac{\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}}} - \sqrt{2} e^{\left (\frac{1}{2} \,{\left (2 \, x + 1\right )}^{2}\right )}\right )} - \frac{1}{32} i \, \sqrt{2}{\left (-\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}}} - 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*cosh(1/4+x+x^2)^2,x, algorithm="maxima")

[Out]

1/4*x^2 - 1/32*sqrt(2)*(sqrt(pi)*(2*x + 1)*(erf(sqrt(1/2)*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(2*x + 1)^2) - sqrt(2
)*e^(1/2*(2*x + 1)^2)) - 1/32*I*sqrt(2)*(-I*sqrt(pi)*(2*x + 1)*(erf(sqrt(1/2)*sqrt((2*x + 1)^2)) - 1)/sqrt((2*
x + 1)^2) - I*sqrt(2)*e^(-1/2*(2*x + 1)^2))

________________________________________________________________________________________

Fricas [A]  time = 2.27742, size = 263, normalized size = 3.51 \begin{align*} \frac{1}{32} \,{\left (8 \, x^{2} e^{\left (2 \, x^{2} + 2 \, x + \frac{1}{2}\right )} - \sqrt{\pi }{\left (\sqrt{2} \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) + \sqrt{2} \operatorname{erfi}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right )\right )} e^{\left (2 \, x^{2} + 2 \, x + \frac{1}{2}\right )} + 2 \, e^{\left (4 \, x^{2} + 4 \, x + 1\right )} - 2\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*cosh(1/4+x+x^2)^2,x, algorithm="fricas")

[Out]

1/32*(8*x^2*e^(2*x^2 + 2*x + 1/2) - sqrt(pi)*(sqrt(2)*erf(1/2*sqrt(2)*(2*x + 1)) + sqrt(2)*erfi(1/2*sqrt(2)*(2
*x + 1)))*e^(2*x^2 + 2*x + 1/2) + 2*e^(4*x^2 + 4*x + 1) - 2)*e^(-2*x^2 - 2*x - 1/2)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \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*cosh(1/4+x+x**2)**2,x)

[Out]

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

________________________________________________________________________________________

Giac [C]  time = 1.23854, size = 95, normalized size = 1.27 \begin{align*} \frac{1}{4} \, x^{2} - \frac{1}{32} \, \sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) - \frac{1}{32} i \, \sqrt{2} \sqrt{\pi } \operatorname{erf}\left (-\frac{1}{2} i \, \sqrt{2}{\left (2 \, x + 1\right )}\right ) + \frac{1}{16} \, e^{\left (2 \, x^{2} + 2 \, x + \frac{1}{2}\right )} - \frac{1}{16} \, 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*cosh(1/4+x+x^2)^2,x, algorithm="giac")

[Out]

1/4*x^2 - 1/32*sqrt(2)*sqrt(pi)*erf(1/2*sqrt(2)*(2*x + 1)) - 1/32*I*sqrt(2)*sqrt(pi)*erf(-1/2*I*sqrt(2)*(2*x +
1)) + 1/16*e^(2*x^2 + 2*x + 1/2) - 1/16*e^(-2*x^2 - 2*x - 1/2)