\(\int \frac {-1+3 x-2 x^2+x \log (x)}{x} \, dx\) [497]

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

[Out]

x+(x-ln(x))*(1-x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21, number of steps used = 5, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {14, 2332} \[ \int \frac {-1+3 x-2 x^2+x \log (x)}{x} \, dx=-x^2+2 x+x \log (x)-\log (x) \]

[In]

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

[Out]

2*x - x^2 - Log[x] + x*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 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21 \[ \int \frac {-1+3 x-2 x^2+x \log (x)}{x} \, dx=2 x-x^2-\log (x)+x \log (x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.29

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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