\(\int \frac {1+x+2 x^2}{x} \, dx\) [1406]

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

[Out]

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

Rubi [A] (verified)

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

[In]

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

[Out]

x + x^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 (1+\frac {1}{x}+2 x\right ) \, dx \\ & = x+x^2+\log (x) \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

x + x^2 + Log[x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 8, normalized size of antiderivative = 1.00

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

[In]

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

[Out]

ln(x)+x^2+x

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

x^2 + x + log(x)

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.88 \[ \int \frac {1+x+2 x^2}{x} \, dx=x^{2} + x + \log {\left (x \right )} \]

[In]

integrate((2*x**2+x+1)/x,x)

[Out]

x**2 + x + log(x)

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.88 \[ \int \frac {1+x+2 x^2}{x} \, dx=x^{2} + x + \log \left (x\right ) \]

[In]

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

[Out]

x^2 + x + log(x)

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 8, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+2 x^2}{x} \, dx=x^{2} + x + \log \left ({\left | x \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.88 \[ \int \frac {1+x+2 x^2}{x} \, dx=x+\ln \left (x\right )+x^2 \]

[In]

int((x + 2*x^2 + 1)/x,x)

[Out]

x + log(x) + x^2