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

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 26, normalized size of antiderivative = 0.96, number of steps used = 6, number of rules used = 3, integrand size = 46, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {14, 2288, 2301} \begin {gather*} -\log ^2\left (x^2\right )-2 x-e^x x \log \left (e^{-x} x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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 2288

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = (v*y)/(Log[F]*D[u, x])}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 26, normalized size = 0.96 \begin {gather*} -2 x-e^x x \log \left (e^{-x} x\right )-\log ^2\left (x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 27, normalized size = 1.00 \begin {gather*} x^{2} e^{x} - \frac {1}{2} \, x e^{x} \log \left (x^{2}\right ) - \log \left (x^{2}\right )^{2} - 2 \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.18, size = 25, normalized size = 0.93 \begin {gather*} x^{2} e^{x} - x e^{x} \log \relax (x) - \log \left (x^{2}\right )^{2} - 2 \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.16, size = 25, normalized size = 0.93




method result size



default \(-2 x -{\mathrm e}^{x} \ln \left (x \,{\mathrm e}^{-x}\right ) x -\ln \left (x^{2}\right )^{2}\) \(25\)
risch \({\mathrm e}^{x} x \ln \left ({\mathrm e}^{x}\right )-4 \ln \relax (x )^{2}-x \,{\mathrm e}^{x} \ln \relax (x )-2 x +2 i \ln \relax (x ) \pi \mathrm {csgn}\left (i x \right )^{2} \mathrm {csgn}\left (i x^{2}\right )-4 i \ln \relax (x ) \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x^{2}\right )^{2}+2 i \ln \relax (x ) \pi \mathrm {csgn}\left (i x^{2}\right )^{3}-\frac {i {\mathrm e}^{x} \pi x \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x \,{\mathrm e}^{-x}\right )^{2}}{2}+\frac {i {\mathrm e}^{x} \pi x \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (i x \,{\mathrm e}^{-x}\right ) \mathrm {csgn}\left (i {\mathrm e}^{-x}\right )}{2}+\frac {i {\mathrm e}^{x} \pi x \mathrm {csgn}\left (i x \,{\mathrm e}^{-x}\right )^{3}}{2}-\frac {i {\mathrm e}^{x} \pi x \mathrm {csgn}\left (i x \,{\mathrm e}^{-x}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{-x}\right )}{2}\) \(176\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.39, size = 38, normalized size = 1.41 \begin {gather*} {\left (x^{2} - x \log \relax (x) - x + 2\right )} e^{x} + {\left (x - 1\right )} e^{x} - \log \left (x^{2}\right )^{2} - 2 \, x - e^{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 7.55, size = 34, normalized size = 1.26 \begin {gather*} -{\ln \left (x^2\right )}^2-2\,x-{\mathrm {e}}^x\,\left (x+x\,\ln \relax (x)-x^2-2\right )+{\mathrm {e}}^x\,\left (x-2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.37, size = 26, normalized size = 0.96 \begin {gather*} - 2 x + \frac {\left (2 x^{2} - x \log {\left (x^{2} \right )}\right ) e^{x}}{2} - \log {\left (x^{2} \right )}^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________