\(\int (a+b \sec ^2(e+f x))^2 \sin ^5(e+f x) \, dx\) [15]

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 = 97 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=-\frac {\left (a^2-4 a b+b^2\right ) \cos (e+f x)}{f}+\frac {2 a (a-b) \cos ^3(e+f x)}{3 f}-\frac {a^2 \cos ^5(e+f x)}{5 f}+\frac {2 (a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \] Output:

-(a^2-4*a*b+b^2)*cos(f*x+e)/f+2/3*a*(a-b)*cos(f*x+e)^3/f-1/5*a^2*cos(f*x+e 
)^5/f+2*(a-b)*b*sec(f*x+e)/f+1/3*b^2*sec(f*x+e)^3/f
 

Mathematica [A] (verified)

Time = 1.11 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.22 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=-\frac {\left (425 a^2-4400 a b+2000 b^2+24 \left (22 a^2-215 a b+120 b^2\right ) \cos (2 (e+f x))+12 \left (7 a^2-60 a b+20 b^2\right ) \cos (4 (e+f x))-16 a^2 \cos (6 (e+f x))+40 a b \cos (6 (e+f x))+3 a^2 \cos (8 (e+f x))\right ) \sec ^3(e+f x)}{1920 f} \] Input:

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

Output:

-1/1920*((425*a^2 - 4400*a*b + 2000*b^2 + 24*(22*a^2 - 215*a*b + 120*b^2)* 
Cos[2*(e + f*x)] + 12*(7*a^2 - 60*a*b + 20*b^2)*Cos[4*(e + f*x)] - 16*a^2* 
Cos[6*(e + f*x)] + 40*a*b*Cos[6*(e + f*x)] + 3*a^2*Cos[8*(e + f*x)])*Sec[e 
 + f*x]^3)/f
 

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 86, 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, 4621, 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 \sin ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (e+f x)^5 \left (a+b \sec (e+f x)^2\right )^2dx\)

\(\Big \downarrow \) 4621

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

\(\Big \downarrow \) 355

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\left (a^2-4 a b+b^2\right ) \cos (e+f x)+\frac {1}{5} a^2 \cos ^5(e+f x)-\frac {2}{3} a (a-b) \cos ^3(e+f x)-2 b (a-b) \sec (e+f x)-\frac {1}{3} b^2 \sec ^3(e+f x)}{f}\)

Input:

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

Output:

-(((a^2 - 4*a*b + b^2)*Cos[e + f*x] - (2*a*(a - b)*Cos[e + f*x]^3)/3 + (a^ 
2*Cos[e + f*x]^5)/5 - 2*(a - b)*b*Sec[e + f*x] - (b^2*Sec[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 4621
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_ 
)]^(m_.), x_Symbol] :> With[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-ff/f 
   Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p)), 
x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/ 
2] && IntegerQ[n] && IntegerQ[p]
 
Maple [A] (verified)

Time = 1.40 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.60

method result size
derivativedivides \(\frac {-\frac {a^{2} \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5}+2 a b \left (\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}+\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{6}}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}-\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )}{f}\) \(155\)
default \(\frac {-\frac {a^{2} \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5}+2 a b \left (\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}+\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )+b^{2} \left (\frac {\sin \left (f x +e \right )^{6}}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}-\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )}{f}\) \(155\)
parts \(-\frac {a^{2} \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5 f}+\frac {b^{2} \left (\frac {\sin \left (f x +e \right )^{6}}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}-\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )}{f}+\frac {2 a b \left (\frac {\sin \left (f x +e \right )^{6}}{\cos \left (f x +e \right )}+\left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )\right )}{f}\) \(160\)
parallelrisch \(\frac {\left (-256 a^{2}+2560 a b -1280 b^{2}\right ) \cos \left (3 f x +3 e \right )+\left (-528 a^{2}+5160 a b -2880 b^{2}\right ) \cos \left (2 f x +2 e \right )+\left (-84 a^{2}+720 a b -240 b^{2}\right ) \cos \left (4 f x +4 e \right )+\left (16 a^{2}-40 a b \right ) \cos \left (6 f x +6 e \right )-3 a^{2} \cos \left (8 f x +8 e \right )+\left (-768 a^{2}+7680 a b -3840 b^{2}\right ) \cos \left (f x +e \right )-425 a^{2}+4400 a b -2000 b^{2}}{480 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(172\)
norman \(\frac {\frac {16 a^{2}-160 a b +80 b^{2}}{15 f}+\frac {16 \left (5 a^{2}-2 a b -7 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{3 f}+\frac {2 \left (16 a^{2}-160 a b +80 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{15 f}-\frac {2 \left (16 a^{2}-160 a b +80 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{15 f}-\frac {2 \left (16 a^{2}+32 a b +16 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}}{3 f}-\frac {2 \left (128 a^{2}-320 a b +320 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{15 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3} \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{5}}\) \(208\)
risch \(-\frac {a^{2} {\mathrm e}^{5 i \left (f x +e \right )}}{160 f}+\frac {5 \,{\mathrm e}^{3 i \left (f x +e \right )} a^{2}}{96 f}-\frac {{\mathrm e}^{3 i \left (f x +e \right )} a b}{12 f}-\frac {5 \,{\mathrm e}^{i \left (f x +e \right )} a^{2}}{16 f}+\frac {7 \,{\mathrm e}^{i \left (f x +e \right )} a b}{4 f}-\frac {{\mathrm e}^{i \left (f x +e \right )} b^{2}}{2 f}-\frac {5 \,{\mathrm e}^{-i \left (f x +e \right )} a^{2}}{16 f}+\frac {7 \,{\mathrm e}^{-i \left (f x +e \right )} a b}{4 f}-\frac {{\mathrm e}^{-i \left (f x +e \right )} b^{2}}{2 f}+\frac {5 \,{\mathrm e}^{-3 i \left (f x +e \right )} a^{2}}{96 f}-\frac {{\mathrm e}^{-3 i \left (f x +e \right )} a b}{12 f}-\frac {a^{2} {\mathrm e}^{-5 i \left (f x +e \right )}}{160 f}-\frac {4 b \,{\mathrm e}^{i \left (f x +e \right )} \left (-3 a \,{\mathrm e}^{4 i \left (f x +e \right )}+3 b \,{\mathrm e}^{4 i \left (f x +e \right )}-6 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a +3 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(313\)

Input:

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

Output:

1/f*(-1/5*a^2*(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2)*cos(f*x+e)+2*a*b*(sin(f* 
x+e)^6/cos(f*x+e)+(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2)*cos(f*x+e))+b^2*(1/3 
*sin(f*x+e)^6/cos(f*x+e)^3-sin(f*x+e)^6/cos(f*x+e)-(8/3+sin(f*x+e)^4+4/3*s 
in(f*x+e)^2)*cos(f*x+e)))
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.93 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=-\frac {3 \, a^{2} \cos \left (f x + e\right )^{8} - 10 \, {\left (a^{2} - a b\right )} \cos \left (f x + e\right )^{6} + 15 \, {\left (a^{2} - 4 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 30 \, {\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 5 \, b^{2}}{15 \, f \cos \left (f x + e\right )^{3}} \] Input:

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

Output:

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

Sympy [F(-1)]

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

integrate((a+b*sec(f*x+e)**2)**2*sin(f*x+e)**5,x)
 

Output:

Timed out
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.19 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=-\frac {3 \, a^{2} \cos \left (f x + e\right )^{5} - 10 \, a^{2} \cos \left (f x + e\right )^{3} + 10 \, a b \cos \left (f x + e\right )^{3} + 15 \, a^{2} \cos \left (f x + e\right ) - 60 \, a b \cos \left (f x + e\right ) + 15 \, b^{2} \cos \left (f x + e\right ) - \frac {5 \, {\left (6 \, a b \cos \left (f x + e\right )^{2} - 6 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}\right )}}{\cos \left (f x + e\right )^{3}}}{15 \, f} \] Input:

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

Output:

-1/15*(3*a^2*cos(f*x + e)^5 - 10*a^2*cos(f*x + e)^3 + 10*a*b*cos(f*x + e)^ 
3 + 15*a^2*cos(f*x + e) - 60*a*b*cos(f*x + e) + 15*b^2*cos(f*x + e) - 5*(6 
*a*b*cos(f*x + e)^2 - 6*b^2*cos(f*x + e)^2 + b^2)/cos(f*x + e)^3)/f
 

Mupad [B] (verification not implemented)

Time = 12.43 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.90 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=\frac {\frac {\frac {b^2}{3}+{\cos \left (e+f\,x\right )}^2\,\left (2\,a\,b-2\,b^2\right )}{{\cos \left (e+f\,x\right )}^3}-\cos \left (e+f\,x\right )\,\left (a^2-4\,a\,b+b^2\right )-\frac {a^2\,{\cos \left (e+f\,x\right )}^5}{5}+\frac {2\,a\,{\cos \left (e+f\,x\right )}^3\,\left (a-b\right )}{3}}{f} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 261, normalized size of antiderivative = 2.69 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^5(e+f x) \, dx=\frac {-3 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{6} a^{2}-\cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{4} a^{2}-4 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{2} a^{2}+8 \cos \left (f x +e \right )^{2} a^{2}+8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a^{2}-80 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a b +40 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}-8 \cos \left (f x +e \right ) a^{2}+80 \cos \left (f x +e \right ) a b -40 \cos \left (f x +e \right ) b^{2}-10 \sin \left (f x +e \right )^{6} a b -30 \sin \left (f x +e \right )^{4} a b +15 \sin \left (f x +e \right )^{4} b^{2}+120 \sin \left (f x +e \right )^{2} a b -60 \sin \left (f x +e \right )^{2} b^{2}-80 a b +40 b^{2}}{15 \cos \left (f x +e \right ) f \left (\sin \left (f x +e \right )^{2}-1\right )} \] Input:

int((a+b*sec(f*x+e)^2)^2*sin(f*x+e)^5,x)
 

Output:

( - 3*cos(e + f*x)**2*sin(e + f*x)**6*a**2 - cos(e + f*x)**2*sin(e + f*x)* 
*4*a**2 - 4*cos(e + f*x)**2*sin(e + f*x)**2*a**2 + 8*cos(e + f*x)**2*a**2 
+ 8*cos(e + f*x)*sin(e + f*x)**2*a**2 - 80*cos(e + f*x)*sin(e + f*x)**2*a* 
b + 40*cos(e + f*x)*sin(e + f*x)**2*b**2 - 8*cos(e + f*x)*a**2 + 80*cos(e 
+ f*x)*a*b - 40*cos(e + f*x)*b**2 - 10*sin(e + f*x)**6*a*b - 30*sin(e + f* 
x)**4*a*b + 15*sin(e + f*x)**4*b**2 + 120*sin(e + f*x)**2*a*b - 60*sin(e + 
 f*x)**2*b**2 - 80*a*b + 40*b**2)/(15*cos(e + f*x)*f*(sin(e + f*x)**2 - 1) 
)