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]
[Out]
Rule 29
Rule 31
Rule 36
Rule 44
Rule 1593
Rule 2295
Rule 2296
Rule 2301
Rule 2346
Rule 2395
Rule 6742
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________
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]
[Out]
________________________________________________________________________________________