\(\int \cos ^6(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\) [177]

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

Optimal result

Integrand size = 23, antiderivative size = 108 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {1}{16} \left (5 a^2+12 a b+8 b^2\right ) x+\frac {\left (5 a^2+12 a b+8 b^2\right ) \cos (e+f x) \sin (e+f x)}{16 f}+\frac {a (5 a+12 b) \cos ^3(e+f x) \sin (e+f x)}{24 f}+\frac {a^2 \cos ^5(e+f x) \sin (e+f x)}{6 f} \] Output:

1/16*(5*a^2+12*a*b+8*b^2)*x+1/16*(5*a^2+12*a*b+8*b^2)*cos(f*x+e)*sin(f*x+e 
)/f+1/24*a*(5*a+12*b)*cos(f*x+e)^3*sin(f*x+e)/f+1/6*a^2*cos(f*x+e)^5*sin(f 
*x+e)/f
 

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.92 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {60 a^2 e+144 a b e+96 b^2 e+60 a^2 f x+144 a b f x+96 b^2 f x+\left (45 a^2+96 a b+48 b^2\right ) \sin (2 (e+f x))+3 a (3 a+4 b) \sin (4 (e+f x))+a^2 \sin (6 (e+f x))}{192 f} \] Input:

Integrate[Cos[e + f*x]^6*(a + b*Sec[e + f*x]^2)^2,x]
 

Output:

(60*a^2*e + 144*a*b*e + 96*b^2*e + 60*a^2*f*x + 144*a*b*f*x + 96*b^2*f*x + 
 (45*a^2 + 96*a*b + 48*b^2)*Sin[2*(e + f*x)] + 3*a*(3*a + 4*b)*Sin[4*(e + 
f*x)] + a^2*Sin[6*(e + f*x)])/(192*f)
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.19, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4634, 315, 298, 215, 216}

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 ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \sec (e+f x)^2\right )^2}{\sec (e+f x)^6}dx\)

\(\Big \downarrow \) 4634

\(\displaystyle \frac {\int \frac {\left (b \tan ^2(e+f x)+a+b\right )^2}{\left (\tan ^2(e+f x)+1\right )^4}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 315

\(\displaystyle \frac {\frac {1}{6} \int \frac {3 b (a+2 b) \tan ^2(e+f x)+(a+b) (5 a+6 b)}{\left (\tan ^2(e+f x)+1\right )^3}d\tan (e+f x)+\frac {a \tan (e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\)

\(\Big \downarrow \) 298

\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (5 a^2+12 a b+8 b^2\right ) \int \frac {1}{\left (\tan ^2(e+f x)+1\right )^2}d\tan (e+f x)+\frac {a (5 a+8 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )+\frac {a \tan (e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\)

\(\Big \downarrow \) 215

\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (5 a^2+12 a b+8 b^2\right ) \left (\frac {1}{2} \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )+\frac {a (5 a+8 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )+\frac {a \tan (e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {1}{6} \left (\frac {3}{4} \left (5 a^2+12 a b+8 b^2\right ) \left (\frac {1}{2} \arctan (\tan (e+f x))+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )+\frac {a (5 a+8 b) \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}\right )+\frac {a \tan (e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{6 \left (\tan ^2(e+f x)+1\right )^3}}{f}\)

Input:

Int[Cos[e + f*x]^6*(a + b*Sec[e + f*x]^2)^2,x]
 

Output:

((a*Tan[e + f*x]*(a + b + b*Tan[e + f*x]^2))/(6*(1 + Tan[e + f*x]^2)^3) + 
((a*(5*a + 8*b)*Tan[e + f*x])/(4*(1 + Tan[e + f*x]^2)^2) + (3*(5*a^2 + 12* 
a*b + 8*b^2)*(ArcTan[Tan[e + f*x]]/2 + Tan[e + f*x]/(2*(1 + Tan[e + f*x]^2 
))))/4)/6)/f
 

Defintions of rubi rules used

rule 215
Int[((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^2)^(p + 1) 
/(2*a*(p + 1))), x] + Simp[(2*p + 3)/(2*a*(p + 1))   Int[(a + b*x^2)^(p + 1 
), x], x] /; FreeQ[{a, b}, x] && LtQ[p, -1] && (IntegerQ[4*p] || IntegerQ[6 
*p])
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 298
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( 
b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 
2*p + 3))/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, 
 c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
 

rule 315
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[(a*d - c*b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(2*a*b*(p + 1))), 
x] - Simp[1/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^(q - 2)*S 
imp[c*(a*d - c*b*(2*p + 3)) + d*(a*d*(2*(q - 1) + 1) - b*c*(2*(p + q) + 1)) 
*x^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, - 
1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, 2, p, q, x]
 

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

rule 4634
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_) 
)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f 
Subst[Int[(1 + ff^2*x^2)^(m/2 - 1)*ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), 
x]^p, x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ 
[m/2] && IntegerQ[n/2]
 
Maple [A] (verified)

Time = 1.73 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.76

method result size
parallelrisch \(\frac {\left (45 a^{2}+96 a b +48 b^{2}\right ) \sin \left (2 f x +2 e \right )+\left (9 a^{2}+12 a b \right ) \sin \left (4 f x +4 e \right )+a^{2} \sin \left (6 f x +6 e \right )+60 x f \left (a^{2}+\frac {12}{5} a b +\frac {8}{5} b^{2}\right )}{192 f}\) \(82\)
derivativedivides \(\frac {a^{2} \left (\frac {\left (\cos \left (f x +e \right )^{5}+\frac {5 \cos \left (f x +e \right )^{3}}{4}+\frac {15 \cos \left (f x +e \right )}{8}\right ) \sin \left (f x +e \right )}{6}+\frac {5 f x}{16}+\frac {5 e}{16}\right )+2 a b \left (\frac {\left (\cos \left (f x +e \right )^{3}+\frac {3 \cos \left (f x +e \right )}{2}\right ) \sin \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+b^{2} \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) \(116\)
default \(\frac {a^{2} \left (\frac {\left (\cos \left (f x +e \right )^{5}+\frac {5 \cos \left (f x +e \right )^{3}}{4}+\frac {15 \cos \left (f x +e \right )}{8}\right ) \sin \left (f x +e \right )}{6}+\frac {5 f x}{16}+\frac {5 e}{16}\right )+2 a b \left (\frac {\left (\cos \left (f x +e \right )^{3}+\frac {3 \cos \left (f x +e \right )}{2}\right ) \sin \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+b^{2} \left (\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}\) \(116\)
risch \(\frac {5 a^{2} x}{16}+\frac {3 a x b}{4}+\frac {x \,b^{2}}{2}+\frac {a^{2} \sin \left (6 f x +6 e \right )}{192 f}+\frac {3 a^{2} \sin \left (4 f x +4 e \right )}{64 f}+\frac {\sin \left (4 f x +4 e \right ) a b}{16 f}+\frac {15 \sin \left (2 f x +2 e \right ) a^{2}}{64 f}+\frac {\sin \left (2 f x +2 e \right ) a b}{2 f}+\frac {\sin \left (2 f x +2 e \right ) b^{2}}{4 f}\) \(119\)

Input:

int(cos(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 

Output:

1/192*((45*a^2+96*a*b+48*b^2)*sin(2*f*x+2*e)+(9*a^2+12*a*b)*sin(4*f*x+4*e) 
+a^2*sin(6*f*x+6*e)+60*x*f*(a^2+12/5*a*b+8/5*b^2))/f
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.82 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (5 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} f x + {\left (8 \, a^{2} \cos \left (f x + e\right )^{5} + 2 \, {\left (5 \, a^{2} + 12 \, a b\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (5 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, f} \] Input:

integrate(cos(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")
 

Output:

1/48*(3*(5*a^2 + 12*a*b + 8*b^2)*f*x + (8*a^2*cos(f*x + e)^5 + 2*(5*a^2 + 
12*a*b)*cos(f*x + e)^3 + 3*(5*a^2 + 12*a*b + 8*b^2)*cos(f*x + e))*sin(f*x 
+ e))/f
 

Sympy [F(-1)]

Timed out. \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\text {Timed out} \] Input:

integrate(cos(f*x+e)**6*(a+b*sec(f*x+e)**2)**2,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.25 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (5 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} {\left (f x + e\right )} + \frac {3 \, {\left (5 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} \tan \left (f x + e\right )^{5} + 8 \, {\left (5 \, a^{2} + 12 \, a b + 6 \, b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \, {\left (11 \, a^{2} + 20 \, a b + 8 \, b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{6} + 3 \, \tan \left (f x + e\right )^{4} + 3 \, \tan \left (f x + e\right )^{2} + 1}}{48 \, f} \] Input:

integrate(cos(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")
 

Output:

1/48*(3*(5*a^2 + 12*a*b + 8*b^2)*(f*x + e) + (3*(5*a^2 + 12*a*b + 8*b^2)*t 
an(f*x + e)^5 + 8*(5*a^2 + 12*a*b + 6*b^2)*tan(f*x + e)^3 + 3*(11*a^2 + 20 
*a*b + 8*b^2)*tan(f*x + e))/(tan(f*x + e)^6 + 3*tan(f*x + e)^4 + 3*tan(f*x 
 + e)^2 + 1))/f
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.39 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {3 \, {\left (5 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} {\left (f x + e\right )} + \frac {15 \, a^{2} \tan \left (f x + e\right )^{5} + 36 \, a b \tan \left (f x + e\right )^{5} + 24 \, b^{2} \tan \left (f x + e\right )^{5} + 40 \, a^{2} \tan \left (f x + e\right )^{3} + 96 \, a b \tan \left (f x + e\right )^{3} + 48 \, b^{2} \tan \left (f x + e\right )^{3} + 33 \, a^{2} \tan \left (f x + e\right ) + 60 \, a b \tan \left (f x + e\right ) + 24 \, b^{2} \tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{3}}}{48 \, f} \] Input:

integrate(cos(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")
 

Output:

1/48*(3*(5*a^2 + 12*a*b + 8*b^2)*(f*x + e) + (15*a^2*tan(f*x + e)^5 + 36*a 
*b*tan(f*x + e)^5 + 24*b^2*tan(f*x + e)^5 + 40*a^2*tan(f*x + e)^3 + 96*a*b 
*tan(f*x + e)^3 + 48*b^2*tan(f*x + e)^3 + 33*a^2*tan(f*x + e) + 60*a*b*tan 
(f*x + e) + 24*b^2*tan(f*x + e))/(tan(f*x + e)^2 + 1)^3)/f
 

Mupad [B] (verification not implemented)

Time = 16.58 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.14 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=x\,\left (\frac {5\,a^2}{16}+\frac {3\,a\,b}{4}+\frac {b^2}{2}\right )+\frac {\left (\frac {5\,a^2}{16}+\frac {3\,a\,b}{4}+\frac {b^2}{2}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^5+\left (\frac {5\,a^2}{6}+2\,a\,b+b^2\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {11\,a^2}{16}+\frac {5\,a\,b}{4}+\frac {b^2}{2}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^6+3\,{\mathrm {tan}\left (e+f\,x\right )}^4+3\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \] Input:

int(cos(e + f*x)^6*(a + b/cos(e + f*x)^2)^2,x)
 

Output:

x*((3*a*b)/4 + (5*a^2)/16 + b^2/2) + (tan(e + f*x)*((5*a*b)/4 + (11*a^2)/1 
6 + b^2/2) + tan(e + f*x)^3*(2*a*b + (5*a^2)/6 + b^2) + tan(e + f*x)^5*((3 
*a*b)/4 + (5*a^2)/16 + b^2/2))/(f*(3*tan(e + f*x)^2 + 3*tan(e + f*x)^4 + t 
an(e + f*x)^6 + 1))
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.22 \[ \int \cos ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{5} a^{2}-26 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a^{2}-24 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a b +33 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a^{2}+60 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a b +24 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b^{2}+15 a^{2} f x +36 a b f x +24 b^{2} f x}{48 f} \] Input:

int(cos(f*x+e)^6*(a+b*sec(f*x+e)^2)^2,x)
 

Output:

(8*cos(e + f*x)*sin(e + f*x)**5*a**2 - 26*cos(e + f*x)*sin(e + f*x)**3*a** 
2 - 24*cos(e + f*x)*sin(e + f*x)**3*a*b + 33*cos(e + f*x)*sin(e + f*x)*a** 
2 + 60*cos(e + f*x)*sin(e + f*x)*a*b + 24*cos(e + f*x)*sin(e + f*x)*b**2 + 
 15*a**2*f*x + 36*a*b*f*x + 24*b**2*f*x)/(48*f)