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

Optimal result
Mathematica [B] (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 = 103 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\left (a^2+6 a b+6 b^2\right ) \cot (e+f x)}{f}-\frac {2 (a+b) (a+2 b) \cot ^3(e+f x)}{3 f}-\frac {(a+b)^2 \cot ^5(e+f x)}{5 f}+\frac {2 b (a+2 b) \tan (e+f x)}{f}+\frac {b^2 \tan ^3(e+f x)}{3 f} \] Output:

-(a^2+6*a*b+6*b^2)*cot(f*x+e)/f-2/3*(a+b)*(a+2*b)*cot(f*x+e)^3/f-1/5*(a+b) 
^2*cot(f*x+e)^5/f+2*b*(a+2*b)*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/f
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(353\) vs. \(2(103)=206\).

Time = 1.87 (sec) , antiderivative size = 353, normalized size of antiderivative = 3.43 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\csc (e) \csc ^5(e+f x) \sec (e) \sec ^3(e+f x) \left (20 a (5 a+12 b) \sin (2 e)-32 \left (2 a^2+9 a b+12 b^2\right ) \sin (2 f x)-24 a^2 \sin (2 (e+f x))-108 a b \sin (2 (e+f x))-54 b^2 \sin (2 (e+f x))+8 a^2 \sin (4 (e+f x))+36 a b \sin (4 (e+f x))+18 b^2 \sin (4 (e+f x))+8 a^2 \sin (6 (e+f x))+36 a b \sin (6 (e+f x))+18 b^2 \sin (6 (e+f x))-4 a^2 \sin (8 (e+f x))-18 a b \sin (8 (e+f x))-9 b^2 \sin (8 (e+f x))+8 a^2 \sin (2 (e+2 f x))+96 a b \sin (2 (e+2 f x))+128 b^2 \sin (2 (e+2 f x))+40 a^2 \sin (4 e+2 f x)+8 a^2 \sin (4 e+6 f x)+96 a b \sin (4 e+6 f x)+128 b^2 \sin (4 e+6 f x)-4 a^2 \sin (6 e+8 f x)-48 a b \sin (6 e+8 f x)-64 b^2 \sin (6 e+8 f x)\right )}{1920 f} \] Input:

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

Output:

-1/1920*(Csc[e]*Csc[e + f*x]^5*Sec[e]*Sec[e + f*x]^3*(20*a*(5*a + 12*b)*Si 
n[2*e] - 32*(2*a^2 + 9*a*b + 12*b^2)*Sin[2*f*x] - 24*a^2*Sin[2*(e + f*x)] 
- 108*a*b*Sin[2*(e + f*x)] - 54*b^2*Sin[2*(e + f*x)] + 8*a^2*Sin[4*(e + f* 
x)] + 36*a*b*Sin[4*(e + f*x)] + 18*b^2*Sin[4*(e + f*x)] + 8*a^2*Sin[6*(e + 
 f*x)] + 36*a*b*Sin[6*(e + f*x)] + 18*b^2*Sin[6*(e + f*x)] - 4*a^2*Sin[8*( 
e + f*x)] - 18*a*b*Sin[8*(e + f*x)] - 9*b^2*Sin[8*(e + f*x)] + 8*a^2*Sin[2 
*(e + 2*f*x)] + 96*a*b*Sin[2*(e + 2*f*x)] + 128*b^2*Sin[2*(e + 2*f*x)] + 4 
0*a^2*Sin[4*e + 2*f*x] + 8*a^2*Sin[4*e + 6*f*x] + 96*a*b*Sin[4*e + 6*f*x] 
+ 128*b^2*Sin[4*e + 6*f*x] - 4*a^2*Sin[6*e + 8*f*x] - 48*a*b*Sin[6*e + 8*f 
*x] - 64*b^2*Sin[6*e + 8*f*x]))/f
 

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.89, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3042, 4620, 355, 2009}

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 \csc ^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}{\sin (e+f x)^6}dx\)

\(\Big \downarrow \) 4620

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

\(\Big \downarrow \) 355

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(-((a^2 + 6*a*b + 6*b^2)*Cot[e + f*x]) - (2*(a + b)*(a + 2*b)*Cot[e + f*x] 
^3)/3 - ((a + b)^2*Cot[e + f*x]^5)/5 + 2*b*(a + 2*b)*Tan[e + f*x] + (b^2*T 
an[e + f*x]^3)/3)/f
 

Defintions of rubi rules used

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

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4620
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_ 
)]^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff^(m 
+ 1)/f   Subst[Int[x^m*(ExpandToSum[a + b*(1 + ff^2*x^2)^(n/2), x]^p/(1 + f 
f^2*x^2)^(m/2 + 1)), 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.84 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.50

method result size
parallelrisch \(\frac {\left (\left (-13 a^{2}-36 a b -48 b^{2}\right ) \cos \left (2 f x +2 e \right )+\left (a^{2}+12 a b +16 b^{2}\right ) \cos \left (4 f x +4 e \right )+\left (a^{2}+12 a b +16 b^{2}\right ) \cos \left (6 f x +6 e \right )+\left (-\frac {1}{2} a^{2}-6 a b -8 b^{2}\right ) \cos \left (8 f x +8 e \right )-\frac {25 a^{2}}{2}-30 a b \right ) \csc \left (\frac {f x}{2}+\frac {e}{2}\right )^{5} \sec \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{960 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(154\)
derivativedivides \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (f x +e \right )^{4}}{5}-\frac {4 \csc \left (f x +e \right )^{2}}{15}\right ) \cot \left (f x +e \right )+2 a b \left (-\frac {1}{5 \sin \left (f x +e \right )^{5} \cos \left (f x +e \right )}-\frac {2}{5 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {8}{5 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {16 \cot \left (f x +e \right )}{5}\right )+b^{2} \left (-\frac {1}{5 \sin \left (f x +e \right )^{5} \cos \left (f x +e \right )^{3}}+\frac {8}{15 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )^{3}}-\frac {16}{15 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {64}{15 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {128 \cot \left (f x +e \right )}{15}\right )}{f}\) \(190\)
default \(\frac {a^{2} \left (-\frac {8}{15}-\frac {\csc \left (f x +e \right )^{4}}{5}-\frac {4 \csc \left (f x +e \right )^{2}}{15}\right ) \cot \left (f x +e \right )+2 a b \left (-\frac {1}{5 \sin \left (f x +e \right )^{5} \cos \left (f x +e \right )}-\frac {2}{5 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {8}{5 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {16 \cot \left (f x +e \right )}{5}\right )+b^{2} \left (-\frac {1}{5 \sin \left (f x +e \right )^{5} \cos \left (f x +e \right )^{3}}+\frac {8}{15 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )^{3}}-\frac {16}{15 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right )}+\frac {64}{15 \sin \left (f x +e \right ) \cos \left (f x +e \right )}-\frac {128 \cot \left (f x +e \right )}{15}\right )}{f}\) \(190\)
risch \(-\frac {16 i \left (10 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}+25 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}+60 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+16 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}+72 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+96 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}-2 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-32 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-2 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{2 i \left (f x +e \right )}-32 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+a^{2}+12 a b +16 b^{2}\right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{5}}\) \(210\)

Input:

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

Output:

1/960*((-13*a^2-36*a*b-48*b^2)*cos(2*f*x+2*e)+(a^2+12*a*b+16*b^2)*cos(4*f* 
x+4*e)+(a^2+12*a*b+16*b^2)*cos(6*f*x+6*e)+(-1/2*a^2-6*a*b-8*b^2)*cos(8*f*x 
+8*e)-25/2*a^2-30*a*b)*csc(1/2*f*x+1/2*e)^5*sec(1/2*f*x+1/2*e)^5/f/(cos(3* 
f*x+3*e)+3*cos(f*x+e))
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.35 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {8 \, {\left (a^{2} + 12 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{8} - 20 \, {\left (a^{2} + 12 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{6} + 15 \, {\left (a^{2} + 12 \, a b + 16 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 10 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 5 \, b^{2}}{15 \, {\left (f \cos \left (f x + e\right )^{7} - 2 \, f \cos \left (f x + e\right )^{5} + f \cos \left (f x + e\right )^{3}\right )} \sin \left (f x + e\right )} \] Input:

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

Output:

-1/15*(8*(a^2 + 12*a*b + 16*b^2)*cos(f*x + e)^8 - 20*(a^2 + 12*a*b + 16*b^ 
2)*cos(f*x + e)^6 + 15*(a^2 + 12*a*b + 16*b^2)*cos(f*x + e)^4 - 10*(3*a*b 
+ 4*b^2)*cos(f*x + e)^2 - 5*b^2)/((f*cos(f*x + e)^7 - 2*f*cos(f*x + e)^5 + 
 f*cos(f*x + e)^3)*sin(f*x + e))
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.04 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {5 \, b^{2} \tan \left (f x + e\right )^{3} + 30 \, {\left (a b + 2 \, b^{2}\right )} \tan \left (f x + e\right ) - \frac {15 \, {\left (a^{2} + 6 \, a b + 6 \, b^{2}\right )} \tan \left (f x + e\right )^{4} + 10 \, {\left (a^{2} + 3 \, a b + 2 \, b^{2}\right )} \tan \left (f x + e\right )^{2} + 3 \, a^{2} + 6 \, a b + 3 \, b^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \] Input:

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

Output:

1/15*(5*b^2*tan(f*x + e)^3 + 30*(a*b + 2*b^2)*tan(f*x + e) - (15*(a^2 + 6* 
a*b + 6*b^2)*tan(f*x + e)^4 + 10*(a^2 + 3*a*b + 2*b^2)*tan(f*x + e)^2 + 3* 
a^2 + 6*a*b + 3*b^2)/tan(f*x + e)^5)/f
 

Giac [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.37 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {5 \, b^{2} \tan \left (f x + e\right )^{3} + 30 \, a b \tan \left (f x + e\right ) + 60 \, b^{2} \tan \left (f x + e\right ) - \frac {15 \, a^{2} \tan \left (f x + e\right )^{4} + 90 \, a b \tan \left (f x + e\right )^{4} + 90 \, b^{2} \tan \left (f x + e\right )^{4} + 10 \, a^{2} \tan \left (f x + e\right )^{2} + 30 \, a b \tan \left (f x + e\right )^{2} + 20 \, b^{2} \tan \left (f x + e\right )^{2} + 3 \, a^{2} + 6 \, a b + 3 \, b^{2}}{\tan \left (f x + e\right )^{5}}}{15 \, f} \] Input:

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

Output:

1/15*(5*b^2*tan(f*x + e)^3 + 30*a*b*tan(f*x + e) + 60*b^2*tan(f*x + e) - ( 
15*a^2*tan(f*x + e)^4 + 90*a*b*tan(f*x + e)^4 + 90*b^2*tan(f*x + e)^4 + 10 
*a^2*tan(f*x + e)^2 + 30*a*b*tan(f*x + e)^2 + 20*b^2*tan(f*x + e)^2 + 3*a^ 
2 + 6*a*b + 3*b^2)/tan(f*x + e)^5)/f
 

Mupad [B] (verification not implemented)

Time = 12.82 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.05 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\frac {2\,a\,b}{5}+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (a^2+6\,a\,b+6\,b^2\right )+\frac {a^2}{5}+\frac {b^2}{5}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {2\,a^2}{3}+2\,a\,b+\frac {4\,b^2}{3}\right )}{f\,{\mathrm {tan}\left (e+f\,x\right )}^5}+\frac {2\,b\,\mathrm {tan}\left (e+f\,x\right )\,\left (a+2\,b\right )}{f} \] Input:

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

Output:

(b^2*tan(e + f*x)^3)/(3*f) - ((2*a*b)/5 + tan(e + f*x)^4*(6*a*b + a^2 + 6* 
b^2) + a^2/5 + b^2/5 + tan(e + f*x)^2*(2*a*b + (2*a^2)/3 + (4*b^2)/3))/(f* 
tan(e + f*x)^5) + (2*b*tan(e + f*x)*(a + 2*b))/f
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.94 \[ \int \csc ^6(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {8 \sin \left (f x +e \right )^{8} a^{2}+96 \sin \left (f x +e \right )^{8} a b +128 \sin \left (f x +e \right )^{8} b^{2}-12 \sin \left (f x +e \right )^{6} a^{2}-144 \sin \left (f x +e \right )^{6} a b -192 \sin \left (f x +e \right )^{6} b^{2}+3 \sin \left (f x +e \right )^{4} a^{2}+36 \sin \left (f x +e \right )^{4} a b +48 \sin \left (f x +e \right )^{4} b^{2}-2 \sin \left (f x +e \right )^{2} a^{2}+6 \sin \left (f x +e \right )^{2} a b +8 \sin \left (f x +e \right )^{2} b^{2}+3 a^{2}+6 a b +3 b^{2}}{15 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{5} f \left (\sin \left (f x +e \right )^{2}-1\right )} \] Input:

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

Output:

(8*sin(e + f*x)**8*a**2 + 96*sin(e + f*x)**8*a*b + 128*sin(e + f*x)**8*b** 
2 - 12*sin(e + f*x)**6*a**2 - 144*sin(e + f*x)**6*a*b - 192*sin(e + f*x)** 
6*b**2 + 3*sin(e + f*x)**4*a**2 + 36*sin(e + f*x)**4*a*b + 48*sin(e + f*x) 
**4*b**2 - 2*sin(e + f*x)**2*a**2 + 6*sin(e + f*x)**2*a*b + 8*sin(e + f*x) 
**2*b**2 + 3*a**2 + 6*a*b + 3*b**2)/(15*cos(e + f*x)*sin(e + f*x)**5*f*(si 
n(e + f*x)**2 - 1))