### 3.178 $$\int \frac{-1+4 x}{(-1+x) (2+x)} \, dx$$

Optimal. Leaf size=13 $\log (1-x)+3 \log (x+2)$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0057979, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 16, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.062, Rules used = {72} $\log (1-x)+3 \log (x+2)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

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

Mathematica [A]  time = 0.0038172, size = 13, normalized size = 1. $\log (1-x)+3 \log (x+2)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 12, normalized size = 0.9 \begin{align*} 3\,\ln \left ( 2+x \right ) +\ln \left ( -1+x \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.918911, size = 15, normalized size = 1.15 \begin{align*} 3 \, \log \left (x + 2\right ) + \log \left (x - 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.9185, size = 36, normalized size = 2.77 \begin{align*} 3 \, \log \left (x + 2\right ) + \log \left (x - 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.094259, size = 10, normalized size = 0.77 \begin{align*} \log{\left (x - 1 \right )} + 3 \log{\left (x + 2 \right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.05401, size = 18, normalized size = 1.38 \begin{align*} 3 \, \log \left ({\left | x + 2 \right |}\right ) + \log \left ({\left | x - 1 \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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