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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

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 \left (\frac{1}{4}+x+x^2\right ) \, dx &=\frac{1}{2} \sinh \left (\frac{1}{4}+x+x^2\right )-\frac{1}{2} \int \cosh \left (\frac{1}{4}+x+x^2\right ) \, dx\\ &=\frac{1}{2} \sinh \left (\frac{1}{4}+x+x^2\right )-\frac{1}{4} \int e^{-\frac{1}{4}-x-x^2} \, dx-\frac{1}{4} \int e^{\frac{1}{4}+x+x^2} \, dx\\ &=\frac{1}{2} \sinh \left (\frac{1}{4}+x+x^2\right )-\frac{1}{4} \int e^{-\frac{1}{4} (-1-2 x)^2} \, dx-\frac{1}{4} \int e^{\frac{1}{4} (1+2 x)^2} \, dx\\ &=\frac{1}{8} \sqrt{\pi } \text{erf}\left (\frac{1}{2} (-1-2 x)\right )-\frac{1}{8} \sqrt{\pi } \text{erfi}\left (\frac{1}{2} (1+2 x)\right )+\frac{1}{2} \sinh \left (\frac{1}{4}+x+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0737857, size = 76, normalized size = 1.46 $\frac{-\sqrt [4]{e} \sqrt{\pi } \text{Erf}\left (x+\frac{1}{2}\right )-\sqrt [4]{e} \sqrt{\pi } \text{Erfi}\left (x+\frac{1}{2}\right )+2 \left (1+\sqrt{e}\right ) \sinh (x (x+1))+2 \left (\sqrt{e}-1\right ) \cosh (x (x+1))}{8 \sqrt [4]{e}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C]  time = 0.028, size = 49, normalized size = 0.9 \begin{align*} -{\frac{1}{4}{{\rm e}^{-{\frac{ \left ( 1+2\,x \right ) ^{2}}{4}}}}}-{\frac{\sqrt{\pi }}{8}{\it Erf} \left ({\frac{1}{2}}+x \right ) }+{\frac{1}{4}{{\rm e}^{{\frac{ \left ( 1+2\,x \right ) ^{2}}{4}}}}}+{\frac{i}{8}}\sqrt{\pi }{\it Erf} \left ( ix+{\frac{i}{2}} \right ) \end{align*}

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

[In]

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

[Out]

-1/4*exp(-1/4*(1+2*x)^2)-1/8*erf(1/2+x)*Pi^(1/2)+1/4*exp(1/4*(1+2*x)^2)+1/8*I*Pi^(1/2)*erf(I*x+1/2*I)

________________________________________________________________________________________

Maxima [B]  time = 1.48487, size = 166, normalized size = 3.19 \begin{align*} \frac{1}{2} \, x^{2} \cosh \left (x^{2} + x + \frac{1}{4}\right ) + \frac{{\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac{3}{2}, \frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right )}{4 \,{\left ({\left (2 \, x + 1\right )}^{2}\right )}^{\frac{3}{2}}} - \frac{{\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac{3}{2}, -\frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right )}{4 \, \left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac{3}{2}}} - \frac{1}{16} \, e^{\left (\frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right )} - \frac{1}{16} \, e^{\left (-\frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right )} - \frac{1}{4} \, \Gamma \left (2, \frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right ) + \frac{1}{4} \, \Gamma \left (2, -\frac{1}{4} \,{\left (2 \, x + 1\right )}^{2}\right ) \end{align*}

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

[In]

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

[Out]

1/2*x^2*cosh(x^2 + x + 1/4) + 1/4*(2*x + 1)^3*gamma(3/2, 1/4*(2*x + 1)^2)/((2*x + 1)^2)^(3/2) - 1/4*(2*x + 1)^
3*gamma(3/2, -1/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - 1/16*e^(1/4*(2*x + 1)^2) - 1/16*e^(-1/4*(2*x + 1)^2) - 1
/4*gamma(2, 1/4*(2*x + 1)^2) + 1/4*gamma(2, -1/4*(2*x + 1)^2)

________________________________________________________________________________________

Fricas [A]  time = 2.51533, size = 155, normalized size = 2.98 \begin{align*} -\frac{1}{8} \,{\left (\sqrt{\pi }{\left (\operatorname{erf}\left (x + \frac{1}{2}\right ) + \operatorname{erfi}\left (x + \frac{1}{2}\right )\right )} e^{\left (x^{2} + x + \frac{1}{4}\right )} - 2 \, e^{\left (2 \, x^{2} + 2 \, x + \frac{1}{2}\right )} + 2\right )} e^{\left (-x^{2} - x - \frac{1}{4}\right )} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

[Out]

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

________________________________________________________________________________________

Giac [C]  time = 1.25733, size = 58, normalized size = 1.12 \begin{align*} -\frac{1}{8} \, \sqrt{\pi } \operatorname{erf}\left (x + \frac{1}{2}\right ) - \frac{1}{8} i \, \sqrt{\pi } \operatorname{erf}\left (-i \, x - \frac{1}{2} i\right ) + \frac{1}{4} \, e^{\left (x^{2} + x + \frac{1}{4}\right )} - \frac{1}{4} \, e^{\left (-x^{2} - x - \frac{1}{4}\right )} \end{align*}

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

[In]

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

[Out]

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