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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.045, Rules used = {6820, 6874, 2629} \[ \int \frac {-2 x+(4+2 x) \log (2+x)+\left (2 x+x^2+(4+2 x) \log (2+x)\right ) \log \left (-\frac {x}{x+2 \log (2+x)}\right )}{2 x+x^2+(4+2 x) \log (2+x)} \, dx=x \log \left (-\frac {x}{x+2 \log (x+2)}\right ) \]

[In]

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

[Out]

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

Rule 2629

Int[Log[u_], x_Symbol] :> Simp[x*Log[u], x] - Int[SimplifyIntegrand[x*Simplify[D[u, x]/u], x], x] /; ProductQ[
u]

Rule 6820

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

Rule 6874

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.86 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.06

method result size
norman \(\ln \left (-\frac {x}{2 \ln \left (2+x \right )+x}\right ) x\) \(17\)
parallelrisch \(\ln \left (-\frac {x}{2 \ln \left (2+x \right )+x}\right ) x\) \(17\)
default \(\ln \left (\frac {x}{-2 \ln \left (2+x \right )-x}\right ) x\) \(18\)
parts \(\ln \left (\frac {x}{-2 \ln \left (2+x \right )-x}\right ) x\) \(18\)
risch \(-x \ln \left (2 \ln \left (2+x \right )+x \right )+x \ln \left (x \right )-i \pi x \operatorname {csgn}\left (\frac {i x}{2 \ln \left (2+x \right )+x}\right )^{2}+\frac {i \pi x \,\operatorname {csgn}\left (\frac {i}{2 \ln \left (2+x \right )+x}\right ) \operatorname {csgn}\left (\frac {i x}{2 \ln \left (2+x \right )+x}\right )^{2}}{2}-\frac {i \pi x \,\operatorname {csgn}\left (\frac {i}{2 \ln \left (2+x \right )+x}\right ) \operatorname {csgn}\left (\frac {i x}{2 \ln \left (2+x \right )+x}\right ) \operatorname {csgn}\left (i x \right )}{2}+\frac {i \pi x \operatorname {csgn}\left (\frac {i x}{2 \ln \left (2+x \right )+x}\right )^{3}}{2}+\frac {i \pi x \operatorname {csgn}\left (\frac {i x}{2 \ln \left (2+x \right )+x}\right )^{2} \operatorname {csgn}\left (i x \right )}{2}+i \pi x\) \(169\)

[In]

int((((4+2*x)*ln(2+x)+x^2+2*x)*ln(-x/(2*ln(2+x)+x))+(4+2*x)*ln(2+x)-2*x)/((4+2*x)*ln(2+x)+x^2+2*x),x,method=_R
ETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (15) = 30\).

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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