\(\int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx\) [1619]

   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 = 33, antiderivative size = 29 \[ \int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx=-e^{\frac {x^2}{2}}+x+\log (2)-\frac {-5+x-\log ^2(x)}{x} \]

[Out]

x+ln(2)-(x-ln(x)^2-5)/x-exp(1/4*x^2)^2

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90, number of steps used = 10, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {14, 2240, 2341, 2342} \[ \int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx=-e^{\frac {x^2}{2}}+x+\frac {5}{x}+\frac {\log ^2(x)}{x} \]

[In]

Int[(-5 + x^2 - E^(x^2/2)*x^3 + 2*Log[x] - Log[x]^2)/x^2,x]

[Out]

-E^(x^2/2) + 5/x + x + Log[x]^2/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 2240

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]

Rule 2341

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

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90 \[ \int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx=-e^{\frac {x^2}{2}}+\frac {5}{x}+x+\frac {\log ^2(x)}{x} \]

[In]

Integrate[(-5 + x^2 - E^(x^2/2)*x^3 + 2*Log[x] - Log[x]^2)/x^2,x]

[Out]

-E^(x^2/2) + 5/x + x + Log[x]^2/x

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.90

method result size
default \(x +\frac {5}{x}-{\mathrm e}^{\frac {x^{2}}{2}}+\frac {\ln \left (x \right )^{2}}{x}\) \(26\)
parts \(x +\frac {5}{x}-{\mathrm e}^{\frac {x^{2}}{2}}+\frac {\ln \left (x \right )^{2}}{x}\) \(26\)
risch \(\frac {\ln \left (x \right )^{2}}{x}+\frac {-x \,{\mathrm e}^{\frac {x^{2}}{2}}+x^{2}+5}{x}\) \(28\)
parallelrisch \(-\frac {x \,{\mathrm e}^{\frac {x^{2}}{2}}-x^{2}-5-\ln \left (x \right )^{2}}{x}\) \(29\)

[In]

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

[Out]

x+5/x-exp(1/4*x^2)^2+ln(x)^2/x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.76 \[ \int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx=\frac {x^{2} - x e^{\left (\frac {1}{2} \, x^{2}\right )} + \log \left (x\right )^{2} + 5}{x} \]

[In]

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

[Out]

(x^2 - x*e^(1/2*x^2) + log(x)^2 + 5)/x

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

x - exp(x**2/2) + log(x)**2/x + 5/x

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

x + (log(x)^2 + 2*log(x) + 2)/x - 2*log(x)/x + 3/x - e^(1/2*x^2)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

(x^2 - x*e^(1/2*x^2) + log(x)^2 + 5)/x

Mupad [B] (verification not implemented)

Time = 9.24 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.69 \[ \int \frac {-5+x^2-e^{\frac {x^2}{2}} x^3+2 \log (x)-\log ^2(x)}{x^2} \, dx=x-{\mathrm {e}}^{\frac {x^2}{2}}+\frac {{\ln \left (x\right )}^2+5}{x} \]

[In]

int(-(log(x)^2 - 2*log(x) + x^3*exp(x^2/2) - x^2 + 5)/x^2,x)

[Out]

x - exp(x^2/2) + (log(x)^2 + 5)/x