3.8.26 \(\int (\frac {e^{(a+x)^2}}{x^2}-\frac {2 a e^{(a+x)^2}}{x}) \, dx\) [726]

Optimal. Leaf size=23 \[ -\frac {e^{(a+x)^2}}{x}+\sqrt {\pi } \text {erfi}(a+x) \]

[Out]

-exp((a+x)^2)/x+erfi(a+x)*Pi^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {2252, 2235} \begin {gather*} \sqrt {\pi } \text {Erfi}(a+x)-\frac {e^{(a+x)^2}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[E^(a + x)^2/x^2 - (2*a*E^(a + x)^2)/x,x]

[Out]

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

Rule 2235

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 2252

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

Rubi steps

\begin {align*} \int \left (\frac {e^{(a+x)^2}}{x^2}-\frac {2 a e^{(a+x)^2}}{x}\right ) \, dx &=-\left ((2 a) \int \frac {e^{(a+x)^2}}{x} \, dx\right )+\int \frac {e^{(a+x)^2}}{x^2} \, dx\\ &=-\frac {e^{(a+x)^2}}{x}+2 \int e^{(a+x)^2} \, dx\\ &=-\frac {e^{(a+x)^2}}{x}+\sqrt {\pi } \text {erfi}(a+x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 23, normalized size = 1.00 \begin {gather*} -\frac {e^{(a+x)^2}}{x}+\sqrt {\pi } \text {erfi}(a+x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[E^(a + x)^2/x^2 - (2*a*E^(a + x)^2)/x,x]

[Out]

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

________________________________________________________________________________________

Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {{\mathrm e}^{\left (a +x \right )^{2}}}{x^{2}}-\frac {2 a \,{\mathrm e}^{\left (a +x \right )^{2}}}{x}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp((a+x)^2)/x^2-2*a*exp((a+x)^2)/x,x)

[Out]

int(exp((a+x)^2)/x^2-2*a*exp((a+x)^2)/x,x)

________________________________________________________________________________________

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((a+x)^2)/x^2-2*a*exp((a+x)^2)/x,x, algorithm="maxima")

[Out]

integrate(-2*a*e^((a + x)^2)/x + e^((a + x)^2)/x^2, x)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 28, normalized size = 1.22 \begin {gather*} \frac {\sqrt {\pi } x \operatorname {erfi}\left (a + x\right ) - e^{\left (a^{2} + 2 \, a x + x^{2}\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(sqrt(pi)*x*erfi(a + x) - e^(a^2 + 2*a*x + x^2))/x

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \left (\int \left (- \frac {e^{x^{2}} e^{2 a x}}{x^{2}}\right )\, dx + \int \frac {2 a e^{x^{2}} e^{2 a x}}{x}\, dx\right ) e^{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp((a+x)**2)/x**2-2*a*exp((a+x)**2)/x,x)

[Out]

-(Integral(-exp(x**2)*exp(2*a*x)/x**2, x) + Integral(2*a*exp(x**2)*exp(2*a*x)/x, x))*exp(a**2)

________________________________________________________________________________________

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((a+x)^2)/x^2-2*a*exp((a+x)^2)/x,x, algorithm="giac")

[Out]

integrate(-2*a*e^((a + x)^2)/x + e^((a + x)^2)/x^2, x)

________________________________________________________________________________________

Mupad [B]
time = 3.41, size = 27, normalized size = 1.17 \begin {gather*} \sqrt {\pi }\,\mathrm {erfi}\left (a+x\right )-\frac {{\mathrm {e}}^{a^2}\,{\mathrm {e}}^{x^2}\,{\mathrm {e}}^{2\,a\,x}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp((a + x)^2)/x^2 - (2*a*exp((a + x)^2))/x,x)

[Out]

pi^(1/2)*erfi(a + x) - (exp(a^2)*exp(x^2)*exp(2*a*x))/x

________________________________________________________________________________________