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

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

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

Mathematica [A] (verified)

Time = 0.40 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.77 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin ^4(e+f x) \, dx=\frac {12 (a-4 b) (e+f x)-8 (a-b) \sin (2 (e+f x))+a \sin (4 (e+f x))+32 b \tan (e+f x)}{32 f} \] Input:

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

Output:

(12*(a - 4*b)*(e + f*x) - 8*(a - b)*Sin[2*(e + f*x)] + a*Sin[4*(e + f*x)] 
+ 32*b*Tan[e + f*x])/(32*f)
 

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.29, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4620, 360, 1471, 299, 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 \sin ^4(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4620

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

\(\Big \downarrow \) 360

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

\(\Big \downarrow \) 1471

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

\(\Big \downarrow \) 299

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

\(\Big \downarrow \) 216

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

Input:

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

Output:

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

Defintions of rubi rules used

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 299
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[d*x 
*((a + b*x^2)^(p + 1)/(b*(2*p + 3))), x] - Simp[(a*d - b*c*(2*p + 3))/(b*(2 
*p + 3))   Int[(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - 
 a*d, 0] && NeQ[2*p + 3, 0]
 

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 1471
Int[((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), 
x_Symbol] :> With[{Qx = PolynomialQuotient[(a + b*x^2 + c*x^4)^p, d + e*x^2 
, x], R = Coeff[PolynomialRemainder[(a + b*x^2 + c*x^4)^p, d + e*x^2, x], x 
, 0]}, Simp[(-R)*x*((d + e*x^2)^(q + 1)/(2*d*(q + 1))), x] + Simp[1/(2*d*(q 
 + 1))   Int[(d + e*x^2)^(q + 1)*ExpandToSum[2*d*(q + 1)*Qx + R*(2*q + 3), 
x], 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] && LtQ[q, -1]
 

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 = 0.98 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.01

method result size
parallelrisch \(\frac {\left (-7 a +8 b \right ) \sin \left (3 f x +3 e \right )+\sin \left (5 f x +5 e \right ) a +24 f x \left (a -4 b \right ) \cos \left (f x +e \right )-8 \sin \left (f x +e \right ) \left (a -9 b \right )}{64 \cos \left (f x +e \right ) f}\) \(71\)
derivativedivides \(\frac {a \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 )+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}\) \(92\)
default \(\frac {a \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 )+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}\) \(92\)
parts \(\frac {a \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 \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}\) \(94\)
risch \(\frac {3 a x}{8}-\frac {3 x b}{2}+\frac {i {\mathrm e}^{2 i \left (f x +e \right )} a}{8 f}-\frac {i {\mathrm e}^{2 i \left (f x +e \right )} b}{8 f}-\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} a}{8 f}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} b}{8 f}+\frac {2 i b}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {\sin \left (4 f x +4 e \right ) a}{32 f}\) \(109\)
norman \(\frac {\left (-\frac {3 a}{8}+\frac {3 b}{2}\right ) x +\left (-\frac {9 a}{8}+\frac {9 b}{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (-\frac {3 a}{4}+3 b \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}+\left (\frac {3 a}{4}-3 b \right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}+\left (\frac {3 a}{8}-\frac {3 b}{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}+\left (\frac {9 a}{8}-\frac {9 b}{2}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}+\frac {3 \left (a -4 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {2 \left (a -4 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{f}+\frac {2 \left (a -4 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{f}+\frac {3 \left (a -4 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{4 f}-\frac {\left (11 a +20 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{2 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right ) \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{4}}\) \(247\)

Input:

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

Output:

1/64*((-7*a+8*b)*sin(3*f*x+3*e)+sin(5*f*x+5*e)*a+24*f*x*(a-4*b)*cos(f*x+e) 
-8*sin(f*x+e)*(a-9*b))/cos(f*x+e)/f
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

1/8*(3*(f*x + e)*(a - 4*b) + 8*b*tan(f*x + e) - ((5*a - 4*b)*tan(f*x + e)^ 
3 + (3*a - 4*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.13 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.17 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin ^4(e+f x) \, dx=\frac {3 \, {\left (f x + e\right )} {\left (a - 4 \, b\right )} + 8 \, b \tan \left (f x + e\right ) - \frac {5 \, a \tan \left (f x + e\right )^{3} - 4 \, b \tan \left (f x + e\right )^{3} + 3 \, a \tan \left (f x + e\right ) - 4 \, b \tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{2}}}{8 \, f} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 12.63 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.13 \[ \int \left (a+b \sec ^2(e+f x)\right ) \sin ^4(e+f x) \, dx=x\,\left (\frac {3\,a}{8}-\frac {3\,b}{2}\right )-\frac {\left (\frac {5\,a}{8}-\frac {b}{2}\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {3\,a}{8}-\frac {b}{2}\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\,\mathrm {tan}\left (e+f\,x\right )}{f} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

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

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

Output:

( - 2*cos(e + f*x)**2*sin(e + f*x)**3*a - 3*cos(e + f*x)**2*sin(e + f*x)*a 
 + 3*cos(e + f*x)*a*f*x - 12*cos(e + f*x)*b*e - 12*cos(e + f*x)*b*f*x - 4* 
sin(e + f*x)**3*b + 12*sin(e + f*x)*b)/(8*cos(e + f*x)*f)