Optimal. Leaf size=24 \[ 2 \sqrt {-2+x}-4 \tan ^{-1}\left (\frac {\sqrt {-2+x}}{2}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.00, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {52, 65, 209}
\begin {gather*} 2 \sqrt {x-2}-4 \tan ^{-1}\left (\frac {\sqrt {x-2}}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 209
Rubi steps
\begin {align*} \int \frac {\sqrt {-2+x}}{2+x} \, dx &=2 \sqrt {-2+x}-4 \int \frac {1}{\sqrt {-2+x} (2+x)} \, dx\\ &=2 \sqrt {-2+x}-8 \text {Subst}\left (\int \frac {1}{4+x^2} \, dx,x,\sqrt {-2+x}\right )\\ &=2 \sqrt {-2+x}-4 \tan ^{-1}\left (\frac {\sqrt {-2+x}}{2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 24, normalized size = 1.00 \begin {gather*} 2 \sqrt {-2+x}-4 \tan ^{-1}\left (\frac {\sqrt {-2+x}}{2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 2.82, size = 111, normalized size = 4.62 \begin {gather*} \text {Piecewise}\left [\left \{\left \{\frac {2 I \left (x \sqrt {\frac {2-x}{2+x}}-2 \text {ArcCosh}\left [\frac {2}{\sqrt {2+x}}\right ] \sqrt {2+x}+2 \sqrt {\frac {2-x}{2+x}}\right )}{\sqrt {2+x}},\frac {1}{\text {Abs}\left [2+x\right ]}>\frac {1}{4}\right \}\right \},\frac {-8}{\sqrt {1-\frac {4}{2+x}} \sqrt {2+x}}+\frac {2 \sqrt {2+x}}{\sqrt {1-\frac {4}{2+x}}}+4 \text {ArcSin}\left [\frac {2}{\sqrt {2+x}}\right ]\right ] \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 19, normalized size = 0.79
method | result | size |
derivativedivides | \(-4 \arctan \left (\frac {\sqrt {-2+x}}{2}\right )+2 \sqrt {-2+x}\) | \(19\) |
default | \(-4 \arctan \left (\frac {\sqrt {-2+x}}{2}\right )+2 \sqrt {-2+x}\) | \(19\) |
risch | \(-4 \arctan \left (\frac {\sqrt {-2+x}}{2}\right )+2 \sqrt {-2+x}\) | \(19\) |
trager | \(2 \sqrt {-2+x}+2 \RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (\frac {\RootOf \left (\textit {\_Z}^{2}+1\right ) x +4 \sqrt {-2+x}-6 \RootOf \left (\textit {\_Z}^{2}+1\right )}{2+x}\right )\) | \(48\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.38, size = 18, normalized size = 0.75 \begin {gather*} 2 \, \sqrt {x - 2} - 4 \, \arctan \left (\frac {1}{2} \, \sqrt {x - 2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.32, size = 18, normalized size = 0.75 \begin {gather*} 2 \, \sqrt {x - 2} - 4 \, \arctan \left (\frac {1}{2} \, \sqrt {x - 2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 0.60, size = 109, normalized size = 4.54 \begin {gather*} \begin {cases} - 4 i \operatorname {acosh}{\left (\frac {2}{\sqrt {x + 2}} \right )} - \frac {2 i \sqrt {x + 2}}{\sqrt {-1 + \frac {4}{x + 2}}} + \frac {8 i}{\sqrt {-1 + \frac {4}{x + 2}} \sqrt {x + 2}} & \text {for}\: \frac {1}{\left |{x + 2}\right |} > \frac {1}{4} \\4 \operatorname {asin}{\left (\frac {2}{\sqrt {x + 2}} \right )} + \frac {2 \sqrt {x + 2}}{\sqrt {1 - \frac {4}{x + 2}}} - \frac {8}{\sqrt {1 - \frac {4}{x + 2}} \sqrt {x + 2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 24, normalized size = 1.00 \begin {gather*} 2 \sqrt {x-2}-4 \arctan \left (\frac {\sqrt {x-2}}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.04, size = 18, normalized size = 0.75 \begin {gather*} 2\,\sqrt {x-2}-4\,\mathrm {atan}\left (\frac {\sqrt {x-2}}{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________