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

Optimal. Leaf size=51 \[ \frac{a^2-b^2}{2 b^3 (a+b \sin (x))^2}-\frac{2 a}{b^3 (a+b \sin (x))}-\frac{\log (a+b \sin (x))}{b^3} \]

[Out]

-(Log[a + b*Sin[x]]/b^3) + (a^2 - b^2)/(2*b^3*(a + b*Sin[x])^2) - (2*a)/(b^3*(a + b*Sin[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0751398, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {4391, 2668, 697} \[ \frac{a^2-b^2}{2 b^3 (a+b \sin (x))^2}-\frac{2 a}{b^3 (a+b \sin (x))}-\frac{\log (a+b \sin (x))}{b^3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(Log[a + b*Sin[x]]/b^3) + (a^2 - b^2)/(2*b^3*(a + b*Sin[x])^2) - (2*a)/(b^3*(a + b*Sin[x]))

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]

Rule 2668

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*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \frac{1}{(a \sec (x)+b \tan (x))^3} \, dx &=\int \frac{\cos ^3(x)}{(a+b \sin (x))^3} \, dx\\ &=\frac{\operatorname{Subst}\left (\int \frac{b^2-x^2}{(a+x)^3} \, dx,x,b \sin (x)\right )}{b^3}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{-a-x}+\frac{-a^2+b^2}{(a+x)^3}+\frac{2 a}{(a+x)^2}\right ) \, dx,x,b \sin (x)\right )}{b^3}\\ &=-\frac{\log (a+b \sin (x))}{b^3}+\frac{a^2-b^2}{2 b^3 (a+b \sin (x))^2}-\frac{2 a}{b^3 (a+b \sin (x))}\\ \end{align*}

Mathematica [A]  time = 0.165935, size = 40, normalized size = 0.78 \[ -\frac{\frac{3 a^2+4 a b \sin (x)+b^2}{2 (a+b \sin (x))^2}+\log (a+b \sin (x))}{b^3} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-((Log[a + b*Sin[x]] + (3*a^2 + b^2 + 4*a*b*Sin[x])/(2*(a + b*Sin[x])^2))/b^3)

________________________________________________________________________________________

Maple [A]  time = 0.085, size = 57, normalized size = 1.1 \begin{align*} -{\frac{\ln \left ( a+b\sin \left ( x \right ) \right ) }{{b}^{3}}}-2\,{\frac{a}{{b}^{3} \left ( a+b\sin \left ( x \right ) \right ) }}+{\frac{{a}^{2}}{2\,{b}^{3} \left ( a+b\sin \left ( x \right ) \right ) ^{2}}}-{\frac{1}{2\,b \left ( a+b\sin \left ( x \right ) \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-ln(a+b*sin(x))/b^3-2*a/b^3/(a+b*sin(x))+1/2/b^3/(a+b*sin(x))^2*a^2-1/2/b/(a+b*sin(x))^2

________________________________________________________________________________________

Maxima [B]  time = 1.56461, size = 271, normalized size = 5.31 \begin{align*} \frac{2 \,{\left (\frac{{\left (a^{3} + a b^{2}\right )} \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{{\left (3 \, a^{2} b + b^{3}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{{\left (a^{3} + a b^{2}\right )} \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}}\right )}}{a^{4} b^{2} + \frac{4 \, a^{3} b^{3} \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{4 \, a^{3} b^{3} \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac{a^{4} b^{2} \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac{2 \,{\left (a^{4} b^{2} + 2 \, a^{2} b^{4}\right )} \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}} - \frac{\log \left (a + \frac{2 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{b^{3}} + \frac{\log \left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.44208, size = 197, normalized size = 3.86 \begin{align*} \frac{4 \, a b \sin \left (x\right ) + 3 \, a^{2} + b^{2} - 2 \,{\left (b^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}\right )} \log \left (b \sin \left (x\right ) + a\right )}{2 \,{\left (b^{5} \cos \left (x\right )^{2} - 2 \, a b^{4} \sin \left (x\right ) - a^{2} b^{3} - b^{5}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(4*a*b*sin(x) + 3*a^2 + b^2 - 2*(b^2*cos(x)^2 - 2*a*b*sin(x) - a^2 - b^2)*log(b*sin(x) + a))/(b^5*cos(x)^2
 - 2*a*b^4*sin(x) - a^2*b^3 - b^5)

________________________________________________________________________________________

Sympy [A]  time = 4.61103, size = 508, normalized size = 9.96 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((-2*a**2*log(a*sec(x)/b + tan(x))*sec(x)**2/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5
*tan(x)**2) + a**2*log(tan(x)**2 + 1)*sec(x)**2/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*tan(x
)**2) - 4*a*b*log(a*sec(x)/b + tan(x))*tan(x)*sec(x)/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*
tan(x)**2) + 2*a*b*log(tan(x)**2 + 1)*tan(x)*sec(x)/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*t
an(x)**2) + 2*a*b*tan(x)*sec(x)/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*tan(x)**2) - 2*b**2*l
og(a*sec(x)/b + tan(x))*tan(x)**2/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*tan(x)**2) + b**2*l
og(tan(x)**2 + 1)*tan(x)**2/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*tan(x)**2) + 2*b**2*tan(x
)**2/(2*a**2*b**3*sec(x)**2 + 4*a*b**4*tan(x)*sec(x) + 2*b**5*tan(x)**2) - b**2/(2*a**2*b**3*sec(x)**2 + 4*a*b
**4*tan(x)*sec(x) + 2*b**5*tan(x)**2), Ne(b, 0)), ((2*tan(x)**3/(3*sec(x)**3) + tan(x)/sec(x)**3)/a**3, True))

________________________________________________________________________________________

Giac [A]  time = 1.15079, size = 58, normalized size = 1.14 \begin{align*} -\frac{\log \left ({\left | b \sin \left (x\right ) + a \right |}\right )}{b^{3}} + \frac{3 \, b \sin \left (x\right )^{2} + 2 \, a \sin \left (x\right ) - b}{2 \,{\left (b \sin \left (x\right ) + a\right )}^{2} b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(abs(b*sin(x) + a))/b^3 + 1/2*(3*b*sin(x)^2 + 2*a*sin(x) - b)/((b*sin(x) + a)^2*b^2)