\(\int \frac {-2+2 x+4 x^2}{x} \, dx\) [2715]

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

[Out]

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

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {14} \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 x^2+2 x-2 \log (x) \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 x+2 x^2-2 \log (x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.88

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 \, x^{2} + 2 \, x - 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 x^{2} + 2 x - 2 \log {\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 \, x^{2} + 2 \, x - 2 \, \log \left (x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.88 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2 \, x^{2} + 2 \, x - 2 \, \log \left ({\left | x \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81 \[ \int \frac {-2+2 x+4 x^2}{x} \, dx=2\,x-2\,\ln \left (x\right )+2\,x^2 \]

[In]

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

[Out]

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