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

   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 [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 42, antiderivative size = 21 \[ \int \frac {4+4 x+2 x^2}{-2 x^2-x^3+\left (2 x+x^2\right ) \log \left (\frac {4+2 x}{x}\right )} \, dx=\log \left (\frac {3 \log (3)}{\left (-x+\log \left (\frac {4+2 x}{x}\right )\right )^2}\right ) \]

[Out]

ln(3/(ln((4+2*x)/x)-x)^2*ln(3))

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {6873, 6816} \[ \int \frac {4+4 x+2 x^2}{-2 x^2-x^3+\left (2 x+x^2\right ) \log \left (\frac {4+2 x}{x}\right )} \, dx=-2 \log \left (x-\log \left (\frac {4}{x}+2\right )\right ) \]

[In]

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

[Out]

-2*Log[x - Log[2 + 4/x]]

Rule 6816

Int[(u_)/(y_), x_Symbol] :> With[{q = DerivativeDivides[y, u, x]}, Simp[q*Log[RemoveContent[y, x]], x] /;  !Fa
lseQ[q]]

Rule 6873

Int[u_, x_Symbol] :> With[{v = NormalizeIntegrand[u, x]}, Int[v, x] /; v =!= u]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.71 \[ \int \frac {4+4 x+2 x^2}{-2 x^2-x^3+\left (2 x+x^2\right ) \log \left (\frac {4+2 x}{x}\right )} \, dx=-2 \log \left (x-\log \left (2+\frac {4}{x}\right )\right ) \]

[In]

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

[Out]

-2*Log[x - Log[2 + 4/x]]

Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.81

method result size
parallelrisch \(-2 \ln \left (x -\ln \left (\frac {4+2 x}{x}\right )\right )\) \(17\)
norman \(-2 \ln \left (x -\ln \left (\frac {4+2 x}{x}\right )\right )\) \(18\)
risch \(-2 \ln \left (\ln \left (\frac {4+2 x}{x}\right )-x \right )\) \(18\)
derivativedivides \(2 \ln \left (\frac {4}{x}\right )-2 \ln \left (\left (2+\frac {4}{x}\right ) \ln \left (2+\frac {4}{x}\right )-2 \ln \left (2+\frac {4}{x}\right )-4\right )\) \(41\)
default \(2 \ln \left (\frac {4}{x}\right )-2 \ln \left (\left (2+\frac {4}{x}\right ) \ln \left (2+\frac {4}{x}\right )-2 \ln \left (2+\frac {4}{x}\right )-4\right )\) \(41\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (20) = 40\).

Time = 0.28 (sec) , antiderivative size = 47, normalized size of antiderivative = 2.24 \[ \int \frac {4+4 x+2 x^2}{-2 x^2-x^3+\left (2 x+x^2\right ) \log \left (\frac {4+2 x}{x}\right )} \, dx=-2 \, \log \left (\frac {2 \, {\left (x + 2\right )} \log \left (\frac {2 \, {\left (x + 2\right )}}{x}\right )}{x} - 2 \, \log \left (\frac {2 \, {\left (x + 2\right )}}{x}\right ) - 4\right ) + 2 \, \log \left (\frac {2 \, {\left (x + 2\right )}}{x} - 2\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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