\(\int \frac {1}{(\cot (x)+\csc (x))^4} \, dx\) [301]

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

Optimal result

Integrand size = 7, antiderivative size = 26 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=x-\frac {2 \sin (x)}{1+\cos (x)}+\frac {2 \sin ^3(x)}{3 (1+\cos (x))^3} \]

[Out]

x-2*sin(x)/(1+cos(x))+2/3*sin(x)^3/(1+cos(x))^3

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4477, 2759, 8} \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=x+\frac {2 \sin ^3(x)}{3 (\cos (x)+1)^3}-\frac {2 \sin (x)}{\cos (x)+1} \]

[In]

Int[(Cot[x] + Csc[x])^(-4),x]

[Out]

x - (2*Sin[x])/(1 + Cos[x]) + (2*Sin[x]^3)/(3*(1 + Cos[x])^3)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2759

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[2*g*(g
*Cos[e + f*x])^(p - 1)*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(2*m + p + 1))), x] + Dist[g^2*((p - 1)/(b^2*(2*m +
p + 1))), Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 2), x], x] /; FreeQ[{a, b, e, f, g}, x] && Eq
Q[a^2 - b^2, 0] && LeQ[m, -2] && GtQ[p, 1] && NeQ[2*m + p + 1, 0] &&  !ILtQ[m + p + 1, 0] && IntegersQ[2*m, 2*
p]

Rule 4477

Int[(cot[(c_.) + (d_.)*(x_)]^(n_.)*(a_.) + csc[(c_.) + (d_.)*(x_)]^(n_.)*(b_.))^(p_)*(u_.), x_Symbol] :> Int[A
ctivateTrig[u]*Csc[c + d*x]^(n*p)*(b + a*Cos[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.15 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=x-\frac {8}{3} \tan \left (\frac {x}{2}\right )+\frac {2}{3} \sec ^2\left (\frac {x}{2}\right ) \tan \left (\frac {x}{2}\right ) \]

[In]

Integrate[(Cot[x] + Csc[x])^(-4),x]

[Out]

x - (8*Tan[x/2])/3 + (2*Sec[x/2]^2*Tan[x/2])/3

Maple [A] (verified)

Time = 1.60 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.88

method result size
default \(\frac {2 \tan \left (\frac {x}{2}\right )^{3}}{3}-2 \tan \left (\frac {x}{2}\right )+2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )\) \(23\)
risch \(x -\frac {8 i \left (3 \,{\mathrm e}^{2 i x}+3 \,{\mathrm e}^{i x}+2\right )}{3 \left ({\mathrm e}^{i x}+1\right )^{3}}\) \(31\)

[In]

int(1/(cot(x)+csc(x))^4,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.54 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=\frac {3 \, x \cos \left (x\right )^{2} + 6 \, x \cos \left (x\right ) - 4 \, {\left (2 \, \cos \left (x\right ) + 1\right )} \sin \left (x\right ) + 3 \, x}{3 \, {\left (\cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right )}} \]

[In]

integrate(1/(cot(x)+csc(x))^4,x, algorithm="fricas")

[Out]

1/3*(3*x*cos(x)^2 + 6*x*cos(x) - 4*(2*cos(x) + 1)*sin(x) + 3*x)/(cos(x)^2 + 2*cos(x) + 1)

Sympy [F(-1)]

Timed out. \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=\text {Timed out} \]

[In]

integrate(1/(cot(x)+csc(x))**4,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.35 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=-\frac {2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {2 \, \sin \left (x\right )^{3}}{3 \, {\left (\cos \left (x\right ) + 1\right )}^{3}} + 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(1/(cot(x)+csc(x))^4,x, algorithm="maxima")

[Out]

-2*sin(x)/(cos(x) + 1) + 2/3*sin(x)^3/(cos(x) + 1)^3 + 2*arctan(sin(x)/(cos(x) + 1))

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.62 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=\frac {2}{3} \, \tan \left (\frac {1}{2} \, x\right )^{3} + x - 2 \, \tan \left (\frac {1}{2} \, x\right ) \]

[In]

integrate(1/(cot(x)+csc(x))^4,x, algorithm="giac")

[Out]

2/3*tan(1/2*x)^3 + x - 2*tan(1/2*x)

Mupad [B] (verification not implemented)

Time = 28.95 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.62 \[ \int \frac {1}{(\cot (x)+\csc (x))^4} \, dx=\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{3}-2\,\mathrm {tan}\left (\frac {x}{2}\right )+x \]

[In]

int(1/(cot(x) + 1/sin(x))^4,x)

[Out]

x - 2*tan(x/2) + (2*tan(x/2)^3)/3