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}} \]
________________________________________________________________________________________
Rubi [A] time = 0.10, 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 204
Rule 617
Rule 3124
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.06, 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]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.25, size = 38, normalized size = 0.72 \[ \frac {1}{6} \, \sqrt {3} \arctan \left (\frac {2 \, {\left ({\left (4 \, \sqrt {3} \cos \relax (x) + 3\right )} \sin \relax (x) + \sqrt {3} \cos \relax (x) + 3\right )}}{3 \, {\left (4 \, \cos \relax (x)^{2} - 3\right )}}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.64, size = 78, normalized size = 1.47 \[ \frac {{\left (x + 2 \, \arctan \left (\frac {\sqrt {3} \cos \relax (x) - 8 \, \sqrt {3} \sin \relax (x) + \sqrt {3} + 4 \, \cos \relax (x) + 7 \, \sin \relax (x) + 4}{8 \, \sqrt {3} \cos \relax (x) + \sqrt {3} \sin \relax (x) + 8 \, \sqrt {3} - 7 \, \cos \relax (x) + 4 \, \sin \relax (x) + 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]
[Out]
________________________________________________________________________________________
maple [A] time = 0.21, size = 43, normalized size = 0.81
method | result | size |
default | \(-\frac {52 \arctan \left (\frac {26 \tan \left (\frac {x}{2}\right )+2 \sqrt {3}+8}{16 \sqrt {3}+12}\right )}{\left (\sqrt {3}-4\right ) \left (16 \sqrt {3}+12\right )}\) | \(43\) |
risch | \(-\frac {i \sqrt {3}\, \ln \left (-\frac {i \sqrt {3}}{2}-\frac {3}{2}+i+\sqrt {3}+{\mathrm e}^{i x}\right )}{6}+\frac {i \sqrt {3}\, \ln \left ({\mathrm e}^{i x}+\frac {3}{2}+i+\sqrt {3}+\frac {i \sqrt {3}}{2}\right )}{6}\) | \(52\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.96, size = 27, normalized size = 0.51 \[ -\frac {1}{3} \, \sqrt {3} \arctan \left (\frac {1}{6} \, \sqrt {3} {\left (\frac {{\left (\sqrt {3} - 4\right )} \sin \relax (x)}{\cos \relax (x) + 1} - 1\right )}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.21, size = 23, normalized size = 0.43 \[ -\frac {\sqrt {12}\,\mathrm {atan}\left (\frac {\sqrt {12}\,\left (\mathrm {tan}\left (\frac {x}{2}\right )\,\left (\sqrt {3}-4\right )-1\right )}{12}\right )}{6} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 9.89, size = 107, normalized size = 2.02 \[ - \frac {71049062919648516608727362362371223166654224256969 \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 )}{-213147188758945549826182087087113669499962672770907 + 123060586806989187969890042718152127140914603059700 \sqrt {3}} + \frac {123060586806989187969890042718152127140914603059700 \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 )}{-213147188758945549826182087087113669499962672770907 + 123060586806989187969890042718152127140914603059700 \sqrt {3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________