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

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

[Out]

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

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, 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.062, Rules used = {78} \[ \int \frac {-1+4 x}{(-1+x) (2+x)} \, dx=\log (1-x)+3 \log (x+2) \]

[In]

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

[Out]

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

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.92

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.85 \[ \int \frac {-1+4 x}{(-1+x) (2+x)} \, dx=\ln \left (x-1\right )+3\,\ln \left (x+2\right ) \]

[In]

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

[Out]

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