3.29.28 \(\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\)

Optimal. Leaf size=24 \[ 6+x^2+x \left (-x (2+x+\log (1-x))+\log ^2(x)\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 28, normalized size of antiderivative = 1.17, number of steps used = 10, number of rules used = 6, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {6688, 772, 2395, 43, 2295, 2296} \begin {gather*} -x^3-x^2-x^2 \log (1-x)+x \log ^2(x) \end {gather*}

Antiderivative was successfully verified.

[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 43

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 772

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 2295

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

Rule 2296

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 2395

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 6688

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

Rubi steps

\begin {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 39, normalized size = 1.62 \begin {gather*} \frac {7}{2}-x^2-x^3-\left (-1+x^2\right ) \log (1-x)-\log (-1+x)+x \log ^2(x) \end {gather*}

Antiderivative was successfully verified.

[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

________________________________________________________________________________________

fricas [A]  time = 0.80, size = 28, normalized size = 1.17 \begin {gather*} -x^{3} + x \log \relax (x)^{2} - x^{2} \log \left (-x + 1\right ) - x^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.23, size = 28, normalized size = 1.17 \begin {gather*} -x^{3} + x \log \relax (x)^{2} - x^{2} \log \left (-x + 1\right ) - x^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.43, size = 29, normalized size = 1.21




method result size



risch \(-x^{3}-x^{2} \ln \left (1-x \right )+x \ln \relax (x )^{2}-x^{2}\) \(29\)
default \(x \ln \relax (x )^{2}-\ln \left (1-x \right ) \left (1-x \right )^{2}-x^{2}-\frac {3}{2}+2 \left (1-x \right ) \ln \left (1-x \right )-x^{3}-\ln \left (x -1\right )\) \(53\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.58, size = 52, normalized size = 2.17 \begin {gather*} -x^{3} + x \log \relax (x)^{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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x-1)*log(x)^2+(2*x-2)*log(x)+(-2*x^2+2*x)*log(-x+1)-3*x^3+2*x)/(x-1),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)

________________________________________________________________________________________

mupad [B]  time = 1.94, size = 25, normalized size = 1.04 \begin {gather*} x\,{\ln \relax (x)}^2-x^2\,\left (\ln \left (1-x\right )+1\right )-x^3 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

sympy [A]  time = 0.48, size = 31, normalized size = 1.29 \begin {gather*} - x^{3} - x^{2} + x \log {\relax (x )}^{2} + \left (\frac {1}{3} - x^{2}\right ) \log {\left (1 - x \right )} - \frac {\log {\left (x - 1 \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________