Optimal. Leaf size=32 \[ 3+\frac {\left (\frac {-3+x+\frac {\log ^2(3)}{x^2}}{x}+\log \left (x^2\right )\right )^2}{3-x} \]
________________________________________________________________________________________
Rubi [B] time = 0.79, antiderivative size = 168, normalized size of antiderivative = 5.25, number of steps used = 26, number of rules used = 14, integrand size = 111, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.126, Rules used = {1594, 27, 6742, 44, 77, 74, 2357, 2317, 2391, 2301, 2314, 31, 2304, 2318} \begin {gather*} \frac {\log ^4(3)}{(3-x) x^6}-\frac {2 \log ^2(3)}{x^4}+\frac {3}{x^2}+\frac {x \log ^2\left (x^2\right )}{3 (3-x)}+\frac {1}{3} \log ^2\left (x^2\right )-\frac {2 \left (27-\log ^2(3)\right ) \log \left (x^2\right )}{27 x}+\frac {2 x \log ^2(3) \log \left (x^2\right )}{81 (3-x)}+\frac {2 \log ^2(3) \log \left (x^2\right )}{9 x^2}+\frac {2 \log ^2(3) \log \left (x^2\right )}{3 x^3}+\frac {3}{x}+\frac {4}{81} \log ^2(3) \log (x)-\frac {4 \left (27-\log ^2(3)\right )}{27 x}-\frac {4 \log ^2(3)}{27 x} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 27
Rule 31
Rule 44
Rule 74
Rule 77
Rule 1594
Rule 2301
Rule 2304
Rule 2314
Rule 2317
Rule 2318
Rule 2357
Rule 2391
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {-54 x^4+9 x^5+12 x^6-3 x^7+\left (72 x^2-36 x^3+4 x^4\right ) \log ^2(3)+(-18+7 x) \log ^4(3)+\left (18 x^5-2 x^7+\left (-18 x^3+8 x^4\right ) \log ^2(3)\right ) \log \left (x^2\right )+x^7 \log ^2\left (x^2\right )}{x^7 \left (9-6 x+x^2\right )} \, dx\\ &=\int \frac {-54 x^4+9 x^5+12 x^6-3 x^7+\left (72 x^2-36 x^3+4 x^4\right ) \log ^2(3)+(-18+7 x) \log ^4(3)+\left (18 x^5-2 x^7+\left (-18 x^3+8 x^4\right ) \log ^2(3)\right ) \log \left (x^2\right )+x^7 \log ^2\left (x^2\right )}{(-3+x)^2 x^7} \, dx\\ &=\int \left (-\frac {3}{(-3+x)^2}-\frac {54}{(-3+x)^2 x^3}+\frac {9}{(-3+x)^2 x^2}+\frac {12}{(-3+x)^2 x}+\frac {4 (-6+x) \log ^2(3)}{(-3+x) x^5}+\frac {(-18+7 x) \log ^4(3)}{(-3+x)^2 x^7}-\frac {2 \left (-9 x^2+x^4+9 \log ^2(3)-4 x \log ^2(3)\right ) \log \left (x^2\right )}{(-3+x)^2 x^4}+\frac {\log ^2\left (x^2\right )}{(-3+x)^2}\right ) \, dx\\ &=-\frac {3}{3-x}-2 \int \frac {\left (-9 x^2+x^4+9 \log ^2(3)-4 x \log ^2(3)\right ) \log \left (x^2\right )}{(-3+x)^2 x^4} \, dx+9 \int \frac {1}{(-3+x)^2 x^2} \, dx+12 \int \frac {1}{(-3+x)^2 x} \, dx-54 \int \frac {1}{(-3+x)^2 x^3} \, dx+\left (4 \log ^2(3)\right ) \int \frac {-6+x}{(-3+x) x^5} \, dx+\log ^4(3) \int \frac {-18+7 x}{(-3+x)^2 x^7} \, dx+\int \frac {\log ^2\left (x^2\right )}{(-3+x)^2} \, dx\\ &=-\frac {3}{3-x}+\frac {\log ^4(3)}{(3-x) x^6}+\frac {x \log ^2\left (x^2\right )}{3 (3-x)}+\frac {4}{3} \int \frac {\log \left (x^2\right )}{-3+x} \, dx-2 \int \left (\frac {2 \log \left (x^2\right )}{3 (-3+x)}-\frac {2 \log \left (x^2\right )}{3 x}-\frac {\log ^2(3) \log \left (x^2\right )}{27 (-3+x)^2}+\frac {\log ^2(3) \log \left (x^2\right )}{x^4}+\frac {2 \log ^2(3) \log \left (x^2\right )}{9 x^3}+\frac {\left (-27+\log ^2(3)\right ) \log \left (x^2\right )}{27 x^2}\right ) \, dx+9 \int \left (\frac {1}{9 (-3+x)^2}-\frac {2}{27 (-3+x)}+\frac {1}{9 x^2}+\frac {2}{27 x}\right ) \, dx+12 \int \left (\frac {1}{3 (-3+x)^2}-\frac {1}{9 (-3+x)}+\frac {1}{9 x}\right ) \, dx-54 \int \left (\frac {1}{27 (-3+x)^2}-\frac {1}{27 (-3+x)}+\frac {1}{9 x^3}+\frac {2}{27 x^2}+\frac {1}{27 x}\right ) \, dx+\left (4 \log ^2(3)\right ) \int \left (-\frac {1}{81 (-3+x)}+\frac {2}{x^5}+\frac {1}{3 x^4}+\frac {1}{9 x^3}+\frac {1}{27 x^2}+\frac {1}{81 x}\right ) \, dx\\ &=\frac {3}{x^2}+\frac {3}{x}-\frac {2 \log ^2(3)}{x^4}-\frac {4 \log ^2(3)}{9 x^3}-\frac {2 \log ^2(3)}{9 x^2}-\frac {4 \log ^2(3)}{27 x}+\frac {\log ^4(3)}{(3-x) x^6}-\frac {4}{81} \log ^2(3) \log (3-x)+\frac {4}{81} \log ^2(3) \log (x)+\frac {4}{3} \log \left (1-\frac {x}{3}\right ) \log \left (x^2\right )+\frac {x \log ^2\left (x^2\right )}{3 (3-x)}-\frac {4}{3} \int \frac {\log \left (x^2\right )}{-3+x} \, dx+\frac {4}{3} \int \frac {\log \left (x^2\right )}{x} \, dx-\frac {8}{3} \int \frac {\log \left (1-\frac {x}{3}\right )}{x} \, dx+\frac {1}{27} \left (2 \log ^2(3)\right ) \int \frac {\log \left (x^2\right )}{(-3+x)^2} \, dx-\frac {1}{9} \left (4 \log ^2(3)\right ) \int \frac {\log \left (x^2\right )}{x^3} \, dx-\left (2 \log ^2(3)\right ) \int \frac {\log \left (x^2\right )}{x^4} \, dx+\frac {1}{27} \left (2 \left (27-\log ^2(3)\right )\right ) \int \frac {\log \left (x^2\right )}{x^2} \, dx\\ &=\frac {3}{x^2}+\frac {3}{x}-\frac {2 \log ^2(3)}{x^4}-\frac {4 \log ^2(3)}{27 x}+\frac {\log ^4(3)}{(3-x) x^6}-\frac {4 \left (27-\log ^2(3)\right )}{27 x}-\frac {4}{81} \log ^2(3) \log (3-x)+\frac {4}{81} \log ^2(3) \log (x)+\frac {2 \log ^2(3) \log \left (x^2\right )}{3 x^3}+\frac {2 \log ^2(3) \log \left (x^2\right )}{9 x^2}+\frac {2 x \log ^2(3) \log \left (x^2\right )}{81 (3-x)}-\frac {2 \left (27-\log ^2(3)\right ) \log \left (x^2\right )}{27 x}+\frac {1}{3} \log ^2\left (x^2\right )+\frac {x \log ^2\left (x^2\right )}{3 (3-x)}+\frac {8 \text {Li}_2\left (\frac {x}{3}\right )}{3}+\frac {8}{3} \int \frac {\log \left (1-\frac {x}{3}\right )}{x} \, dx+\frac {1}{81} \left (4 \log ^2(3)\right ) \int \frac {1}{-3+x} \, dx\\ &=\frac {3}{x^2}+\frac {3}{x}-\frac {2 \log ^2(3)}{x^4}-\frac {4 \log ^2(3)}{27 x}+\frac {\log ^4(3)}{(3-x) x^6}-\frac {4 \left (27-\log ^2(3)\right )}{27 x}+\frac {4}{81} \log ^2(3) \log (x)+\frac {2 \log ^2(3) \log \left (x^2\right )}{3 x^3}+\frac {2 \log ^2(3) \log \left (x^2\right )}{9 x^2}+\frac {2 x \log ^2(3) \log \left (x^2\right )}{81 (3-x)}-\frac {2 \left (27-\log ^2(3)\right ) \log \left (x^2\right )}{27 x}+\frac {1}{3} \log ^2\left (x^2\right )+\frac {x \log ^2\left (x^2\right )}{3 (3-x)}\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 33, normalized size = 1.03 \begin {gather*} -\frac {\left (-3 x^2+x^3+\log ^2(3)+x^3 \log \left (x^2\right )\right )^2}{(-3+x) x^6} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.48, size = 79, normalized size = 2.47 \begin {gather*} -\frac {x^{6} \log \left (x^{2}\right )^{2} + x^{6} - 6 \, x^{5} + 9 \, x^{4} + \log \relax (3)^{4} + 2 \, {\left (x^{3} - 3 \, x^{2}\right )} \log \relax (3)^{2} + 2 \, {\left (x^{6} - 3 \, x^{5} + x^{3} \log \relax (3)^{2}\right )} \log \left (x^{2}\right )}{x^{7} - 3 \, x^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.25, size = 147, normalized size = 4.59 \begin {gather*} -\frac {\log \relax (3)^{4}}{729 \, {\left (x - 3\right )}} - \frac {2}{27} \, {\left (\frac {\log \relax (3)^{2}}{x - 3} - \frac {x^{2} \log \relax (3)^{2} + 3 \, x \log \relax (3)^{2} - 27 \, x^{2} + 9 \, \log \relax (3)^{2}}{x^{3}}\right )} \log \left (x^{2}\right ) - \frac {\log \left (x^{2}\right )^{2}}{x - 3} + \frac {x^{5} \log \relax (3)^{4} + 3 \, x^{4} \log \relax (3)^{4} + 9 \, x^{3} \log \relax (3)^{4} + 27 \, x^{2} \log \relax (3)^{4} - 729 \, x^{5} + 81 \, x \log \relax (3)^{4} + 2187 \, x^{4} - 1458 \, x^{2} \log \relax (3)^{2} + 243 \, \log \relax (3)^{4}}{729 \, x^{6}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.08, size = 88, normalized size = 2.75
method | result | size |
risch | \(-\frac {\ln \left (x^{2}\right )^{2}}{x -3}-\frac {2 \left (x^{3}+\ln \relax (3)^{2}-3 x^{2}\right ) \ln \left (x^{2}\right )}{\left (x -3\right ) x^{3}}-\frac {x^{6}+2 x^{3} \ln \relax (3)^{2}-6 x^{5}+\ln \relax (3)^{4}-6 x^{2} \ln \relax (3)^{2}+9 x^{4}}{\left (x -3\right ) x^{6}}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.93, size = 400, normalized size = 12.50 \begin {gather*} \frac {1}{7290} \, {\left (\frac {3 \, {\left (140 \, x^{6} - 210 \, x^{5} - 210 \, x^{4} - 315 \, x^{3} - 567 \, x^{2} - 1134 \, x - 2430\right )}}{x^{7} - 3 \, x^{6}} + 140 \, \log \left (x - 3\right ) - 140 \, \log \relax (x)\right )} \log \relax (3)^{4} - \frac {7}{7290} \, {\left (\frac {3 \, {\left (20 \, x^{5} - 30 \, x^{4} - 30 \, x^{3} - 45 \, x^{2} - 81 \, x - 162\right )}}{x^{6} - 3 \, x^{5}} + 20 \, \log \left (x - 3\right ) - 20 \, \log \relax (x)\right )} \log \relax (3)^{4} - \frac {2}{81} \, {\left (\frac {3 \, {\left (20 \, x^{4} - 30 \, x^{3} - 30 \, x^{2} - 45 \, x - 81\right )}}{x^{5} - 3 \, x^{4}} + 20 \, \log \left (x - 3\right ) - 20 \, \log \relax (x)\right )} \log \relax (3)^{2} + \frac {4}{27} \, {\left (\frac {3 \, {\left (4 \, x^{3} - 6 \, x^{2} - 6 \, x - 9\right )}}{x^{4} - 3 \, x^{3}} + 4 \, \log \left (x - 3\right ) - 4 \, \log \relax (x)\right )} \log \relax (3)^{2} - \frac {2}{27} \, {\left (\frac {3 \, {\left (2 \, x^{2} - 3 \, x - 3\right )}}{x^{3} - 3 \, x^{2}} + 2 \, \log \left (x - 3\right ) - 2 \, \log \relax (x)\right )} \log \relax (3)^{2} + \frac {4}{81} \, \log \relax (3)^{2} \log \left (x - 3\right ) - \frac {2 \, {\left (162 \, x^{3} \log \relax (x)^{2} - 6 \, {\left (\log \relax (3)^{2} - 27\right )} x^{3} + 9 \, {\left (\log \relax (3)^{2} - 54\right )} x^{2} + 9 \, x \log \relax (3)^{2} + 54 \, \log \relax (3)^{2} + 2 \, {\left (x^{4} \log \relax (3)^{2} - 3 \, {\left (\log \relax (3)^{2} - 27\right )} x^{3} - 243 \, x^{2} + 81 \, \log \relax (3)^{2}\right )} \log \relax (x)\right )}}{81 \, {\left (x^{4} - 3 \, x^{3}\right )}} + \frac {3 \, {\left (2 \, x^{2} - 3 \, x - 3\right )}}{x^{3} - 3 \, x^{2}} - \frac {2 \, x - 3}{x^{2} - 3 \, x} - \frac {1}{x - 3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.00, size = 81, normalized size = 2.53 \begin {gather*} -\frac {x^3\,\left (2\,\ln \left (x^2\right )\,{\ln \relax (3)}^2+2\,{\ln \relax (3)}^2\right )-6\,x^2\,{\ln \relax (3)}^2-x^5\,\left (6\,\ln \left (x^2\right )+6\right )+{\ln \relax (3)}^4+9\,x^4+x^6\,\left ({\ln \left (x^2\right )}^2+2\,\ln \left (x^2\right )+1\right )}{x^6\,\left (x-3\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 1.30, size = 87, normalized size = 2.72 \begin {gather*} \frac {- x^{6} + 6 x^{5} - 9 x^{4} - 2 x^{3} \log {\relax (3 )}^{2} + 6 x^{2} \log {\relax (3 )}^{2} - \log {\relax (3 )}^{4}}{x^{7} - 3 x^{6}} + \frac {\left (- 2 x^{3} + 6 x^{2} - 2 \log {\relax (3 )}^{2}\right ) \log {\left (x^{2} \right )}}{x^{4} - 3 x^{3}} - \frac {\log {\left (x^{2} \right )}^{2}}{x - 3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________