3.140 \(\int \frac{1}{5-\cos (x)+2 \sin (x)} \, dx\)

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]

x/(2*Sqrt[5]) + ArcTan[(2*Cos[x] + Sin[x])/(5 + 2*Sqrt[5] - Cos[x] + 2*Sin[x])]/
Sqrt[5]

_______________________________________________________________________________________

Rubi [A]  time = 0.0839133, 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 \[ \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]  Int[(5 - Cos[x] + 2*Sin[x])^(-1),x]

[Out]

x/(2*Sqrt[5]) + ArcTan[(2*Cos[x] + Sin[x])/(5 + 2*Sqrt[5] - Cos[x] + 2*Sin[x])]/
Sqrt[5]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 0.801627, size = 24, normalized size = 0.53 \[ \frac{\sqrt{5} \operatorname{atan}{\left (\sqrt{5} \left (\frac{3 \tan{\left (\frac{x}{2} \right )}}{5} + \frac{1}{5}\right ) \right )}}{5} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(5-cos(x)+2*sin(x)),x)

[Out]

sqrt(5)*atan(sqrt(5)*(3*tan(x/2)/5 + 1/5))/5

_______________________________________________________________________________________

Mathematica [A]  time = 0.0346503, 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]  Integrate[(5 - Cos[x] + 2*Sin[x])^(-1),x]

[Out]

ArcTan[(1 + 3*Tan[x/2])/Sqrt[5]]/Sqrt[5]

_______________________________________________________________________________________

Maple [A]  time = 0.053, size = 20, normalized size = 0.4 \[{\frac{\sqrt{5}}{5}\arctan \left ({\frac{\sqrt{5}}{10} \left ( 6\,\tan \left ( x/2 \right ) +2 \right ) } \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(5-cos(x)+2*sin(x)),x)

[Out]

1/5*5^(1/2)*arctan(1/10*(6*tan(1/2*x)+2)*5^(1/2))

_______________________________________________________________________________________

Maxima [A]  time = 1.60667, size = 31, normalized size = 0.69 \[ \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-1/(cos(x) - 2*sin(x) - 5),x, algorithm="maxima")

[Out]

1/5*sqrt(5)*arctan(1/5*sqrt(5)*(3*sin(x)/(cos(x) + 1) + 1))

_______________________________________________________________________________________

Fricas [A]  time = 0.220963, size = 49, normalized size = 1.09 \[ \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-1/(cos(x) - 2*sin(x) - 5),x, algorithm="fricas")

[Out]

1/10*sqrt(5)*arctan(-1/2*(sqrt(5)*cos(x) - 2*sqrt(5)*sin(x) - sqrt(5))/(2*cos(x)
 + sin(x)))

_______________________________________________________________________________________

Sympy [A]  time = 0.835013, size = 39, normalized size = 0.87 \[ \frac{\sqrt{5} \left (\operatorname{atan}{\left (\frac{3 \sqrt{5} \tan{\left (\frac{x}{2} \right )}}{5} + \frac{\sqrt{5}}{5} \right )} + \pi \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\rfloor \right )}{5} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(5-cos(x)+2*sin(x)),x)

[Out]

sqrt(5)*(atan(3*sqrt(5)*tan(x/2)/5 + sqrt(5)/5) + pi*floor((x/2 - pi/2)/pi))/5

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.215703, size = 63, normalized size = 1.4 \[ \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 )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(-1/(cos(x) - 2*sin(x) - 5),x, algorithm="giac")

[Out]

1/10*sqrt(5)*(x + 2*arctan(-(sqrt(5)*sin(x) - cos(x) - 3*sin(x) - 1)/(sqrt(5)*co
s(x) + sqrt(5) - 3*cos(x) + sin(x) + 3)))