Optimal. Leaf size=37 \[ \frac{1}{6} \log \left (x^2+1\right )-\frac{1}{6} \log \left (x^2+4\right )-\frac{1}{3} \tan ^{-1}\left (\frac{x}{2}\right )+\frac{2}{3} \tan ^{-1}(x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.023859, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {1010, 391, 203, 444, 36, 31} \[ \frac{1}{6} \log \left (x^2+1\right )-\frac{1}{6} \log \left (x^2+4\right )-\frac{1}{3} \tan ^{-1}\left (\frac{x}{2}\right )+\frac{2}{3} \tan ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1010
Rule 391
Rule 203
Rule 444
Rule 36
Rule 31
Rubi steps
\begin{align*} \int \frac{2+x}{\left (1+x^2\right ) \left (4+x^2\right )} \, dx &=2 \int \frac{1}{\left (1+x^2\right ) \left (4+x^2\right )} \, dx+\int \frac{x}{\left (1+x^2\right ) \left (4+x^2\right )} \, dx\\ &=\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{(1+x) (4+x)} \, dx,x,x^2\right )+\frac{2}{3} \int \frac{1}{1+x^2} \, dx-\frac{2}{3} \int \frac{1}{4+x^2} \, dx\\ &=-\frac{1}{3} \tan ^{-1}\left (\frac{x}{2}\right )+\frac{2}{3} \tan ^{-1}(x)+\frac{1}{6} \operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,x^2\right )-\frac{1}{6} \operatorname{Subst}\left (\int \frac{1}{4+x} \, dx,x,x^2\right )\\ &=-\frac{1}{3} \tan ^{-1}\left (\frac{x}{2}\right )+\frac{2}{3} \tan ^{-1}(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.0075078, size = 37, normalized size = 1. \[ \frac{1}{6} \log \left (x^2+1\right )-\frac{1}{6} \log \left (x^2+4\right )-\frac{1}{3} \tan ^{-1}\left (\frac{x}{2}\right )+\frac{2}{3} \tan ^{-1}(x) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 28, normalized size = 0.8 \begin{align*} -{\frac{1}{3}\arctan \left ({\frac{x}{2}} \right ) }+{\frac{2\,\arctan \left ( x \right ) }{3}}+{\frac{\ln \left ({x}^{2}+1 \right ) }{6}}-{\frac{\ln \left ({x}^{2}+4 \right ) }{6}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.46583, size = 36, normalized size = 0.97 \begin{align*} -\frac{1}{3} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{2}{3} \, \arctan \left (x\right ) - \frac{1}{6} \, \log \left (x^{2} + 4\right ) + \frac{1}{6} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.55561, size = 100, normalized size = 2.7 \begin{align*} -\frac{1}{3} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{2}{3} \, \arctan \left (x\right ) - \frac{1}{6} \, \log \left (x^{2} + 4\right ) + \frac{1}{6} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.152719, size = 29, normalized size = 0.78 \begin{align*} \frac{\log{\left (x^{2} + 1 \right )}}{6} - \frac{\log{\left (x^{2} + 4 \right )}}{6} - \frac{\operatorname{atan}{\left (\frac{x}{2} \right )}}{3} + \frac{2 \operatorname{atan}{\left (x \right )}}{3} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23479, size = 36, normalized size = 0.97 \begin{align*} -\frac{1}{3} \, \arctan \left (\frac{1}{2} \, x\right ) + \frac{2}{3} \, \arctan \left (x\right ) - \frac{1}{6} \, \log \left (x^{2} + 4\right ) + \frac{1}{6} \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]