\(\int \frac {1}{(\sec (x)+\tan (x))^5} \, dx\) [282]

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

Optimal result

Integrand size = 7, antiderivative size = 22 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=\log (1+\sin (x))-\frac {2}{(1+\sin (x))^2}+\frac {4}{1+\sin (x)} \]

[Out]

ln(1+sin(x))-2/(1+sin(x))^2+4/(1+sin(x))

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 22, 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 = {4476, 2746, 45} \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=\frac {4}{\sin (x)+1}-\frac {2}{(\sin (x)+1)^2}+\log (\sin (x)+1) \]

[In]

Int[(Sec[x] + Tan[x])^(-5),x]

[Out]

Log[1 + Sin[x]] - 2/(1 + Sin[x])^2 + 4/(1 + Sin[x])

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rule 4476

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

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

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.77 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=2 \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\frac {2+4 \sin (x)}{\left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )^4} \]

[In]

Integrate[(Sec[x] + Tan[x])^(-5),x]

[Out]

2*Log[Cos[x/2] + Sin[x/2]] + (2 + 4*Sin[x])/(Cos[x/2] + Sin[x/2])^4

Maple [A] (verified)

Time = 6.85 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.05

method result size
default \(\ln \left (1+\sin \left (x \right )\right )-\frac {2}{\left (1+\sin \left (x \right )\right )^{2}}+\frac {4}{1+\sin \left (x \right )}\) \(23\)
risch \(-i x +\frac {8 i \left (i {\mathrm e}^{2 i x}+{\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{\left (i+{\mathrm e}^{i x}\right )^{4}}+2 \ln \left (i+{\mathrm e}^{i x}\right )\) \(51\)

[In]

int(1/(sec(x)+tan(x))^5,x,method=_RETURNVERBOSE)

[Out]

ln(1+sin(x))-2/(1+sin(x))^2+4/(1+sin(x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.59 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=\frac {{\left (\cos \left (x\right )^{2} - 2 \, \sin \left (x\right ) - 2\right )} \log \left (\sin \left (x\right ) + 1\right ) - 4 \, \sin \left (x\right ) - 2}{\cos \left (x\right )^{2} - 2 \, \sin \left (x\right ) - 2} \]

[In]

integrate(1/(sec(x)+tan(x))^5,x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1059 vs. \(2 (20) = 40\).

Time = 1.66 (sec) , antiderivative size = 1059, normalized size of antiderivative = 48.14 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=\text {Too large to display} \]

[In]

integrate(1/(sec(x)+tan(x))**5,x)

[Out]

36*log(tan(x) + sec(x))*tan(x)**4/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*
sec(x)**3 + 36*sec(x)**4) + 144*log(tan(x) + sec(x))*tan(x)**3*sec(x)/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 2
16*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) + 216*log(tan(x) + sec(x))*tan(x)**2*sec(x)**2/(
36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) + 144*log
(tan(x) + sec(x))*tan(x)*sec(x)**3/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)
*sec(x)**3 + 36*sec(x)**4) + 36*log(tan(x) + sec(x))*sec(x)**4/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(
x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 18*log(tan(x)**2 + 1)*tan(x)**4/(36*tan(x)**4 + 144*t
an(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 72*log(tan(x)**2 + 1)*tan(x
)**3*sec(x)/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)*
*4) - 108*log(tan(x)**2 + 1)*tan(x)**2*sec(x)**2/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**
2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 72*log(tan(x)**2 + 1)*tan(x)*sec(x)**3/(36*tan(x)**4 + 144*tan(x)**
3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 18*log(tan(x)**2 + 1)*sec(x)**4/(3
6*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 28*tan(x
)**4/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 5
2*tan(x)**3*sec(x)/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*
sec(x)**4) + 18*tan(x)**2/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**
3 + 36*sec(x)**4) + 44*tan(x)*sec(x)**3/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)**2 + 144*t
an(x)*sec(x)**3 + 36*sec(x)**4) + 24*tan(x)*sec(x)/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2*sec(x)
**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) + 20*sec(x)**4/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)**2
*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) + 6*sec(x)**2/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan
(x)**2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4) - 9/(36*tan(x)**4 + 144*tan(x)**3*sec(x) + 216*tan(x)*
*2*sec(x)**2 + 144*tan(x)*sec(x)**3 + 36*sec(x)**4)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (22) = 44\).

Time = 0.31 (sec) , antiderivative size = 92, normalized size of antiderivative = 4.18 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=-\frac {8 \, \sin \left (x\right )^{2}}{{\left (\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {6 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {4 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {\sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + 1\right )} {\left (\cos \left (x\right ) + 1\right )}^{2}} + 2 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right ) \]

[In]

integrate(1/(sec(x)+tan(x))^5,x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 64 vs. \(2 (22) = 44\).

Time = 0.27 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.91 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=-\frac {25 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 100 \, \tan \left (\frac {1}{2} \, x\right )^{3} + 198 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 100 \, \tan \left (\frac {1}{2} \, x\right ) + 25}{6 \, {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{4}} - \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + 2 \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) \]

[In]

integrate(1/(sec(x)+tan(x))^5,x, algorithm="giac")

[Out]

-1/6*(25*tan(1/2*x)^4 + 100*tan(1/2*x)^3 + 198*tan(1/2*x)^2 + 100*tan(1/2*x) + 25)/(tan(1/2*x) + 1)^4 - log(ta
n(1/2*x)^2 + 1) + 2*log(abs(tan(1/2*x) + 1))

Mupad [B] (verification not implemented)

Time = 30.56 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.77 \[ \int \frac {1}{(\sec (x)+\tan (x))^5} \, dx=2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )-\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-\frac {8\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{{\mathrm {tan}\left (\frac {x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+6\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+4\,\mathrm {tan}\left (\frac {x}{2}\right )+1} \]

[In]

int(1/(tan(x) + 1/cos(x))^5,x)

[Out]

2*log(tan(x/2) + 1) - log(tan(x/2)^2 + 1) - (8*tan(x/2)^2)/(4*tan(x/2) + 6*tan(x/2)^2 + 4*tan(x/2)^3 + tan(x/2
)^4 + 1)