3.5.66 \(\int \frac {e^{a+b x} x^2}{c+d x^2} \, dx\) [466]

Optimal. Leaf size=132 \[ \frac {e^{a+b x}}{b d}+\frac {\sqrt {-c} e^{a+\frac {b \sqrt {-c}}{\sqrt {d}}} \text {Ei}\left (-\frac {b \left (\sqrt {-c}-\sqrt {d} x\right )}{\sqrt {d}}\right )}{2 d^{3/2}}-\frac {\sqrt {-c} e^{a-\frac {b \sqrt {-c}}{\sqrt {d}}} \text {Ei}\left (\frac {b \left (\sqrt {-c}+\sqrt {d} x\right )}{\sqrt {d}}\right )}{2 d^{3/2}} \]

[Out]

exp(b*x+a)/b/d+1/2*exp(a+b*(-c)^(1/2)/d^(1/2))*Ei(-b*((-c)^(1/2)-x*d^(1/2))/d^(1/2))*(-c)^(1/2)/d^(3/2)-1/2*ex
p(a-b*(-c)^(1/2)/d^(1/2))*Ei(b*((-c)^(1/2)+x*d^(1/2))/d^(1/2))*(-c)^(1/2)/d^(3/2)

________________________________________________________________________________________

Rubi [A]
time = 0.17, antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2303, 2225, 2301, 2209} \begin {gather*} \frac {\sqrt {-c} e^{a+\frac {b \sqrt {-c}}{\sqrt {d}}} \text {Ei}\left (-\frac {b \left (\sqrt {-c}-\sqrt {d} x\right )}{\sqrt {d}}\right )}{2 d^{3/2}}-\frac {\sqrt {-c} e^{a-\frac {b \sqrt {-c}}{\sqrt {d}}} \text {Ei}\left (\frac {b \left (\sqrt {d} x+\sqrt {-c}\right )}{\sqrt {d}}\right )}{2 d^{3/2}}+\frac {e^{a+b x}}{b d} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^(a + b*x)/(b*d) + (Sqrt[-c]*E^(a + (b*Sqrt[-c])/Sqrt[d])*ExpIntegralEi[-((b*(Sqrt[-c] - Sqrt[d]*x))/Sqrt[d])
])/(2*d^(3/2)) - (Sqrt[-c]*E^(a - (b*Sqrt[-c])/Sqrt[d])*ExpIntegralEi[(b*(Sqrt[-c] + Sqrt[d]*x))/Sqrt[d]])/(2*
d^(3/2))

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2301

Int[(F_)^((g_.)*((d_.) + (e_.)*(x_))^(n_.))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[F^(g*(d +
e*x)^n), 1/(a + c*x^2), x], x] /; FreeQ[{F, a, c, d, e, g, n}, x]

Rule 2303

Int[((F_)^((g_.)*((d_.) + (e_.)*(x_))^(n_.))*(u_)^(m_.))/((a_) + (c_)*(x_)^2), x_Symbol] :> Int[ExpandIntegran
d[F^(g*(d + e*x)^n), u^m/(a + c*x^2), x], x] /; FreeQ[{F, a, c, d, e, g, n}, x] && PolynomialQ[u, x] && Intege
rQ[m]

Rubi steps

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

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.12, size = 120, normalized size = 0.91 \begin {gather*} \frac {e^a \left (2 \sqrt {d} e^{b x}+i b \sqrt {c} e^{\frac {i b \sqrt {c}}{\sqrt {d}}} \text {Ei}\left (b \left (-\frac {i \sqrt {c}}{\sqrt {d}}+x\right )\right )-i b \sqrt {c} e^{-\frac {i b \sqrt {c}}{\sqrt {d}}} \text {Ei}\left (b \left (\frac {i \sqrt {c}}{\sqrt {d}}+x\right )\right )\right )}{2 b d^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(E^a*(2*Sqrt[d]*E^(b*x) + I*b*Sqrt[c]*E^((I*b*Sqrt[c])/Sqrt[d])*ExpIntegralEi[b*(((-I)*Sqrt[c])/Sqrt[d] + x)]
- (I*b*Sqrt[c]*ExpIntegralEi[b*((I*Sqrt[c])/Sqrt[d] + x)])/E^((I*b*Sqrt[c])/Sqrt[d])))/(2*b*d^(3/2))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(659\) vs. \(2(97)=194\).
time = 0.07, size = 660, normalized size = 5.00

method result size
risch \(\frac {{\mathrm e}^{b x +a}}{b d}-\frac {{\mathrm e}^{\frac {-b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) c}{2 d \sqrt {-c d}}+\frac {{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) c}{2 d \sqrt {-c d}}\) \(127\)
derivativedivides \(\frac {-\frac {a^{2} b \left ({\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right )-{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right )\right )}{2 \sqrt {-c d}}+\frac {b^{2} {\mathrm e}^{b x +a}}{d}-\frac {b \left (2 \,{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, a b +{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) a^{2} d -{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) b^{2} c +2 \,{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, a b -{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) a^{2} d +{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) b^{2} c \right )}{2 d \sqrt {-c d}}+\frac {a b \left ({\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, b +{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) a d +{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, b -{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) a d \right )}{d \sqrt {-c d}}}{b^{3}}\) \(660\)
default \(\frac {-\frac {a^{2} b \left ({\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right )-{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right )\right )}{2 \sqrt {-c d}}+\frac {b^{2} {\mathrm e}^{b x +a}}{d}-\frac {b \left (2 \,{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, a b +{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) a^{2} d -{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) b^{2} c +2 \,{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, a b -{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) a^{2} d +{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) b^{2} c \right )}{2 d \sqrt {-c d}}+\frac {a b \left ({\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, b +{\mathrm e}^{\frac {b \sqrt {-c d}+a d}{d}} \expIntegral \left (1, \frac {b \sqrt {-c d}+a d -\left (b x +a \right ) d}{d}\right ) a d +{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) \sqrt {-c d}\, b -{\mathrm e}^{-\frac {b \sqrt {-c d}-a d}{d}} \expIntegral \left (1, -\frac {b \sqrt {-c d}-a d +\left (b x +a \right ) d}{d}\right ) a d \right )}{d \sqrt {-c d}}}{b^{3}}\) \(660\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(b*x+a)*x^2/(d*x^2+c),x,method=_RETURNVERBOSE)

[Out]

1/b^3*(-1/2*a^2*b*(exp((b*(-c*d)^(1/2)+a*d)/d)*Ei(1,(b*(-c*d)^(1/2)+a*d-(b*x+a)*d)/d)-exp(-(b*(-c*d)^(1/2)-a*d
)/d)*Ei(1,-(b*(-c*d)^(1/2)-a*d+(b*x+a)*d)/d))/(-c*d)^(1/2)+b^2/d*exp(b*x+a)-1/2/d*b*(2*exp((b*(-c*d)^(1/2)+a*d
)/d)*Ei(1,(b*(-c*d)^(1/2)+a*d-(b*x+a)*d)/d)*(-c*d)^(1/2)*a*b+exp((b*(-c*d)^(1/2)+a*d)/d)*Ei(1,(b*(-c*d)^(1/2)+
a*d-(b*x+a)*d)/d)*a^2*d-exp((b*(-c*d)^(1/2)+a*d)/d)*Ei(1,(b*(-c*d)^(1/2)+a*d-(b*x+a)*d)/d)*b^2*c+2*exp(-(b*(-c
*d)^(1/2)-a*d)/d)*Ei(1,-(b*(-c*d)^(1/2)-a*d+(b*x+a)*d)/d)*(-c*d)^(1/2)*a*b-exp(-(b*(-c*d)^(1/2)-a*d)/d)*Ei(1,-
(b*(-c*d)^(1/2)-a*d+(b*x+a)*d)/d)*a^2*d+exp(-(b*(-c*d)^(1/2)-a*d)/d)*Ei(1,-(b*(-c*d)^(1/2)-a*d+(b*x+a)*d)/d)*b
^2*c)/(-c*d)^(1/2)+a*b/d*(exp((b*(-c*d)^(1/2)+a*d)/d)*Ei(1,(b*(-c*d)^(1/2)+a*d-(b*x+a)*d)/d)*(-c*d)^(1/2)*b+ex
p((b*(-c*d)^(1/2)+a*d)/d)*Ei(1,(b*(-c*d)^(1/2)+a*d-(b*x+a)*d)/d)*a*d+exp(-(b*(-c*d)^(1/2)-a*d)/d)*Ei(1,-(b*(-c
*d)^(1/2)-a*d+(b*x+a)*d)/d)*(-c*d)^(1/2)*b-exp(-(b*(-c*d)^(1/2)-a*d)/d)*Ei(1,-(b*(-c*d)^(1/2)-a*d+(b*x+a)*d)/d
)*a*d)/(-c*d)^(1/2))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x^2*e^(b*x + a)/(b*d*x^2 + b*c) - 2*c*integrate(x*e^(b*x + a)/(b*d^2*x^4 + 2*b*c*d*x^2 + b*c^2), x)

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 106, normalized size = 0.80 \begin {gather*} \frac {\sqrt {-\frac {b^{2} c}{d}} {\rm Ei}\left (b x - \sqrt {-\frac {b^{2} c}{d}}\right ) e^{\left (a + \sqrt {-\frac {b^{2} c}{d}}\right )} - \sqrt {-\frac {b^{2} c}{d}} {\rm Ei}\left (b x + \sqrt {-\frac {b^{2} c}{d}}\right ) e^{\left (a - \sqrt {-\frac {b^{2} c}{d}}\right )} + 2 \, e^{\left (b x + a\right )}}{2 \, b d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(sqrt(-b^2*c/d)*Ei(b*x - sqrt(-b^2*c/d))*e^(a + sqrt(-b^2*c/d)) - sqrt(-b^2*c/d)*Ei(b*x + sqrt(-b^2*c/d))*
e^(a - sqrt(-b^2*c/d)) + 2*e^(b*x + a))/(b*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} e^{a} \int \frac {x^{2} e^{b x}}{c + d x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate(x^2*e^(b*x + a)/(d*x^2 + c), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^2\,{\mathrm {e}}^{a+b\,x}}{d\,x^2+c} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________