\(\int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx\) [461]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 21 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=x+2 \arctan \left (\frac {\cos (x)-\sin (x)}{2+\cos (x)+\sin (x)}\right ) \]

[Out]

x+2*arctan((cos(x)-sin(x))/(2+cos(x)+sin(x)))

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3245, 3203, 632, 210} \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=2 \arctan \left (\frac {\cos (x)-\sin (x)}{\sin (x)+\cos (x)+2}\right )+x \]

[In]

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

[Out]

x + 2*ArcTan[(Cos[x] - Sin[x])/(2 + Cos[x] + Sin[x])]

Rule 210

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

Rule 632

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 3203

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2], x]}, Dist[2*(f/e), Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d +
e*x)/2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]

Rule 3245

Int[csc[(d_.) + (e_.)*(x_)]^(n_.)*((a_.) + csc[(d_.) + (e_.)*(x_)]*(b_.) + cot[(d_.) + (e_.)*(x_)]*(c_.))^(m_)
, x_Symbol] :> Int[1/(b + a*Sin[d + e*x] + c*Cos[d + e*x])^n, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[m + n, 0]
 && IntegerQ[n]

Rubi steps \begin{align*} \text {integral}& = \int \frac {1}{3+2 \cos (x)+2 \sin (x)} \, dx \\ & = 2 \text {Subst}\left (\int \frac {1}{5+4 x+x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right ) \\ & = -\left (4 \text {Subst}\left (\int \frac {1}{-4-x^2} \, dx,x,4+2 \tan \left (\frac {x}{2}\right )\right )\right ) \\ & = x+2 \arctan \left (\frac {\cos (x)-\sin (x)}{2+\cos (x)+\sin (x)}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(51\) vs. \(2(21)=42\).

Time = 0.04 (sec) , antiderivative size = 51, normalized size of antiderivative = 2.43 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=-\arctan \left (\frac {\cos \left (\frac {x}{2}\right )}{2 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}\right )+\arctan \left (\sec \left (\frac {x}{2}\right ) \left (2 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )\right ) \]

[In]

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

[Out]

-ArcTan[Cos[x/2]/(2*Cos[x/2] + Sin[x/2])] + ArcTan[Sec[x/2]*(2*Cos[x/2] + Sin[x/2])]

Maple [A] (verified)

Time = 0.44 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.48

method result size
default \(2 \arctan \left (2+\tan \left (\frac {x}{2}\right )\right )\) \(10\)
risch \(-i \ln \left ({\mathrm e}^{i x}+\frac {1}{2}+\frac {i}{2}\right )+i \ln \left ({\mathrm e}^{i x}+1+i\right )\) \(28\)

[In]

int(csc(x)/(2+2*cot(x)+3*csc(x)),x,method=_RETURNVERBOSE)

[Out]

2*arctan(2+tan(1/2*x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.14 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=-\arctan \left (-\frac {3 \, \cos \left (x\right ) + 3 \, \sin \left (x\right ) + 4}{\cos \left (x\right ) - \sin \left (x\right )}\right ) \]

[In]

integrate(csc(x)/(2+2*cot(x)+3*csc(x)),x, algorithm="fricas")

[Out]

-arctan(-(3*cos(x) + 3*sin(x) + 4)/(cos(x) - sin(x)))

Sympy [F]

\[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=\int \frac {\csc {\left (x \right )}}{2 \cot {\left (x \right )} + 3 \csc {\left (x \right )} + 2}\, dx \]

[In]

integrate(csc(x)/(2+2*cot(x)+3*csc(x)),x)

[Out]

Integral(csc(x)/(2*cot(x) + 3*csc(x) + 2), x)

Maxima [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.67 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 2\right ) \]

[In]

integrate(csc(x)/(2+2*cot(x)+3*csc(x)),x, algorithm="maxima")

[Out]

2*arctan(sin(x)/(cos(x) + 1) + 2)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.05 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=2 \, \pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor + 2 \, \arctan \left (\tan \left (\frac {1}{2} \, x\right ) + 2\right ) \]

[In]

integrate(csc(x)/(2+2*cot(x)+3*csc(x)),x, algorithm="giac")

[Out]

2*pi*floor(1/2*x/pi + 1/2) + 2*arctan(tan(1/2*x) + 2)

Mupad [B] (verification not implemented)

Time = 27.33 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.43 \[ \int \frac {\csc (x)}{2+2 \cot (x)+3 \csc (x)} \, dx=2\,\mathrm {atan}\left (\mathrm {tan}\left (\frac {x}{2}\right )+2\right ) \]

[In]

int(1/(sin(x)*(2*cot(x) + 3/sin(x) + 2)),x)

[Out]

2*atan(tan(x/2) + 2)