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

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

[Out]

x^2/(1+x)

Rubi [A] (verified)

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

[In]

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

[Out]

x + (1 + x)^(-1)

Rule 697

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d +
 e*x)^m*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[2*c*d - b*e,
 0] && IGtQ[p, 0] &&  !(EqQ[m, 3] && NeQ[p, 1])

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

Mathematica [A] (verified)

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

[In]

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

[Out]

x + (1 + x)^(-1)

Maple [A] (verified)

Time = 0.79 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.89

method result size
default \(x +\frac {1}{x +1}\) \(8\)
risch \(x +\frac {1}{x +1}\) \(8\)
gosper \(\frac {x^{2}}{x +1}\) \(10\)
norman \(\frac {x^{2}}{x +1}\) \(10\)
parallelrisch \(\frac {x^{2}}{x +1}\) \(10\)
meijerg \(\frac {x \left (6+3 x \right )}{3 x +3}-\frac {2 x}{x +1}\) \(23\)

[In]

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

[Out]

x+1/(x+1)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.33 \[ \int \frac {2 x+x^2}{(1+x)^2} \, dx=\frac {x^{2} + x + 1}{x + 1} \]

[In]

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

[Out]

(x^2 + x + 1)/(x + 1)

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.56 \[ \int \frac {2 x+x^2}{(1+x)^2} \, dx=x + \frac {1}{x + 1} \]

[In]

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

[Out]

x + 1/(x + 1)

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

x + 1/(x + 1)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.89 \[ \int \frac {2 x+x^2}{(1+x)^2} \, dx=x + \frac {1}{x + 1} + 1 \]

[In]

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

[Out]

x + 1/(x + 1) + 1

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

x + 1/(x + 1)