Optimal. Leaf size=30 \[ -6+2 x+\frac {2+\frac {4 \log ^2(x+(-1+x) x)}{4-x}}{x} \]
________________________________________________________________________________________
Rubi [A] time = 0.52, antiderivative size = 47, normalized size of antiderivative = 1.57, number of steps used = 25, number of rules used = 13, integrand size = 59, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {1594, 27, 6742, 44, 43, 2351, 2317, 2391, 2304, 2301, 2357, 2318, 2305} \begin {gather*} \frac {x \log ^2\left (x^2\right )}{4 (4-x)}+\frac {\log ^2\left (x^2\right )}{x}+\frac {1}{4} \log ^2\left (x^2\right )+2 x+\frac {2}{x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 43
Rule 44
Rule 1594
Rule 2301
Rule 2304
Rule 2305
Rule 2317
Rule 2318
Rule 2351
Rule 2357
Rule 2391
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{x^2 \left (16-8 x+x^2\right )} \, dx\\ &=\int \frac {-32+16 x+30 x^2-16 x^3+2 x^4+(64-16 x) \log \left (x^2\right )+(-16+8 x) \log ^2\left (x^2\right )}{(-4+x)^2 x^2} \, dx\\ &=\int \left (\frac {30}{(-4+x)^2}-\frac {32}{(-4+x)^2 x^2}+\frac {16}{(-4+x)^2 x}-\frac {16 x}{(-4+x)^2}+\frac {2 x^2}{(-4+x)^2}-\frac {16 \log \left (x^2\right )}{(-4+x) x^2}+\frac {8 (-2+x) \log ^2\left (x^2\right )}{(-4+x)^2 x^2}\right ) \, dx\\ &=\frac {30}{4-x}+2 \int \frac {x^2}{(-4+x)^2} \, dx+8 \int \frac {(-2+x) \log ^2\left (x^2\right )}{(-4+x)^2 x^2} \, dx+16 \int \frac {1}{(-4+x)^2 x} \, dx-16 \int \frac {x}{(-4+x)^2} \, dx-16 \int \frac {\log \left (x^2\right )}{(-4+x) x^2} \, dx-32 \int \frac {1}{(-4+x)^2 x^2} \, dx\\ &=\frac {30}{4-x}+2 \int \left (1+\frac {16}{(-4+x)^2}+\frac {8}{-4+x}\right ) \, dx+8 \int \left (\frac {\log ^2\left (x^2\right )}{8 (-4+x)^2}-\frac {\log ^2\left (x^2\right )}{8 x^2}\right ) \, dx-16 \int \left (\frac {4}{(-4+x)^2}+\frac {1}{-4+x}\right ) \, dx+16 \int \left (\frac {1}{4 (-4+x)^2}-\frac {1}{16 (-4+x)}+\frac {1}{16 x}\right ) \, dx-16 \int \left (\frac {\log \left (x^2\right )}{16 (-4+x)}-\frac {\log \left (x^2\right )}{4 x^2}-\frac {\log \left (x^2\right )}{16 x}\right ) \, dx-32 \int \left (\frac {1}{16 (-4+x)^2}-\frac {1}{32 (-4+x)}+\frac {1}{16 x^2}+\frac {1}{32 x}\right ) \, dx\\ &=\frac {2}{x}+2 x+4 \int \frac {\log \left (x^2\right )}{x^2} \, dx-\int \frac {\log \left (x^2\right )}{-4+x} \, dx+\int \frac {\log \left (x^2\right )}{x} \, dx+\int \frac {\log ^2\left (x^2\right )}{(-4+x)^2} \, dx-\int \frac {\log ^2\left (x^2\right )}{x^2} \, dx\\ &=-\frac {6}{x}+2 x-\frac {4 \log \left (x^2\right )}{x}-\log \left (1-\frac {x}{4}\right ) \log \left (x^2\right )+\frac {1}{4} \log ^2\left (x^2\right )+\frac {\log ^2\left (x^2\right )}{x}+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}+2 \int \frac {\log \left (1-\frac {x}{4}\right )}{x} \, dx-4 \int \frac {\log \left (x^2\right )}{x^2} \, dx+\int \frac {\log \left (x^2\right )}{-4+x} \, dx\\ &=\frac {2}{x}+2 x+\frac {1}{4} \log ^2\left (x^2\right )+\frac {\log ^2\left (x^2\right )}{x}+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}-2 \text {Li}_2\left (\frac {x}{4}\right )-2 \int \frac {\log \left (1-\frac {x}{4}\right )}{x} \, dx\\ &=\frac {2}{x}+2 x+\frac {1}{4} \log ^2\left (x^2\right )+\frac {\log ^2\left (x^2\right )}{x}+\frac {x \log ^2\left (x^2\right )}{4 (4-x)}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.07, size = 29, normalized size = 0.97 \begin {gather*} \frac {2 \left (-4+x-4 x^2+x^3-2 \log ^2\left (x^2\right )\right )}{(-4+x) x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.60, size = 30, normalized size = 1.00 \begin {gather*} \frac {2 \, {\left (x^{3} - 4 \, x^{2} - 2 \, \log \left (x^{2}\right )^{2} + x - 4\right )}}{x^{2} - 4 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.15, size = 28, normalized size = 0.93 \begin {gather*} -{\left (\frac {1}{x - 4} - \frac {1}{x}\right )} \log \left (x^{2}\right )^{2} + 2 \, x + \frac {2}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 28, normalized size = 0.93
method | result | size |
norman | \(\frac {-8-30 x +2 x^{3}-4 \ln \left (x^{2}\right )^{2}}{\left (x -4\right ) x}\) | \(28\) |
risch | \(-\frac {4 \ln \left (x^{2}\right )^{2}}{\left (x -4\right ) x}+\frac {2 x^{2}+2}{x}\) | \(28\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 40, normalized size = 1.33 \begin {gather*} 2 \, x - \frac {16 \, \log \relax (x)^{2}}{x^{2} - 4 \, x} + \frac {4 \, {\left (x - 2\right )}}{x^{2} - 4 \, x} - \frac {2}{x - 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.22, size = 30, normalized size = 1.00 \begin {gather*} -\frac {-4\,x^3+15\,x^2+8\,{\ln \left (x^2\right )}^2+16}{2\,x\,\left (x-4\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.15, size = 20, normalized size = 0.67 \begin {gather*} 2 x - \frac {4 \log {\left (x^{2} \right )}^{2}}{x^{2} - 4 x} + \frac {2}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________