Optimal. Leaf size=53 \[ \frac {x}{2 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {\cos (x)-\sqrt {3} \sin (x)}{2 \left (2+\sqrt {3}\right )+\sqrt {3} \cos (x)+\sin (x)}\right )}{\sqrt {3}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, 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 = {3203, 631, 210}
\begin {gather*} \frac {\text {ArcTan}\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 (\left (3-4 \sqrt {3}\right ) \cos (x)\right )+2 \left (5+2 \sqrt {3}\right )}\right )}{\sqrt {3}}+\frac {x}{2 \sqrt {3}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 631
Rule 3203
Rubi steps
\begin {align*} \int \frac {1}{4+\sqrt {3} \cos (x)+\sin (x)} \, dx &=2 \text {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 \text {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.05, size = 33, normalized size = 0.62 \begin {gather*} -\frac {\tan ^{-1}\left (\frac {-1+\left (-4+\sqrt {3}\right ) \tan \left (\frac {x}{2}\right )}{2 \sqrt {3}}\right )}{\sqrt {3}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, 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}+\sqrt {3}-\frac {3}{2}+i+{\mathrm e}^{i x}\right )}{6}+\frac {i \sqrt {3}\, \ln \left ({\mathrm e}^{i x}+\sqrt {3}+\frac {3}{2}+i+\frac {i \sqrt {3}}{2}\right )}{6}\) | \(52\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.68, size = 27, normalized size = 0.51 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.46, size = 38, normalized size = 0.72 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs.
\(2 (48) = 96\).
time = 6.29, size = 107, normalized size = 2.02 \begin {gather*} - \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}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.63, size = 78, normalized size = 1.47 \begin {gather*} \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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.21, size = 23, normalized size = 0.43 \begin {gather*} -\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} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________