3.100.45 \(\int \frac {4+x+2 x^2-2 e^{x^2} x^2}{x} \, dx\)

Optimal. Leaf size=25 \[ -2+3 e^3-e^{x^2}+x^2+\log \left (e^x x^4\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 16, normalized size of antiderivative = 0.64, number of steps used = 5, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {14, 2209} \begin {gather*} x^2-e^{x^2}+x+4 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-E^x^2 + x + x^2 + 4*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 2209

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-2 e^{x^2} x+\frac {4+x+2 x^2}{x}\right ) \, dx\\ &=-\left (2 \int e^{x^2} x \, dx\right )+\int \frac {4+x+2 x^2}{x} \, dx\\ &=-e^{x^2}+\int \left (1+\frac {4}{x}+2 x\right ) \, dx\\ &=-e^{x^2}+x+x^2+4 \log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 16, normalized size = 0.64 \begin {gather*} -e^{x^2}+x+x^2+4 \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.69, size = 15, normalized size = 0.60 \begin {gather*} x^{2} + x - e^{\left (x^{2}\right )} + 4 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 3.82, size = 15, normalized size = 0.60 \begin {gather*} x^{2} + x - e^{\left (x^{2}\right )} + 4 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 16, normalized size = 0.64




method result size



default \(x^{2}+x +4 \ln \relax (x )-{\mathrm e}^{x^{2}}\) \(16\)
norman \(x^{2}+x +4 \ln \relax (x )-{\mathrm e}^{x^{2}}\) \(16\)
risch \(x^{2}+x +4 \ln \relax (x )-{\mathrm e}^{x^{2}}\) \(16\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.35, size = 15, normalized size = 0.60 \begin {gather*} x^{2} + x - e^{\left (x^{2}\right )} + 4 \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 15, normalized size = 0.60 \begin {gather*} x-{\mathrm {e}}^{x^2}+4\,\ln \relax (x)+x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.11, size = 14, normalized size = 0.56 \begin {gather*} x^{2} + x - e^{x^{2}} + 4 \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________