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

Optimal. Leaf size=29 \[ -e^{\frac {x^2}{2}}+x+\log (2)-\frac {-5+x-\log ^2(x)}{x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 26, normalized size of antiderivative = 0.90, number of steps used = 10, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {14, 2209, 2304, 2305} \begin {gather*} -e^{\frac {x^2}{2}}+x+\frac {5}{x}+\frac {\log ^2(x)}{x} \end {gather*}

Antiderivative was successfully verified.

[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 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]

Rule 2304

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 2305

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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 26, normalized size = 0.90 \begin {gather*} -e^{\frac {x^2}{2}}+\frac {5}{x}+x+\frac {\log ^2(x)}{x} \end {gather*}

Antiderivative was successfully verified.

[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

________________________________________________________________________________________

fricas [A]  time = 0.83, size = 22, normalized size = 0.76 \begin {gather*} \frac {x^{2} - x e^{\left (\frac {1}{2} \, x^{2}\right )} + \log \relax (x)^{2} + 5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

giac [A]  time = 0.26, size = 22, normalized size = 0.76 \begin {gather*} \frac {x^{2} - x e^{\left (\frac {1}{2} \, x^{2}\right )} + \log \relax (x)^{2} + 5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

maple [A]  time = 0.06, size = 26, normalized size = 0.90




method result size



default \(x +\frac {5}{x}-{\mathrm e}^{\frac {x^{2}}{2}}+\frac {\ln \relax (x )^{2}}{x}\) \(26\)
risch \(\frac {\ln \relax (x )^{2}}{x}+\frac {-x \,{\mathrm e}^{\frac {x^{2}}{2}}+x^{2}+5}{x}\) \(28\)



Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 36, normalized size = 1.24 \begin {gather*} x + \frac {\log \relax (x)^{2} + 2 \, \log \relax (x) + 2}{x} - \frac {2 \, \log \relax (x)}{x} + \frac {3}{x} - e^{\left (\frac {1}{2} \, x^{2}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

mupad [B]  time = 1.11, size = 20, normalized size = 0.69 \begin {gather*} x-{\mathrm {e}}^{\frac {x^2}{2}}+\frac {{\ln \relax (x)}^2+5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

sympy [A]  time = 0.29, size = 17, normalized size = 0.59 \begin {gather*} x - e^{\frac {x^{2}}{2}} + \frac {\log {\relax (x )}^{2}}{x} + \frac {5}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________