Optimal. Leaf size=22 \[ x \left (2+\log (4)+x \log \left (6+\frac {x^2}{3-x}\right )\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.49, antiderivative size = 29, normalized size of antiderivative = 1.32, number of steps used = 29, number of rules used = 10, integrand size = 87, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {6742, 681, 31, 628, 800, 634, 617, 204, 1628, 2525} \begin {gather*} x^2 \log \left (\frac {x^2-6 x+18}{3-x}\right )+2 x+x \log (4) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 204
Rule 617
Rule 628
Rule 634
Rule 681
Rule 800
Rule 1628
Rule 2525
Rule 6742
Rubi steps
\begin {gather*} \begin {aligned} \text {integral} &=\int \left (-\frac {108}{(-3+x) \left (18-6 x+x^2\right )}+\frac {72 x}{(-3+x) \left (18-6 x+x^2\right )}-\frac {18 x^2}{(-3+x) \left (18-6 x+x^2\right )}-\frac {4 x^3}{(-3+x) \left (18-6 x+x^2\right )}+\frac {x^4}{(-3+x) \left (18-6 x+x^2\right )}+\log (4)+2 x \log \left (-\frac {18-6 x+x^2}{-3+x}\right )\right ) \, dx\\ &=x \log (4)+2 \int x \log \left (-\frac {18-6 x+x^2}{-3+x}\right ) \, dx-4 \int \frac {x^3}{(-3+x) \left (18-6 x+x^2\right )} \, dx-18 \int \frac {x^2}{(-3+x) \left (18-6 x+x^2\right )} \, dx+72 \int \frac {x}{(-3+x) \left (18-6 x+x^2\right )} \, dx-108 \int \frac {1}{(-3+x) \left (18-6 x+x^2\right )} \, dx+\int \frac {x^4}{(-3+x) \left (18-6 x+x^2\right )} \, dx\\ &=x \log (4)+x^2 \log \left (\frac {18-6 x+x^2}{3-x}\right )-4 \int \left (1+\frac {3}{-3+x}+\frac {6 x}{18-6 x+x^2}\right ) \, dx+12 \int \frac {-3+x}{18-6 x+x^2} \, dx-18 \int \left (\frac {1}{-3+x}+\frac {6}{18-6 x+x^2}\right ) \, dx-24 \int \frac {1}{-6+2 x} \, dx+72 \int \left (\frac {1}{3 (-3+x)}+\frac {6-x}{3 \left (18-6 x+x^2\right )}\right ) \, dx-\int \frac {(6-x) x^3}{(3-x) \left (18-6 x+x^2\right )} \, dx+\int \left (9+\frac {9}{-3+x}+x+\frac {36 (-3+x)}{18-6 x+x^2}\right ) \, dx\\ &=5 x+\frac {x^2}{2}+x \log (4)-9 \log (3-x)+6 \log \left (18-6 x+x^2\right )+x^2 \log \left (\frac {18-6 x+x^2}{3-x}\right )+24 \int \frac {6-x}{18-6 x+x^2} \, dx-24 \int \frac {x}{18-6 x+x^2} \, dx+36 \int \frac {-3+x}{18-6 x+x^2} \, dx-108 \int \frac {1}{18-6 x+x^2} \, dx-\int \left (3-\frac {9}{-3+x}+x-\frac {108}{18-6 x+x^2}\right ) \, dx\\ &=2 x+x \log (4)+24 \log \left (18-6 x+x^2\right )+x^2 \log \left (\frac {18-6 x+x^2}{3-x}\right )-2 \left (12 \int \frac {-6+2 x}{18-6 x+x^2} \, dx\right )-36 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {x}{3}\right )+108 \int \frac {1}{18-6 x+x^2} \, dx\\ &=2 x+36 \tan ^{-1}\left (1-\frac {x}{3}\right )+x \log (4)+x^2 \log \left (\frac {18-6 x+x^2}{3-x}\right )+36 \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {x}{3}\right )\\ &=2 x+x \log (4)+x^2 \log \left (\frac {18-6 x+x^2}{3-x}\right )\\ \end {aligned} \end {gather*}
________________________________________________________________________________________
Mathematica [B] time = 0.05, size = 47, normalized size = 2.14 \begin {gather*} 36 \tan ^{-1}\left (\frac {3}{-3+x}\right )+36 \tan ^{-1}\left (\frac {1}{3} (-3+x)\right )+x (2+\log (4))+x^2 \log \left (-\frac {18-6 x+x^2}{-3+x}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 29, normalized size = 1.32 \begin {gather*} x^{2} \log \left (-\frac {x^{2} - 6 \, x + 18}{x - 3}\right ) + 2 \, x \log \relax (2) + 2 \, x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.26, size = 32, normalized size = 1.45 \begin {gather*} x^{2} \log \left (-x^{2} + 6 \, x - 18\right ) - x^{2} \log \left (x - 3\right ) + 2 \, x {\left (\log \relax (2) + 1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 31, normalized size = 1.41
method | result | size |
default | \(2 x +x^{2} \ln \left (\frac {-x^{2}+6 x -18}{x -3}\right )+2 x \ln \relax (2)\) | \(31\) |
norman | \(x^{2} \ln \left (\frac {-x^{2}+6 x -18}{x -3}\right )+\left (2+2 \ln \relax (2)\right ) x\) | \(31\) |
risch | \(2 x +x^{2} \ln \left (\frac {-x^{2}+6 x -18}{x -3}\right )+2 x \ln \relax (2)\) | \(31\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.50, size = 134, normalized size = 6.09 \begin {gather*} x^{2} \log \left (-x^{2} + 6 \, x - 18\right ) + 2 \, {\left (x + 6 \, \arctan \left (\frac {1}{3} \, x - 1\right ) + 3 \, \log \left (x^{2} - 6 \, x + 18\right ) + 3 \, \log \left (x - 3\right )\right )} \log \relax (2) + 12 \, {\left (2 \, \arctan \left (\frac {1}{3} \, x - 1\right ) - \log \left (x^{2} - 6 \, x + 18\right ) + 2 \, \log \left (x - 3\right )\right )} \log \relax (2) - 18 \, {\left (2 \, \arctan \left (\frac {1}{3} \, x - 1\right ) + \log \left (x - 3\right )\right )} \log \relax (2) + 6 \, {\left (\log \left (x^{2} - 6 \, x + 18\right ) - 2 \, \log \left (x - 3\right )\right )} \log \relax (2) - {\left (x^{2} - 9\right )} \log \left (x - 3\right ) + 2 \, x - 9 \, \log \left (x - 3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.10, size = 27, normalized size = 1.23 \begin {gather*} x^2\,\ln \left (-\frac {x^2-6\,x+18}{x-3}\right )+x\,\left (\ln \relax (4)+2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.20, size = 24, normalized size = 1.09 \begin {gather*} x^{2} \log {\left (\frac {- x^{2} + 6 x - 18}{x - 3} \right )} + x \left (2 \log {\relax (2 )} + 2\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________