3.373 \(\int \frac {\cot (x)}{2+\sin (2 x)} \, dx\)

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]

Int[Cot[x]/(2 + Sin[2*x]),x]

[Out]

-x/(2*Sqrt[3]) + ArcTan[(1 - 2*Cos[x]^2)/(2 + Sqrt[3] + 2*Cos[x]*Sin[x])]/(2*Sqrt[3]) + Log[Tan[x]]/2 - Log[1
+ Tan[x] + Tan[x]^2]/4

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(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]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 705

Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[e^2/(c*d^2 - b*d*e + a*e^2
), Int[1/(d + e*x), x], x] + Dist[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] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0]

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]

Integrate[Cot[x]/(2 + Sin[2*x]),x]

[Out]

(-2*Sqrt[3]*ArcTan[(1 + 2*Tan[x])/Sqrt[3]] + 6*Log[Sin[x]] - 3*Log[2 + Sin[2*x]])/12

________________________________________________________________________________________

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]

IntegrateAlgebraic[Cot[x]/(2 + Sin[2*x]),x]

[Out]

Could not integrate

________________________________________________________________________________________

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]

integrate(cos(x)/sin(x)/(2+sin(2*x)),x, algorithm="fricas")

[Out]

-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)

________________________________________________________________________________________

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]

integrate(cos(x)/sin(x)/(2+sin(2*x)),x, algorithm="giac")

[Out]

-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)))

________________________________________________________________________________________

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]

int(cos(x)/sin(x)/(2+sin(2*x)),x,method=_RETURNVERBOSE)

[Out]

-1/4*ln(1+tan(x)+tan(x)^2)-1/6*3^(1/2)*arctan(1/3*(2*tan(x)+1)*3^(1/2))+1/2*ln(tan(x))

________________________________________________________________________________________

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]

integrate(cos(x)/sin(x)/(2+sin(2*x)),x, algorithm="maxima")

[Out]

-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) + s
in(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)*lo
g(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)
 + sin(2*x)^2 - 4*sqrt(3) + 7)))

________________________________________________________________________________________

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]

int(cos(x)/(sin(x)*(sin(2*x) + 2)),x)

[Out]

log(tan(x))/2 + log(tan(x) - (3^(1/2)*1i)/2 + 1/2)*((3^(1/2)*1i)/12 - 1/4) - log(tan(x) + (3^(1/2)*1i)/2 + 1/2
)*((3^(1/2)*1i)/12 + 1/4)

________________________________________________________________________________________

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]

integrate(cos(x)/sin(x)/(2+sin(2*x)),x)

[Out]

Integral(cos(x)/((sin(2*x) + 2)*sin(x)), x)

________________________________________________________________________________________