Optimal. Leaf size=126 \[ -\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \tan ^{-1}\left (\frac {2 \sqrt {5}-\left (5+\sqrt {5}\right ) x}{\sqrt {10 \left (1+\sqrt {5}\right )} \sqrt {2+2 x+x^2}}\right )-\sqrt {\frac {1}{2} \left (-1+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {2 \sqrt {5}+\left (5-\sqrt {5}\right ) x}{\sqrt {10 \left (-1+\sqrt {5}\right )} \sqrt {2+2 x+x^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {1050, 1044,
213, 209} \begin {gather*} -\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \text {ArcTan}\left (\frac {2 \sqrt {5}-\left (5+\sqrt {5}\right ) x}{\sqrt {10 \left (1+\sqrt {5}\right )} \sqrt {x^2+2 x+2}}\right )-\sqrt {\frac {1}{2} \left (\sqrt {5}-1\right )} \tanh ^{-1}\left (\frac {\left (5-\sqrt {5}\right ) x+2 \sqrt {5}}{\sqrt {10 \left (\sqrt {5}-1\right )} \sqrt {x^2+2 x+2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 213
Rule 1044
Rule 1050
Rubi steps
\begin {align*} \int \frac {1+2 x}{\left (1+x^2\right ) \sqrt {2+2 x+x^2}} \, dx &=-\frac {\int \frac {-5-\sqrt {5}-2 \sqrt {5} x}{\left (1+x^2\right ) \sqrt {2+2 x+x^2}} \, dx}{2 \sqrt {5}}+\frac {\int \frac {-5+\sqrt {5}+2 \sqrt {5} x}{\left (1+x^2\right ) \sqrt {2+2 x+x^2}} \, dx}{2 \sqrt {5}}\\ &=\left (2 \left (5-\sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{20 \left (1-\sqrt {5}\right )+2 x^2} \, dx,x,\frac {2 \sqrt {5}+\left (5-\sqrt {5}\right ) x}{\sqrt {2+2 x+x^2}}\right )+\left (2 \left (5+\sqrt {5}\right )\right ) \text {Subst}\left (\int \frac {1}{20 \left (1+\sqrt {5}\right )+2 x^2} \, dx,x,\frac {-2 \sqrt {5}+\left (5+\sqrt {5}\right ) x}{\sqrt {2+2 x+x^2}}\right )\\ &=-\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \tan ^{-1}\left (\frac {2 \sqrt {5}-\left (5+\sqrt {5}\right ) x}{\sqrt {10 \left (1+\sqrt {5}\right )} \sqrt {2+2 x+x^2}}\right )-\sqrt {\frac {1}{2} \left (-1+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {2 \sqrt {5}+\left (5-\sqrt {5}\right ) x}{\sqrt {10 \left (-1+\sqrt {5}\right )} \sqrt {2+2 x+x^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 0.13, size = 97, normalized size = 0.77 \begin {gather*} \text {RootSum}\left [8-8 \text {$\#$1}+\text {$\#$1}^4\&,\frac {-\log \left (-x+\sqrt {2+2 x+x^2}-\text {$\#$1}\right )-\log \left (-x+\sqrt {2+2 x+x^2}-\text {$\#$1}\right ) \text {$\#$1}+\log \left (-x+\sqrt {2+2 x+x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{-2+\text {$\#$1}^3}\&\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(752\) vs.
\(2(94)=188\).
time = 0.77, size = 753, normalized size = 5.98 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 770 vs.
\(2 (93) = 186\).
time = 0.38, size = 770, normalized size = 6.11 \begin {gather*} \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {\sqrt {5} + 5} \arctan \left (\frac {1}{200} \, \sqrt {20 \, x^{2} - 20 \, \sqrt {x^{2} + 2 \, x + 2} x - {\left (2 \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {x^{2} + 2 \, x + 2} - 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} - 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} + 20 \, x + 10 \, \sqrt {5} + 30} {\left (\sqrt {10} {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} - \sqrt {2}\right )} + 2 \cdot 5^{\frac {3}{4}} \sqrt {2}\right )} \sqrt {\sqrt {5} + 5} + 10 \, \sqrt {10} {\left (\sqrt {5} + 3\right )}\right )} + \frac {1}{10} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x + 1\right )} + 5\right )} + \frac {1}{2} \, \sqrt {5} x + \frac {1}{20} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} x - \sqrt {2} {\left (x - 2\right )}\right )} - \sqrt {x^{2} + 2 \, x + 2} {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} - \sqrt {2}\right )} + 2 \cdot 5^{\frac {3}{4}} \sqrt {2}\right )} + 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} + 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} - \frac {1}{2} \, \sqrt {x^{2} + 2 \, x + 2} {\left (\sqrt {5} + 3\right )} + \frac {1}{2} \, x + 1\right ) + \frac {1}{5} \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {\sqrt {5} + 5} \arctan \left (\frac {1}{200} \, \sqrt {20 \, x^{2} - 20 \, \sqrt {x^{2} + 2 \, x + 2} x + {\left (2 \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {x^{2} + 2 \, x + 2} - 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} - 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} + 20 \, x + 10 \, \sqrt {5} + 30} {\left (\sqrt {10} {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} - \sqrt {2}\right )} + 2 \cdot 5^{\frac {3}{4}} \sqrt {2}\right )} \sqrt {\sqrt {5} + 5} - 10 \, \sqrt {10} {\left (\sqrt {5} + 3\right )}\right )} - \frac {1}{10} \, \sqrt {5} {\left (\sqrt {5} {\left (2 \, x + 1\right )} + 5\right )} - \frac {1}{2} \, \sqrt {5} x + \frac {1}{20} \, {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} x - \sqrt {2} {\left (x - 2\right )}\right )} - \sqrt {x^{2} + 2 \, x + 2} {\left (5^{\frac {3}{4}} {\left (\sqrt {5} \sqrt {2} - \sqrt {2}\right )} + 2 \cdot 5^{\frac {3}{4}} \sqrt {2}\right )} + 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} + 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} + \frac {1}{2} \, \sqrt {x^{2} + 2 \, x + 2} {\left (\sqrt {5} + 3\right )} - \frac {1}{2} \, x - 1\right ) + \frac {1}{40} \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} - 5 \, \sqrt {2}\right )} \sqrt {\sqrt {5} + 5} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + 2 \, x + 2} x + \frac {1}{10} \, {\left (2 \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {x^{2} + 2 \, x + 2} - 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} - 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} + 2 \, x + \sqrt {5} + 3\right ) - \frac {1}{40} \cdot 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} - 5 \, \sqrt {2}\right )} \sqrt {\sqrt {5} + 5} \log \left (2 \, x^{2} - 2 \, \sqrt {x^{2} + 2 \, x + 2} x - \frac {1}{10} \, {\left (2 \cdot 5^{\frac {3}{4}} \sqrt {2} \sqrt {x^{2} + 2 \, x + 2} - 5^{\frac {1}{4}} {\left (\sqrt {5} \sqrt {2} {\left (2 \, x + 1\right )} - 5 \, \sqrt {2}\right )}\right )} \sqrt {\sqrt {5} + 5} + 2 \, x + \sqrt {5} + 3\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {2 x + 1}{\left (x^{2} + 1\right ) \sqrt {x^{2} + 2 x + 2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 444 vs.
\(2 (93) = 186\).
time = 2.26, size = 444, normalized size = 3.52 \begin {gather*} \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 2} \log \left (256 \, {\left (\sqrt {5} {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} - 2 \, x + \sqrt {5} \sqrt {\sqrt {5} - 2} + \sqrt {5} + 2 \, \sqrt {x^{2} + 2 \, x + 2} - 2 \, \sqrt {\sqrt {5} - 2} - 2\right )}^{2} + 256 \, {\left (\sqrt {5} {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} - 2 \, x - \sqrt {5} + 2 \, \sqrt {x^{2} + 2 \, x + 2} + \sqrt {\sqrt {5} - 2} + 2\right )}^{2}\right ) - \frac {1}{4} \, \sqrt {2 \, \sqrt {5} - 2} \log \left (256 \, {\left (\sqrt {5} {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} - 2 \, x - \sqrt {5} \sqrt {\sqrt {5} - 2} + \sqrt {5} + 2 \, \sqrt {x^{2} + 2 \, x + 2} + 2 \, \sqrt {\sqrt {5} - 2} - 2\right )}^{2} + 256 \, {\left (\sqrt {5} {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} - 2 \, x - \sqrt {5} + 2 \, \sqrt {x^{2} + 2 \, x + 2} - \sqrt {\sqrt {5} - 2} + 2\right )}^{2}\right ) + \frac {{\left (\pi + 4 \, \arctan \left (\frac {1}{2} \, {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} {\left (2 \, \sqrt {5} \sqrt {\sqrt {5} - 2} + \sqrt {5} + 4 \, \sqrt {\sqrt {5} - 2} + 3\right )} + \frac {3}{2} \, \sqrt {5} \sqrt {\sqrt {5} - 2} + \frac {1}{2} \, \sqrt {5} + \frac {7}{2} \, \sqrt {\sqrt {5} - 2} + \frac {3}{2}\right )\right )} \sqrt {2 \, \sqrt {5} - 2}}{4 \, {\left (\sqrt {5} - 1\right )}} - \frac {{\left (\pi + 4 \, \arctan \left (-\frac {1}{2} \, {\left (x - \sqrt {x^{2} + 2 \, x + 2}\right )} {\left (2 \, \sqrt {5} \sqrt {\sqrt {5} - 2} - \sqrt {5} + 4 \, \sqrt {\sqrt {5} - 2} - 3\right )} - \frac {3}{2} \, \sqrt {5} \sqrt {\sqrt {5} - 2} + \frac {1}{2} \, \sqrt {5} - \frac {7}{2} \, \sqrt {\sqrt {5} - 2} + \frac {3}{2}\right )\right )} \sqrt {2 \, \sqrt {5} - 2}}{4 \, {\left (\sqrt {5} - 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {2\,x+1}{\left (x^2+1\right )\,\sqrt {x^2+2\,x+2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________