3.63.71 \(\int \frac {x-2 x^2+2 \log (x)}{x} \, dx\)

Optimal. Leaf size=14 \[ 3+x-x^2+\log (5)+\log ^2(x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 11, normalized size of antiderivative = 0.79, number of steps used = 3, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {14, 2301} \begin {gather*} -x^2+x+\log ^2(x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - x^2 + Log[x]^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 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 (1-2 x+\frac {2 \log (x)}{x}\right ) \, dx\\ &=x-x^2+2 \int \frac {\log (x)}{x} \, dx\\ &=x-x^2+\log ^2(x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.69, size = 11, normalized size = 0.79 \begin {gather*} -x^{2} + \log \relax (x)^{2} + x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 12, normalized size = 0.86




method result size



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



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________