Integrand size = 11, antiderivative size = 64 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=-\frac {x}{2 \sqrt {3}}+\frac {\arctan \left (\frac {1-2 \cos ^2(x)}{2+\sqrt {3}+2 \cos (x) \sin (x)}\right )}{2 \sqrt {3}}+\frac {1}{2} \log (\sin (x))-\frac {1}{4} \log (1+\cos (x) \sin (x)) \]
1/2*ln(sin(x))-1/4*ln(1+cos(x)*sin(x))-1/6*x*3^(1/2)+1/6*arctan((1-2*cos(x )^2)/(2+2*cos(x)*sin(x)+3^(1/2)))*3^(1/2)
Time = 0.06 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.61 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=\frac {1}{12} \left (-2 \sqrt {3} \arctan \left (\frac {1+2 \tan (x)}{\sqrt {3}}\right )+6 \log (\sin (x))-3 \log (2+\sin (2 x))\right ) \]
Time = 0.26 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.64, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.818, Rules used = {3042, 4889, 27, 1144, 25, 1142, 1083, 217, 1103}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cot (x)}{\sin (2 x)+2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(\sin (2 x)+2) \tan (x)}dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \int \frac {\cot (x)}{2 \left (\tan ^2(x)+\tan (x)+1\right )}d\tan (x)\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \int \frac {\cot (x)}{\tan ^2(x)+\tan (x)+1}d\tan (x)\) |
\(\Big \downarrow \) 1144 |
\(\displaystyle \frac {1}{2} \left (\int -\frac {\tan (x)+1}{\tan ^2(x)+\tan (x)+1}d\tan (x)+\log (\tan (x))\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} \left (\log (\tan (x))-\int \frac {\tan (x)+1}{\tan ^2(x)+\tan (x)+1}d\tan (x)\right )\) |
\(\Big \downarrow \) 1142 |
\(\displaystyle \frac {1}{2} \left (-\frac {1}{2} \int \frac {1}{\tan ^2(x)+\tan (x)+1}d\tan (x)-\frac {1}{2} \int \frac {2 \tan (x)+1}{\tan ^2(x)+\tan (x)+1}d\tan (x)+\log (\tan (x))\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {1}{2} \left (-\frac {1}{2} \int \frac {2 \tan (x)+1}{\tan ^2(x)+\tan (x)+1}d\tan (x)+\int \frac {1}{-(2 \tan (x)+1)^2-3}d(2 \tan (x)+1)+\log (\tan (x))\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {1}{2} \left (-\frac {1}{2} \int \frac {2 \tan (x)+1}{\tan ^2(x)+\tan (x)+1}d\tan (x)-\frac {\arctan \left (\frac {2 \tan (x)+1}{\sqrt {3}}\right )}{\sqrt {3}}+\log (\tan (x))\right )\) |
\(\Big \downarrow \) 1103 |
\(\displaystyle \frac {1}{2} \left (-\frac {\arctan \left (\frac {2 \tan (x)+1}{\sqrt {3}}\right )}{\sqrt {3}}-\frac {1}{2} \log \left (\tan ^2(x)+\tan (x)+1\right )+\log (\tan (x))\right )\) |
3.4.73.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[(2*c*d - b*e)/(2*c) Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Simp[e*(Log[RemoveContent[d + e*x, x]]/(c*d^2 - b*d*e + a*e^2)), x] + S imp[1/(c*d^2 - b*d*e + a*e^2) Int[(c*d - b*e - c*e*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Time = 0.44 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.55
method | result | size |
default | \(\frac {\ln \left (\tan \left (x \right )\right )}{2}-\frac {\ln \left (\tan ^{2}\left (x \right )+\tan \left (x \right )+1\right )}{4}-\frac {\sqrt {3}\, \arctan \left (\frac {\left (2 \tan \left (x \right )+1\right ) \sqrt {3}}{3}\right )}{6}\) | \(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\) |
Time = 0.29 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.00 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=-\frac {1}{12} \, \sqrt {3} \arctan \left (\frac {4 \, \sqrt {3} \cos \left (x\right ) \sin \left (x\right ) + \sqrt {3}}{3 \, {\left (2 \, \cos \left (x\right )^{2} - 1\right )}}\right ) - \frac {1}{8} \, \log \left (-\cos \left (x\right )^{4} + \cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) + \frac {1}{4} \, \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right ) \]
-1/12*sqrt(3)*arctan(1/3*(4*sqrt(3)*cos(x)*sin(x) + sqrt(3))/(2*cos(x)^2 - 1)) - 1/8*log(-cos(x)^4 + cos(x)^2 + 2*cos(x)*sin(x) + 1) + 1/4*log(-1/4* cos(x)^2 + 1/4)
\[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=\int \frac {\cos {\left (x \right )}}{\left (\sin {\left (2 x \right )} + 2\right ) \sin {\left (x \right )}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 208 vs. \(2 (51) = 102\).
Time = 0.29 (sec) , antiderivative size = 208, normalized size of antiderivative = 3.25 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=-\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 \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) - 2 \, \sqrt {3} \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 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 )} \]
-1/24*sqrt(3)*(sqrt(3)*log(-2*(4*sin(2*x) + 1)*cos(4*x) + cos(4*x)^2 + 16* cos(2*x)^2 + 8*cos(2*x)*sin(4*x) + sin(4*x)^2 + 16*sin(2*x)^2 + 8*sin(2*x) + 1) - 2*sqrt(3)*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) - 2*sqrt(3)*log( cos(x)^2 + sin(x)^2 - 2*cos(x) + 1) - 2*arctan2(2*sqrt(3)*cos(2*x)/(cos(2* x)^2 - 2*(sqrt(3) - 2)*sin(2*x) + sin(2*x)^2 - 4*sqrt(3) + 7), (cos(2*x)^2 + sin(2*x)^2 + 4*sin(2*x) + 1)/(cos(2*x)^2 - 2*(sqrt(3) - 2)*sin(2*x) + s in(2*x)^2 - 4*sqrt(3) + 7)))
Time = 0.29 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.17 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=-\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 \left (x\right )^{2} + \tan \left (x\right ) + 1\right ) + \frac {1}{2} \, \log \left ({\left | \tan \left (x\right ) \right |}\right ) \]
-1/6*sqrt(3)*(x + arctan(-(sqrt(3)*sin(2*x) - cos(2*x) - 2*sin(2*x) - 1)/( sqrt(3)*cos(2*x) + sqrt(3) - 2*cos(2*x) + sin(2*x) + 2))) - 1/4*log(tan(x) ^2 + tan(x) + 1) + 1/2*log(abs(tan(x)))
Time = 0.37 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.73 \[ \int \frac {\cot (x)}{2+\sin (2 x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (x\right )\right )}{2}+\ln \left (\mathrm {tan}\left (x\right )+\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}\left (x\right )+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {1}{4}+\frac {\sqrt {3}\,1{}\mathrm {i}}{12}\right ) \]