3.21 $$\int x \cosh ^2(a+b x-c x^2) \, dx$$

Optimal. Leaf size=136 $-\frac{\sqrt{\frac{\pi }{2}} b e^{2 a+\frac{b^2}{2 c}} \text{Erf}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{16 c^{3/2}}-\frac{\sqrt{\frac{\pi }{2}} b e^{-2 a-\frac{b^2}{2 c}} \text{Erfi}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{16 c^{3/2}}-\frac{\sinh \left (2 a+2 b x-2 c x^2\right )}{8 c}+\frac{x^2}{4}$

[Out]

x^2/4 - (b*E^(2*a + b^2/(2*c))*Sqrt[Pi/2]*Erf[(b - 2*c*x)/(Sqrt[2]*Sqrt[c])])/(16*c^(3/2)) - (b*E^(-2*a - b^2/
(2*c))*Sqrt[Pi/2]*Erfi[(b - 2*c*x)/(Sqrt[2]*Sqrt[c])])/(16*c^(3/2)) - Sinh[2*a + 2*b*x - 2*c*x^2]/(8*c)

________________________________________________________________________________________

Rubi [A]  time = 0.0926933, antiderivative size = 136, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 16, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.375, Rules used = {5395, 5383, 5375, 2234, 2205, 2204} $-\frac{\sqrt{\frac{\pi }{2}} b e^{2 a+\frac{b^2}{2 c}} \text{Erf}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{16 c^{3/2}}-\frac{\sqrt{\frac{\pi }{2}} b e^{-2 a-\frac{b^2}{2 c}} \text{Erfi}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{16 c^{3/2}}-\frac{\sinh \left (2 a+2 b x-2 c x^2\right )}{8 c}+\frac{x^2}{4}$

Antiderivative was successfully veriﬁed.

[In]

Int[x*Cosh[a + b*x - c*x^2]^2,x]

[Out]

x^2/4 - (b*E^(2*a + b^2/(2*c))*Sqrt[Pi/2]*Erf[(b - 2*c*x)/(Sqrt[2]*Sqrt[c])])/(16*c^(3/2)) - (b*E^(-2*a - b^2/
(2*c))*Sqrt[Pi/2]*Erfi[(b - 2*c*x)/(Sqrt[2]*Sqrt[c])])/(16*c^(3/2)) - Sinh[2*a + 2*b*x - 2*c*x^2]/(8*c)

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 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 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]

Rubi steps

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

Mathematica [A]  time = 0.388476, size = 161, normalized size = 1.18 $\frac{\sqrt{2 \pi } b \text{Erf}\left (\frac{2 c x-b}{\sqrt{2} \sqrt{c}}\right ) \left (\sinh \left (2 a+\frac{b^2}{2 c}\right )+\cosh \left (2 a+\frac{b^2}{2 c}\right )\right )+\sqrt{2 \pi } b \text{Erfi}\left (\frac{2 c x-b}{\sqrt{2} \sqrt{c}}\right ) \left (\cosh \left (2 a+\frac{b^2}{2 c}\right )-\sinh \left (2 a+\frac{b^2}{2 c}\right )\right )+4 \sqrt{c} \left (2 c x^2-\sinh (2 (a+x (b-c x)))\right )}{32 c^{3/2}}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x*Cosh[a + b*x - c*x^2]^2,x]

[Out]

(b*Sqrt[2*Pi]*Erfi[(-b + 2*c*x)/(Sqrt[2]*Sqrt[c])]*(Cosh[2*a + b^2/(2*c)] - Sinh[2*a + b^2/(2*c)]) + b*Sqrt[2*
Pi]*Erf[(-b + 2*c*x)/(Sqrt[2]*Sqrt[c])]*(Cosh[2*a + b^2/(2*c)] + Sinh[2*a + b^2/(2*c)]) + 4*Sqrt[c]*(2*c*x^2 -
Sinh[2*(a + x*(b - c*x))]))/(32*c^(3/2))

________________________________________________________________________________________

Maple [A]  time = 0.051, size = 137, normalized size = 1. \begin{align*}{\frac{{x}^{2}}{4}}+{\frac{{{\rm e}^{2\,c{x}^{2}-2\,bx-2\,a}}}{16\,c}}+{\frac{b\sqrt{\pi }}{16\,c}{{\rm e}^{-{\frac{4\,ac+{b}^{2}}{2\,c}}}}{\it Erf} \left ( \sqrt{-2\,c}x+{b{\frac{1}{\sqrt{-2\,c}}}} \right ){\frac{1}{\sqrt{-2\,c}}}}-{\frac{{{\rm e}^{-2\,c{x}^{2}+2\,bx+2\,a}}}{16\,c}}-{\frac{b\sqrt{\pi }\sqrt{2}}{32}{{\rm e}^{{\frac{4\,ac+{b}^{2}}{2\,c}}}}{\it Erf} \left ( -\sqrt{2}\sqrt{c}x+{\frac{b\sqrt{2}}{2}{\frac{1}{\sqrt{c}}}} \right ){c}^{-{\frac{3}{2}}}} \end{align*}

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

[In]

int(x*cosh(-c*x^2+b*x+a)^2,x)

[Out]

1/4*x^2+1/16/c*exp(2*c*x^2-2*b*x-2*a)+1/16*b/c*Pi^(1/2)*exp(-1/2*(4*a*c+b^2)/c)/(-2*c)^(1/2)*erf((-2*c)^(1/2)*
x+b/(-2*c)^(1/2))-1/16/c*exp(-2*c*x^2+2*b*x+2*a)-1/32*b/c^(3/2)*Pi^(1/2)*exp(1/2*(4*a*c+b^2)/c)*2^(1/2)*erf(-2
^(1/2)*c^(1/2)*x+1/2*b*2^(1/2)/c^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.2944, size = 292, normalized size = 2.15 \begin{align*} \frac{1}{4} \, x^{2} + \frac{\sqrt{2}{\left (\frac{\sqrt{\pi }{\left (2 \, c x - b\right )} b{\left (\operatorname{erf}\left (\sqrt{\frac{1}{2}} \sqrt{\frac{{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt{\frac{{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac{3}{2}}} - \frac{\sqrt{2} c e^{\left (-\frac{{\left (2 \, c x - b\right )}^{2}}{2 \, c}\right )}}{\left (-c\right )^{\frac{3}{2}}}\right )} e^{\left (2 \, a + \frac{b^{2}}{2 \, c}\right )}}{32 \, \sqrt{-c}} + \frac{\sqrt{2}{\left (\frac{\sqrt{\pi }{\left (2 \, c x - b\right )} b{\left (\operatorname{erf}\left (\sqrt{\frac{1}{2}} \sqrt{-\frac{{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt{-\frac{{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac{3}{2}}} + \frac{\sqrt{2} e^{\left (\frac{{\left (2 \, c x - b\right )}^{2}}{2 \, c}\right )}}{\sqrt{c}}\right )} e^{\left (-2 \, a - \frac{b^{2}}{2 \, c}\right )}}{32 \, \sqrt{c}} \end{align*}

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

[In]

integrate(x*cosh(-c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

1/4*x^2 + 1/32*sqrt(2)*(sqrt(pi)*(2*c*x - b)*b*(erf(sqrt(1/2)*sqrt((2*c*x - b)^2/c)) - 1)/(sqrt((2*c*x - b)^2/
c)*(-c)^(3/2)) - sqrt(2)*c*e^(-1/2*(2*c*x - b)^2/c)/(-c)^(3/2))*e^(2*a + 1/2*b^2/c)/sqrt(-c) + 1/32*sqrt(2)*(s
qrt(pi)*(2*c*x - b)*b*(erf(sqrt(1/2)*sqrt(-(2*c*x - b)^2/c)) - 1)/(sqrt(-(2*c*x - b)^2/c)*c^(3/2)) + sqrt(2)*e
^(1/2*(2*c*x - b)^2/c)/sqrt(c))*e^(-2*a - 1/2*b^2/c)/sqrt(c)

________________________________________________________________________________________

Fricas [B]  time = 2.15541, size = 1634, normalized size = 12.01 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

integrate(x*cosh(-c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

1/32*(8*c^2*x^2*cosh(c*x^2 - b*x - a)^2 + 2*c*cosh(c*x^2 - b*x - a)^4 + 8*c*cosh(c*x^2 - b*x - a)*sinh(c*x^2 -
b*x - a)^3 + 2*c*sinh(c*x^2 - b*x - a)^4 - sqrt(2)*sqrt(pi)*(b*cosh(c*x^2 - b*x - a)^2*cosh(1/2*(b^2 + 4*a*c)
/c) - b*cosh(c*x^2 - b*x - a)^2*sinh(1/2*(b^2 + 4*a*c)/c) + (b*cosh(1/2*(b^2 + 4*a*c)/c) - b*sinh(1/2*(b^2 + 4
*a*c)/c))*sinh(c*x^2 - b*x - a)^2 + 2*(b*cosh(c*x^2 - b*x - a)*cosh(1/2*(b^2 + 4*a*c)/c) - b*cosh(c*x^2 - b*x
- a)*sinh(1/2*(b^2 + 4*a*c)/c))*sinh(c*x^2 - b*x - a))*sqrt(-c)*erf(1/2*sqrt(2)*(2*c*x - b)*sqrt(-c)/c) + sqrt
(2)*sqrt(pi)*(b*cosh(c*x^2 - b*x - a)^2*cosh(1/2*(b^2 + 4*a*c)/c) + b*cosh(c*x^2 - b*x - a)^2*sinh(1/2*(b^2 +
4*a*c)/c) + (b*cosh(1/2*(b^2 + 4*a*c)/c) + b*sinh(1/2*(b^2 + 4*a*c)/c))*sinh(c*x^2 - b*x - a)^2 + 2*(b*cosh(c*
x^2 - b*x - a)*cosh(1/2*(b^2 + 4*a*c)/c) + b*cosh(c*x^2 - b*x - a)*sinh(1/2*(b^2 + 4*a*c)/c))*sinh(c*x^2 - b*x
- a))*sqrt(c)*erf(1/2*sqrt(2)*(2*c*x - b)/sqrt(c)) + 4*(2*c^2*x^2 + 3*c*cosh(c*x^2 - b*x - a)^2)*sinh(c*x^2 -
b*x - a)^2 + 8*(2*c^2*x^2*cosh(c*x^2 - b*x - a) + c*cosh(c*x^2 - b*x - a)^3)*sinh(c*x^2 - b*x - a) - 2*c)/(c^
2*cosh(c*x^2 - b*x - a)^2 + 2*c^2*cosh(c*x^2 - b*x - a)*sinh(c*x^2 - b*x - a) + c^2*sinh(c*x^2 - b*x - a)^2)

________________________________________________________________________________________

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

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

[In]

integrate(x*cosh(-c*x**2+b*x+a)**2,x)

[Out]

Integral(x*cosh(a + b*x - c*x**2)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.28649, size = 194, normalized size = 1.43 \begin{align*} \frac{1}{4} \, x^{2} - \frac{\frac{\sqrt{2} \sqrt{\pi } b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} \sqrt{c}{\left (2 \, x - \frac{b}{c}\right )}\right ) e^{\left (\frac{b^{2} + 4 \, a c}{2 \, c}\right )}}{\sqrt{c}} + 2 \, e^{\left (-2 \, c x^{2} + 2 \, b x + 2 \, a\right )}}{32 \, c} - \frac{\frac{\sqrt{2} \sqrt{\pi } b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} \sqrt{-c}{\left (2 \, x - \frac{b}{c}\right )}\right ) e^{\left (-\frac{b^{2} + 4 \, a c}{2 \, c}\right )}}{\sqrt{-c}} - 2 \, e^{\left (2 \, c x^{2} - 2 \, b x - 2 \, a\right )}}{32 \, c} \end{align*}

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

[In]

integrate(x*cosh(-c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

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