\(\int \frac {1}{(\cos (x)+\sin (x))^6} \, dx\) [5]

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

Optimal result

Integrand size = 7, antiderivative size = 50 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {\cos (x)-\sin (x)}{10 (\cos (x)+\sin (x))^5}-\frac {\cos (x)-\sin (x)}{15 (\cos (x)+\sin (x))^3}+\frac {2 \sin (x)}{15 (\cos (x)+\sin (x))} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3155, 3154} \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {\cos (x)-\sin (x)}{15 (\sin (x)+\cos (x))^3}-\frac {\cos (x)-\sin (x)}{10 (\sin (x)+\cos (x))^5}+\frac {2 \sin (x)}{15 (\sin (x)+\cos (x))} \]

[In]

Int[(Cos[x] + Sin[x])^(-6),x]

[Out]

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

Rule 3154

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-2), x_Symbol] :> Simp[Sin[c + d*x]/(a*d*
(a*Cos[c + d*x] + b*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3155

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*Cos[c + d*x] -
a*Sin[c + d*x])*((a*Cos[c + d*x] + b*Sin[c + d*x])^(n + 1)/(d*(n + 1)*(a^2 + b^2))), x] + Dist[(n + 2)/((n + 1
)*(a^2 + b^2)), Int[(a*Cos[c + d*x] + b*Sin[c + d*x])^(n + 2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b
^2, 0] && LtQ[n, -1] && NeQ[n, -2]

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

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.52 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {5 \cos (3 x)-10 \sin (x)+\sin (5 x)}{30 (\cos (x)+\sin (x))^5} \]

[In]

Integrate[(Cos[x] + Sin[x])^(-6),x]

[Out]

-1/30*(5*Cos[3*x] - 10*Sin[x] + Sin[5*x])/(Cos[x] + Sin[x])^5

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.39 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.60

method result size
risch \(\frac {-\frac {2}{15}+\frac {4 \,{\mathrm e}^{4 i x}}{3}+\frac {2 i {\mathrm e}^{2 i x}}{3}}{\left ({\mathrm e}^{2 i x}+i\right )^{5}}\) \(30\)
default \(-\frac {4}{5 \left (\tan \left (x \right )+1\right )^{5}}-\frac {8}{3 \left (\tan \left (x \right )+1\right )^{3}}-\frac {1}{\tan \left (x \right )+1}+\frac {2}{\left (\tan \left (x \right )+1\right )^{4}}+\frac {2}{\left (\tan \left (x \right )+1\right )^{2}}\) \(42\)
parallelrisch \(\frac {-9 \sin \left (5 x \right )+25 \sin \left (3 x \right )+90 \sin \left (x \right )-45 \cos \left (3 x \right )-5 \cos \left (5 x \right )+50 \cos \left (x \right )}{-30 \cos \left (5 x \right )-150 \cos \left (3 x \right )+300 \cos \left (x \right )-30 \sin \left (5 x \right )+150 \sin \left (3 x \right )+300 \sin \left (x \right )}\) \(70\)
norman \(\frac {-8 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 \tan \left (\frac {x}{2}\right )-2 \left (\tan ^{9}\left (\frac {x}{2}\right )\right )+8 \left (\tan ^{8}\left (\frac {x}{2}\right )\right )-\frac {40 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-\frac {40 \left (\tan ^{7}\left (\frac {x}{2}\right )\right )}{3}-\frac {8 \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{3}+\frac {8 \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{3}+\frac {236 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{15}}{\left (\tan ^{2}\left (\frac {x}{2}\right )-2 \tan \left (\frac {x}{2}\right )-1\right )^{5}}\) \(89\)

[In]

int(1/(cos(x)+sin(x))^6,x,method=_RETURNVERBOSE)

[Out]

2/15*(-1+10*exp(4*I*x)+5*I*exp(2*I*x))/(exp(2*I*x)+I)^5

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.34 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {8 \, \cos \left (x\right )^{5} - 20 \, \cos \left (x\right )^{3} - {\left (8 \, \cos \left (x\right )^{4} + 4 \, \cos \left (x\right )^{2} - 7\right )} \sin \left (x\right ) + 5 \, \cos \left (x\right )}{30 \, {\left (4 \, \cos \left (x\right )^{5} + {\left (4 \, \cos \left (x\right )^{4} - 8 \, \cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) - 5 \, \cos \left (x\right )\right )}} \]

[In]

integrate(1/(cos(x)+sin(x))^6,x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 838 vs. \(2 (51) = 102\).

Time = 3.80 (sec) , antiderivative size = 838, normalized size of antiderivative = 16.76 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=\text {Too large to display} \]

[In]

integrate(1/(cos(x)+sin(x))**6,x)

[Out]

-30*tan(x/2)**9/(15*tan(x/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 102
0*tan(x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) + 120*tan(x/2)**8/(15
*tan(x/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450
*tan(x/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) - 200*tan(x/2)**7/(15*tan(x/2)**10 - 150
*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x/2)**4 - 600*
tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) - 40*tan(x/2)**6/(15*tan(x/2)**10 - 150*tan(x/2)**9 + 525*t
an(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**3 - 525*ta
n(x/2)**2 - 150*tan(x/2) - 15) + 236*tan(x/2)**5/(15*tan(x/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*ta
n(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan
(x/2) - 15) + 40*tan(x/2)**4/(15*tan(x/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(
x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) - 200*ta
n(x/2)**3/(15*tan(x/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(
x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) - 120*tan(x/2)**2/(15*tan(x
/2)**10 - 150*tan(x/2)**9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x
/2)**4 - 600*tan(x/2)**3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15) - 30*tan(x/2)/(15*tan(x/2)**10 - 150*tan(x/2)*
*9 + 525*tan(x/2)**8 - 600*tan(x/2)**7 - 450*tan(x/2)**6 + 1020*tan(x/2)**5 + 450*tan(x/2)**4 - 600*tan(x/2)**
3 - 525*tan(x/2)**2 - 150*tan(x/2) - 15)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.12 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {15 \, \tan \left (x\right )^{4} + 30 \, \tan \left (x\right )^{3} + 40 \, \tan \left (x\right )^{2} + 20 \, \tan \left (x\right ) + 7}{15 \, {\left (\tan \left (x\right )^{5} + 5 \, \tan \left (x\right )^{4} + 10 \, \tan \left (x\right )^{3} + 10 \, \tan \left (x\right )^{2} + 5 \, \tan \left (x\right ) + 1\right )}} \]

[In]

integrate(1/(cos(x)+sin(x))^6,x, algorithm="maxima")

[Out]

-1/15*(15*tan(x)^4 + 30*tan(x)^3 + 40*tan(x)^2 + 20*tan(x) + 7)/(tan(x)^5 + 5*tan(x)^4 + 10*tan(x)^3 + 10*tan(
x)^2 + 5*tan(x) + 1)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.64 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=-\frac {15 \, \tan \left (x\right )^{4} + 30 \, \tan \left (x\right )^{3} + 40 \, \tan \left (x\right )^{2} + 20 \, \tan \left (x\right ) + 7}{15 \, {\left (\tan \left (x\right ) + 1\right )}^{5}} \]

[In]

integrate(1/(cos(x)+sin(x))^6,x, algorithm="giac")

[Out]

-1/15*(15*tan(x)^4 + 30*tan(x)^3 + 40*tan(x)^2 + 20*tan(x) + 7)/(tan(x) + 1)^5

Mupad [B] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.76 \[ \int \frac {1}{(\cos (x)+\sin (x))^6} \, dx=\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )\,\left (15\,{\mathrm {tan}\left (\frac {x}{2}\right )}^8-60\,{\mathrm {tan}\left (\frac {x}{2}\right )}^7+100\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+20\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5-118\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4-20\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+100\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+60\,\mathrm {tan}\left (\frac {x}{2}\right )+15\right )}{15\,{\left (-{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}^5} \]

[In]

int(1/(cos(x) + sin(x))^6,x)

[Out]

(2*tan(x/2)*(60*tan(x/2) + 100*tan(x/2)^2 - 20*tan(x/2)^3 - 118*tan(x/2)^4 + 20*tan(x/2)^5 + 100*tan(x/2)^6 -
60*tan(x/2)^7 + 15*tan(x/2)^8 + 15))/(15*(2*tan(x/2) - tan(x/2)^2 + 1)^5)