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/8*x+35/8*cot(x)-35/24*cot(x)^3+7/8*cos(x)^2*cot(x)^3+1/4*cos(x)^4*cot(x)^3

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 44, normalized size of antiderivative = 1.00, 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 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])

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]

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.03, 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

________________________________________________________________________________________

fricas [A]  time = 2.05, size = 51, normalized size = 1.16 \[ -\frac {6 \, \cos \relax (x)^{7} + 21 \, \cos \relax (x)^{5} - 140 \, \cos \relax (x)^{3} - 105 \, {\left (x \cos \relax (x)^{2} - x\right )} \sin \relax (x) + 105 \, \cos \relax (x)}{24 \, {\left (\cos \relax (x)^{2} - 1\right )} \sin \relax (x)} \]

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

________________________________________________________________________________________

giac [A]  time = 0.13, size = 39, normalized size = 0.89 \[ \frac {35}{8} \, x + \frac {11 \, \tan \relax (x)^{3} + 13 \, \tan \relax (x)}{8 \, {\left (\tan \relax (x)^{2} + 1\right )}^{2}} + \frac {9 \, \tan \relax (x)^{2} - 1}{3 \, \tan \relax (x)^{3}} \]

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

________________________________________________________________________________________

maple [A]  time = 0.06, size = 39, normalized size = 0.89 \[ -\frac {\left (\sin ^{3}\relax (x )+\frac {3 \sin \relax (x )}{2}\right ) \cos \relax (x )}{4}+\frac {35 x}{8}+2 \cos \relax (x ) \sin \relax (x )+4 \cot \relax (x )+\left (-\frac {2}{3}-\frac {\left (\csc ^{2}\relax (x )\right )}{3}\right ) \cot \relax (x ) \]

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 = 0.31, size = 36, normalized size = 0.82 \[ \frac {35}{8} \, x + \frac {4}{\tan \relax (x)} - \frac {3 \, \tan \relax (x)^{2} + 1}{3 \, \tan \relax (x)^{3}} + \frac {1}{32} \, \sin \left (4 \, x\right ) + \frac {3}{4} \, \sin \left (2 \, x\right ) \]

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)

________________________________________________________________________________________

mupad [B]  time = 2.49, size = 59, normalized size = 1.34 \[ \frac {\frac {{\cos \relax (x)}^7}{4}+\frac {7\,{\cos \relax (x)}^5}{8}-\frac {35\,{\cos \relax (x)}^3}{6}+\frac {35\,\cos \relax (x)}{8}}{\sin \relax (x)-{\cos \relax (x)}^2\,\sin \relax (x)}-\frac {\frac {35\,x}{8}-\frac {35\,x\,{\cos \relax (x)}^2}{8}}{{\cos \relax (x)}^2-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sin(x) - 1/sin(x))^4,x)

[Out]

((35*cos(x))/8 - (35*cos(x)^3)/6 + (7*cos(x)^5)/8 + cos(x)^7/4)/(sin(x) - cos(x)^2*sin(x)) - ((35*x)/8 - (35*x
*cos(x)^2)/8)/(cos(x)^2 - 1)

________________________________________________________________________________________

sympy [A]  time = 8.78, size = 44, normalized size = 1.00 \[ \frac {35 x}{8} + 2 \sin {\relax (x )} \cos {\relax (x )} - \frac {\sin {\left (2 x \right )}}{4} + \frac {\sin {\left (4 x \right )}}{32} - \frac {\cot ^{3}{\relax (x )}}{3} - \cot {\relax (x )} + \frac {4 \cos {\relax (x )}}{\sin {\relax (x )}} \]

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)

________________________________________________________________________________________