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

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

[Out]

4/(2-x)+ln(2-x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {27, 45} \[ \int \frac {2+x}{4-4 x+x^2} \, dx=\frac {4}{2-x}+\log (2-x) \]

[In]

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

[Out]

4/(2 - x) + Log[2 - x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

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

Mathematica [A] (verified)

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

[In]

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

[Out]

-4/(-2 + x) + Log[-2 + x]

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.81

method result size
default \(-\frac {4}{-2+x}+\ln \left (-2+x \right )\) \(13\)
norman \(-\frac {4}{-2+x}+\ln \left (-2+x \right )\) \(13\)
risch \(-\frac {4}{-2+x}+\ln \left (-2+x \right )\) \(13\)
meijerg \(\frac {x}{1-\frac {x}{2}}+\ln \left (1-\frac {x}{2}\right )\) \(17\)
parallelrisch \(\frac {\ln \left (-2+x \right ) x -4-2 \ln \left (-2+x \right )}{-2+x}\) \(21\)

[In]

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

[Out]

-4/(-2+x)+ln(-2+x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

((x - 2)*log(x - 2) - 4)/(x - 2)

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

log(x - 2) - 4/(x - 2)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \frac {2+x}{4-4 x+x^2} \, dx=-\frac {4}{x - 2} + \log \left (x - 2\right ) \]

[In]

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

[Out]

-4/(x - 2) + log(x - 2)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

-4/(x - 2) + log(abs(x - 2))

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.75 \[ \int \frac {2+x}{4-4 x+x^2} \, dx=\ln \left (x-2\right )-\frac {4}{x-2} \]

[In]

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

[Out]

log(x - 2) - 4/(x - 2)