\(\int \sec (a+b x) \sec ^2(c+b x) \, dx\) [319]

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

Optimal result

Integrand size = 15, antiderivative size = 61 \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=-\frac {\text {arctanh}(\sin (c+b x)) \cot (a-c) \csc (a-c)}{b}+\frac {\text {arctanh}(\sin (a+b x)) \csc ^2(a-c)}{b}-\frac {\csc (a-c) \sec (c+b x)}{b} \] Output:

-arctanh(sin(b*x+c))*cot(a-c)*csc(a-c)/b+arctanh(sin(b*x+a))*csc(a-c)^2/b- 
csc(a-c)*sec(b*x+c)/b
 

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.57 \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=-\frac {\csc (a-c) \left (2 \text {arctanh}\left (\sin (c)+\cos (c) \tan \left (\frac {b x}{2}\right )\right ) \cot (a-c)+\csc (a-c) \left (\log \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (a+b x)\right )+\sin \left (\frac {1}{2} (a+b x)\right )\right )\right )+\sec (c+b x)\right )}{b} \] Input:

Integrate[Sec[a + b*x]*Sec[c + b*x]^2,x]
 

Output:

-((Csc[a - c]*(2*ArcTanh[Sin[c] + Cos[c]*Tan[(b*x)/2]]*Cot[a - c] + Csc[a 
- c]*(Log[Cos[(a + b*x)/2] - Sin[(a + b*x)/2]] - Log[Cos[(a + b*x)/2] + Si 
n[(a + b*x)/2]]) + Sec[c + b*x]))/b)
 

Rubi [F]

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 \sec (a+b x) \sec ^2(b x+c) \, dx\)

\(\Big \downarrow \) 7299

\(\displaystyle \int \sec (a+b x) \sec ^2(b x+c)dx\)

Input:

Int[Sec[a + b*x]*Sec[c + b*x]^2,x]
 

Output:

$Aborted
 

Defintions of rubi rules used

rule 7299
Int[u_, x_] :> CannotIntegrate[u, x]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(355\) vs. \(2(61)=122\).

Time = 1.51 (sec) , antiderivative size = 356, normalized size of antiderivative = 5.84

method result size
default \(\frac {-\frac {\ln \left (\tan \left (\frac {a}{2}+\frac {b x}{2}\right )-1\right )}{\left (\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right )^{2}}+\frac {\frac {2 \left (\frac {\left (\cos \left (c \right )^{2} \sin \left (a \right )^{2}-2 \cos \left (a \right ) \cos \left (c \right ) \sin \left (a \right ) \sin \left (c \right )+\sin \left (c \right )^{2} \cos \left (a \right )^{2}\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )}{\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )}+\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right )}{\cos \left (c \right ) \cos \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )^{2}+\sin \left (c \right ) \sin \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )^{2}-2 \cos \left (c \right ) \sin \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )+2 \sin \left (c \right ) \cos \left (a \right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )-\cos \left (a \right ) \cos \left (c \right )-\sin \left (a \right ) \sin \left (c \right )}+\frac {2 \left (\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right ) \arctan \left (\frac {2 \left (\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right ) \tan \left (\frac {a}{2}+\frac {b x}{2}\right )-2 \sin \left (a \right ) \cos \left (c \right )+2 \cos \left (a \right ) \sin \left (c \right )}{2 \sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}\right )}{\sqrt {-\cos \left (c \right )^{2} \sin \left (a \right )^{2}-\cos \left (a \right )^{2} \cos \left (c \right )^{2}-\sin \left (a \right )^{2} \sin \left (c \right )^{2}-\sin \left (c \right )^{2} \cos \left (a \right )^{2}}}}{\left (\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right )^{2}}+\frac {\ln \left (\tan \left (\frac {a}{2}+\frac {b x}{2}\right )+1\right )}{\left (\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right )^{2}}}{b}\) \(356\)
risch \(-\frac {4 i {\mathrm e}^{i \left (b x +3 a +2 c \right )}}{\left ({\mathrm e}^{2 i \left (b x +a +c \right )}+{\mathrm e}^{2 i a}\right ) \left ({\mathrm e}^{2 i a}-{\mathrm e}^{2 i c}\right ) b}-\frac {4 \ln \left ({\mathrm e}^{i \left (b x +a \right )}+i\right ) {\mathrm e}^{2 i \left (a +c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}-\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}-i {\mathrm e}^{i \left (a -c \right )}\right ) {\mathrm e}^{i \left (3 a +c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}-\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}-i {\mathrm e}^{i \left (a -c \right )}\right ) {\mathrm e}^{i \left (a +3 c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}+\frac {4 \ln \left ({\mathrm e}^{i \left (b x +a \right )}-i\right ) {\mathrm e}^{2 i \left (a +c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}+\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}+i {\mathrm e}^{i \left (a -c \right )}\right ) {\mathrm e}^{i \left (3 a +c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}+\frac {2 \ln \left ({\mathrm e}^{i \left (b x +a \right )}+i {\mathrm e}^{i \left (a -c \right )}\right ) {\mathrm e}^{i \left (a +3 c \right )}}{\left ({\mathrm e}^{4 i a}-2 \,{\mathrm e}^{2 i \left (a +c \right )}+{\mathrm e}^{4 i c}\right ) b}\) \(385\)

Input:

int(sec(b*x+a)*sec(b*x+c)^2,x,method=_RETURNVERBOSE)
 

Output:

1/b*(-1/(sin(a)*cos(c)-cos(a)*sin(c))^2*ln(tan(1/2*a+1/2*b*x)-1)+2/(sin(a) 
*cos(c)-cos(a)*sin(c))^2*(((cos(c)^2*sin(a)^2-2*cos(a)*cos(c)*sin(a)*sin(c 
)+sin(c)^2*cos(a)^2)/(cos(a)*cos(c)+sin(a)*sin(c))*tan(1/2*a+1/2*b*x)+sin( 
a)*cos(c)-cos(a)*sin(c))/(cos(c)*cos(a)*tan(1/2*a+1/2*b*x)^2+sin(c)*sin(a) 
*tan(1/2*a+1/2*b*x)^2-2*cos(c)*sin(a)*tan(1/2*a+1/2*b*x)+2*sin(c)*cos(a)*t 
an(1/2*a+1/2*b*x)-cos(a)*cos(c)-sin(a)*sin(c))+(cos(a)*cos(c)+sin(a)*sin(c 
))/(-cos(c)^2*sin(a)^2-cos(a)^2*cos(c)^2-sin(a)^2*sin(c)^2-sin(c)^2*cos(a) 
^2)^(1/2)*arctan(1/2*(2*(cos(a)*cos(c)+sin(a)*sin(c))*tan(1/2*a+1/2*b*x)-2 
*sin(a)*cos(c)+2*cos(a)*sin(c))/(-cos(c)^2*sin(a)^2-cos(a)^2*cos(c)^2-sin( 
a)^2*sin(c)^2-sin(c)^2*cos(a)^2)^(1/2)))+1/(sin(a)*cos(c)-cos(a)*sin(c))^2 
*ln(tan(1/2*a+1/2*b*x)+1))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 181 vs. \(2 (61) = 122\).

Time = 0.10 (sec) , antiderivative size = 181, normalized size of antiderivative = 2.97 \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=\frac {\cos \left (b x + c\right ) \cos \left (-a + c\right ) \log \left (\sin \left (b x + c\right ) + 1\right ) - \cos \left (b x + c\right ) \cos \left (-a + c\right ) \log \left (-\sin \left (b x + c\right ) + 1\right ) - \cos \left (b x + c\right ) \log \left (\frac {2 \, {\left (\cos \left (-a + c\right ) \sin \left (b x + c\right ) - \cos \left (b x + c\right ) \sin \left (-a + c\right ) + 1\right )}}{\cos \left (-a + c\right ) + 1}\right ) + \cos \left (b x + c\right ) \log \left (-\frac {2 \, {\left (\cos \left (-a + c\right ) \sin \left (b x + c\right ) - \cos \left (b x + c\right ) \sin \left (-a + c\right ) - 1\right )}}{\cos \left (-a + c\right ) + 1}\right ) - 2 \, \sin \left (-a + c\right )}{2 \, {\left (b \cos \left (-a + c\right )^{2} - b\right )} \cos \left (b x + c\right )} \] Input:

integrate(sec(b*x+a)*sec(b*x+c)^2,x, algorithm="fricas")
 

Output:

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

Sympy [F]

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

integrate(sec(b*x+a)*sec(b*x+c)**2,x)
 

Output:

Integral(sec(a + b*x)*sec(b*x + c)**2, x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 12393 vs. \(2 (61) = 122\).

Time = 0.34 (sec) , antiderivative size = 12393, normalized size of antiderivative = 203.16 \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=\text {Too large to display} \] Input:

integrate(sec(b*x+a)*sec(b*x+c)^2,x, algorithm="maxima")
 

Output:

-(4*(cos(4*a)^2 - 4*(cos(4*a) + cos(4*c))*cos(2*a + 2*c) + 4*cos(2*a + 2*c 
)^2 + 2*cos(4*a)*cos(4*c) + cos(4*c)^2 + sin(4*a)^2 - 4*(sin(4*a) + sin(4* 
c))*sin(2*a + 2*c) + 4*sin(2*a + 2*c)^2 + 2*sin(4*a)*sin(4*c) + sin(4*c)^2 
)*cos(b*x + a + 2*c)*sin(2*b*x + 2*a + 2*c) - 4*(cos(4*a)^2 - 4*(cos(4*a) 
+ cos(4*c))*cos(2*a + 2*c) + 4*cos(2*a + 2*c)^2 + 2*cos(4*a)*cos(4*c) + co 
s(4*c)^2 + sin(4*a)^2 - 4*(sin(4*a) + sin(4*c))*sin(2*a + 2*c) + 4*sin(2*a 
 + 2*c)^2 + 2*sin(4*a)*sin(4*c) + sin(4*c)^2)*cos(b*x + a + 2*c)*sin(2*b*x 
 + 4*c) - 4*(cos(4*a)^2 - 4*(cos(4*a) + cos(4*c))*cos(2*a + 2*c) + 4*cos(2 
*a + 2*c)^2 + 2*cos(4*a)*cos(4*c) + cos(4*c)^2 + sin(4*a)^2 - 4*(sin(4*a) 
+ sin(4*c))*sin(2*a + 2*c) + 4*sin(2*a + 2*c)^2 + 2*sin(4*a)*sin(4*c) + si 
n(4*c)^2)*cos(2*b*x + 2*a + 2*c)*sin(b*x + a + 2*c) + 4*(cos(4*a)^2 - 4*(c 
os(4*a) + cos(4*c))*cos(2*a + 2*c) + 4*cos(2*a + 2*c)^2 + 2*cos(4*a)*cos(4 
*c) + cos(4*c)^2 + sin(4*a)^2 - 4*(sin(4*a) + sin(4*c))*sin(2*a + 2*c) + 4 
*sin(2*a + 2*c)^2 + 2*sin(4*a)*sin(4*c) + sin(4*c)^2)*cos(2*b*x + 4*c)*sin 
(b*x + a + 2*c) + 4*(((sin(4*a) + sin(4*c))*cos(2*a + 2*c) - (cos(4*a) + c 
os(4*c))*sin(2*a + 2*c))*cos(2*b*x + 2*a + 2*c)^2 + ((sin(4*a) + sin(4*c)) 
*cos(2*a + 2*c) - (cos(4*a) + cos(4*c))*sin(2*a + 2*c))*cos(2*b*x + 4*c)^2 
 + ((sin(4*a) + sin(4*c))*cos(2*a + 2*c) - (cos(4*a) + cos(4*c))*sin(2*a + 
 2*c))*sin(2*b*x + 2*a + 2*c)^2 + ((sin(4*a) + sin(4*c))*cos(2*a + 2*c) - 
(cos(4*a) + cos(4*c))*sin(2*a + 2*c))*sin(2*b*x + 4*c)^2 + 2*((cos(2*a)...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2905 vs. \(2 (61) = 122\).

Time = 0.36 (sec) , antiderivative size = 2905, normalized size of antiderivative = 47.62 \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=\text {Too large to display} \] Input:

integrate(sec(b*x+a)*sec(b*x+c)^2,x, algorithm="giac")
 

Output:

1/4*((tan(1/2*a)^5*tan(1/2*c)^5 - tan(1/2*a)^5*tan(1/2*c)^4 + tan(1/2*a)^4 
*tan(1/2*c)^5 + 5*tan(1/2*a)^4*tan(1/2*c)^4 - 4*tan(1/2*a)^4*tan(1/2*c)^3 
+ 4*tan(1/2*a)^3*tan(1/2*c)^4 - tan(1/2*a)^5*tan(1/2*c) + 4*tan(1/2*a)^4*t 
an(1/2*c)^2 + 4*tan(1/2*a)^3*tan(1/2*c)^3 + 4*tan(1/2*a)^2*tan(1/2*c)^4 - 
tan(1/2*a)*tan(1/2*c)^5 + tan(1/2*a)^5 - 5*tan(1/2*a)^4*tan(1/2*c) + 4*tan 
(1/2*a)^3*tan(1/2*c)^2 - 4*tan(1/2*a)^2*tan(1/2*c)^3 + 5*tan(1/2*a)*tan(1/ 
2*c)^4 - tan(1/2*c)^5 - tan(1/2*a)^4 + 4*tan(1/2*a)^3*tan(1/2*c) + 4*tan(1 
/2*a)^2*tan(1/2*c)^2 + 4*tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*c)^4 - 4*tan(1/ 
2*a)^2*tan(1/2*c) + 4*tan(1/2*a)*tan(1/2*c)^2 + 5*tan(1/2*a)*tan(1/2*c) - 
tan(1/2*a) + tan(1/2*c) + 1)*log(abs(-tan(1/2*b*x + 1/2*a)*tan(1/2*a)*tan( 
1/2*c) + tan(1/2*b*x + 1/2*a)*tan(1/2*a) - tan(1/2*b*x + 1/2*a)*tan(1/2*c) 
 + tan(1/2*a)*tan(1/2*c) - tan(1/2*b*x + 1/2*a) + tan(1/2*a) - tan(1/2*c) 
+ 1))/(tan(1/2*a)^5*tan(1/2*c)^3 - 2*tan(1/2*a)^4*tan(1/2*c)^4 + tan(1/2*a 
)^3*tan(1/2*c)^5 - tan(1/2*a)^5*tan(1/2*c)^2 + 3*tan(1/2*a)^4*tan(1/2*c)^3 
 - 3*tan(1/2*a)^3*tan(1/2*c)^4 + tan(1/2*a)^2*tan(1/2*c)^5 + 3*tan(1/2*a)^ 
4*tan(1/2*c)^2 - 6*tan(1/2*a)^3*tan(1/2*c)^3 + 3*tan(1/2*a)^2*tan(1/2*c)^4 
 - 2*tan(1/2*a)^4*tan(1/2*c) + 6*tan(1/2*a)^3*tan(1/2*c)^2 - 6*tan(1/2*a)^ 
2*tan(1/2*c)^3 + 2*tan(1/2*a)*tan(1/2*c)^4 + 3*tan(1/2*a)^3*tan(1/2*c) - 6 
*tan(1/2*a)^2*tan(1/2*c)^2 + 3*tan(1/2*a)*tan(1/2*c)^3 - tan(1/2*a)^3 + 3* 
tan(1/2*a)^2*tan(1/2*c) - 3*tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*c)^3 + ta...
 

Mupad [F(-1)]

Timed out. \[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=\text {Hanged} \] Input:

int(1/(cos(a + b*x)*cos(c + b*x)^2),x)
 

Output:

\text{Hanged}
 

Reduce [F]

\[ \int \sec (a+b x) \sec ^2(c+b x) \, dx=\frac {-\cos \left (b x +c \right ) \left (\int \frac {\sin \left (b x +c \right )^{2}}{\sin \left (b x +c \right )^{2}-1}d x \right ) b -\cos \left (b x +c \right ) \left (\int \frac {\sin \left (b x +c \right )^{2}}{\cos \left (b x +a \right ) \sin \left (b x +c \right )^{2}-\cos \left (b x +a \right )}d x \right ) b -\cos \left (b x +c \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )-1\right )+\cos \left (b x +c \right ) \mathrm {log}\left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )+\cos \left (b x +c \right ) b x -\sin \left (b x +c \right )}{\cos \left (b x +c \right ) b} \] Input:

int(sec(b*x+a)*sec(b*x+c)^2,x)
 

Output:

( - cos(b*x + c)*int(sin(b*x + c)**2/(sin(b*x + c)**2 - 1),x)*b - cos(b*x 
+ c)*int(sin(b*x + c)**2/(cos(a + b*x)*sin(b*x + c)**2 - cos(a + b*x)),x)* 
b - cos(b*x + c)*log(tan((a + b*x)/2) - 1) + cos(b*x + c)*log(tan((a + b*x 
)/2) + 1) + cos(b*x + c)*b*x - sin(b*x + c))/(cos(b*x + c)*b)