3.439 \(\int e^{(a+b x) (c+d x)} x^2 \, dx\)

Optimal. Leaf size=216 \[ \frac{\sqrt{\pi } e^{-\frac{(b c-a d)^2}{4 b d}} (a d+b c)^2 \text{Erfi}\left (\frac{a d+b c+2 b d x}{2 \sqrt{b} \sqrt{d}}\right )}{8 b^{5/2} d^{5/2}}-\frac{\sqrt{\pi } e^{-\frac{(b c-a d)^2}{4 b d}} \text{Erfi}\left (\frac{a d+b c+2 b d x}{2 \sqrt{b} \sqrt{d}}\right )}{4 b^{3/2} d^{3/2}}-\frac{(a d+b c) e^{x (a d+b c)+a c+b d x^2}}{4 b^2 d^2}+\frac{x e^{x (a d+b c)+a c+b d x^2}}{2 b d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.271386, antiderivative size = 216, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.294, Rules used = {2244, 2241, 2240, 2234, 2204} \[ \frac{\sqrt{\pi } e^{-\frac{(b c-a d)^2}{4 b d}} (a d+b c)^2 \text{Erfi}\left (\frac{a d+b c+2 b d x}{2 \sqrt{b} \sqrt{d}}\right )}{8 b^{5/2} d^{5/2}}-\frac{\sqrt{\pi } e^{-\frac{(b c-a d)^2}{4 b d}} \text{Erfi}\left (\frac{a d+b c+2 b d x}{2 \sqrt{b} \sqrt{d}}\right )}{4 b^{3/2} d^{3/2}}-\frac{(a d+b c) e^{x (a d+b c)+a c+b d x^2}}{4 b^2 d^2}+\frac{x e^{x (a d+b c)+a c+b d x^2}}{2 b d} \]

Antiderivative was successfully verified.

[In]

Int[E^((a + b*x)*(c + d*x))*x^2,x]

[Out]

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

Rule 2244

Int[(F_)^(v_)*(u_)^(m_.), x_Symbol] :> Int[ExpandToSum[u, x]^m*F^ExpandToSum[v, x], x] /; FreeQ[{F, m}, x] &&
LinearQ[u, x] && QuadraticQ[v, x] &&  !(LinearMatchQ[u, x] && QuadraticMatchQ[v, x])

Rule 2241

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_))^(m_), x_Symbol] :> Simp[(e*(d + e*x)^(m - 1)
*F^(a + b*x + c*x^2))/(2*c*Log[F]), x] + (-Dist[(b*e - 2*c*d)/(2*c), Int[(d + e*x)^(m - 1)*F^(a + b*x + c*x^2)
, x], x] - Dist[((m - 1)*e^2)/(2*c*Log[F]), Int[(d + e*x)^(m - 2)*F^(a + b*x + c*x^2), x], x]) /; FreeQ[{F, a,
 b, c, d, e}, x] && NeQ[b*e - 2*c*d, 0] && GtQ[m, 1]

Rule 2240

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[(e*F^(a + b*x + c*x^2))/(
2*c*Log[F]), x] - Dist[(b*e - 2*c*d)/(2*c), Int[F^(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e}, x] &&
 NeQ[b*e - 2*c*d, 0]

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]

Rubi steps

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

Mathematica [A]  time = 0.177909, size = 144, normalized size = 0.67 \[ \frac{e^{-\frac{(b c-a d)^2}{4 b d}} \left (\sqrt{\pi } \left (a^2 d^2+2 b d (a c-1)+b^2 c^2\right ) \text{Erfi}\left (\frac{a d+b (c+2 d x)}{2 \sqrt{b} \sqrt{d}}\right )-2 \sqrt{b} \sqrt{d} e^{\frac{(a d+b (c+2 d x))^2}{4 b d}} (a d+b (c-2 d x))\right )}{8 b^{5/2} d^{5/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[E^((a + b*x)*(c + d*x))*x^2,x]

[Out]

(-2*Sqrt[b]*Sqrt[d]*E^((a*d + b*(c + 2*d*x))^2/(4*b*d))*(a*d + b*(c - 2*d*x)) + (b^2*c^2 + 2*b*(-1 + a*c)*d +
a^2*d^2)*Sqrt[Pi]*Erfi[(a*d + b*(c + 2*d*x))/(2*Sqrt[b]*Sqrt[d])])/(8*b^(5/2)*d^(5/2)*E^((b*c - a*d)^2/(4*b*d)
))

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 212, normalized size = 1. \begin{align*}{\frac{{{\rm e}^{ac+ \left ( ad+bc \right ) x+bd{x}^{2}}}x}{2\,bd}}-{\frac{ad+bc}{2\,bd} \left ({\frac{{{\rm e}^{ac+ \left ( ad+bc \right ) x+bd{x}^{2}}}}{2\,bd}}+{\frac{ \left ( ad+bc \right ) \sqrt{\pi }}{4\,bd}{{\rm e}^{ac-{\frac{ \left ( ad+bc \right ) ^{2}}{4\,bd}}}}{\it Erf} \left ( -\sqrt{-bd}x+{\frac{ad+bc}{2}{\frac{1}{\sqrt{-bd}}}} \right ){\frac{1}{\sqrt{-bd}}}} \right ) }+{\frac{\sqrt{\pi }}{4\,bd}{{\rm e}^{ac-{\frac{ \left ( ad+bc \right ) ^{2}}{4\,bd}}}}{\it Erf} \left ( -\sqrt{-bd}x+{\frac{ad+bc}{2}{\frac{1}{\sqrt{-bd}}}} \right ){\frac{1}{\sqrt{-bd}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp((b*x+a)*(d*x+c))*x^2,x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.17927, size = 298, normalized size = 1.38 \begin{align*} \frac{{\left (\frac{\sqrt{\pi }{\left (2 \, b d x + b c + a d\right )}{\left (b c + a d\right )}^{2}{\left (\operatorname{erf}\left (\frac{1}{2} \, \sqrt{-\frac{{\left (2 \, b d x + b c + a d\right )}^{2}}{b d}}\right ) - 1\right )}}{\left (b d\right )^{\frac{5}{2}} \sqrt{-\frac{{\left (2 \, b d x + b c + a d\right )}^{2}}{b d}}} - \frac{4 \,{\left (b c + a d\right )} b d e^{\left (\frac{{\left (2 \, b d x + b c + a d\right )}^{2}}{4 \, b d}\right )}}{\left (b d\right )^{\frac{5}{2}}} - \frac{4 \,{\left (2 \, b d x + b c + a d\right )}^{3} \Gamma \left (\frac{3}{2}, -\frac{{\left (2 \, b d x + b c + a d\right )}^{2}}{4 \, b d}\right )}{\left (b d\right )^{\frac{5}{2}} \left (-\frac{{\left (2 \, b d x + b c + a d\right )}^{2}}{b d}\right )^{\frac{3}{2}}}\right )} e^{\left (a c - \frac{{\left (b c + a d\right )}^{2}}{4 \, b d}\right )}}{8 \, \sqrt{b d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.58228, size = 328, normalized size = 1.52 \begin{align*} -\frac{\sqrt{\pi }{\left (b^{2} c^{2} + a^{2} d^{2} + 2 \,{\left (a b c - b\right )} d\right )} \sqrt{-b d} \operatorname{erf}\left (\frac{{\left (2 \, b d x + b c + a d\right )} \sqrt{-b d}}{2 \, b d}\right ) e^{\left (-\frac{b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}}{4 \, b d}\right )} - 2 \,{\left (2 \, b^{2} d^{2} x - b^{2} c d - a b d^{2}\right )} e^{\left (b d x^{2} + a c +{\left (b c + a d\right )} x\right )}}{8 \, b^{3} d^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp((b*x+a)*(d*x+c))*x**2,x)

[Out]

Timed out

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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