Optimal. Leaf size=37 \[ -\frac {1}{3} \log (1-x)+\frac {1}{3} \log (2-x)+\frac {2}{3} \log (x+1)-\frac {2}{3} \log (x+2) \]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 61, normalized size of antiderivative = 1.65, number of steps used = 12, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {1673, 1161, 616, 31, 1107} \[ \frac {1}{6} \log \left (1-x^2\right )-\frac {1}{6} \log \left (4-x^2\right )-\frac {1}{2} \log (1-x)+\frac {1}{2} \log (2-x)+\frac {1}{2} \log (x+1)-\frac {1}{2} \log (x+2) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 616
Rule 1107
Rule 1161
Rule 1673
Rubi steps
\begin {align*} \int \frac {2-x+x^2}{4-5 x^2+x^4} \, dx &=-\int \frac {x}{4-5 x^2+x^4} \, dx+\int \frac {2+x^2}{4-5 x^2+x^4} \, dx\\ &=\frac {1}{2} \int \frac {1}{2-3 x+x^2} \, dx+\frac {1}{2} \int \frac {1}{2+3 x+x^2} \, dx-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{4-5 x+x^2} \, dx,x,x^2\right )\\ &=-\left (\frac {1}{6} \operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,x^2\right )\right )+\frac {1}{6} \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,x^2\right )+\frac {1}{2} \int \frac {1}{-2+x} \, dx-\frac {1}{2} \int \frac {1}{-1+x} \, dx+\frac {1}{2} \int \frac {1}{1+x} \, dx-\frac {1}{2} \int \frac {1}{2+x} \, dx\\ &=-\frac {1}{2} \log (1-x)+\frac {1}{2} \log (2-x)+\frac {1}{2} \log (1+x)-\frac {1}{2} \log (2+x)+\frac {1}{6} \log \left (1-x^2\right )-\frac {1}{6} \log \left (4-x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.01, size = 37, normalized size = 1.00 \[ -\frac {1}{3} \log (1-x)+\frac {1}{3} \log (2-x)+\frac {2}{3} \log (x+1)-\frac {2}{3} \log (x+2) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.01, size = 21, normalized size = 0.57 \[ \frac {2}{3} \tanh ^{-1}(3-2 x)-\frac {4}{3} \tanh ^{-1}(2 x+3) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.72, size = 25, normalized size = 0.68 \[ -\frac {2}{3} \, \log \left (x + 2\right ) + \frac {2}{3} \, \log \left (x + 1\right ) - \frac {1}{3} \, \log \left (x - 1\right ) + \frac {1}{3} \, \log \left (x - 2\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.99, size = 29, normalized size = 0.78 \[ -\frac {2}{3} \, \log \left ({\left | x + 2 \right |}\right ) + \frac {2}{3} \, \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{3} \, \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{3} \, \log \left ({\left | x - 2 \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 26, normalized size = 0.70
method | result | size |
default | \(\frac {\ln \left (-2+x \right )}{3}-\frac {2 \ln \left (2+x \right )}{3}-\frac {\ln \left (-1+x \right )}{3}+\frac {2 \ln \left (1+x \right )}{3}\) | \(26\) |
norman | \(\frac {\ln \left (-2+x \right )}{3}-\frac {2 \ln \left (2+x \right )}{3}-\frac {\ln \left (-1+x \right )}{3}+\frac {2 \ln \left (1+x \right )}{3}\) | \(26\) |
risch | \(\frac {\ln \left (-2+x \right )}{3}-\frac {2 \ln \left (2+x \right )}{3}-\frac {\ln \left (-1+x \right )}{3}+\frac {2 \ln \left (1+x \right )}{3}\) | \(26\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 25, normalized size = 0.68 \[ -\frac {2}{3} \, \log \left (x + 2\right ) + \frac {2}{3} \, \log \left (x + 1\right ) - \frac {1}{3} \, \log \left (x - 1\right ) + \frac {1}{3} \, \log \left (x - 2\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.06, size = 29, normalized size = 0.78 \[ \frac {2\,\mathrm {atanh}\left (\frac {64}{3\,\left (24\,x-16\right )}-\frac {5}{3}\right )}{3}+\frac {4\,\mathrm {atanh}\left (\frac {128}{3\,\left (48\,x+32\right )}+\frac {5}{3}\right )}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.19, size = 29, normalized size = 0.78 \[ \frac {\log {\left (x - 2 \right )}}{3} - \frac {\log {\left (x - 1 \right )}}{3} + \frac {2 \log {\left (x + 1 \right )}}{3} - \frac {2 \log {\left (x + 2 \right )}}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________