3.280 \(\int \frac {1}{(\sec (x)+\tan (x))^3} \, dx\)

Optimal. Leaf size=16 \[ -\frac {2}{\sin (x)+1}-\log (\sin (x)+1) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4391, 2667, 43} \[ -\frac {2}{\sin (x)+1}-\log (\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 43

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 2667

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 4391

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*} \int \frac {1}{(\sec (x)+\tan (x))^3} \, dx &=\int \frac {\cos ^3(x)}{(1+\sin (x))^3} \, dx\\ &=\operatorname {Subst}\left (\int \frac {1-x}{(1+x)^2} \, dx,x,\sin (x)\right )\\ &=\operatorname {Subst}\left (\int \left (\frac {1}{-1-x}+\frac {2}{(1+x)^2}\right ) \, dx,x,\sin (x)\right )\\ &=-\log (1+\sin (x))-\frac {2}{1+\sin (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.02, size = 34, normalized size = 2.12 \[ -\frac {2}{\left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )^2}-2 \log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.07, size = 20, normalized size = 1.25 \[ -\frac {{\left (\sin \relax (x) + 1\right )} \log \left (\sin \relax (x) + 1\right ) + 2}{\sin \relax (x) + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-((sin(x) + 1)*log(sin(x) + 1) + 2)/(sin(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.16, size = 45, normalized size = 2.81 \[ \frac {3 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 10 \, \tan \left (\frac {1}{2} \, x\right ) + 3}{{\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}^{2}} + \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(3*tan(1/2*x)^2 + 10*tan(1/2*x) + 3)/(tan(1/2*x) + 1)^2 + log(tan(1/2*x)^2 + 1) - 2*log(abs(tan(1/2*x) + 1))

________________________________________________________________________________________

maple [A]  time = 0.16, size = 17, normalized size = 1.06 \[ -\ln \left (1+\sin \relax (x )\right )-\frac {2}{1+\sin \relax (x )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sec(x)+tan(x))^3,x)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.44, size = 64, normalized size = 4.00 \[ \frac {4 \, \sin \relax (x)}{{\left (\frac {2 \, \sin \relax (x)}{\cos \relax (x) + 1} + \frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1\right )} {\left (\cos \relax (x) + 1\right )}} - 2 \, \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) + \log \left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.36, size = 41, normalized size = 2.56 \[ \ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )+\frac {4\,\mathrm {tan}\left (\frac {x}{2}\right )}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,\mathrm {tan}\left (\frac {x}{2}\right )+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [B]  time = 0.83, size = 301, normalized size = 18.81 \[ - \frac {2 \log {\left (\tan {\relax (x )} + \sec {\relax (x )} \right )} \tan ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} - \frac {4 \log {\left (\tan {\relax (x )} + \sec {\relax (x )} \right )} \tan {\relax (x )} \sec {\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} - \frac {2 \log {\left (\tan {\relax (x )} + \sec {\relax (x )} \right )} \sec ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} + \frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )} \tan ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} + \frac {2 \log {\left (\tan ^{2}{\relax (x )} + 1 \right )} \tan {\relax (x )} \sec {\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} + \frac {\log {\left (\tan ^{2}{\relax (x )} + 1 \right )} \sec ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} + \frac {\tan ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} - \frac {\sec ^{2}{\relax (x )}}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} - \frac {1}{2 \tan ^{2}{\relax (x )} + 4 \tan {\relax (x )} \sec {\relax (x )} + 2 \sec ^{2}{\relax (x )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*log(tan(x) + sec(x))*tan(x)**2/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) - 4*log(tan(x) + sec(x))*tan(x
)*sec(x)/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) - 2*log(tan(x) + sec(x))*sec(x)**2/(2*tan(x)**2 + 4*tan
(x)*sec(x) + 2*sec(x)**2) + log(tan(x)**2 + 1)*tan(x)**2/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) + 2*log
(tan(x)**2 + 1)*tan(x)*sec(x)/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) + log(tan(x)**2 + 1)*sec(x)**2/(2*
tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) + tan(x)**2/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) - sec(x)*
*2/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2) - 1/(2*tan(x)**2 + 4*tan(x)*sec(x) + 2*sec(x)**2)

________________________________________________________________________________________