\(\int \cos ^2(a+b x) \sec ^4(c+d x) \, dx\) [339]

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

Optimal result

Integrand size = 17, antiderivative size = 157 \[ \int \cos ^2(a+b x) \sec ^4(c+d x) \, dx=\frac {2 i e^{-2 i a-2 i b x+4 i (c+d x)} \operatorname {Hypergeometric2F1}\left (4,2-\frac {b}{d},3-\frac {b}{d},-e^{2 i (c+d x)}\right )}{b-2 d}-\frac {2 i e^{2 i a+2 i b x+4 i (c+d x)} \operatorname {Hypergeometric2F1}\left (4,2+\frac {b}{d},3+\frac {b}{d},-e^{2 i (c+d x)}\right )}{b+2 d}+\frac {\tan (c+d x)}{2 d}+\frac {\tan ^3(c+d x)}{6 d} \] Output:

2*I*exp(-2*I*a-2*I*b*x+4*I*(d*x+c))*hypergeom([4, 2-b/d],[3-b/d],-exp(2*I* 
(d*x+c)))/(b-2*d)-2*I*exp(2*I*a+2*I*b*x+4*I*(d*x+c))*hypergeom([4, 2+b/d], 
[3+b/d],-exp(2*I*(d*x+c)))/(b+2*d)+1/2*tan(d*x+c)/d+1/6*tan(d*x+c)^3/d
 

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(429\) vs. \(2(157)=314\).

Time = 1.64 (sec) , antiderivative size = 429, normalized size of antiderivative = 2.73 \[ \int \cos ^2(a+b x) \sec ^4(c+d x) \, dx=\frac {i \left (b^2-d^2\right ) e^{-2 i (a+b x)} \left (-1-e^{4 i (a+b x)}+\left (1+e^{2 i c}\right ) \operatorname {Hypergeometric2F1}\left (1,-\frac {b}{d},1-\frac {b}{d},-e^{2 i (c+d x)}\right )+e^{4 i (a+b x)} \left (1+e^{2 i c}\right ) \operatorname {Hypergeometric2F1}\left (1,\frac {b}{d},\frac {b+d}{d},-e^{2 i (c+d x)}\right )\right )}{3 d^3 \left (1+e^{2 i c}\right )}+\frac {\sec (c) \sec ^3(c+d x) \left (6 d^2 \sin (d x)+\left (b^2-d^2\right ) \sin (2 a-2 c+2 b x-3 d x)+2 b^2 \sin (2 a+2 b x-d x)+b d \sin (2 a+2 b x-d x)-3 d^2 \sin (2 a+2 b x-d x)-b^2 \sin (2 a-2 c+2 b x-d x)+b d \sin (2 a-2 c+2 b x-d x)-2 b^2 \sin (2 a+2 b x+d x)+b d \sin (2 a+2 b x+d x)+3 d^2 \sin (2 a+2 b x+d x)+b^2 \sin (2 a+2 c+2 b x+d x)+b d \sin (2 a+2 c+2 b x+d x)+2 d^2 \sin (2 c+3 d x)-b^2 \sin (2 a+2 c+2 b x+3 d x)+d^2 \sin (2 a+2 c+2 b x+3 d x)\right )}{24 d^3} \] Input:

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

Output:

((I/3)*(b^2 - d^2)*(-1 - E^((4*I)*(a + b*x)) + (1 + E^((2*I)*c))*Hypergeom 
etric2F1[1, -(b/d), 1 - b/d, -E^((2*I)*(c + d*x))] + E^((4*I)*(a + b*x))*( 
1 + E^((2*I)*c))*Hypergeometric2F1[1, b/d, (b + d)/d, -E^((2*I)*(c + d*x)) 
]))/(d^3*E^((2*I)*(a + b*x))*(1 + E^((2*I)*c))) + (Sec[c]*Sec[c + d*x]^3*( 
6*d^2*Sin[d*x] + (b^2 - d^2)*Sin[2*a - 2*c + 2*b*x - 3*d*x] + 2*b^2*Sin[2* 
a + 2*b*x - d*x] + b*d*Sin[2*a + 2*b*x - d*x] - 3*d^2*Sin[2*a + 2*b*x - d* 
x] - b^2*Sin[2*a - 2*c + 2*b*x - d*x] + b*d*Sin[2*a - 2*c + 2*b*x - d*x] - 
 2*b^2*Sin[2*a + 2*b*x + d*x] + b*d*Sin[2*a + 2*b*x + d*x] + 3*d^2*Sin[2*a 
 + 2*b*x + d*x] + b^2*Sin[2*a + 2*c + 2*b*x + d*x] + b*d*Sin[2*a + 2*c + 2 
*b*x + d*x] + 2*d^2*Sin[2*c + 3*d*x] - b^2*Sin[2*a + 2*c + 2*b*x + 3*d*x] 
+ d^2*Sin[2*a + 2*c + 2*b*x + 3*d*x]))/(24*d^3)
 

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

\(\Big \downarrow \) 7299

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

Input:

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

Output:

$Aborted
 

Defintions of rubi rules used

rule 7299
Int[u_, x_] :> CannotIntegrate[u, x]
 
Maple [F]

\[\int \cos \left (b x +a \right )^{2} \sec \left (d x +c \right )^{4}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral(cos(b*x + a)^2*sec(d*x + c)^4, x)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

1/3*((b^2 - d^2)*cos(2*b*x + 2*a)*sin(4*b*x + 4*a) - (b^2 - d^2)*cos(4*b*x 
 + 4*a)*sin(2*b*x + 2*a) - (b^2 - b*d)*cos(4*d*x + 4*c)*sin(2*b*x + 2*a) - 
 (2*b^2 - b*d - 3*d^2)*cos(2*d*x + 2*c)*sin(2*b*x + 2*a) + (b^2 - b*d)*cos 
(2*b*x + 2*a)*sin(4*d*x + 4*c) + (2*b^2 - b*d - 3*d^2)*cos(2*b*x + 2*a)*si 
n(2*d*x + 2*c) - (3*(2*b^2 + b*d - 3*d^2)*sin(2*(b + d)*x + 2*a + 2*c) + ( 
2*b^2 + b*d - 3*d^2)*sin(2*b*x + 2*a))*cos(2*(2*b + d)*x + 4*a + 2*c) - (6 
*d^2*sin(2*(b + d)*x + 2*a + 2*c) + 2*d^2*sin(2*b*x + 2*a) - (2*b^2 + b*d 
- 3*d^2)*sin(2*(2*b + d)*x + 4*a + 2*c) - (b^2 + b*d)*sin(4*(b + d)*x + 4* 
a + 4*c) - (b^2 - d^2)*sin(4*b*x + 4*a) - (b^2 - b*d)*sin(4*d*x + 4*c) - ( 
2*b^2 - b*d - 3*d^2)*sin(2*d*x + 2*c))*cos(2*(b + 3*d)*x + 2*a + 6*c) - 3* 
(6*d^2*sin(2*(b + d)*x + 2*a + 2*c) + 2*d^2*sin(2*b*x + 2*a) - (2*b^2 + b* 
d - 3*d^2)*sin(2*(2*b + d)*x + 4*a + 2*c) - (b^2 - d^2)*sin(4*b*x + 4*a) - 
 (b^2 - b*d)*sin(4*d*x + 4*c) - (2*b^2 - b*d - 3*d^2)*sin(2*d*x + 2*c))*co 
s(2*(b + 2*d)*x + 2*a + 4*c) - (3*(b^2 + b*d)*sin(2*(b + 2*d)*x + 2*a + 4* 
c) + 3*(b^2 + b*d)*sin(2*(b + d)*x + 2*a + 2*c) + (b^2 + b*d)*sin(2*b*x + 
2*a))*cos(4*(b + d)*x + 4*a + 4*c) + 3*((b^2 - d^2)*sin(4*b*x + 4*a) + (b^ 
2 - b*d)*sin(4*d*x + 4*c) + (2*b^2 - b*d - 3*d^2)*sin(2*d*x + 2*c))*cos(2* 
(b + d)*x + 2*a + 2*c) + 3*(d^3*cos(2*(b + 3*d)*x + 2*a + 6*c)^2 + 9*d^3*c 
os(2*(b + 2*d)*x + 2*a + 4*c)^2 + 9*d^3*cos(2*(b + d)*x + 2*a + 2*c)^2 + 6 
*d^3*cos(2*(b + d)*x + 2*a + 2*c)*cos(2*b*x + 2*a) + d^3*cos(2*b*x + 2*...
 

Giac [F]

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

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

Output:

integrate(cos(b*x + a)^2*sec(d*x + c)^4, x)
 

Mupad [F(-1)]

Timed out. \[ \int \cos ^2(a+b x) \sec ^4(c+d x) \, dx=\int \frac {{\cos \left (a+b\,x\right )}^2}{{\cos \left (c+d\,x\right )}^4} \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

int(cos(a + b*x)**2*sec(c + d*x)**4,x)