Optimal. Leaf size=45 \[ \frac{x}{2 \sqrt{5}}+\frac{\tan ^{-1}\left (\frac{\sin (x)+2 \cos (x)}{2 \sin (x)-\cos (x)+2 \sqrt{5}+5}\right )}{\sqrt{5}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0242, antiderivative size = 45, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3124, 618, 204} \[ \frac{x}{2 \sqrt{5}}+\frac{\tan ^{-1}\left (\frac{\sin (x)+2 \cos (x)}{2 \sin (x)-\cos (x)+2 \sqrt{5}+5}\right )}{\sqrt{5}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3124
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{1}{5-\cos (x)+2 \sin (x)} \, dx &=2 \operatorname{Subst}\left (\int \frac{1}{4+4 x+6 x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-\left (4 \operatorname{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.0238248, size = 23, normalized size = 0.51 \[ \frac{\tan ^{-1}\left (\frac{3 \tan \left (\frac{x}{2}\right )+1}{\sqrt{5}}\right )}{\sqrt{5}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.035, size = 20, normalized size = 0.4 \begin{align*}{\frac{\sqrt{5}}{5}\arctan \left ({\frac{\sqrt{5}}{10} \left ( 6\,\tan \left ( x/2 \right ) +2 \right ) } \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.41722, size = 31, normalized size = 0.69 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.10643, size = 126, normalized size = 2.8 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.494684, size = 39, normalized size = 0.87 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09243, size = 63, normalized size = 1.4 \begin{align*} \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{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]