Optimal. Leaf size=32 \[ \frac {1}{4+x^2}+\frac {1}{2} \tan ^{-1}\left (\frac {x}{2}\right )+2 \tan ^{-1}(x)-2 \log (x)+\log \left (4+x^2\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.116, Rules used = {6857, 209, 267,
649, 266} \begin {gather*} \frac {1}{2} \text {ArcTan}\left (\frac {x}{2}\right )+2 \text {ArcTan}(x)+\frac {1}{x^2+4}+\log \left (x^2+4\right )-2 \log (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 266
Rule 267
Rule 649
Rule 6857
Rubi steps
\begin {align*} \int \frac {-32+36 x-42 x^2+21 x^3-10 x^4+3 x^5}{x \left (1+x^2\right ) \left (4+x^2\right )^2} \, dx &=\int \left (-\frac {2}{x}+\frac {2}{1+x^2}-\frac {2 x}{\left (4+x^2\right )^2}+\frac {1+2 x}{4+x^2}\right ) \, dx\\ &=-2 \log (x)+2 \int \frac {1}{1+x^2} \, dx-2 \int \frac {x}{\left (4+x^2\right )^2} \, dx+\int \frac {1+2 x}{4+x^2} \, dx\\ &=\frac {1}{4+x^2}+2 \tan ^{-1}(x)-2 \log (x)+2 \int \frac {x}{4+x^2} \, dx+\int \frac {1}{4+x^2} \, dx\\ &=\frac {1}{4+x^2}+\frac {1}{2} \tan ^{-1}\left (\frac {x}{2}\right )+2 \tan ^{-1}(x)-2 \log (x)+\log \left (4+x^2\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 32, normalized size = 1.00 \begin {gather*} \frac {1}{4+x^2}+\frac {1}{2} \tan ^{-1}\left (\frac {x}{2}\right )+2 \tan ^{-1}(x)-2 \log (x)+\log \left (4+x^2\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 29, normalized size = 0.91
method | result | size |
default | \(\frac {1}{x^{2}+4}+\frac {\arctan \left (\frac {x}{2}\right )}{2}+2 \arctan \left (x \right )-2 \ln \left (x \right )+\ln \left (x^{2}+4\right )\) | \(29\) |
risch | \(\frac {1}{x^{2}+4}+\frac {\arctan \left (\frac {x}{2}\right )}{2}+2 \arctan \left (x \right )-2 \ln \left (x \right )+\ln \left (x^{2}+4\right )\) | \(29\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 28, normalized size = 0.88 \begin {gather*} \frac {1}{x^{2} + 4} + \frac {1}{2} \, \arctan \left (\frac {1}{2} \, x\right ) + 2 \, \arctan \left (x\right ) + \log \left (x^{2} + 4\right ) - 2 \, \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 52, normalized size = 1.62 \begin {gather*} \frac {{\left (x^{2} + 4\right )} \arctan \left (\frac {1}{2} \, x\right ) + 4 \, {\left (x^{2} + 4\right )} \arctan \left (x\right ) + 2 \, {\left (x^{2} + 4\right )} \log \left (x^{2} + 4\right ) - 4 \, {\left (x^{2} + 4\right )} \log \left (x\right ) + 2}{2 \, {\left (x^{2} + 4\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.11, size = 29, normalized size = 0.91 \begin {gather*} - 2 \log {\left (x \right )} + \log {\left (x^{2} + 4 \right )} + \frac {\operatorname {atan}{\left (\frac {x}{2} \right )}}{2} + 2 \operatorname {atan}{\left (x \right )} + \frac {1}{x^{2} + 4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 6.75, size = 29, normalized size = 0.91 \begin {gather*} \frac {1}{x^{2} + 4} + \frac {1}{2} \, \arctan \left (\frac {1}{2} \, x\right ) + 2 \, \arctan \left (x\right ) + \log \left (x^{2} + 4\right ) - 2 \, \log \left ({\left | x \right |}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 44, normalized size = 1.38 \begin {gather*} \frac {1}{x^2+4}-2\,\ln \left (x\right )-2\,\mathrm {atan}\left (\frac {328000}{7\,\left (36288\,x-19584\right )}+\frac {34}{63}\right )+\ln \left (x-2{}\mathrm {i}\right )\,\left (1-\frac {1}{4}{}\mathrm {i}\right )+\ln \left (x+2{}\mathrm {i}\right )\,\left (1+\frac {1}{4}{}\mathrm {i}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________