\(\int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx\) [558]

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

Optimal result

Integrand size = 21, antiderivative size = 79 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {a \text {arctanh}(\sin (c+d x))}{b^2 d}-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d} \] Output:

-a*arctanh(sin(d*x+c))/b^2/d-(a^2+b^2)^(1/2)*arctanh(cos(d*x+c)*(b-a*tan(d 
*x+c))/(a^2+b^2)^(1/2))/b^2/d+sec(d*x+c)/b/d
 

Mathematica [A] (verified)

Time = 0.33 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.38 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )+a \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+b \sec (c+d x)}{b^2 d} \] Input:

Integrate[Sec[c + d*x]^3/(a + b*Tan[c + d*x]),x]
 

Output:

(2*Sqrt[a^2 + b^2]*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]] + a* 
(Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c 
+ d*x)/2]]) + b*Sec[c + d*x])/(b^2*d)
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.01, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 3989, 3042, 3967, 3042, 3988, 219, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sec (c+d x)^3}{a+b \tan (c+d x)}dx\)

\(\Big \downarrow \) 3989

\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \tan (c+d x)}dx}{b^2}-\frac {\int \sec (c+d x) (a-b \tan (c+d x))dx}{b^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \tan (c+d x)}dx}{b^2}-\frac {\int \sec (c+d x) (a-b \tan (c+d x))dx}{b^2}\)

\(\Big \downarrow \) 3967

\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \tan (c+d x)}dx}{b^2}-\frac {a \int \sec (c+d x)dx-\frac {b \sec (c+d x)}{d}}{b^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\left (a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \tan (c+d x)}dx}{b^2}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {b \sec (c+d x)}{d}}{b^2}\)

\(\Big \downarrow \) 3988

\(\displaystyle -\frac {\left (a^2+b^2\right ) \int \frac {1}{a^2+b^2-\cos ^2(c+d x) (b-a \tan (c+d x))^2}d(\cos (c+d x) (b-a \tan (c+d x)))}{b^2 d}-\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {b \sec (c+d x)}{d}}{b^2}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {a \int \csc \left (c+d x+\frac {\pi }{2}\right )dx-\frac {b \sec (c+d x)}{d}}{b^2}-\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle -\frac {\sqrt {a^2+b^2} \text {arctanh}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {\frac {a \text {arctanh}(\sin (c+d x))}{d}-\frac {b \sec (c+d x)}{d}}{b^2}\)

Input:

Int[Sec[c + d*x]^3/(a + b*Tan[c + d*x]),x]
 

Output:

-((Sqrt[a^2 + b^2]*ArcTanh[(Cos[c + d*x]*(b - a*Tan[c + d*x]))/Sqrt[a^2 + 
b^2]])/(b^2*d)) - ((a*ArcTanh[Sin[c + d*x]])/d - (b*Sec[c + d*x])/d)/b^2
 

Defintions of rubi rules used

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3967
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a   Int[(d 
*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] 
|| NeQ[a^2 + b^2, 0])
 

rule 3988
Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbo 
l] :> Simp[-f^(-1)   Subst[Int[1/(a^2 + b^2 - x^2), x], x, (b - a*Tan[e + f 
*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]
 

rule 3989
Int[sec[(e_.) + (f_.)*(x_)]^(m_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_ 
Symbol] :> Simp[-(b^2)^(-1)   Int[Sec[e + f*x]^(m - 2)*(a - b*Tan[e + f*x]) 
, x], x] + Simp[(a^2 + b^2)/b^2   Int[Sec[e + f*x]^(m - 2)/(a + b*Tan[e + f 
*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0] && IGtQ[(m - 1) 
/2, 0]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 3.85 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.63

method result size
derivativedivides \(\frac {\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) \(129\)
default \(\frac {\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}-\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) \(129\)
risch \(\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d \,b^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \,b^{2}}+\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{2}}-\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{2}}\) \(167\)

Input:

int(sec(d*x+c)^3/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/b/(tan(1/2*d*x+1/2*c)+1)-a/b^2*ln(tan(1/2*d*x+1/2*c)+1)-1/b/(tan(1/ 
2*d*x+1/2*c)-1)+a/b^2*ln(tan(1/2*d*x+1/2*c)-1)-2/b^2*(-a^2-b^2)/(a^2+b^2)^ 
(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 191 vs. \(2 (77) = 154\).

Time = 0.12 (sec) , antiderivative size = 191, normalized size of antiderivative = 2.42 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {a \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - \sqrt {a^{2} + b^{2}} \cos \left (d x + c\right ) \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 2 \, b}{2 \, b^{2} d \cos \left (d x + c\right )} \] Input:

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

Output:

-1/2*(a*cos(d*x + c)*log(sin(d*x + c) + 1) - a*cos(d*x + c)*log(-sin(d*x + 
 c) + 1) - sqrt(a^2 + b^2)*cos(d*x + c)*log(-(2*a*b*cos(d*x + c)*sin(d*x + 
 c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*cos( 
d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2) 
*cos(d*x + c)^2 + b^2)) - 2*b)/(b^2*d*cos(d*x + c))
 

Sympy [F]

\[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\sec ^{3}{\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \] Input:

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

Output:

Integral(sec(c + d*x)**3/(a + b*tan(c + d*x)), x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 163 vs. \(2 (77) = 154\).

Time = 0.12 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.06 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{2}} - \frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{2}} - \frac {2}{b - \frac {b \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \] Input:

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

Output:

-(a*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^2 - a*log(sin(d*x + c)/(cos 
(d*x + c) + 1) - 1)/b^2 + sqrt(a^2 + b^2)*log((b - a*sin(d*x + c)/(cos(d*x 
 + c) + 1) + sqrt(a^2 + b^2))/(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - sqr 
t(a^2 + b^2)))/b^2 - 2/(b - b*sin(d*x + c)^2/(cos(d*x + c) + 1)^2))/d
 

Giac [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.72 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{2}} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}} + \frac {2}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} b}}{d} \] Input:

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

Output:

-(a*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^2 - a*log(abs(tan(1/2*d*x + 1/2*c 
) - 1))/b^2 + sqrt(a^2 + b^2)*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*s 
qrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/b 
^2 + 2/((tan(1/2*d*x + 1/2*c)^2 - 1)*b))/d
 

Mupad [B] (verification not implemented)

Time = 0.94 (sec) , antiderivative size = 310, normalized size of antiderivative = 3.92 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {64\,a^2\,\sqrt {a^2+b^2}}{64\,a^2\,b+\frac {64\,a^4}{b}+128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+128\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {128\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^2+\frac {64\,a^4}{b^2}+\frac {128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}+128\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^4+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b+64\,a^2\,b^2+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^3}\right )\,\sqrt {a^2+b^2}}{b^2\,d}-\frac {2\,a\,\mathrm {atanh}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^2+\frac {64\,a^4}{b^2}}+\frac {64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^4+64\,a^2\,b^2}\right )}{b^2\,d}-\frac {2}{b\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \] Input:

int(1/(cos(c + d*x)^3*(a + b*tan(c + d*x))),x)
 

Output:

(2*atanh((64*a^2*(a^2 + b^2)^(1/2))/(64*a^2*b + (64*a^4)/b + 128*a^3*tan(c 
/2 + (d*x)/2) + 128*a*b^2*tan(c/2 + (d*x)/2)) + (128*a*tan(c/2 + (d*x)/2)* 
(a^2 + b^2)^(1/2))/(64*a^2 + (64*a^4)/b^2 + (128*a^3*tan(c/2 + (d*x)/2))/b 
 + 128*a*b*tan(c/2 + (d*x)/2)) + (64*a^3*tan(c/2 + (d*x)/2)*(a^2 + b^2)^(1 
/2))/(64*a^4 + 64*a^2*b^2 + 128*a*b^3*tan(c/2 + (d*x)/2) + 128*a^3*b*tan(c 
/2 + (d*x)/2)))*(a^2 + b^2)^(1/2))/(b^2*d) - (2*a*atanh((64*a^2*tan(c/2 + 
(d*x)/2))/(64*a^2 + (64*a^4)/b^2) + (64*a^4*tan(c/2 + (d*x)/2))/(64*a^4 + 
64*a^2*b^2)))/(b^2*d) - 2/(b*d*(tan(c/2 + (d*x)/2)^2 - 1))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.43 \[ \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx=\frac {-2 \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a i -b i}{\sqrt {a^{2}+b^{2}}}\right ) \cos \left (d x +c \right ) i +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a -\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a -\cos \left (d x +c \right ) b +b}{\cos \left (d x +c \right ) b^{2} d} \] Input:

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

Output:

( - 2*sqrt(a**2 + b**2)*atan((tan((c + d*x)/2)*a*i - b*i)/sqrt(a**2 + b**2 
))*cos(c + d*x)*i + cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a - cos(c + d*x 
)*log(tan((c + d*x)/2) + 1)*a - cos(c + d*x)*b + b)/(cos(c + d*x)*b**2*d)