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

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

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

Mathematica [A] (verified)

Time = 1.67 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.42 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^4(e+f x) \, dx=\frac {\left (b+a \cos ^2(e+f x)\right )^2 \sec ^3(e+f x) \left (32 b^2 \sec (e) \sin (f x)+64 (3 a-2 b) b \cos ^2(e+f x) \sec (e) \sin (f x)+3 \cos ^3(e+f x) \left (4 \left (3 a^2-24 a b+8 b^2\right ) f x-8 a (a-2 b) \sin (2 (e+f x))+a^2 \sin (4 (e+f x))\right )+32 b^2 \cos (e+f x) \tan (e)\right )}{24 f (a+2 b+a \cos (2 (e+f x)))^2} \] Input:

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

Output:

((b + a*Cos[e + f*x]^2)^2*Sec[e + f*x]^3*(32*b^2*Sec[e]*Sin[f*x] + 64*(3*a 
 - 2*b)*b*Cos[e + f*x]^2*Sec[e]*Sin[f*x] + 3*Cos[e + f*x]^3*(4*(3*a^2 - 24 
*a*b + 8*b^2)*f*x - 8*a*(a - 2*b)*Sin[2*(e + f*x)] + a^2*Sin[4*(e + f*x)]) 
 + 32*b^2*Cos[e + f*x]*Tan[e]))/(24*f*(a + 2*b + a*Cos[2*(e + f*x)])^2)
 

Rubi [A] (verified)

Time = 0.34 (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, 4620, 366, 360, 1467, 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 ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4620

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

\(\Big \downarrow \) 366

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

\(\Big \downarrow \) 360

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

\(\Big \downarrow \) 1467

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 360
Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] : 
> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p 
+ 1))), x] + Simp[1/(2*b^(m/2 + 1)*(p + 1))   Int[(a + b*x^2)^(p + 1)*Expan 
dToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 
- 1)*(b*c - a*d))/(a + b*x^2)] - (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; 
FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[m/2, 0] & 
& (IntegerQ[p] || EqQ[m + 2*p + 1, 0])
 

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

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

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.47 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.93

method result size
parallelrisch \(\frac {48 a b \tan \left (f x +e \right ) \cos \left (2 f x +2 e \right )-24 a^{2} \sin \left (2 f x +2 e \right )+3 a^{2} \sin \left (4 f x +4 e \right )+\left (32 b^{2} \sec \left (f x +e \right )^{2}+240 \left (a -\frac {8 b}{15}\right ) b \right ) \tan \left (f x +e \right )+36 x f \left (a^{2}-8 a b +\frac {8}{3} b^{2}\right )}{96 f}\) \(100\)
derivativedivides \(\frac {a^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{5}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )+b^{2} \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+f x +e \right )}{f}\) \(123\)
default \(\frac {a^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (\frac {\sin \left (f x +e \right )^{5}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )+b^{2} \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+f x +e \right )}{f}\) \(123\)
parts \(\frac {a^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}+\frac {b^{2} \left (\frac {\tan \left (f x +e \right )^{3}}{3}-\tan \left (f x +e \right )+f x +e \right )}{f}+\frac {2 a b \left (\frac {\sin \left (f x +e \right )^{5}}{\cos \left (f x +e \right )}+\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )}{f}\) \(128\)
risch \(\frac {3 a^{2} x}{8}-3 x a b +x \,b^{2}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} a^{2}}{64 f}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a^{2}}{8 f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a b}{4 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a^{2}}{8 f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a b}{4 f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )} a^{2}}{64 f}-\frac {4 i b \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 )}+3 b \,{\mathrm e}^{2 i \left (f x +e \right )}-3 a +2 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(199\)
norman \(\frac {\left (-\frac {3}{8} a^{2}+3 a b -b^{2}\right ) x +\left (-\frac {9}{8} a^{2}+9 a b -3 b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}+\left (-\frac {9}{8} a^{2}+9 a b -3 b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}+\left (-\frac {3}{8} a^{2}+3 a b -b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (\frac {3}{8} a^{2}-3 a b +b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{12}+\left (\frac {3}{8} a^{2}-3 a b +b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{14}+\left (\frac {9}{8} a^{2}-9 a b +3 b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+\left (\frac {9}{8} a^{2}-9 a b +3 b^{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}+\frac {\left (15 a^{2}+8 a b -24 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{f}+\frac {\left (3 a^{2}-24 a b +8 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {\left (3 a^{2}-24 a b +8 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{6 f}+\frac {\left (3 a^{2}-24 a b +8 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{11}}{6 f}+\frac {\left (3 a^{2}-24 a b +8 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{13}}{4 f}-\frac {\left (105 a^{2}-72 a b +152 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{12 f}-\frac {\left (105 a^{2}-72 a b +152 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{12 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 )^{4}}\) \(456\)

Input:

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

Output:

1/96*(48*a*b*tan(f*x+e)*cos(2*f*x+2*e)-24*a^2*sin(2*f*x+2*e)+3*a^2*sin(4*f 
*x+4*e)+(32*b^2*sec(f*x+e)^2+240*(a-8/15*b)*b)*tan(f*x+e)+36*x*f*(a^2-8*a* 
b+8/3*b^2))/f
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.14 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^4(e+f x) \, dx=\frac {8 \, b^{2} \tan \left (f x + e\right )^{3} + 48 \, a b \tan \left (f x + e\right ) - 24 \, b^{2} \tan \left (f x + e\right ) + 3 \, {\left (3 \, a^{2} - 24 \, a b + 8 \, b^{2}\right )} {\left (f x + e\right )} - \frac {3 \, {\left (5 \, a^{2} \tan \left (f x + e\right )^{3} - 8 \, a b \tan \left (f x + e\right )^{3} + 3 \, a^{2} \tan \left (f x + e\right ) - 8 \, a b \tan \left (f x + e\right )\right )}}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{2}}}{24 \, f} \] Input:

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

Output:

1/24*(8*b^2*tan(f*x + e)^3 + 48*a*b*tan(f*x + e) - 24*b^2*tan(f*x + e) + 3 
*(3*a^2 - 24*a*b + 8*b^2)*(f*x + e) - 3*(5*a^2*tan(f*x + e)^3 - 8*a*b*tan( 
f*x + e)^3 + 3*a^2*tan(f*x + e) - 8*a*b*tan(f*x + e))/(tan(f*x + e)^2 + 1) 
^2)/f
 

Mupad [B] (verification not implemented)

Time = 12.52 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.07 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^4(e+f x) \, dx=x\,\left (\frac {3\,a^2}{8}-3\,a\,b+b^2\right )+\frac {\left (a\,b-\frac {5\,a^2}{8}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (a\,b-\frac {3\,a^2}{8}\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (3\,b^2-2\,b\,\left (a+b\right )\right )}{f} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 275, normalized size of antiderivative = 2.55 \[ \int \left (a+b \sec ^2(e+f x)\right )^2 \sin ^4(e+f x) \, dx=\frac {-6 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{5} a^{2}-3 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right )^{3} a^{2}+9 \cos \left (f x +e \right )^{2} \sin \left (f x +e \right ) a^{2}+9 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a^{2} f x -72 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a b e -72 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a b f x +24 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2} f x -9 \cos \left (f x +e \right ) a^{2} f x +72 \cos \left (f x +e \right ) a b e +72 \cos \left (f x +e \right ) a b f x -24 \cos \left (f x +e \right ) b^{2} f x -24 \sin \left (f x +e \right )^{5} a b +96 \sin \left (f x +e \right )^{3} a b -32 \sin \left (f x +e \right )^{3} b^{2}-72 \sin \left (f x +e \right ) a b +24 \sin \left (f x +e \right ) b^{2}}{24 \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)^4,x)
 

Output:

( - 6*cos(e + f*x)**2*sin(e + f*x)**5*a**2 - 3*cos(e + f*x)**2*sin(e + f*x 
)**3*a**2 + 9*cos(e + f*x)**2*sin(e + f*x)*a**2 + 9*cos(e + f*x)*sin(e + f 
*x)**2*a**2*f*x - 72*cos(e + f*x)*sin(e + f*x)**2*a*b*e - 72*cos(e + f*x)* 
sin(e + f*x)**2*a*b*f*x + 24*cos(e + f*x)*sin(e + f*x)**2*b**2*f*x - 9*cos 
(e + f*x)*a**2*f*x + 72*cos(e + f*x)*a*b*e + 72*cos(e + f*x)*a*b*f*x - 24* 
cos(e + f*x)*b**2*f*x - 24*sin(e + f*x)**5*a*b + 96*sin(e + f*x)**3*a*b - 
32*sin(e + f*x)**3*b**2 - 72*sin(e + f*x)*a*b + 24*sin(e + f*x)*b**2)/(24* 
cos(e + f*x)*f*(sin(e + f*x)**2 - 1))