Optimal. Leaf size=83 \[ -\frac {2}{1-x-\sqrt {-3-2 x+x^2}}+\frac {3}{2 \left (x+\sqrt {-3-2 x+x^2}\right )}+4 \log \left (1-x-\sqrt {-3-2 x+x^2}\right )-4 \log \left (x+\sqrt {-3-2 x+x^2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2141, 907}
\begin {gather*} -\frac {2}{-\sqrt {x^2-2 x-3}-x+1}+\frac {3}{2 \left (\sqrt {x^2-2 x-3}+x\right )}+4 \log \left (-\sqrt {x^2-2 x-3}-x+1\right )-4 \log \left (\sqrt {x^2-2 x-3}+x\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 907
Rule 2141
Rubi steps
\begin {align*} \int \frac {1}{\left (x+\sqrt {-3-2 x+x^2}\right )^2} \, dx &=2 \text {Subst}\left (\int \frac {-3-2 x+x^2}{x^2 (-2+2 x)^2} \, dx,x,x+\sqrt {-3-2 x+x^2}\right )\\ &=2 \text {Subst}\left (\int \left (-\frac {1}{(-1+x)^2}+\frac {2}{-1+x}-\frac {3}{4 x^2}-\frac {2}{x}\right ) \, dx,x,x+\sqrt {-3-2 x+x^2}\right )\\ &=-\frac {2}{1-x-\sqrt {-3-2 x+x^2}}+\frac {3}{2 \left (x+\sqrt {-3-2 x+x^2}\right )}+4 \log \left (1-x-\sqrt {-3-2 x+x^2}\right )-4 \log \left (x+\sqrt {-3-2 x+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.31, size = 69, normalized size = 0.83 \begin {gather*} \frac {-9+6 x+4 x^2-4 (3+x) \sqrt {-3-2 x+x^2}-32 (3+2 x) \tanh ^{-1}\left (\frac {1+x}{2+2 x+\sqrt {-3-2 x+x^2}}\right )}{4 (3+2 x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 118, normalized size = 1.42
method | result | size |
trager | \(\frac {\left (3+x \right ) x}{3+2 x}-\frac {\left (3+x \right ) \sqrt {x^{2}-2 x -3}}{3+2 x}+4 \ln \left (-\frac {\sqrt {x^{2}-2 x -3}+3+x}{3+2 x}\right )\) | \(61\) |
default | \(-2 \ln \left (3+2 x \right )+\frac {x}{2}-\frac {9}{4 \left (3+2 x \right )}-\frac {\left (\left (\frac {3}{2}+x \right )^{2}-5 x -\frac {21}{4}\right )^{\frac {3}{2}}}{3 \left (\frac {3}{2}+x \right )}-\frac {2 \sqrt {4 \left (\frac {3}{2}+x \right )^{2}-20 x -21}}{3}+2 \ln \left (-1+x +\sqrt {\left (\frac {3}{2}+x \right )^{2}-5 x -\frac {21}{4}}\right )+2 \arctanh \left (\frac {-2-\frac {10 x}{3}}{\sqrt {4 \left (\frac {3}{2}+x \right )^{2}-20 x -21}}\right )+\frac {\left (-2+2 x \right ) \sqrt {\left (\frac {3}{2}+x \right )^{2}-5 x -\frac {21}{4}}}{6}\) | \(118\) |
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 [A]
time = 0.33, size = 97, normalized size = 1.17 \begin {gather*} \frac {4 \, x^{2} - 8 \, {\left (2 \, x + 3\right )} \log \left (x^{2} - \sqrt {x^{2} - 2 \, x - 3} {\left (x + 1\right )} - 3\right ) - 8 \, {\left (2 \, x + 3\right )} \log \left (2 \, x + 3\right ) + 8 \, {\left (2 \, x + 3\right )} \log \left (-x + \sqrt {x^{2} - 2 \, x - 3}\right ) - 4 \, \sqrt {x^{2} - 2 \, x - 3} {\left (x + 3\right )} + 2 \, x - 15}{4 \, {\left (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 {1}{\left (x + \sqrt {x^{2} - 2 x - 3}\right )^{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. 143 vs.
\(2 (69) = 138\).
time = 1.91, size = 143, normalized size = 1.72 \begin {gather*} \frac {1}{2} \, x - \frac {1}{2} \, \sqrt {x^{2} - 2 \, x - 3} - \frac {3 \, {\left (5 \, x - 5 \, \sqrt {x^{2} - 2 \, x - 3} + 3\right )}}{4 \, {\left ({\left (x - \sqrt {x^{2} - 2 \, x - 3}\right )}^{2} + 3 \, x - 3 \, \sqrt {x^{2} - 2 \, x - 3}\right )}} - \frac {9}{4 \, {\left (2 \, x + 3\right )}} - 2 \, \log \left ({\left | 2 \, x + 3 \right |}\right ) - 2 \, \log \left ({\left | -x + \sqrt {x^{2} - 2 \, x - 3} + 1 \right |}\right ) + 2 \, \log \left ({\left | -x + \sqrt {x^{2} - 2 \, x - 3} \right |}\right ) - 2 \, \log \left ({\left | -x + \sqrt {x^{2} - 2 \, x - 3} - 3 \right |}\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 {1}{{\left (x+\sqrt {x^2-2\,x-3}\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________