\(\int \frac {-1+4 x^2+e^{x^2} (-2 x-4 x^3)}{x} \, dx\) [5248]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 26 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=\log \left (\frac {60 e^{-e^2+2 x \left (-e^{x^2}+x\right )}}{x}\right ) \]

[Out]

ln(60*exp(2*(-exp(x^2)+x)*x-ln(x)-exp(2)))

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69, number of steps used = 9, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {14, 2258, 2235, 2243} \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2 x^2-2 e^{x^2} x-\log (x) \]

[In]

Int[(-1 + 4*x^2 + E^x^2*(-2*x - 4*x^3))/x,x]

[Out]

-2*E^x^2*x + 2*x^2 - Log[x]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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 2243

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

Rule 2258

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^(n_))*(u_), x_Symbol] :> Int[ExpandLinearProduct[F^(a + b*(c + d*
x)^n), u, c, d, x], x] /; FreeQ[{F, a, b, c, d, n}, x] && PolynomialQ[u, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (-2 e^{x^2} \left (1+2 x^2\right )+\frac {-1+4 x^2}{x}\right ) \, dx \\ & = -\left (2 \int e^{x^2} \left (1+2 x^2\right ) \, dx\right )+\int \frac {-1+4 x^2}{x} \, dx \\ & = -\left (2 \int \left (e^{x^2}+2 e^{x^2} x^2\right ) \, dx\right )+\int \left (-\frac {1}{x}+4 x\right ) \, dx \\ & = 2 x^2-\log (x)-2 \int e^{x^2} \, dx-4 \int e^{x^2} x^2 \, dx \\ & = -2 e^{x^2} x+2 x^2-\sqrt {\pi } \text {erfi}(x)-\log (x)+2 \int e^{x^2} \, dx \\ & = -2 e^{x^2} x+2 x^2-\log (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=-2 e^{x^2} x+2 x^2-\log (x) \]

[In]

Integrate[(-1 + 4*x^2 + E^x^2*(-2*x - 4*x^3))/x,x]

[Out]

-2*E^x^2*x + 2*x^2 - Log[x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69

method result size
default \(2 x^{2}-\ln \left (x \right )-2 \,{\mathrm e}^{x^{2}} x\) \(18\)
norman \(2 x^{2}-\ln \left (x \right )-2 \,{\mathrm e}^{x^{2}} x\) \(18\)
risch \(2 x^{2}-\ln \left (x \right )-2 \,{\mathrm e}^{x^{2}} x\) \(18\)
parallelrisch \(2 x^{2}-\ln \left (x \right )-2 \,{\mathrm e}^{x^{2}} x\) \(18\)
parts \(2 x^{2}-\ln \left (x \right )-2 \,{\mathrm e}^{x^{2}} x\) \(18\)

[In]

int(((-4*x^3-2*x)*exp(x^2)+4*x^2-1)/x,x,method=_RETURNVERBOSE)

[Out]

2*x^2-ln(x)-2*exp(x^2)*x

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2 \, x^{2} - 2 \, x e^{\left (x^{2}\right )} - \log \left (x\right ) \]

[In]

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

[Out]

2*x^2 - 2*x*e^(x^2) - log(x)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.58 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2 x^{2} - 2 x e^{x^{2}} - \log {\left (x \right )} \]

[In]

integrate(((-4*x**3-2*x)*exp(x**2)+4*x**2-1)/x,x)

[Out]

2*x**2 - 2*x*exp(x**2) - log(x)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2 \, x^{2} - 2 \, x e^{\left (x^{2}\right )} - \log \left (x\right ) \]

[In]

integrate(((-4*x^3-2*x)*exp(x^2)+4*x^2-1)/x,x, algorithm="maxima")

[Out]

2*x^2 - 2*x*e^(x^2) - log(x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2 \, x^{2} - 2 \, x e^{\left (x^{2}\right )} - \log \left (x\right ) \]

[In]

integrate(((-4*x^3-2*x)*exp(x^2)+4*x^2-1)/x,x, algorithm="giac")

[Out]

2*x^2 - 2*x*e^(x^2) - log(x)

Mupad [B] (verification not implemented)

Time = 11.17 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65 \[ \int \frac {-1+4 x^2+e^{x^2} \left (-2 x-4 x^3\right )}{x} \, dx=2\,x^2-2\,x\,{\mathrm {e}}^{x^2}-\ln \left (x\right ) \]

[In]

int(-(exp(x^2)*(2*x + 4*x^3) - 4*x^2 + 1)/x,x)

[Out]

2*x^2 - 2*x*exp(x^2) - log(x)