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

Optimal. Leaf size=14 \[ x+(1-x) (x-\log (x)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 17, normalized size of antiderivative = 1.21, number of steps used = 5, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {14, 2295} \begin {gather*} -x^2+2 x+x \log (x)-\log (x) \end {gather*}

Antiderivative was successfully verified.

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

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 17, normalized size = 1.21 \begin {gather*} 2 x-x^2-\log (x)+x \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.19, size = 17, normalized size = 1.21 \begin {gather*} -x^{2} + x \log \relax (x) + 2 \, x - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 18, normalized size = 1.29




method result size



default \(x \ln \relax (x )+2 x -x^{2}-\ln \relax (x )\) \(18\)
norman \(x \ln \relax (x )+2 x -x^{2}-\ln \relax (x )\) \(18\)
risch \(x \ln \relax (x )+2 x -x^{2}-\ln \relax (x )\) \(18\)



Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

maxima [A]  time = 0.45, size = 17, normalized size = 1.21 \begin {gather*} -x^{2} + x \log \relax (x) + 2 \, x - \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

mupad [B]  time = 0.45, size = 17, normalized size = 1.21 \begin {gather*} 2\,x-\ln \relax (x)+x\,\ln \relax (x)-x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________