Optimal. Leaf size=47 \[ \frac {3}{4} \log \left (x^2+1\right )+\frac {5}{2 (1-x)}-\frac {1}{2 (1-x)^2}-\frac {3}{2} \log (1-x)-\tan ^{-1}(x) \]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {1629, 635, 203, 260} \[ \frac {3}{4} \log \left (x^2+1\right )+\frac {5}{2 (1-x)}-\frac {1}{2 (1-x)^2}-\frac {3}{2} \log (1-x)-\tan ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 260
Rule 635
Rule 1629
Rubi steps
\begin {align*} \int \frac {-2+x+3 x^2}{(-1+x)^3 \left (1+x^2\right )} \, dx &=\int \left (\frac {1}{(-1+x)^3}+\frac {5}{2 (-1+x)^2}-\frac {3}{2 (-1+x)}+\frac {-2+3 x}{2 \left (1+x^2\right )}\right ) \, dx\\ &=-\frac {1}{2 (1-x)^2}+\frac {5}{2 (1-x)}-\frac {3}{2} \log (1-x)+\frac {1}{2} \int \frac {-2+3 x}{1+x^2} \, dx\\ &=-\frac {1}{2 (1-x)^2}+\frac {5}{2 (1-x)}-\frac {3}{2} \log (1-x)+\frac {3}{2} \int \frac {x}{1+x^2} \, dx-\int \frac {1}{1+x^2} \, dx\\ &=-\frac {1}{2 (1-x)^2}+\frac {5}{2 (1-x)}-\tan ^{-1}(x)-\frac {3}{2} \log (1-x)+\frac {3}{4} \log \left (1+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.03, size = 37, normalized size = 0.79 \[ \frac {1}{4} \left (3 \log \left (x^2+1\right )-\frac {10}{x-1}-\frac {2}{(x-1)^2}-6 \log (x-1)-4 \tan ^{-1}(x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.03, size = 37, normalized size = 0.79 \[ \frac {3}{4} \log \left (x^2+1\right )+\frac {4-5 x}{2 (x-1)^2}-\frac {3}{2} \log (x-1)-\tan ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.88, size = 59, normalized size = 1.26 \[ -\frac {4 \, {\left (x^{2} - 2 \, x + 1\right )} \arctan \relax (x) - 3 \, {\left (x^{2} - 2 \, x + 1\right )} \log \left (x^{2} + 1\right ) + 6 \, {\left (x^{2} - 2 \, x + 1\right )} \log \left (x - 1\right ) + 10 \, x - 8}{4 \, {\left (x^{2} - 2 \, x + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.91, size = 32, normalized size = 0.68 \[ -\frac {5 \, x - 4}{2 \, {\left (x - 1\right )}^{2}} - \arctan \relax (x) + \frac {3}{4} \, \log \left (x^{2} + 1\right ) - \frac {3}{2} \, \log \left ({\left | x - 1 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.36, size = 33, normalized size = 0.70
method | result | size |
risch | \(\frac {-\frac {5 x}{2}+2}{\left (-1+x \right )^{2}}-\frac {3 \ln \left (-1+x \right )}{2}+\frac {3 \ln \left (4 x^{2}+4\right )}{4}-\arctan \relax (x )\) | \(33\) |
default | \(\frac {3 \ln \left (x^{2}+1\right )}{4}-\arctan \relax (x )-\frac {1}{2 \left (-1+x \right )^{2}}-\frac {5}{2 \left (-1+x \right )}-\frac {3 \ln \left (-1+x \right )}{2}\) | \(34\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.99, size = 36, normalized size = 0.77 \[ -\frac {5 \, x - 4}{2 \, {\left (x^{2} - 2 \, x + 1\right )}} - \arctan \relax (x) + \frac {3}{4} \, \log \left (x^{2} + 1\right ) - \frac {3}{2} \, \log \left (x - 1\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.04, size = 42, normalized size = 0.89 \[ -\frac {3\,\ln \left (x-1\right )}{2}-\frac {\frac {5\,x}{2}-2}{x^2-2\,x+1}+\ln \left (x-\mathrm {i}\right )\,\left (\frac {3}{4}+\frac {1}{2}{}\mathrm {i}\right )+\ln \left (x+1{}\mathrm {i}\right )\,\left (\frac {3}{4}-\frac {1}{2}{}\mathrm {i}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.18, size = 36, normalized size = 0.77 \[ \frac {4 - 5 x}{2 x^{2} - 4 x + 2} - \frac {3 \log {\left (x - 1 \right )}}{2} + \frac {3 \log {\left (x^{2} + 1 \right )}}{4} - \operatorname {atan}{\relax (x )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________