\(\int \frac {-1+7 x+2 x^2}{-1-x+x^2+x^3} \, dx\) [301]

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

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, 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.042, Rules used = {2099} \[ \int \frac {-1+7 x+2 x^2}{-1-x+x^2+x^3} \, dx=2 \log (1-x)-\frac {3}{x+1} \]

[In]

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

[Out]

-3/(1 + x) + 2*Log[1 - x]

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

-3/(1 + x) + 2*Log[-1 + x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.94

method result size
default \(2 \ln \left (x -1\right )-\frac {3}{x +1}\) \(15\)
norman \(2 \ln \left (x -1\right )-\frac {3}{x +1}\) \(15\)
risch \(2 \ln \left (x -1\right )-\frac {3}{x +1}\) \(15\)
parallelrisch \(\frac {2 \ln \left (x -1\right ) x -3+2 \ln \left (x -1\right )}{x +1}\) \(22\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06 \[ \int \frac {-1+7 x+2 x^2}{-1-x+x^2+x^3} \, dx=\frac {2 \, {\left (x + 1\right )} \log \left (x - 1\right ) - 3}{x + 1} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

integrate((2*x**2+7*x-1)/(x**3+x**2-x-1),x)

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.94 \[ \int \frac {-1+7 x+2 x^2}{-1-x+x^2+x^3} \, dx=-\frac {3}{x + 1} + 2 \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

int(-(7*x + 2*x^2 - 1)/(x - x^2 - x^3 + 1),x)

[Out]

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