3.14.85 \(\int \frac {4+(4-x) \log (4-x)+(8 x+6 x^2-2 x^3) \log (x)+(4 x^2-x^3) \log ^2(x)}{-8 x^2+2 x^3} \, dx\)

Optimal. Leaf size=29 \[ \frac {1-x+\log (4-x)-\left (x+x^2\right ) \log ^2(x)}{2 x} \]

________________________________________________________________________________________

Rubi [A]  time = 0.45, antiderivative size = 38, normalized size of antiderivative = 1.31, number of steps used = 16, number of rules used = 11, integrand size = 61, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.180, Rules used = {1593, 6742, 44, 2395, 36, 31, 29, 2346, 2301, 2295, 2296} \begin {gather*} \frac {1}{2 x}-\frac {1}{2} x \log ^2(x)-\frac {\log ^2(x)}{2}+\frac {\log (4-x)}{2 x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 44

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}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 1593

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2346

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_.))/(x_), x_Symbol] :> Dist[d, Int[((d
 + e*x)^(q - 1)*(a + b*Log[c*x^n])^p)/x, x], x] + Dist[e, Int[(d + e*x)^(q - 1)*(a + b*Log[c*x^n])^p, x], x] /
; FreeQ[{a, b, c, d, e, n}, x] && IGtQ[p, 0] && GtQ[q, 0] && IntegerQ[2*q]

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 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {4+(4-x) \log (4-x)+\left (8 x+6 x^2-2 x^3\right ) \log (x)+\left (4 x^2-x^3\right ) \log ^2(x)}{x^2 (-8+2 x)} \, dx\\ &=\int \left (\frac {4+4 \log (4-x)-x \log (4-x)}{2 (-4+x) x^2}-\frac {(1+x) \log (x)}{x}-\frac {\log ^2(x)}{2}\right ) \, dx\\ &=\frac {1}{2} \int \frac {4+4 \log (4-x)-x \log (4-x)}{(-4+x) x^2} \, dx-\frac {1}{2} \int \log ^2(x) \, dx-\int \frac {(1+x) \log (x)}{x} \, dx\\ &=-\frac {1}{2} x \log ^2(x)+\frac {1}{2} \int \left (\frac {4}{(-4+x) x^2}-\frac {\log (4-x)}{x^2}\right ) \, dx-\int \frac {\log (x)}{x} \, dx\\ &=-\frac {1}{2} \log ^2(x)-\frac {1}{2} x \log ^2(x)-\frac {1}{2} \int \frac {\log (4-x)}{x^2} \, dx+2 \int \frac {1}{(-4+x) x^2} \, dx\\ &=\frac {\log (4-x)}{2 x}-\frac {\log ^2(x)}{2}-\frac {1}{2} x \log ^2(x)+\frac {1}{2} \int \frac {1}{(4-x) x} \, dx+2 \int \left (\frac {1}{16 (-4+x)}-\frac {1}{4 x^2}-\frac {1}{16 x}\right ) \, dx\\ &=\frac {1}{2 x}+\frac {1}{8} \log (4-x)+\frac {\log (4-x)}{2 x}-\frac {\log (x)}{8}-\frac {\log ^2(x)}{2}-\frac {1}{2} x \log ^2(x)+\frac {1}{8} \int \frac {1}{4-x} \, dx+\frac {1}{8} \int \frac {1}{x} \, dx\\ &=\frac {1}{2 x}+\frac {\log (4-x)}{2 x}-\frac {\log ^2(x)}{2}-\frac {1}{2} x \log ^2(x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 31, normalized size = 1.07 \begin {gather*} \frac {1}{2} \left (\frac {1}{x}+\frac {\log (4-x)}{x}-\log ^2(x)-x \log ^2(x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x^3+4*x^2)*log(x)^2+(-2*x^3+6*x^2+8*x)*log(x)+(-x+4)*log(-x+4)+4)/(2*x^3-8*x^2),x, algorithm="fri
cas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.46, size = 26, normalized size = 0.90 \begin {gather*} -\frac {1}{2} \, {\left (x + 1\right )} \log \relax (x)^{2} + \frac {\log \left (-x + 4\right )}{2 \, x} + \frac {1}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x^3+4*x^2)*log(x)^2+(-2*x^3+6*x^2+8*x)*log(x)+(-x+4)*log(-x+4)+4)/(2*x^3-8*x^2),x, algorithm="gia
c")

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.27, size = 34, normalized size = 1.17




method result size



risch \(\frac {\ln \left (-x +4\right )}{2 x}-\frac {x^{2} \ln \relax (x )^{2}+x \ln \relax (x )^{2}-1}{2 x}\) \(34\)
default \(-\frac {x \ln \relax (x )^{2}}{2}+\frac {\ln \left (-x \right )}{8}+\frac {\ln \left (-x +4\right ) \left (-x +4\right )}{8 x}+\frac {\ln \left (x -4\right )}{8}+\frac {1}{2 x}-\frac {\ln \relax (x )}{8}-\frac {\ln \relax (x )^{2}}{2}\) \(52\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 48, normalized size = 1.66 \begin {gather*} -\frac {4 \, {\left (x^{2} + x\right )} \log \relax (x)^{2} - x \log \relax (x) + {\left (x - 4\right )} \log \left (-x + 4\right )}{8 \, x} + \frac {1}{2 \, x} + \frac {1}{8} \, \log \left (x - 4\right ) - \frac {1}{8} \, \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-x^3+4*x^2)*log(x)^2+(-2*x^3+6*x^2+8*x)*log(x)+(-x+4)*log(-x+4)+4)/(2*x^3-8*x^2),x, algorithm="max
ima")

[Out]

-1/8*(4*(x^2 + x)*log(x)^2 - x*log(x) + (x - 4)*log(-x + 4))/x + 1/2/x + 1/8*log(x - 4) - 1/8*log(x)

________________________________________________________________________________________

mupad [B]  time = 1.19, size = 28, normalized size = 0.97 \begin {gather*} \frac {1}{2\,x}+\frac {\ln \left (4-x\right )}{2\,x}-{\ln \relax (x)}^2\,\left (\frac {x}{2}+\frac {1}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.36, size = 26, normalized size = 0.90 \begin {gather*} \left (- \frac {x}{2} - \frac {1}{2}\right ) \log {\relax (x )}^{2} + \frac {\log {\left (4 - x \right )}}{2 x} + \frac {1}{2 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________