3.348 \(\int \frac{1}{(\sin (x)+\tan (x))^4} \, dx\)

Optimal. Leaf size=65 \[ -\frac{8}{11} \cot ^{11}(x)-\frac{16 \cot ^9(x)}{9}-\frac{9 \cot ^7(x)}{7}-\frac{\cot ^5(x)}{5}+\frac{8 \csc ^{11}(x)}{11}-\frac{20 \csc ^9(x)}{9}+\frac{16 \csc ^7(x)}{7}-\frac{4 \csc ^5(x)}{5} \]

[Out]

-Cot[x]^5/5 - (9*Cot[x]^7)/7 - (16*Cot[x]^9)/9 - (8*Cot[x]^11)/11 - (4*Csc[x]^5)/5 + (16*Csc[x]^7)/7 - (20*Csc
[x]^9)/9 + (8*Csc[x]^11)/11

________________________________________________________________________________________

Rubi [A]  time = 0.210677, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 18, number of rules used = 6, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.857, Rules used = {4397, 2711, 2607, 14, 2606, 270} \[ -\frac{8}{11} \cot ^{11}(x)-\frac{16 \cot ^9(x)}{9}-\frac{9 \cot ^7(x)}{7}-\frac{\cot ^5(x)}{5}+\frac{8 \csc ^{11}(x)}{11}-\frac{20 \csc ^9(x)}{9}+\frac{16 \csc ^7(x)}{7}-\frac{4 \csc ^5(x)}{5} \]

Antiderivative was successfully verified.

[In]

Int[(Sin[x] + Tan[x])^(-4),x]

[Out]

-Cot[x]^5/5 - (9*Cot[x]^7)/7 - (16*Cot[x]^9)/9 - (8*Cot[x]^11)/11 - (4*Csc[x]^5)/5 + (16*Csc[x]^7)/7 - (20*Csc
[x]^9)/9 + (8*Csc[x]^11)/11

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 2711

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Dist[a^(2*
m), Int[ExpandIntegrand[(g*Tan[e + f*x])^p/Sec[e + f*x]^m, (a*Sec[e + f*x] - b*Tan[e + f*x])^(-m), x], x], x]
/; FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && ILtQ[m, 0]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 270

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

Rubi steps

\begin{align*} \int \frac{1}{(\sin (x)+\tan (x))^4} \, dx &=\int \frac{\cot ^4(x)}{(1+\cos (x))^4} \, dx\\ &=\int \left (\cot ^8(x) \csc ^4(x)-4 \cot ^7(x) \csc ^5(x)+6 \cot ^6(x) \csc ^6(x)-4 \cot ^5(x) \csc ^7(x)+\cot ^4(x) \csc ^8(x)\right ) \, dx\\ &=-\left (4 \int \cot ^7(x) \csc ^5(x) \, dx\right )-4 \int \cot ^5(x) \csc ^7(x) \, dx+6 \int \cot ^6(x) \csc ^6(x) \, dx+\int \cot ^8(x) \csc ^4(x) \, dx+\int \cot ^4(x) \csc ^8(x) \, dx\\ &=4 \operatorname{Subst}\left (\int x^6 \left (-1+x^2\right )^2 \, dx,x,\csc (x)\right )+4 \operatorname{Subst}\left (\int x^4 \left (-1+x^2\right )^3 \, dx,x,\csc (x)\right )+6 \operatorname{Subst}\left (\int x^6 \left (1+x^2\right )^2 \, dx,x,-\cot (x)\right )+\operatorname{Subst}\left (\int x^8 \left (1+x^2\right ) \, dx,x,-\cot (x)\right )+\operatorname{Subst}\left (\int x^4 \left (1+x^2\right )^3 \, dx,x,-\cot (x)\right )\\ &=4 \operatorname{Subst}\left (\int \left (-x^4+3 x^6-3 x^8+x^{10}\right ) \, dx,x,\csc (x)\right )+4 \operatorname{Subst}\left (\int \left (x^6-2 x^8+x^{10}\right ) \, dx,x,\csc (x)\right )+6 \operatorname{Subst}\left (\int \left (x^6+2 x^8+x^{10}\right ) \, dx,x,-\cot (x)\right )+\operatorname{Subst}\left (\int \left (x^8+x^{10}\right ) \, dx,x,-\cot (x)\right )+\operatorname{Subst}\left (\int \left (x^4+3 x^6+3 x^8+x^{10}\right ) \, dx,x,-\cot (x)\right )\\ &=-\frac{1}{5} \cot ^5(x)-\frac{9 \cot ^7(x)}{7}-\frac{16 \cot ^9(x)}{9}-\frac{8 \cot ^{11}(x)}{11}-\frac{4 \csc ^5(x)}{5}+\frac{16 \csc ^7(x)}{7}-\frac{20 \csc ^9(x)}{9}+\frac{8 \csc ^{11}(x)}{11}\\ \end{align*}

Mathematica [A]  time = 0.0207937, size = 129, normalized size = 1.98 \[ -\frac{2749 \tan \left (\frac{x}{2}\right )}{110880}+\frac{1}{96} \cot \left (\frac{x}{2}\right )-\frac{1}{384} \cot \left (\frac{x}{2}\right ) \csc ^2\left (\frac{x}{2}\right )+\frac{\tan \left (\frac{x}{2}\right ) \sec ^{10}\left (\frac{x}{2}\right )}{1408}-\frac{7 \tan \left (\frac{x}{2}\right ) \sec ^8\left (\frac{x}{2}\right )}{1584}+\frac{641 \tan \left (\frac{x}{2}\right ) \sec ^6\left (\frac{x}{2}\right )}{88704}+\frac{179 \tan \left (\frac{x}{2}\right ) \sec ^4\left (\frac{x}{2}\right )}{73920}-\frac{2033 \tan \left (\frac{x}{2}\right ) \sec ^2\left (\frac{x}{2}\right )}{443520} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sin[x] + Tan[x])^(-4),x]

[Out]

Cot[x/2]/96 - (Cot[x/2]*Csc[x/2]^2)/384 - (2749*Tan[x/2])/110880 - (2033*Sec[x/2]^2*Tan[x/2])/443520 + (179*Se
c[x/2]^4*Tan[x/2])/73920 + (641*Sec[x/2]^6*Tan[x/2])/88704 - (7*Sec[x/2]^8*Tan[x/2])/1584 + (Sec[x/2]^10*Tan[x
/2])/1408

________________________________________________________________________________________

Maple [A]  time = 0.054, size = 64, normalized size = 1. \begin{align*}{\frac{1}{1408} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{11}}-{\frac{1}{1152} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{9}}-{\frac{3}{896} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{7}}+{\frac{3}{640} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{5}}+{\frac{1}{128} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3}}-{\frac{3}{128}\tan \left ({\frac{x}{2}} \right ) }+{\frac{1}{128} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{1}{384} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/1408*tan(1/2*x)^11-1/1152*tan(1/2*x)^9-3/896*tan(1/2*x)^7+3/640*tan(1/2*x)^5+1/128*tan(1/2*x)^3-3/128*tan(1/
2*x)+1/128/tan(1/2*x)-1/384/tan(1/2*x)^3

________________________________________________________________________________________

Maxima [A]  time = 1.00157, size = 131, normalized size = 2.02 \begin{align*} \frac{{\left (\frac{3 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1\right )}{\left (\cos \left (x\right ) + 1\right )}^{3}}{384 \, \sin \left (x\right )^{3}} - \frac{3 \, \sin \left (x\right )}{128 \,{\left (\cos \left (x\right ) + 1\right )}} + \frac{\sin \left (x\right )^{3}}{128 \,{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac{3 \, \sin \left (x\right )^{5}}{640 \,{\left (\cos \left (x\right ) + 1\right )}^{5}} - \frac{3 \, \sin \left (x\right )^{7}}{896 \,{\left (\cos \left (x\right ) + 1\right )}^{7}} - \frac{\sin \left (x\right )^{9}}{1152 \,{\left (\cos \left (x\right ) + 1\right )}^{9}} + \frac{\sin \left (x\right )^{11}}{1408 \,{\left (\cos \left (x\right ) + 1\right )}^{11}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sin(x)+tan(x))^4,x, algorithm="maxima")

[Out]

1/384*(3*sin(x)^2/(cos(x) + 1)^2 - 1)*(cos(x) + 1)^3/sin(x)^3 - 3/128*sin(x)/(cos(x) + 1) + 1/128*sin(x)^3/(co
s(x) + 1)^3 + 3/640*sin(x)^5/(cos(x) + 1)^5 - 3/896*sin(x)^7/(cos(x) + 1)^7 - 1/1152*sin(x)^9/(cos(x) + 1)^9 +
 1/1408*sin(x)^11/(cos(x) + 1)^11

________________________________________________________________________________________

Fricas [A]  time = 2.18283, size = 255, normalized size = 3.92 \begin{align*} \frac{122 \, \cos \left (x\right )^{7} + 488 \, \cos \left (x\right )^{6} + 549 \, \cos \left (x\right )^{5} - 244 \, \cos \left (x\right )^{4} - 64 \, \cos \left (x\right )^{3} + 144 \, \cos \left (x\right )^{2} + 128 \, \cos \left (x\right ) + 32}{3465 \,{\left (\cos \left (x\right )^{6} + 4 \, \cos \left (x\right )^{5} + 5 \, \cos \left (x\right )^{4} - 5 \, \cos \left (x\right )^{2} - 4 \, \cos \left (x\right ) - 1\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sin(x)+tan(x))^4,x, algorithm="fricas")

[Out]

1/3465*(122*cos(x)^7 + 488*cos(x)^6 + 549*cos(x)^5 - 244*cos(x)^4 - 64*cos(x)^3 + 144*cos(x)^2 + 128*cos(x) +
32)/((cos(x)^6 + 4*cos(x)^5 + 5*cos(x)^4 - 5*cos(x)^2 - 4*cos(x) - 1)*sin(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\left (\sin{\left (x \right )} + \tan{\left (x \right )}\right )^{4}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sin(x)+tan(x))**4,x)

[Out]

Integral((sin(x) + tan(x))**(-4), x)

________________________________________________________________________________________

Giac [A]  time = 1.14752, size = 88, normalized size = 1.35 \begin{align*} \frac{1}{1408} \, \tan \left (\frac{1}{2} \, x\right )^{11} - \frac{1}{1152} \, \tan \left (\frac{1}{2} \, x\right )^{9} - \frac{3}{896} \, \tan \left (\frac{1}{2} \, x\right )^{7} + \frac{3}{640} \, \tan \left (\frac{1}{2} \, x\right )^{5} + \frac{1}{128} \, \tan \left (\frac{1}{2} \, x\right )^{3} + \frac{3 \, \tan \left (\frac{1}{2} \, x\right )^{2} - 1}{384 \, \tan \left (\frac{1}{2} \, x\right )^{3}} - \frac{3}{128} \, \tan \left (\frac{1}{2} \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sin(x)+tan(x))^4,x, algorithm="giac")

[Out]

1/1408*tan(1/2*x)^11 - 1/1152*tan(1/2*x)^9 - 3/896*tan(1/2*x)^7 + 3/640*tan(1/2*x)^5 + 1/128*tan(1/2*x)^3 + 1/
384*(3*tan(1/2*x)^2 - 1)/tan(1/2*x)^3 - 3/128*tan(1/2*x)