Optimal. Leaf size=64 \[ -\frac {x}{2 \sqrt {3}}+\frac {1}{2} \log (\sin (x))+\frac {\tan ^{-1}\left (\frac {1-2 \cos ^2(x)}{2 \sin (x) \cos (x)+\sqrt {3}+2}\right )}{2 \sqrt {3}}-\frac {1}{4} \log (\sin (x) \cos (x)+1) \]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 65, normalized size of antiderivative = 1.02, number of steps used = 7, number of rules used = 6, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.546, Rules used = {705, 29, 634, 618, 204, 628} \[ -\frac {x}{2 \sqrt {3}}-\frac {1}{4} \log \left (\tan ^2(x)+\tan (x)+1\right )+\frac {1}{2} \log (\tan (x))+\frac {\tan ^{-1}\left (\frac {1-2 \cos ^2(x)}{2 \sin (x) \cos (x)+\sqrt {3}+2}\right )}{2 \sqrt {3}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 204
Rule 618
Rule 628
Rule 634
Rule 705
Rubi steps
\begin {align*} \int \frac {\cot (x)}{2+\sin (2 x)} \, dx &=\operatorname {Subst}\left (\int \frac {1}{x \left (2+2 x+2 x^2\right )} \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,\tan (x)\right )+\frac {1}{2} \operatorname {Subst}\left (\int \frac {-2-2 x}{2+2 x+2 x^2} \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \log (\tan (x))-\frac {1}{4} \operatorname {Subst}\left (\int \frac {2+4 x}{2+2 x+2 x^2} \, dx,x,\tan (x)\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{2+2 x+2 x^2} \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \log (\tan (x))-\frac {1}{4} \log \left (1+\tan (x)+\tan ^2(x)\right )+\operatorname {Subst}\left (\int \frac {1}{-12-x^2} \, dx,x,2+4 \tan (x)\right )\\ &=-\frac {x}{2 \sqrt {3}}+\frac {\tan ^{-1}\left (\frac {1-2 \cos ^2(x)}{2+\sqrt {3}+2 \cos (x) \sin (x)}\right )}{2 \sqrt {3}}+\frac {1}{2} \log (\tan (x))-\frac {1}{4} \log \left (1+\tan (x)+\tan ^2(x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 39, normalized size = 0.61 \[ \frac {1}{12} \left (-2 \sqrt {3} \tan ^{-1}\left (\frac {2 \tan (x)+1}{\sqrt {3}}\right )+6 \log (\sin (x))-3 \log (\sin (2 x)+2)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.12, size = 64, normalized size = 1.00 \[ -\frac {1}{12} \, \sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} \cos \relax (x) \sin \relax (x) + \sqrt {3}}{3 \, {\left (2 \, \cos \relax (x)^{2} - 1\right )}}\right ) - \frac {1}{8} \, \log \left (-\cos \relax (x)^{4} + \cos \relax (x)^{2} + 2 \, \cos \relax (x) \sin \relax (x) + 1\right ) + \frac {1}{4} \, \log \left (-\frac {1}{4} \, \cos \relax (x)^{2} + \frac {1}{4}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.64, size = 75, normalized size = 1.17 \[ -\frac {1}{6} \, \sqrt {3} {\left (x + \arctan \left (-\frac {\sqrt {3} \sin \left (2 \, x\right ) - \cos \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right ) - 1}{\sqrt {3} \cos \left (2 \, x\right ) + \sqrt {3} - 2 \, \cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 2}\right )\right )} - \frac {1}{4} \, \log \left (\tan \relax (x)^{2} + \tan \relax (x) + 1\right ) + \frac {1}{2} \, \log \left ({\left | \tan \relax (x) \right |}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.26, size = 35, normalized size = 0.55
method | result | size |
default | \(-\frac {\ln \left (1+\tan \relax (x )+\tan ^{2}\relax (x )\right )}{4}-\frac {\sqrt {3}\, \arctan \left (\frac {\left (2 \tan \relax (x )+1\right ) \sqrt {3}}{3}\right )}{6}+\frac {\ln \left (\tan \relax (x )\right )}{2}\) | \(35\) |
risch | \(-\frac {\ln \left ({\mathrm e}^{2 i x}-i \sqrt {3}+2 i\right )}{4}+\frac {i \ln \left ({\mathrm e}^{2 i x}-i \sqrt {3}+2 i\right ) \sqrt {3}}{12}-\frac {\ln \left ({\mathrm e}^{2 i x}+i \sqrt {3}+2 i\right )}{4}-\frac {i \ln \left ({\mathrm e}^{2 i x}+i \sqrt {3}+2 i\right ) \sqrt {3}}{12}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{2}\) | \(88\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.07, size = 208, normalized size = 3.25 \[ -\frac {1}{24} \, \sqrt {3} {\left (\sqrt {3} \log \left (-2 \, {\left (4 \, \sin \left (2 \, x\right ) + 1\right )} \cos \left (4 \, x\right ) + \cos \left (4 \, x\right )^{2} + 16 \, \cos \left (2 \, x\right )^{2} + 8 \, \cos \left (2 \, x\right ) \sin \left (4 \, x\right ) + \sin \left (4 \, x\right )^{2} + 16 \, \sin \left (2 \, x\right )^{2} + 8 \, \sin \left (2 \, x\right ) + 1\right ) - 2 \, \sqrt {3} \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} + 2 \, \cos \relax (x) + 1\right ) - 2 \, \sqrt {3} \log \left (\cos \relax (x)^{2} + \sin \relax (x)^{2} - 2 \, \cos \relax (x) + 1\right ) - 2 \, \arctan \left (\frac {2 \, \sqrt {3} \cos \left (2 \, x\right )}{\cos \left (2 \, x\right )^{2} - 2 \, {\left (\sqrt {3} - 2\right )} \sin \left (2 \, x\right ) + \sin \left (2 \, x\right )^{2} - 4 \, \sqrt {3} + 7}, \frac {\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 4 \, \sin \left (2 \, x\right ) + 1}{\cos \left (2 \, x\right )^{2} - 2 \, {\left (\sqrt {3} - 2\right )} \sin \left (2 \, x\right ) + \sin \left (2 \, x\right )^{2} - 4 \, \sqrt {3} + 7}\right )\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.34, size = 47, normalized size = 0.73 \[ \frac {\ln \left (\mathrm {tan}\relax (x)\right )}{2}+\ln \left (\mathrm {tan}\relax (x)+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-\frac {1}{4}+\frac {\sqrt {3}\,1{}\mathrm {i}}{12}\right )-\ln \left (\mathrm {tan}\relax (x)+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{4}+\frac {\sqrt {3}\,1{}\mathrm {i}}{12}\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos {\relax (x )}}{\left (\sin {\left (2 x \right )} + 2\right ) \sin {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________