Optimal. Leaf size=76 \[ -\frac {(3-x) \sqrt {4+2 x+x^2}}{4 \left (3+2 x+x^2\right )}-\frac {\tan ^{-1}\left (\frac {1+x}{\sqrt {2} \sqrt {4+2 x+x^2}}\right )}{4 \sqrt {2}}+\tanh ^{-1}\left (\sqrt {4+2 x+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {1030, 1039,
996, 210, 1038, 212} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {x+1}{\sqrt {2} \sqrt {x^2+2 x+4}}\right )}{4 \sqrt {2}}-\frac {\sqrt {x^2+2 x+4} (3-x)}{4 \left (x^2+2 x+3\right )}+\tanh ^{-1}\left (\sqrt {x^2+2 x+4}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 212
Rule 996
Rule 1030
Rule 1038
Rule 1039
Rubi steps
\begin {align*} \int \frac {3+2 x}{\left (3+2 x+x^2\right )^2 \sqrt {4+2 x+x^2}} \, dx &=-\frac {(3-x) \sqrt {4+2 x+x^2}}{4 \left (3+2 x+x^2\right )}+\frac {1}{8} \int \frac {-10-8 x}{\left (3+2 x+x^2\right ) \sqrt {4+2 x+x^2}} \, dx\\ &=-\frac {(3-x) \sqrt {4+2 x+x^2}}{4 \left (3+2 x+x^2\right )}-\frac {1}{4} \int \frac {1}{\left (3+2 x+x^2\right ) \sqrt {4+2 x+x^2}} \, dx-\frac {1}{2} \int \frac {2+2 x}{\left (3+2 x+x^2\right ) \sqrt {4+2 x+x^2}} \, dx\\ &=-\frac {(3-x) \sqrt {4+2 x+x^2}}{4 \left (3+2 x+x^2\right )}+2 \text {Subst}\left (\int \frac {1}{2-2 x^2} \, dx,x,\sqrt {4+2 x+x^2}\right )+\text {Subst}\left (\int \frac {1}{-16-2 x^2} \, dx,x,\frac {2+2 x}{\sqrt {4+2 x+x^2}}\right )\\ &=-\frac {(3-x) \sqrt {4+2 x+x^2}}{4 \left (3+2 x+x^2\right )}-\frac {\tan ^{-1}\left (\frac {2+2 x}{2 \sqrt {2} \sqrt {4+2 x+x^2}}\right )}{4 \sqrt {2}}+\tanh ^{-1}\left (\sqrt {4+2 x+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.43, size = 84, normalized size = 1.11 \begin {gather*} \frac {1}{8} \left (\frac {2 (-3+x) \sqrt {4+2 x+x^2}}{3+2 x+x^2}+\sqrt {2} \tan ^{-1}\left (\frac {3+2 x+x^2-(1+x) \sqrt {4+2 x+x^2}}{\sqrt {2}}\right )\right )+\tanh ^{-1}\left (\sqrt {4+2 x+x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.56, size = 123, normalized size = 1.62
method | result | size |
risch | \(\frac {\left (-3+x \right ) \sqrt {x^{2}+2 x +4}}{4 x^{2}+8 x +12}+\arctanh \left (\sqrt {x^{2}+2 x +4}\right )-\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \left (2+2 x \right )}{4 \sqrt {x^{2}+2 x +4}}\right )}{8}\) | \(64\) |
default | \(-\frac {1}{2 \left (\sqrt {x^{2}+2 x +4}+1\right )}+\frac {\ln \left (\sqrt {x^{2}+2 x +4}+1\right )}{2}-\frac {1}{2 \left (\sqrt {x^{2}+2 x +4}-1\right )}-\frac {\ln \left (\sqrt {x^{2}+2 x +4}-1\right )}{2}+\frac {\frac {3}{4}+\frac {3 x}{4}}{\sqrt {x^{2}+2 x +4}\, \left (\frac {\left (1+x \right )^{2}}{x^{2}+2 x +4}+2\right )}-\frac {\arctan \left (\frac {\left (1+x \right ) \sqrt {2}}{2 \sqrt {x^{2}+2 x +4}}\right ) \sqrt {2}}{8}\) | \(123\) |
trager | \(\frac {\left (-3+x \right ) \sqrt {x^{2}+2 x +4}}{4 x^{2}+8 x +12}+3 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) \ln \left (-\frac {-16128 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )^{2} x +320 \sqrt {x^{2}+2 x +4}\, \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )+5648 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -59 \sqrt {x^{2}+2 x +4}+1232 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )-494 x -209}{16 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -3 x -1}\right )-3 \ln \left (\frac {48384 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )^{2} x +960 \sqrt {x^{2}+2 x +4}\, \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )-15312 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -143 \sqrt {x^{2}+2 x +4}+3696 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )+1210 x -605}{48 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -7 x +3}\right ) \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )+\ln \left (\frac {48384 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )^{2} x +960 \sqrt {x^{2}+2 x +4}\, \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )-15312 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -143 \sqrt {x^{2}+2 x +4}+3696 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right )+1210 x -605}{48 \RootOf \left (384 \textit {\_Z}^{2}-128 \textit {\_Z} +11\right ) x -7 x +3}\right )\) | \(372\) |
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. 174 vs.
\(2 (61) = 122\).
time = 0.52, size = 174, normalized size = 2.29 \begin {gather*} \frac {\sqrt {2} {\left (x^{2} + 2 \, x + 3\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x + 2\right )} + \frac {1}{2} \, \sqrt {2} \sqrt {x^{2} + 2 \, x + 4}\right ) - \sqrt {2} {\left (x^{2} + 2 \, x + 3\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} x + \frac {1}{2} \, \sqrt {2} \sqrt {x^{2} + 2 \, x + 4}\right ) + 2 \, x^{2} - 4 \, {\left (x^{2} + 2 \, x + 3\right )} \log \left (x^{2} - \sqrt {x^{2} + 2 \, x + 4} {\left (x + 2\right )} + 3 \, x + 5\right ) + 4 \, {\left (x^{2} + 2 \, x + 3\right )} \log \left (x^{2} - \sqrt {x^{2} + 2 \, x + 4} x + x + 3\right ) + 2 \, \sqrt {x^{2} + 2 \, x + 4} {\left (x - 3\right )} + 4 \, x + 6}{8 \, {\left (x^{2} + 2 \, x + 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 + 3}{\left (x^{2} + 2 x + 3\right )^{2} \sqrt {x^{2} + 2 x + 4}}\, 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. 235 vs.
\(2 (61) = 122\).
time = 1.02, size = 235, normalized size = 3.09 \begin {gather*} \frac {1}{8} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x - \sqrt {x^{2} + 2 \, x + 4} + 2\right )}\right ) - \frac {1}{8} \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}\right ) + \frac {4 \, {\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{3} + 13 \, {\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{2} + 26 \, x - 26 \, \sqrt {x^{2} + 2 \, x + 4} + 26}{2 \, {\left ({\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{4} + 4 \, {\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{3} + 8 \, {\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{2} + 8 \, x - 8 \, \sqrt {x^{2} + 2 \, x + 4} + 12\right )}} - \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{2} + 4 \, x - 4 \, \sqrt {x^{2} + 2 \, x + 4} + 6\right ) + \frac {1}{2} \, \log \left ({\left (x - \sqrt {x^{2} + 2 \, x + 4}\right )}^{2} + 2\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+3}{{\left (x^2+2\,x+3\right )}^2\,\sqrt {x^2+2\,x+4}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________