Optimal. Leaf size=76 \[ -\frac {\sqrt {x^2+2 x+4} (3-x)}{4 \left (x^2+2 x+3\right )}-\frac {\tan ^{-1}\left (\frac {x+1}{\sqrt {2} \sqrt {x^2+2 x+4}}\right )}{4 \sqrt {2}}+\tanh ^{-1}\left (\sqrt {x^2+2 x+4}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.07, 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 = {1016, 1025, 982, 204, 1024, 206} \[ -\frac {\sqrt {x^2+2 x+4} (3-x)}{4 \left (x^2+2 x+3\right )}-\frac {\tan ^{-1}\left (\frac {x+1}{\sqrt {2} \sqrt {x^2+2 x+4}}\right )}{4 \sqrt {2}}+\tanh ^{-1}\left (\sqrt {x^2+2 x+4}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 206
Rule 982
Rule 1016
Rule 1024
Rule 1025
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 \operatorname {Subst}\left (\int \frac {1}{2-2 x^2} \, dx,x,\sqrt {4+2 x+x^2}\right )+\operatorname {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.40, size = 146, normalized size = 1.92 \[ \frac {1}{32} \left (8 \left (\frac {\sqrt {x^2+2 x+4} (x-3)}{x^2+2 x+3}-2 \log \left (\left (x^2+2 x+3\right )^2\right )+2 \log \left (\left (x^2+2 x+3\right ) \left (x^2+2 \sqrt {x^2+2 x+4}+2 x+5\right )\right )\right )-4 \sqrt {2} \tan ^{-1}\left (\frac {\sqrt {2} \left (5 x^2+10 x+4\right )}{4 x^2+\left (11 \sqrt {x^2+2 x+4}+8\right ) x+11 \sqrt {x^2+2 x+4}+12}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [C] time = 1.68, size = 244, normalized size = 3.21 \[ \frac {\sqrt {x^2+2 x+4} (x-3)}{4 \left (x^2+2 x+3\right )}-i \tan ^{-1}\left (-\sqrt {\frac {1}{9}-\frac {2 i \sqrt {2}}{9}} \sqrt {x^2+2 x+4}+\sqrt {\frac {1}{9}-\frac {2 i \sqrt {2}}{9}} x+\sqrt {\frac {1}{9}-\frac {2 i \sqrt {2}}{9}}\right )+i \tan ^{-1}\left (-\sqrt {\frac {1}{9}+\frac {2 i \sqrt {2}}{9}} \sqrt {x^2+2 x+4}+\sqrt {\frac {1}{9}+\frac {2 i \sqrt {2}}{9}} x+\sqrt {\frac {1}{9}+\frac {2 i \sqrt {2}}{9}}\right )+\frac {\tan ^{-1}\left (\frac {x^2}{\sqrt {2}}-\frac {(x+1) \sqrt {x^2+2 x+4}}{\sqrt {2}}+\sqrt {2} x+\frac {3}{\sqrt {2}}\right )}{4 \sqrt {2}} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.57, size = 174, normalized size = 2.29 \[ \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 )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.66, size = 235, normalized size = 3.09 \[ \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 ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.72, size = 64, normalized size = 0.84
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 x +2\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 \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 )+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 )+\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 \[ \int \frac {2 \, x + 3}{\sqrt {x^{2} + 2 \, x + 4} {\left (x^{2} + 2 \, x + 3\right )}^{2}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {2\,x+3}{{\left (x^2+2\,x+3\right )}^2\,\sqrt {x^2+2\,x+4}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {2 x + 3}{\left (x^{2} + 2 x + 3\right )^{2} \sqrt {x^{2} + 2 x + 4}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________