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

   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 = 47, antiderivative size = 24 \[ \int \frac {2 x-3 x^3+\left (2 x-2 x^2\right ) \log (1-x)+(-2+2 x) \log (x)+(-1+x) \log ^2(x)}{-1+x} \, dx=6+x^2+x \left (-x (2+x+\log (1-x))+\log ^2(x)\right ) \]

[Out]

6+x*(ln(x)^2-x*(ln(1-x)+2+x))+x^2

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.17, number of steps used = 10, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {6820, 786, 2442, 45, 2332, 2333} \[ \int \frac {2 x-3 x^3+\left (2 x-2 x^2\right ) \log (1-x)+(-2+2 x) \log (x)+(-1+x) \log ^2(x)}{-1+x} \, dx=-x^3-x^2-x^2 \log (1-x)+x \log ^2(x) \]

[In]

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

[Out]

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

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])

Rule 786

Int[((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegr
and[(d + e*x)^m*(f + g*x)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IGtQ[p, 0]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 6820

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

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.62 \[ \int \frac {2 x-3 x^3+\left (2 x-2 x^2\right ) \log (1-x)+(-2+2 x) \log (x)+(-1+x) \log ^2(x)}{-1+x} \, dx=\frac {7}{2}-x^2-x^3-\left (-1+x^2\right ) \log (1-x)-\log (-1+x)+x \log ^2(x) \]

[In]

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

[Out]

7/2 - x^2 - x^3 - (-1 + x^2)*Log[1 - x] - Log[-1 + x] + x*Log[x]^2

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21

method result size
risch \(-x^{3}-x^{2} \ln \left (1-x \right )+x \ln \left (x \right )^{2}-x^{2}\) \(29\)
parallelrisch \(-x^{3}-x^{2} \ln \left (1-x \right )+x \ln \left (x \right )^{2}-x^{2}-\ln \left (-1+x \right )+\ln \left (1-x \right )\) \(41\)
default \(x \ln \left (x \right )^{2}+2 \left (1-x \right ) \ln \left (1-x \right )-\frac {3}{2}-\left (1-x \right )^{2} \ln \left (1-x \right )-x^{2}-x^{3}-\ln \left (-1+x \right )\) \(53\)
parts \(x \ln \left (x \right )^{2}+2 \left (1-x \right ) \ln \left (1-x \right )-\frac {3}{2}-\left (1-x \right )^{2} \ln \left (1-x \right )-x^{2}-x^{3}-\ln \left (-1+x \right )\) \(53\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.78 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04 \[ \int \frac {2 x-3 x^3+\left (2 x-2 x^2\right ) \log (1-x)+(-2+2 x) \log (x)+(-1+x) \log ^2(x)}{-1+x} \, dx=x\,{\ln \left (x\right )}^2-x^2\,\left (\ln \left (1-x\right )+1\right )-x^3 \]

[In]

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

[Out]

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