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]
________________________________________________________________________________________
Rubi [A] time = 0.0981272, 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, Rules used = {3124, 617, 204} \[ \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]
[Out]
Rule 3124
Rule 617
Rule 204
Rubi steps
\begin{align*} \int \frac{1}{4+\sqrt{3} \cos (x)+\sin (x)} \, dx &=2 \operatorname{Subst}\left (\int \frac{1}{4+\sqrt{3}+2 x+\left (4-\sqrt{3}\right ) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-\left (2 \operatorname{Subst}\left (\int \frac{1}{-12-x^2} \, dx,x,1+\left (4-\sqrt{3}\right ) \tan \left (\frac{x}{2}\right )\right )\right )\\ &=\frac{x}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{\left (4-\sqrt{3}\right ) \cos (x)+\left (3-4 \sqrt{3}\right ) \sin (x)}{2 \left (5+2 \sqrt{3}\right )-\left (3-4 \sqrt{3}\right ) \cos (x)+\left (4-\sqrt{3}\right ) \sin (x)}\right )}{\sqrt{3}}\\ \end{align*}
Mathematica [A] time = 0.0586049, 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]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 43, normalized size = 0.8 \begin{align*} -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 ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.41039, size = 36, normalized size = 0.68 \begin{align*} -\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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.36854, size = 128, normalized size = 2.42 \begin{align*} \frac{1}{6} \, \sqrt{3} \arctan \left (\frac{2 \,{\left ({\left (4 \, \sqrt{3} \cos \left (x\right ) + 3\right )} \sin \left (x\right ) + \sqrt{3} \cos \left (x\right ) + 3\right )}}{3 \,{\left (4 \, \cos \left (x\right )^{2} - 3\right )}}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 8.79338, size = 107, normalized size = 2.02 \begin{align*} - \frac{32740422521042607546022212148053452119318508626030927624231148228935405286489175211319301372839079350465571750721183129 \sqrt{3} \left (\operatorname{atan}{\left (- \frac{\tan{\left (\frac{x}{2} \right )}}{2} + \frac{2 \sqrt{3} \tan{\left (\frac{x}{2} \right )}}{3} + \frac{\sqrt{3}}{6} \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{-98221267563127822638066636444160356357955525878092782872693444686806215859467525633957904118517238051396715252163549387 + 56708075267718105834187832387484068077733602149839287127746937933009385700734375614806821267782634833770441526627045716 \sqrt{3}} + \frac{56708075267718105834187832387484068077733602149839287127746937933009385700734375614806821267782634833770441526627045716 \left (\operatorname{atan}{\left (- \frac{\tan{\left (\frac{x}{2} \right )}}{2} + \frac{2 \sqrt{3} \tan{\left (\frac{x}{2} \right )}}{3} + \frac{\sqrt{3}}{6} \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{-98221267563127822638066636444160356357955525878092782872693444686806215859467525633957904118517238051396715252163549387 + 56708075267718105834187832387484068077733602149839287127746937933009385700734375614806821267782634833770441526627045716 \sqrt{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.06747, size = 105, normalized size = 1.98 \begin{align*} \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 )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]