Optimal. Leaf size=36 \[ 2 \log \left (x^2+1\right )-2 \log \left (x^2+2\right )+3 \tan ^{-1}(x)-\frac{3 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{\sqrt{2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0261453, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3, Rules used = {1010, 391, 203, 444, 36, 31} \[ 2 \log \left (x^2+1\right )-2 \log \left (x^2+2\right )+3 \tan ^{-1}(x)-\frac{3 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{\sqrt{2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1010
Rule 391
Rule 203
Rule 444
Rule 36
Rule 31
Rubi steps
\begin{align*} \int \frac{3+4 x}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx &=3 \int \frac{1}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx+4 \int \frac{x}{\left (1+x^2\right ) \left (2+x^2\right )} \, dx\\ &=2 \operatorname{Subst}\left (\int \frac{1}{(1+x) (2+x)} \, dx,x,x^2\right )+3 \int \frac{1}{1+x^2} \, dx-3 \int \frac{1}{2+x^2} \, dx\\ &=3 \tan ^{-1}(x)-\frac{3 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{\sqrt{2}}+2 \operatorname{Subst}\left (\int \frac{1}{1+x} \, dx,x,x^2\right )-2 \operatorname{Subst}\left (\int \frac{1}{2+x} \, dx,x,x^2\right )\\ &=3 \tan ^{-1}(x)-\frac{3 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{\sqrt{2}}+2 \log \left (1+x^2\right )-2 \log \left (2+x^2\right )\\ \end{align*}
Mathematica [A] time = 0.0148312, size = 36, normalized size = 1. \[ 2 \log \left (x^2+1\right )-2 \log \left (x^2+2\right )+3 \tan ^{-1}(x)-\frac{3 \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right )}{\sqrt{2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.003, size = 34, normalized size = 0.9 \begin{align*} 3\,\arctan \left ( x \right ) +2\,\ln \left ({x}^{2}+1 \right ) -2\,\ln \left ({x}^{2}+2 \right ) -{\frac{3\,\sqrt{2}}{2}\arctan \left ({\frac{x\sqrt{2}}{2}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.45174, size = 45, normalized size = 1.25 \begin{align*} -\frac{3}{2} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 3 \, \arctan \left (x\right ) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.51031, size = 113, normalized size = 3.14 \begin{align*} -\frac{3}{2} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 3 \, \arctan \left (x\right ) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.16702, size = 39, normalized size = 1.08 \begin{align*} 2 \log{\left (x^{2} + 1 \right )} - 2 \log{\left (x^{2} + 2 \right )} + 3 \operatorname{atan}{\left (x \right )} - \frac{3 \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} x}{2} \right )}}{2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.18855, size = 45, normalized size = 1.25 \begin{align*} -\frac{3}{2} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 3 \, \arctan \left (x\right ) - 2 \, \log \left (x^{2} + 2\right ) + 2 \, \log \left (x^{2} + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]