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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
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 = 72 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^3(e+f x) \, dx=-\frac {a (a-2 b) \cos (e+f x)}{f}+\frac {a^2 \cos ^3(e+f x)}{3 f}+\frac {(2 a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \] Output:

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

Mathematica [A] (verified)

Time = 0.83 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.15 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^3(e+f x) \, dx=\frac {\left (-26 a^2+168 a b-16 b^2-3 \left (11 a^2-64 a b+16 b^2\right ) \cos (2 (e+f x))-6 a (a-4 b) \cos (4 (e+f x))+a^2 \cos (6 (e+f x))\right ) \sec ^3(e+f x)}{96 f} \] Input:

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

Output:

((-26*a^2 + 168*a*b - 16*b^2 - 3*(11*a^2 - 64*a*b + 16*b^2)*Cos[2*(e + f*x 
)] - 6*a*(a - 4*b)*Cos[4*(e + f*x)] + a^2*Cos[6*(e + f*x)])*Sec[e + f*x]^3 
)/(96*f)
 

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.90, 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 ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4621

\(\displaystyle -\frac {\int \left (1-\cos ^2(e+f x)\right ) \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 (b^2 \sec ^4(e+f x)+(2 a-b) b \sec ^2(e+f x)-a^2 \cos ^2(e+f x)+a (a-2 b)\right )d\cos (e+f x)}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {-\frac {1}{3} a^2 \cos ^3(e+f x)+a (a-2 b) \cos (e+f x)-b (2 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]^3,x]
 

Output:

-((a*(a - 2*b)*Cos[e + f*x] - (a^2*Cos[e + f*x]^3)/3 - (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.12 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.96

method result size
derivativedivides \(\frac {\frac {b^{2} \sec \left (f x +e \right )^{3}}{3}+2 \sec \left (f x +e \right ) a b -\sec \left (f x +e \right ) b^{2}+\frac {a^{2}}{3 \sec \left (f x +e \right )^{3}}-\frac {a \left (a -2 b \right )}{\sec \left (f x +e \right )}}{f}\) \(69\)
default \(\frac {\frac {b^{2} \sec \left (f x +e \right )^{3}}{3}+2 \sec \left (f x +e \right ) a b -\sec \left (f x +e \right ) b^{2}+\frac {a^{2}}{3 \sec \left (f x +e \right )^{3}}-\frac {a \left (a -2 b \right )}{\sec \left (f x +e \right )}}{f}\) \(69\)
parts \(-\frac {a^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3 f}+\frac {b^{2} \left (\frac {\sec \left (f x +e \right )^{3}}{3}-\sec \left (f x +e \right )\right )}{f}+\frac {2 a b \left (\frac {\sin \left (f x +e \right )^{4}}{\cos \left (f x +e \right )}+\left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )\right )}{f}\) \(94\)
norman \(\frac {\frac {4 a^{2}-24 a b +4 b^{2}}{3 f}+\frac {32 \left (a^{2}-b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{3 f}-\frac {\left (4 a^{2}+8 a b +4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{f}-\frac {\left (8 a^{2}-16 a b +8 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{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 )^{3}}\) \(140\)
parallelrisch \(\frac {\left (-16 a^{2}+96 a b -16 b^{2}\right ) \cos \left (3 f x +3 e \right )+\left (-33 a^{2}+192 a b -48 b^{2}\right ) \cos \left (2 f x +2 e \right )-6 a \left (a -4 b \right ) \cos \left (4 f x +4 e \right )+a^{2} \cos \left (6 f x +6 e \right )+\left (-48 a^{2}+288 a b -48 b^{2}\right ) \cos \left (f x +e \right )-26 a^{2}+168 a b -16 b^{2}}{24 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(143\)
risch \(\frac {{\mathrm e}^{3 i \left (f x +e \right )} a^{2}}{24 f}-\frac {3 \,{\mathrm e}^{i \left (f x +e \right )} a^{2}}{8 f}+\frac {{\mathrm e}^{i \left (f x +e \right )} a b}{f}-\frac {3 \,{\mathrm e}^{-i \left (f x +e \right )} a^{2}}{8 f}+\frac {{\mathrm e}^{-i \left (f x +e \right )} a b}{f}+\frac {{\mathrm e}^{-3 i \left (f x +e \right )} a^{2}}{24 f}-\frac {2 b \,{\mathrm e}^{i \left (f x +e \right )} \left (-6 a \,{\mathrm e}^{4 i \left (f x +e \right )}+3 b \,{\mathrm e}^{4 i \left (f x +e \right )}-12 a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-6 a +3 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(201\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

Integral((a + b*sec(e + f*x)**2)**2*sin(e + f*x)**3, x)
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.07 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^3(e+f x) \, dx=\frac {a^{2} \cos \left (f x + e\right )^{3} - 3 \, a^{2} \cos \left (f x + e\right ) + 6 \, a b \cos \left (f x + e\right ) + \frac {6 \, a b \cos \left (f x + e\right )^{2} - 3 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{\cos \left (f x + e\right )^{3}}}{3 \, f} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 474, normalized size of antiderivative = 6.58 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^3(e+f x) \, dx=\frac {-\cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{4} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}+\cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{4} a^{2}-\cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}+\cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{2} a^{2}+2 \cos \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}-2 \cos \left (f x +e \right )^{2} a^{2}+2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}-24 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a b +2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} b^{2}-2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a^{2}-2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}-2 \cos \left (f x +e \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}+24 \cos \left (f x +e \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a b -2 \cos \left (f x +e \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} b^{2}+2 \cos \left (f x +e \right ) a^{2}+2 \cos \left (f x +e \right ) b^{2}-3 \sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} b^{2}+3 \sin \left (f x +e \right )^{2} b^{2}+2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} b^{2}-2 b^{2}}{3 \cos \left (f x +e \right ) f \left (\sin \left (f x +e \right )^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}-\sin \left (f x +e \right )^{2}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+1\right )} \] Input:

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

Output:

( - cos(e + f*x)**2*sin(e + f*x)**4*tan((e + f*x)/2)**4*a**2 + cos(e + f*x 
)**2*sin(e + f*x)**4*a**2 - cos(e + f*x)**2*sin(e + f*x)**2*tan((e + f*x)/ 
2)**4*a**2 + cos(e + f*x)**2*sin(e + f*x)**2*a**2 + 2*cos(e + f*x)**2*tan( 
(e + f*x)/2)**4*a**2 - 2*cos(e + f*x)**2*a**2 + 2*cos(e + f*x)*sin(e + f*x 
)**2*tan((e + f*x)/2)**4*a**2 - 24*cos(e + f*x)*sin(e + f*x)**2*tan((e + f 
*x)/2)**4*a*b + 2*cos(e + f*x)*sin(e + f*x)**2*tan((e + f*x)/2)**4*b**2 - 
2*cos(e + f*x)*sin(e + f*x)**2*a**2 - 2*cos(e + f*x)*sin(e + f*x)**2*b**2 
- 2*cos(e + f*x)*tan((e + f*x)/2)**4*a**2 + 24*cos(e + f*x)*tan((e + f*x)/ 
2)**4*a*b - 2*cos(e + f*x)*tan((e + f*x)/2)**4*b**2 + 2*cos(e + f*x)*a**2 
+ 2*cos(e + f*x)*b**2 - 3*sin(e + f*x)**2*tan((e + f*x)/2)**4*b**2 + 3*sin 
(e + f*x)**2*b**2 + 2*tan((e + f*x)/2)**4*b**2 - 2*b**2)/(3*cos(e + f*x)*f 
*(sin(e + f*x)**2*tan((e + f*x)/2)**4 - sin(e + f*x)**2 - tan((e + f*x)/2) 
**4 + 1))