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

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

[Out]

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

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {645} \[ \int \frac {2+x}{x+x^2} \, dx=2 \log (x)-\log (x+1) \]

[In]

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

[Out]

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

Rule 645

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)
*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && IntegerQ[p] && (GtQ[p, 0]
|| EqQ[a, 0])

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09

method result size
default \(2 \ln \left (x \right )-\ln \left (1+x \right )\) \(12\)
norman \(2 \ln \left (x \right )-\ln \left (1+x \right )\) \(12\)
meijerg \(2 \ln \left (x \right )-\ln \left (1+x \right )\) \(12\)
risch \(2 \ln \left (x \right )-\ln \left (1+x \right )\) \(12\)
parallelrisch \(2 \ln \left (x \right )-\ln \left (1+x \right )\) \(12\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.18 \[ \int \frac {2+x}{x+x^2} \, dx=-\log \left ({\left | x + 1 \right |}\right ) + 2 \, \log \left ({\left | x \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00 \[ \int \frac {2+x}{x+x^2} \, dx=2\,\ln \left (x\right )-\ln \left (x+1\right ) \]

[In]

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

[Out]

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