Optimal. Leaf size=45 \[ \frac {x}{2 \sqrt {5}}+\frac {\tan ^{-1}\left (\frac {2 \cos (x)+\sin (x)}{5+2 \sqrt {5}-\cos (x)+2 \sin (x)}\right )}{\sqrt {5}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3203, 632, 210}
\begin {gather*} \frac {\text {ArcTan}\left (\frac {\sin (x)+2 \cos (x)}{2 \sin (x)-\cos (x)+2 \sqrt {5}+5}\right )}{\sqrt {5}}+\frac {x}{2 \sqrt {5}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 3203
Rubi steps
\begin {align*} \int \frac {1}{5-\cos (x)+2 \sin (x)} \, dx &=2 \text {Subst}\left (\int \frac {1}{4+4 x+6 x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )\\ &=-\left (4 \text {Subst}\left (\int \frac {1}{-80-x^2} \, dx,x,4+12 \tan \left (\frac {x}{2}\right )\right )\right )\\ &=\frac {x}{2 \sqrt {5}}+\frac {\tan ^{-1}\left (\frac {2 \cos (x)+\sin (x)}{5+2 \sqrt {5}-\cos (x)+2 \sin (x)}\right )}{\sqrt {5}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 23, normalized size = 0.51 \begin {gather*} \frac {\tan ^{-1}\left (\frac {1+3 \tan \left (\frac {x}{2}\right )}{\sqrt {5}}\right )}{\sqrt {5}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 20, normalized size = 0.44
method | result | size |
default | \(\frac {\sqrt {5}\, \arctan \left (\frac {\left (6 \tan \left (\frac {x}{2}\right )+2\right ) \sqrt {5}}{10}\right )}{5}\) | \(20\) |
risch | \(\frac {i \sqrt {5}\, \ln \left ({\mathrm e}^{i x}-1+2 i+\frac {4 i \sqrt {5}}{5}-\frac {2 \sqrt {5}}{5}\right )}{10}-\frac {i \sqrt {5}\, \ln \left ({\mathrm e}^{i x}-1+2 i-\frac {4 i \sqrt {5}}{5}+\frac {2 \sqrt {5}}{5}\right )}{10}\) | \(56\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.99, size = 23, normalized size = 0.51 \begin {gather*} \frac {1}{5} \, \sqrt {5} \arctan \left (\frac {1}{5} \, \sqrt {5} {\left (\frac {3 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.92, size = 36, normalized size = 0.80 \begin {gather*} \frac {1}{10} \, \sqrt {5} \arctan \left (-\frac {\sqrt {5} \cos \left (x\right ) - 2 \, \sqrt {5} \sin \left (x\right ) - \sqrt {5}}{2 \, {\left (2 \, \cos \left (x\right ) + \sin \left (x\right )\right )}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.18, size = 39, normalized size = 0.87 \begin {gather*} \frac {\sqrt {5} \left (\operatorname {atan}{\left (\frac {3 \sqrt {5} \tan {\left (\frac {x}{2} \right )}}{5} + \frac {\sqrt {5}}{5} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.44, size = 47, normalized size = 1.04 \begin {gather*} \frac {1}{10} \, \sqrt {5} {\left (x + 2 \, \arctan \left (-\frac {\sqrt {5} \sin \left (x\right ) - \cos \left (x\right ) - 3 \, \sin \left (x\right ) - 1}{\sqrt {5} \cos \left (x\right ) + \sqrt {5} - 3 \, \cos \left (x\right ) + \sin \left (x\right ) + 3}\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.10, size = 21, normalized size = 0.47 \begin {gather*} \frac {\sqrt {20}\,\mathrm {atan}\left (\frac {3\,\sqrt {20}\,\mathrm {tan}\left (\frac {x}{2}\right )}{10}+\frac {\sqrt {20}}{10}\right )}{10} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________