\(\int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+(-6 x^3-2 x^4) \log (1-x+\log (4+x))+(12 x^2-9 x^3-3 x^4+(12 x^2+3 x^3) \log (4+x)) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx\) [7814]

   Optimal result
   Rubi [F]
   Mathematica [F]
   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 = 106, antiderivative size = 20 \[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=-x+x^3 \log ^2(1-x+\log (4+x)) \]

[Out]

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

Rubi [F]

\[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=\int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx \]

[In]

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

[Out]

-x + Defer[Int][(-1 + x - Log[4 + x])^(-1), x] + Defer[Int][(1 - x + Log[4 + x])^(-1), x] - 32*Defer[Int][Log[
1 - x + Log[4 + x]]/(-1 + x - Log[4 + x]), x] + 8*Defer[Int][(x*Log[1 - x + Log[4 + x]])/(-1 + x - Log[4 + x])
, x] - 2*Defer[Int][(x^2*Log[1 - x + Log[4 + x]])/(-1 + x - Log[4 + x]), x] + 2*Defer[Int][(x^3*Log[1 - x + Lo
g[4 + x]])/(-1 + x - Log[4 + x]), x] + 128*Defer[Int][Log[1 - x + Log[4 + x]]/((4 + x)*(-1 + x - Log[4 + x])),
 x] + 3*Defer[Int][x^2*Log[1 - x + Log[4 + x]]^2, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{(4+x) (1-x+\log (4+x))} \, dx \\ & = \int \left (\frac {4}{(4+x) (-1+x-\log (4+x))}-\frac {3 x}{(4+x) (-1+x-\log (4+x))}-\frac {x^2}{(4+x) (-1+x-\log (4+x))}+\frac {\log (4+x)}{-1+x-\log (4+x)}+\frac {2 x^3 (3+x) \log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))}+3 x^2 \log ^2(1-x+\log (4+x))\right ) \, dx \\ & = 2 \int \frac {x^3 (3+x) \log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))} \, dx-3 \int \frac {x}{(4+x) (-1+x-\log (4+x))} \, dx+3 \int x^2 \log ^2(1-x+\log (4+x)) \, dx+4 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-\int \frac {x^2}{(4+x) (-1+x-\log (4+x))} \, dx+\int \frac {\log (4+x)}{-1+x-\log (4+x)} \, dx \\ & = 2 \int \left (-\frac {16 \log (1-x+\log (4+x))}{-1+x-\log (4+x)}+\frac {4 x \log (1-x+\log (4+x))}{-1+x-\log (4+x)}-\frac {x^2 \log (1-x+\log (4+x))}{-1+x-\log (4+x)}+\frac {x^3 \log (1-x+\log (4+x))}{-1+x-\log (4+x)}+\frac {64 \log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))}\right ) \, dx-3 \int \left (\frac {1}{-1+x-\log (4+x)}-\frac {4}{(4+x) (-1+x-\log (4+x))}\right ) \, dx+3 \int x^2 \log ^2(1-x+\log (4+x)) \, dx+4 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx+\int \left (-1+\frac {-1+x}{-1+x-\log (4+x)}\right ) \, dx-\int \left (-\frac {4}{-1+x-\log (4+x)}+\frac {x}{-1+x-\log (4+x)}+\frac {16}{(4+x) (-1+x-\log (4+x))}\right ) \, dx \\ & = -x-2 \int \frac {x^2 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+2 \int \frac {x^3 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx-3 \int \frac {1}{-1+x-\log (4+x)} \, dx+3 \int x^2 \log ^2(1-x+\log (4+x)) \, dx+4 \int \frac {1}{-1+x-\log (4+x)} \, dx+4 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx+8 \int \frac {x \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+12 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-16 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-32 \int \frac {\log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+128 \int \frac {\log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))} \, dx+\int \frac {-1+x}{-1+x-\log (4+x)} \, dx-\int \frac {x}{-1+x-\log (4+x)} \, dx \\ & = -x-2 \int \frac {x^2 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+2 \int \frac {x^3 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx-3 \int \frac {1}{-1+x-\log (4+x)} \, dx+3 \int x^2 \log ^2(1-x+\log (4+x)) \, dx+4 \int \frac {1}{-1+x-\log (4+x)} \, dx+4 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx+8 \int \frac {x \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+12 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-16 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-32 \int \frac {\log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+128 \int \frac {\log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))} \, dx-\int \frac {x}{-1+x-\log (4+x)} \, dx+\int \left (\frac {x}{-1+x-\log (4+x)}+\frac {1}{1-x+\log (4+x)}\right ) \, dx \\ & = -x-2 \int \frac {x^2 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+2 \int \frac {x^3 \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx-3 \int \frac {1}{-1+x-\log (4+x)} \, dx+3 \int x^2 \log ^2(1-x+\log (4+x)) \, dx+4 \int \frac {1}{-1+x-\log (4+x)} \, dx+4 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx+8 \int \frac {x \log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+12 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-16 \int \frac {1}{(4+x) (-1+x-\log (4+x))} \, dx-32 \int \frac {\log (1-x+\log (4+x))}{-1+x-\log (4+x)} \, dx+128 \int \frac {\log (1-x+\log (4+x))}{(4+x) (-1+x-\log (4+x))} \, dx+\int \frac {1}{1-x+\log (4+x)} \, dx \\ \end{align*}

Mathematica [F]

\[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=\int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.05

method result size
risch \(x^{3} \ln \left (\ln \left (4+x \right )-x +1\right )^{2}-x\) \(21\)
parallelrisch \(x^{3} \ln \left (\ln \left (4+x \right )-x +1\right )^{2}+1-x\) \(22\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

integrate((((3*x**3+12*x**2)*ln(4+x)-3*x**4-9*x**3+12*x**2)*ln(ln(4+x)-x+1)**2+(-2*x**4-6*x**3)*ln(ln(4+x)-x+1
)+(-4-x)*ln(4+x)+x**2+3*x-4)/((4+x)*ln(4+x)-x**2-3*x+4),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=x^{3} \log \left (-x + \log \left (x + 4\right ) + 1\right )^{2} - x \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=x^{3} \log \left (-x + \log \left (x + 4\right ) + 1\right )^{2} - x \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \frac {-4+3 x+x^2+(-4-x) \log (4+x)+\left (-6 x^3-2 x^4\right ) \log (1-x+\log (4+x))+\left (12 x^2-9 x^3-3 x^4+\left (12 x^2+3 x^3\right ) \log (4+x)\right ) \log ^2(1-x+\log (4+x))}{4-3 x-x^2+(4+x) \log (4+x)} \, dx=x^3\,{\ln \left (\ln \left (x+4\right )-x+1\right )}^2-x \]

[In]

int(-(3*x - log(log(x + 4) - x + 1)*(6*x^3 + 2*x^4) + log(log(x + 4) - x + 1)^2*(log(x + 4)*(12*x^2 + 3*x^3) +
 12*x^2 - 9*x^3 - 3*x^4) - log(x + 4)*(x + 4) + x^2 - 4)/(3*x - log(x + 4)*(x + 4) + x^2 - 4),x)

[Out]

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