3.303 \(\int (\csc (x)-\sin (x))^4 \, dx\)

Optimal. Leaf size=44 \[ \frac{35 x}{8}-\frac{35 \cot ^3(x)}{24}+\frac{35 \cot (x)}{8}+\frac{1}{4} \cos ^4(x) \cot ^3(x)+\frac{7}{8} \cos ^2(x) \cot ^3(x) \]

[Out]

(35*x)/8 + (35*Cot[x])/8 - (35*Cot[x]^3)/24 + (7*Cos[x]^2*Cot[x]^3)/8 + (Cos[x]^4*Cot[x]^3)/4

________________________________________________________________________________________

Rubi [A]  time = 0.0336686, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {290, 325, 203} \[ \frac{35 x}{8}-\frac{35 \cot ^3(x)}{24}+\frac{35 \cot (x)}{8}+\frac{1}{4} \cos ^4(x) \cot ^3(x)+\frac{7}{8} \cos ^2(x) \cot ^3(x) \]

Antiderivative was successfully verified.

[In]

Int[(Csc[x] - Sin[x])^4,x]

[Out]

(35*x)/8 + (35*Cot[x])/8 - (35*Cot[x]^3)/24 + (7*Cos[x]^2*Cot[x]^3)/8 + (Cos[x]^4*Cot[x]^3)/4

Rule 290

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> -Simp[((c*x)^(m + 1)*(a + b*x^n)^(p + 1))/(
a*c*n*(p + 1)), x] + Dist[(m + n*(p + 1) + 1)/(a*n*(p + 1)), Int[(c*x)^m*(a + b*x^n)^(p + 1), x], x] /; FreeQ[
{a, b, c, m}, x] && IGtQ[n, 0] && LtQ[p, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 325

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[((c*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*
c*(m + 1)), x] - Dist[(b*(m + n*(p + 1) + 1))/(a*c^n*(m + 1)), Int[(c*x)^(m + n)*(a + b*x^n)^p, x], x] /; Free
Q[{a, b, c, p}, x] && IGtQ[n, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 203

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

Rubi steps

\begin{align*} \int (\csc (x)-\sin (x))^4 \, dx &=\operatorname{Subst}\left (\int \frac{1}{x^4 \left (1+x^2\right )^3} \, dx,x,\tan (x)\right )\\ &=\frac{1}{4} \cos ^4(x) \cot ^3(x)+\frac{7}{4} \operatorname{Subst}\left (\int \frac{1}{x^4 \left (1+x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=\frac{7}{8} \cos ^2(x) \cot ^3(x)+\frac{1}{4} \cos ^4(x) \cot ^3(x)+\frac{35}{8} \operatorname{Subst}\left (\int \frac{1}{x^4 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac{35}{24} \cot ^3(x)+\frac{7}{8} \cos ^2(x) \cot ^3(x)+\frac{1}{4} \cos ^4(x) \cot ^3(x)-\frac{35}{8} \operatorname{Subst}\left (\int \frac{1}{x^2 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\frac{35 \cot (x)}{8}-\frac{35 \cot ^3(x)}{24}+\frac{7}{8} \cos ^2(x) \cot ^3(x)+\frac{1}{4} \cos ^4(x) \cot ^3(x)+\frac{35}{8} \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac{35 x}{8}+\frac{35 \cot (x)}{8}-\frac{35 \cot ^3(x)}{24}+\frac{7}{8} \cos ^2(x) \cot ^3(x)+\frac{1}{4} \cos ^4(x) \cot ^3(x)\\ \end{align*}

Mathematica [A]  time = 0.0295829, size = 38, normalized size = 0.86 \[ \frac{35 x}{8}+\frac{3}{4} \sin (2 x)+\frac{1}{32} \sin (4 x)+\frac{10 \cot (x)}{3}-\frac{1}{3} \cot (x) \csc ^2(x) \]

Antiderivative was successfully verified.

[In]

Integrate[(Csc[x] - Sin[x])^4,x]

[Out]

(35*x)/8 + (10*Cot[x])/3 - (Cot[x]*Csc[x]^2)/3 + (3*Sin[2*x])/4 + Sin[4*x]/32

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 39, normalized size = 0.9 \begin{align*} -{\frac{\cos \left ( x \right ) }{4} \left ( \left ( \sin \left ( x \right ) \right ) ^{3}+{\frac{3\,\sin \left ( x \right ) }{2}} \right ) }+{\frac{35\,x}{8}}+2\,\cos \left ( x \right ) \sin \left ( x \right ) +4\,\cot \left ( x \right ) + \left ( -{\frac{2}{3}}-{\frac{ \left ( \csc \left ( x \right ) \right ) ^{2}}{3}} \right ) \cot \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((csc(x)-sin(x))^4,x)

[Out]

-1/4*(sin(x)^3+3/2*sin(x))*cos(x)+35/8*x+2*cos(x)*sin(x)+4*cot(x)+(-2/3-1/3*csc(x)^2)*cot(x)

________________________________________________________________________________________

Maxima [A]  time = 1.00614, size = 49, normalized size = 1.11 \begin{align*} \frac{35}{8} \, x + \frac{4}{\tan \left (x\right )} - \frac{3 \, \tan \left (x\right )^{2} + 1}{3 \, \tan \left (x\right )^{3}} + \frac{1}{32} \, \sin \left (4 \, x\right ) + \frac{3}{4} \, \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^4,x, algorithm="maxima")

[Out]

35/8*x + 4/tan(x) - 1/3*(3*tan(x)^2 + 1)/tan(x)^3 + 1/32*sin(4*x) + 3/4*sin(2*x)

________________________________________________________________________________________

Fricas [A]  time = 2.12102, size = 157, normalized size = 3.57 \begin{align*} -\frac{6 \, \cos \left (x\right )^{7} + 21 \, \cos \left (x\right )^{5} - 140 \, \cos \left (x\right )^{3} - 105 \,{\left (x \cos \left (x\right )^{2} - x\right )} \sin \left (x\right ) + 105 \, \cos \left (x\right )}{24 \,{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^4,x, algorithm="fricas")

[Out]

-1/24*(6*cos(x)^7 + 21*cos(x)^5 - 140*cos(x)^3 - 105*(x*cos(x)^2 - x)*sin(x) + 105*cos(x))/((cos(x)^2 - 1)*sin
(x))

________________________________________________________________________________________

Sympy [A]  time = 18.1013, size = 44, normalized size = 1. \begin{align*} \frac{35 x}{8} + 2 \sin{\left (x \right )} \cos{\left (x \right )} - \frac{\sin{\left (2 x \right )}}{4} + \frac{\sin{\left (4 x \right )}}{32} - \frac{\cot ^{3}{\left (x \right )}}{3} - \cot{\left (x \right )} + \frac{4 \cos{\left (x \right )}}{\sin{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))**4,x)

[Out]

35*x/8 + 2*sin(x)*cos(x) - sin(2*x)/4 + sin(4*x)/32 - cot(x)**3/3 - cot(x) + 4*cos(x)/sin(x)

________________________________________________________________________________________

Giac [A]  time = 1.16528, size = 53, normalized size = 1.2 \begin{align*} \frac{35}{8} \, x + \frac{11 \, \tan \left (x\right )^{3} + 13 \, \tan \left (x\right )}{8 \,{\left (\tan \left (x\right )^{2} + 1\right )}^{2}} + \frac{9 \, \tan \left (x\right )^{2} - 1}{3 \, \tan \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((csc(x)-sin(x))^4,x, algorithm="giac")

[Out]

35/8*x + 1/8*(11*tan(x)^3 + 13*tan(x))/(tan(x)^2 + 1)^2 + 1/3*(9*tan(x)^2 - 1)/tan(x)^3