Optimal. Leaf size=56 \[ \sqrt{2} \tanh ^{-1}\left (\frac{x+1}{\sqrt{2} \sqrt{x^2+x+1}}\right )-2 \sqrt{2} \tan ^{-1}\left (\frac{1-x}{\sqrt{2} \sqrt{x^2+x+1}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0466675, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {1036, 1030, 207, 203} \[ \sqrt{2} \tanh ^{-1}\left (\frac{x+1}{\sqrt{2} \sqrt{x^2+x+1}}\right )-2 \sqrt{2} \tan ^{-1}\left (\frac{1-x}{\sqrt{2} \sqrt{x^2+x+1}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1036
Rule 1030
Rule 207
Rule 203
Rubi steps
\begin{align*} \int \frac{3+x}{\left (1+x^2\right ) \sqrt{1+x+x^2}} \, dx &=-\left (\frac{1}{2} \int \frac{-4-4 x}{\left (1+x^2\right ) \sqrt{1+x+x^2}} \, dx\right )+\frac{1}{2} \int \frac{2-2 x}{\left (1+x^2\right ) \sqrt{1+x+x^2}} \, dx\\ &=4 \operatorname{Subst}\left (\int \frac{1}{-8+x^2} \, dx,x,\frac{-2-2 x}{\sqrt{1+x+x^2}}\right )+16 \operatorname{Subst}\left (\int \frac{1}{32+x^2} \, dx,x,\frac{-4+4 x}{\sqrt{1+x+x^2}}\right )\\ &=-2 \sqrt{2} \tan ^{-1}\left (\frac{1-x}{\sqrt{2} \sqrt{1+x+x^2}}\right )+\sqrt{2} \tanh ^{-1}\left (\frac{1+x}{\sqrt{2} \sqrt{1+x+x^2}}\right )\\ \end{align*}
Mathematica [C] time = 0.0251623, size = 80, normalized size = 1.43 \[ \left (\frac{1}{2}+\frac{i}{2}\right ) (-1)^{3/4} \left ((2+i) \tan ^{-1}\left (\frac{\sqrt [4]{-1} ((2+i) x+(1+2 i))}{2 \sqrt{x^2+x+1}}\right )+(1+2 i) \tanh ^{-1}\left (\frac{(-1)^{3/4} ((1+2 i) x+(2+i))}{2 \sqrt{x^2+x+1}}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.016, size = 128, normalized size = 2.3 \begin{align*}{\sqrt{2}\sqrt{{\frac{ \left ( -1+x \right ) ^{2}}{ \left ( -1-x \right ) ^{2}}}+3} \left ({\it Artanh} \left ({\frac{\sqrt{2}}{2}\sqrt{{\frac{ \left ( -1+x \right ) ^{2}}{ \left ( -1-x \right ) ^{2}}}+3}} \right ) -2\,\arctan \left ({\frac{\sqrt{2} \left ( -1+x \right ) }{-1-x}{\frac{1}{\sqrt{{\frac{ \left ( -1+x \right ) ^{2}}{ \left ( -1-x \right ) ^{2}}}+3}}}} \right ) \right ){\frac{1}{\sqrt{{ \left ({\frac{ \left ( -1+x \right ) ^{2}}{ \left ( -1-x \right ) ^{2}}}+3 \right ) \left ( 1+{\frac{-1+x}{-1-x}} \right ) ^{-2}}}}} \left ( 1+{\frac{-1+x}{-1-x}} \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x + 3}{\sqrt{x^{2} + x + 1}{\left (x^{2} + 1\right )}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.61507, size = 1041, normalized size = 18.59 \begin{align*} \frac{4}{5} \, \sqrt{10} \sqrt{5} \arctan \left (\frac{1}{25} \, \sqrt{5} \sqrt{\sqrt{10} \sqrt{5}{\left (x - 1\right )} + 10 \, x^{2} - \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} + 10 \, x\right )} + 5 \, x + 15}{\left (\sqrt{10} \sqrt{5} + 10\right )} + \frac{1}{5} \, \sqrt{10} \sqrt{5}{\left (x + 1\right )} - \frac{1}{5} \, \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} + 10\right )} + 2 \, x + 1\right ) + \frac{4}{5} \, \sqrt{10} \sqrt{5} \arctan \left (\frac{1}{5} \, \sqrt{10} \sqrt{5}{\left (x + 1\right )} + \frac{1}{50} \, \sqrt{-20 \, \sqrt{10} \sqrt{5}{\left (x - 1\right )} + 200 \, x^{2} + 20 \, \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} - 10 \, x\right )} + 100 \, x + 300}{\left (\sqrt{10} \sqrt{5} - 10\right )} - \frac{1}{5} \, \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} - 10\right )} - 2 \, x - 1\right ) - \frac{1}{10} \, \sqrt{10} \sqrt{5} \log \left (20 \, \sqrt{10} \sqrt{5}{\left (x - 1\right )} + 200 \, x^{2} - 20 \, \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} + 10 \, x\right )} + 100 \, x + 300\right ) + \frac{1}{10} \, \sqrt{10} \sqrt{5} \log \left (-20 \, \sqrt{10} \sqrt{5}{\left (x - 1\right )} + 200 \, x^{2} + 20 \, \sqrt{x^{2} + x + 1}{\left (\sqrt{10} \sqrt{5} - 10 \, x\right )} + 100 \, x + 300\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{x + 3}{\left (x^{2} + 1\right ) \sqrt{x^{2} + x + 1}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [C] time = 1.11181, size = 139, normalized size = 2.48 \begin{align*} -\left (i - \frac{1}{2}\right ) \, \sqrt{2} \log \left (-\left (i + 1\right ) \, x + \sqrt{2} + \left (i + 1\right ) \, \sqrt{x^{2} + x + 1} - i + 1\right ) + \left (i + \frac{1}{2}\right ) \, \sqrt{2} \log \left (-\left (i + 1\right ) \, x + i \, \sqrt{2} + \left (i + 1\right ) \, \sqrt{x^{2} + x + 1} + i - 1\right ) - \left (i + \frac{1}{2}\right ) \, \sqrt{2} \log \left (-\left (i + 1\right ) \, x - i \, \sqrt{2} + \left (i + 1\right ) \, \sqrt{x^{2} + x + 1} + i - 1\right ) + \left (i - \frac{1}{2}\right ) \, \sqrt{2} \log \left (-\left (i + 1\right ) \, x - \sqrt{2} + \left (i + 1\right ) \, \sqrt{x^{2} + x + 1} - i + 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]