Optimal. Leaf size=58 \[ \frac{45}{32} \log \left (x^2-4 x+8\right )+\frac{41}{4 (4-x)}-\frac{83}{4 (4-x)^2}-\frac{45}{16} \log (4-x)-\frac{3}{16} \tan ^{-1}\left (1-\frac{x}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0550267, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192, Rules used = {1628, 634, 617, 204, 628} \[ \frac{45}{32} \log \left (x^2-4 x+8\right )+\frac{41}{4 (4-x)}-\frac{83}{4 (4-x)^2}-\frac{45}{16} \log (4-x)-\frac{3}{16} \tan ^{-1}\left (1-\frac{x}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1628
Rule 634
Rule 617
Rule 204
Rule 628
Rubi steps
\begin{align*} \int \frac{-20+8 x+5 x^3}{(-4+x)^3 \left (8-4 x+x^2\right )} \, dx &=\int \left (\frac{83}{2 (-4+x)^3}+\frac{41}{4 (-4+x)^2}-\frac{45}{16 (-4+x)}+\frac{3 (-28+15 x)}{16 \left (8-4 x+x^2\right )}\right ) \, dx\\ &=-\frac{83}{4 (4-x)^2}+\frac{41}{4 (4-x)}-\frac{45}{16} \log (4-x)+\frac{3}{16} \int \frac{-28+15 x}{8-4 x+x^2} \, dx\\ &=-\frac{83}{4 (4-x)^2}+\frac{41}{4 (4-x)}-\frac{45}{16} \log (4-x)+\frac{3}{8} \int \frac{1}{8-4 x+x^2} \, dx+\frac{45}{32} \int \frac{-4+2 x}{8-4 x+x^2} \, dx\\ &=-\frac{83}{4 (4-x)^2}+\frac{41}{4 (4-x)}-\frac{45}{16} \log (4-x)+\frac{45}{32} \log \left (8-4 x+x^2\right )+\frac{3}{16} \operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1-\frac{x}{2}\right )\\ &=-\frac{83}{4 (4-x)^2}+\frac{41}{4 (4-x)}-\frac{3}{16} \tan ^{-1}\left (1-\frac{x}{2}\right )-\frac{45}{16} \log (4-x)+\frac{45}{32} \log \left (8-4 x+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0244687, size = 46, normalized size = 0.79 \[ \frac{1}{32} \left (45 \log \left (x^2-4 x+8\right )-\frac{328}{x-4}-\frac{664}{(x-4)^2}-90 \log (x-4)+6 \tan ^{-1}\left (\frac{x-2}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.008, size = 41, normalized size = 0.7 \begin{align*} -{\frac{83}{4\, \left ( x-4 \right ) ^{2}}}-{\frac{41}{4\,x-16}}-{\frac{45\,\ln \left ( x-4 \right ) }{16}}+{\frac{45\,\ln \left ({x}^{2}-4\,x+8 \right ) }{32}}+{\frac{3}{16}\arctan \left ( -1+{\frac{x}{2}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.42162, size = 58, normalized size = 1. \begin{align*} -\frac{41 \, x - 81}{4 \,{\left (x^{2} - 8 \, x + 16\right )}} + \frac{3}{16} \, \arctan \left (\frac{1}{2} \, x - 1\right ) + \frac{45}{32} \, \log \left (x^{2} - 4 \, x + 8\right ) - \frac{45}{16} \, \log \left (x - 4\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.15851, size = 203, normalized size = 3.5 \begin{align*} \frac{6 \,{\left (x^{2} - 8 \, x + 16\right )} \arctan \left (\frac{1}{2} \, x - 1\right ) + 45 \,{\left (x^{2} - 8 \, x + 16\right )} \log \left (x^{2} - 4 \, x + 8\right ) - 90 \,{\left (x^{2} - 8 \, x + 16\right )} \log \left (x - 4\right ) - 328 \, x + 648}{32 \,{\left (x^{2} - 8 \, x + 16\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.167134, size = 46, normalized size = 0.79 \begin{align*} - \frac{41 x - 81}{4 x^{2} - 32 x + 64} - \frac{45 \log{\left (x - 4 \right )}}{16} + \frac{45 \log{\left (x^{2} - 4 x + 8 \right )}}{32} + \frac{3 \operatorname{atan}{\left (\frac{x}{2} - 1 \right )}}{16} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.07188, size = 53, normalized size = 0.91 \begin{align*} -\frac{41 \, x - 81}{4 \,{\left (x - 4\right )}^{2}} + \frac{3}{16} \, \arctan \left (\frac{1}{2} \, x - 1\right ) + \frac{45}{32} \, \log \left (x^{2} - 4 \, x + 8\right ) - \frac{45}{16} \, \log \left ({\left | x - 4 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]