3.376 \(\int \frac{1}{4+\sqrt{3} \cos (x)+\sin (x)} \, dx\)

Optimal. Leaf size=53 \[ \frac{x}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{\cos (x)-\sqrt{3} \sin (x)}{\sin (x)+\sqrt{3} \cos (x)+2 \left (2+\sqrt{3}\right )}\right )}{\sqrt{3}} \]

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.196873, antiderivative size = 83, normalized size of antiderivative = 1.57, number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214 \[ \frac{x}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{\left (3-4 \sqrt{3}\right ) \sin (x)+\left (4-\sqrt{3}\right ) \cos (x)}{\left (4-\sqrt{3}\right ) \sin (x)-\left (3-4 \sqrt{3}\right ) \cos (x)+2 \left (5+2 \sqrt{3}\right )}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]  Int[(4 + Sqrt[3]*Cos[x] + Sin[x])^(-1),x]

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 1.05476, size = 31, normalized size = 0.58 \[ \frac{\sqrt{3} \operatorname{atan}{\left (\sqrt{3} \left (\left (- \frac{\sqrt{3}}{6} + \frac{2}{3}\right ) \tan{\left (\frac{x}{2} \right )} + \frac{1}{6}\right ) \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(4+sin(x)+cos(x)*3**(1/2)),x)

[Out]

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

_______________________________________________________________________________________

Mathematica [A]  time = 0.0795651, size = 33, normalized size = 0.62 \[ -\frac{\tan ^{-1}\left (\frac{\left (\sqrt{3}-4\right ) \tan \left (\frac{x}{2}\right )-1}{2 \sqrt{3}}\right )}{\sqrt{3}} \]

Antiderivative was successfully verified.

[In]  Integrate[(4 + Sqrt[3]*Cos[x] + Sin[x])^(-1),x]

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.075, size = 43, normalized size = 0.8 \[ -52\,{\frac{1}{ \left ( \sqrt{3}-4 \right ) \left ( 16\,\sqrt{3}+12 \right ) }\arctan \left ({\frac{26\,\tan \left ( x/2 \right ) +2\,\sqrt{3}+8}{16\,\sqrt{3}+12}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(4+sin(x)+cos(x)*3^(1/2)),x)

[Out]

-52/(3^(1/2)-4)/(16*3^(1/2)+12)*arctan((26*tan(1/2*x)+2*3^(1/2)+8)/(16*3^(1/2)+1
2))

_______________________________________________________________________________________

Maxima [A]  time = 1.48518, size = 36, normalized size = 0.68 \[ -\frac{1}{3} \, \sqrt{3} \arctan \left (\frac{1}{6} \, \sqrt{3}{\left (\frac{{\left (\sqrt{3} - 4\right )} \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/(sqrt(3)*cos(x) + sin(x) + 4),x, algorithm="maxima")

[Out]

-1/3*sqrt(3)*arctan(1/6*sqrt(3)*((sqrt(3) - 4)*sin(x)/(cos(x) + 1) - 1))

_______________________________________________________________________________________

Fricas [A]  time = 0.235278, size = 47, normalized size = 0.89 \[ -\frac{1}{6} \, \sqrt{3} \arctan \left (\frac{2 \,{\left (\sqrt{3} \sin \left (x\right ) + \sqrt{3} + 3 \, \cos \left (x\right )\right )}}{3 \,{\left (\sqrt{3} \sin \left (x\right ) - \cos \left (x\right )\right )}}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sqrt(3)*cos(x) + sin(x) + 4),x, algorithm="fricas")

[Out]

-1/6*sqrt(3)*arctan(2/3*(sqrt(3)*sin(x) + sqrt(3) + 3*cos(x))/(sqrt(3)*sin(x) -
cos(x)))

_______________________________________________________________________________________

Sympy [A]  time = 15.0299, size = 107, normalized size = 2.02 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(4+sin(x)+cos(x)*3**(1/2)),x)

[Out]

-5662812078512789246708733017828833613331363588145697134668285459880259664341133
28944938543235525204081038190652929785503682163799903899723386341595971933164152
35157911166753157023885854821578374471173305508724204664925117118228716789710429
927603063675376140172856876142393156348619730666418542364096027779*sqrt(3)*(atan
(-tan(x/2)/2 + 2*sqrt(3)*tan(x/2)/3 + sqrt(3)/6) + pi*floor((x/2 - pi/2)/pi))/(-
16988436235538367740126199053486500839994090764437091404004856379640778993023399
86834815629706575612243114571958789356511046491399711699170159024787915799492457
05473733500259471071657564464735123413519916526172613994775351354686150369131289
782809191026128420518570628427179469045859191999255627092288083337 + 98082782336
98869183561671643471985406071740824011875062169821715033023838412659385115939499
64504990885357835292787266602623350677722008627904618135612423279019163200506667
25669138625068301350591954612156741717254089207470474020581459508877066290149709
589443908724454027554596549165362939031865731186980004*sqrt(3)) + 98082782336988
69183561671643471985406071740824011875062169821715033023838412659385115939499645
04990885357835292787266602623350677722008627904618135612423279019163200506667256
69138625068301350591954612156741717254089207470474020581459508877066290149709589
443908724454027554596549165362939031865731186980004*(atan(-tan(x/2)/2 + 2*sqrt(3
)*tan(x/2)/3 + sqrt(3)/6) + pi*floor((x/2 - pi/2)/pi))/(-16988436235538367740126
19905348650083999409076443709140400485637964077899302339986834815629706575612243
11457195878935651104649139971169917015902478791579949245705473733500259471071657
56446473512341351991652617261399477535135468615036913128978280919102612842051857
0628427179469045859191999255627092288083337 + 9808278233698869183561671643471985
40607174082401187506216982171503302383841265938511593949964504990885357835292787
26660262335067772200862790461813561242327901916320050666725669138625068301350591
95461215674171725408920747047402058145950887706629014970958944390872445402755459
6549165362939031865731186980004*sqrt(3))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.211906, size = 105, normalized size = 1.98 \[ \frac{{\left (x + 2 \, \arctan \left (\frac{\sqrt{3} \cos \left (x\right ) - 8 \, \sqrt{3} \sin \left (x\right ) + \sqrt{3} + 4 \, \cos \left (x\right ) + 7 \, \sin \left (x\right ) + 4}{8 \, \sqrt{3} \cos \left (x\right ) + \sqrt{3} \sin \left (x\right ) + 8 \, \sqrt{3} - 7 \, \cos \left (x\right ) + 4 \, \sin \left (x\right ) + 19}\right )\right )}{\left (\sqrt{3} + 4\right )}}{2 \,{\left (4 \, \sqrt{3} + 3\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(sqrt(3)*cos(x) + sin(x) + 4),x, algorithm="giac")

[Out]

1/2*(x + 2*arctan((sqrt(3)*cos(x) - 8*sqrt(3)*sin(x) + sqrt(3) + 4*cos(x) + 7*si
n(x) + 4)/(8*sqrt(3)*cos(x) + sqrt(3)*sin(x) + 8*sqrt(3) - 7*cos(x) + 4*sin(x) +
 19)))*(sqrt(3) + 4)/(4*sqrt(3) + 3)