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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0339899, antiderivative size = 91, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 11, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.364, Rules used = {5375, 2234, 2204, 2205} $\frac{\sqrt{\pi } e^{\frac{b^2}{4 c}-a} \text{Erf}\left (\frac{b+2 c x}{2 \sqrt{c}}\right )}{4 \sqrt{c}}+\frac{\sqrt{\pi } e^{a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b+2 c x}{2 \sqrt{c}}\right )}{4 \sqrt{c}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

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

Mathematica [A]  time = 0.0629771, size = 105, normalized size = 1.15 $\frac{\sqrt{\pi } \left (\text{Erf}\left (\frac{b+2 c x}{2 \sqrt{c}}\right ) \left (\cosh \left (a-\frac{b^2}{4 c}\right )-\sinh \left (a-\frac{b^2}{4 c}\right )\right )+\text{Erfi}\left (\frac{b+2 c x}{2 \sqrt{c}}\right ) \left (\sinh \left (a-\frac{b^2}{4 c}\right )+\cosh \left (a-\frac{b^2}{4 c}\right )\right )\right )}{4 \sqrt{c}}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.03, size = 83, normalized size = 0.9 \begin{align*}{\frac{\sqrt{\pi }}{4}{{\rm e}^{-{\frac{4\,ac-{b}^{2}}{4\,c}}}}{\it Erf} \left ( \sqrt{c}x+{\frac{b}{2}{\frac{1}{\sqrt{c}}}} \right ){\frac{1}{\sqrt{c}}}}-{\frac{\sqrt{\pi }}{4}{{\rm e}^{{\frac{4\,ac-{b}^{2}}{4\,c}}}}{\it Erf} \left ( -\sqrt{-c}x+{\frac{b}{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),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.51132, size = 626, normalized size = 6.88 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

1/8*(sqrt(pi)*(2*c*x + b)*b*(erf(1/2*sqrt(-(2*c*x + b)^2/c)) - 1)/(sqrt(-(2*c*x + b)^2/c)*c^(3/2)) - 2*e^(1/4*
(2*c*x + b)^2/c)/sqrt(c))*b*e^(a - 1/4*b^2/c)/sqrt(c) - 1/8*(sqrt(pi)*(2*c*x + b)*b^2*(erf(1/2*sqrt(-(2*c*x +
b)^2/c)) - 1)/(sqrt(-(2*c*x + b)^2/c)*c^(5/2)) - 4*b*e^(1/4*(2*c*x + b)^2/c)/c^(3/2) - 4*(2*c*x + b)^3*gamma(3
/2, -1/4*(2*c*x + b)^2/c)/((-(2*c*x + b)^2/c)^(3/2)*c^(5/2)))*sqrt(c)*e^(a - 1/4*b^2/c) - 1/8*(sqrt(pi)*(2*c*x
+ b)*b*(erf(1/2*sqrt((2*c*x + b)^2/c)) - 1)/(sqrt((2*c*x + b)^2/c)*(-c)^(3/2)) + 2*c*e^(-1/4*(2*c*x + b)^2/c)
/(-c)^(3/2))*b*e^(-a + 1/4*b^2/c)/sqrt(-c) - 1/8*(sqrt(pi)*(2*c*x + b)*b^2*(erf(1/2*sqrt((2*c*x + b)^2/c)) - 1
)/(sqrt((2*c*x + b)^2/c)*(-c)^(5/2)) + 4*b*c*e^(-1/4*(2*c*x + b)^2/c)/(-c)^(5/2) - 4*(2*c*x + b)^3*gamma(3/2,
1/4*(2*c*x + b)^2/c)/(((2*c*x + b)^2/c)^(3/2)*(-c)^(5/2)))*c*e^(-a + 1/4*b^2/c)/sqrt(-c) + x*cosh(c*x^2 + b*x
+ a)

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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