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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0659586, antiderivative size = 110, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 14, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.357, Rules used = {5377, 5375, 2234, 2205, 2204} $-\frac{\sqrt{\frac{\pi }{2}} e^{2 a+\frac{b^2}{2 c}} \text{Erf}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}-\frac{\sqrt{\frac{\pi }{2}} e^{-2 a-\frac{b^2}{2 c}} \text{Erfi}\left (\frac{b-2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{x}{2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 5377

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

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

Mathematica [A]  time = 0.136785, size = 144, normalized size = 1.31 $\frac{\sqrt{\pi } \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{\pi } \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{2} \sqrt{c} x}{8 \sqrt{2} \sqrt{c}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 90, normalized size = 0.8 \begin{align*}{\frac{x}{2}}+{\frac{\sqrt{\pi }}{8}{{\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{\sqrt{\pi }\sqrt{2}}{16}{{\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 ){\frac{1}{\sqrt{c}}}} \end{align*}

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

[In]

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

[Out]

1/2*x+1/8*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*Pi^(1/2)*exp(1
/2*(4*a*c+b^2)/c)*2^(1/2)/c^(1/2)*erf(-2^(1/2)*c^(1/2)*x+1/2*b*2^(1/2)/c^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.56002, size = 130, normalized size = 1.18 \begin{align*} \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\sqrt{2} \sqrt{c} x - \frac{\sqrt{2} b}{2 \, \sqrt{c}}\right ) e^{\left (2 \, a + \frac{b^{2}}{2 \, c}\right )}}{16 \, \sqrt{c}} + \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\sqrt{2} \sqrt{-c} x + \frac{\sqrt{2} b}{2 \, \sqrt{-c}}\right ) e^{\left (-2 \, a - \frac{b^{2}}{2 \, c}\right )}}{16 \, \sqrt{-c}} + \frac{1}{2} \, x \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.11069, size = 352, normalized size = 3.2 \begin{align*} -\frac{\sqrt{2} \sqrt{\pi } \sqrt{-c}{\left (\cosh \left (\frac{b^{2} + 4 \, a c}{2 \, c}\right ) - \sinh \left (\frac{b^{2} + 4 \, a c}{2 \, c}\right )\right )} \operatorname{erf}\left (\frac{\sqrt{2}{\left (2 \, c x - b\right )} \sqrt{-c}}{2 \, c}\right ) - \sqrt{2} \sqrt{\pi } \sqrt{c}{\left (\cosh \left (\frac{b^{2} + 4 \, a c}{2 \, c}\right ) + \sinh \left (\frac{b^{2} + 4 \, a c}{2 \, c}\right )\right )} \operatorname{erf}\left (\frac{\sqrt{2}{\left (2 \, c x - b\right )}}{2 \, \sqrt{c}}\right ) - 8 \, c x}{16 \, c} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.32759, size = 130, normalized size = 1.18 \begin{align*} -\frac{\sqrt{2} \sqrt{\pi } \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 )}}{16 \, \sqrt{c}} - \frac{\sqrt{2} \sqrt{\pi } \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 )}}{16 \, \sqrt{-c}} + \frac{1}{2} \, x \end{align*}

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

[In]

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

[Out]

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