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

Optimal result
Mathematica [B] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 110 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=-\frac {\left (3 a^2+4 b^2\right ) \text {arctanh}(\cos (e+f x))}{8 f}-\frac {2 a b \cot (e+f x)}{f}-\frac {2 a b \cot ^3(e+f x)}{3 f}-\frac {\left (3 a^2+4 b^2\right ) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f} \] Output:

-1/8*(3*a^2+4*b^2)*arctanh(cos(f*x+e))/f-2*a*b*cot(f*x+e)/f-2/3*a*b*cot(f* 
x+e)^3/f-1/8*(3*a^2+4*b^2)*cot(f*x+e)*csc(f*x+e)/f-1/4*a^2*cot(f*x+e)*csc( 
f*x+e)^3/f
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(255\) vs. \(2(110)=220\).

Time = 0.21 (sec) , antiderivative size = 255, normalized size of antiderivative = 2.32 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=-\frac {4 a b \cot (e+f x)}{3 f}-\frac {3 a^2 \csc ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}-\frac {b^2 \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {a^2 \csc ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}-\frac {2 a b \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {3 a^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {b^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {3 a^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}+\frac {b^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {3 a^2 \sec ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {b^2 \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {a^2 \sec ^4\left (\frac {1}{2} (e+f x)\right )}{64 f} \] Input:

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

Output:

(-4*a*b*Cot[e + f*x])/(3*f) - (3*a^2*Csc[(e + f*x)/2]^2)/(32*f) - (b^2*Csc 
[(e + f*x)/2]^2)/(8*f) - (a^2*Csc[(e + f*x)/2]^4)/(64*f) - (2*a*b*Cot[e + 
f*x]*Csc[e + f*x]^2)/(3*f) - (3*a^2*Log[Cos[(e + f*x)/2]])/(8*f) - (b^2*Lo 
g[Cos[(e + f*x)/2]])/(2*f) + (3*a^2*Log[Sin[(e + f*x)/2]])/(8*f) + (b^2*Lo 
g[Sin[(e + f*x)/2]])/(2*f) + (3*a^2*Sec[(e + f*x)/2]^2)/(32*f) + (b^2*Sec[ 
(e + f*x)/2]^2)/(8*f) + (a^2*Sec[(e + f*x)/2]^4)/(64*f)
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.91, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {3042, 3268, 3042, 3491, 3042, 4254, 2009, 4255, 3042, 4257}

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 ^5(e+f x) (a+b \sin (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \sin (e+f x))^2}{\sin (e+f x)^5}dx\)

\(\Big \downarrow \) 3268

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a^2+b^2 \sin (e+f x)^2}{\sin (e+f x)^5}dx+2 a b \int \csc (e+f x)^4dx\)

\(\Big \downarrow \) 3491

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \int \csc ^3(e+f x)dx+2 a b \int \csc (e+f x)^4dx-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \int \csc (e+f x)^3dx+2 a b \int \csc (e+f x)^4dx-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}\)

\(\Big \downarrow \) 4254

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \int \csc (e+f x)^3dx-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \left (\frac {1}{3} \cot ^3(e+f x)+\cot (e+f x)\right )}{f}\)

\(\Big \downarrow \) 4255

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \left (\frac {1}{2} \int \csc (e+f x)dx-\frac {\cot (e+f x) \csc (e+f x)}{2 f}\right )-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \left (\frac {1}{3} \cot ^3(e+f x)+\cot (e+f x)\right )}{f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \left (\frac {1}{2} \int \csc (e+f x)dx-\frac {\cot (e+f x) \csc (e+f x)}{2 f}\right )-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \left (\frac {1}{3} \cot ^3(e+f x)+\cot (e+f x)\right )}{f}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{4} \left (3 a^2+4 b^2\right ) \left (-\frac {\text {arctanh}(\cos (e+f x))}{2 f}-\frac {\cot (e+f x) \csc (e+f x)}{2 f}\right )-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \left (\frac {1}{3} \cot ^3(e+f x)+\cot (e+f x)\right )}{f}\)

Input:

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

Output:

(-2*a*b*(Cot[e + f*x] + Cot[e + f*x]^3/3))/f - (a^2*Cot[e + f*x]*Csc[e + f 
*x]^3)/(4*f) + ((3*a^2 + 4*b^2)*(-1/2*ArcTanh[Cos[e + f*x]]/f - (Cot[e + f 
*x]*Csc[e + f*x])/(2*f)))/4
 

Defintions of rubi rules used

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 3268
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)])^2, x_Symbol] :> Simp[2*c*(d/b)   Int[(b*Sin[e + f*x])^(m + 1), x], x] 
+ Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c, d, 
e, f, m}, x]
 

rule 3491
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x 
_)]^2), x_Symbol] :> Simp[A*Cos[e + f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m 
+ 1))), x] + Simp[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1))   Int[(b*Sin[e + f* 
x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 1.06 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {a^{2} \left (\left (-\frac {\csc \left (f x +e \right )^{3}}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+2 a b \left (-\frac {2}{3}-\frac {\csc \left (f x +e \right )^{2}}{3}\right ) \cot \left (f x +e \right )+b^{2} \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )}{f}\) \(114\)
default \(\frac {a^{2} \left (\left (-\frac {\csc \left (f x +e \right )^{3}}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+2 a b \left (-\frac {2}{3}-\frac {\csc \left (f x +e \right )^{2}}{3}\right ) \cot \left (f x +e \right )+b^{2} \left (-\frac {\csc \left (f x +e \right ) \cot \left (f x +e \right )}{2}+\frac {\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )}{f}\) \(114\)
parallelrisch \(\frac {3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}-3 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} a^{2}+16 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}-16 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} a b +24 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} a^{2}+24 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} b^{2}-24 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} a^{2}-24 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} b^{2}+144 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+72 a^{2} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )+96 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) b^{2}-144 \cot \left (\frac {f x}{2}+\frac {e}{2}\right ) a b}{192 f}\) \(189\)
risch \(\frac {9 a^{2} {\mathrm e}^{7 i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{7 i \left (f x +e \right )}+96 i a b \,{\mathrm e}^{4 i \left (f x +e \right )}-33 a^{2} {\mathrm e}^{5 i \left (f x +e \right )}-12 b^{2} {\mathrm e}^{5 i \left (f x +e \right )}-128 i a b \,{\mathrm e}^{2 i \left (f x +e \right )}-33 a^{2} {\mathrm e}^{3 i \left (f x +e \right )}-12 b^{2} {\mathrm e}^{3 i \left (f x +e \right )}+32 i a b +9 a^{2} {\mathrm e}^{i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{i \left (f x +e \right )}}{12 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{4}}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{8 f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b^{2}}{2 f}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{8 f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b^{2}}{2 f}\) \(246\)
norman \(\frac {-\frac {a^{2}}{64 f}+\frac {a^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{12}}{64 f}-\frac {\left (5 a^{2}+4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{32 f}+\frac {\left (5 a^{2}+4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}}{32 f}-\frac {\left (17 a^{2}+16 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{32 f}-\frac {\left (17 a^{2}+16 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{32 f}-\frac {a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{12 f}-\frac {11 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{12 f}-\frac {5 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{6 f}+\frac {5 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{6 f}+\frac {11 a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{12 f}+\frac {a b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{11}}{12 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{2}}+\frac {\left (3 a^{2}+4 b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}\) \(297\)

Input:

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

Output:

1/f*(a^2*((-1/4*csc(f*x+e)^3-3/8*csc(f*x+e))*cot(f*x+e)+3/8*ln(csc(f*x+e)- 
cot(f*x+e)))+2*a*b*(-2/3-1/3*csc(f*x+e)^2)*cot(f*x+e)+b^2*(-1/2*csc(f*x+e) 
*cot(f*x+e)+1/2*ln(csc(f*x+e)-cot(f*x+e))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (102) = 204\).

Time = 0.09 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.08 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {6 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - 6 \, {\left (5 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right ) - 3 \, {\left ({\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a^{2} + 4 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left ({\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a^{2} + 4 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 32 \, {\left (2 \, a b \cos \left (f x + e\right )^{3} - 3 \, a b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, {\left (f \cos \left (f x + e\right )^{4} - 2 \, f \cos \left (f x + e\right )^{2} + f\right )}} \] Input:

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

Output:

1/48*(6*(3*a^2 + 4*b^2)*cos(f*x + e)^3 - 6*(5*a^2 + 4*b^2)*cos(f*x + e) - 
3*((3*a^2 + 4*b^2)*cos(f*x + e)^4 - 2*(3*a^2 + 4*b^2)*cos(f*x + e)^2 + 3*a 
^2 + 4*b^2)*log(1/2*cos(f*x + e) + 1/2) + 3*((3*a^2 + 4*b^2)*cos(f*x + e)^ 
4 - 2*(3*a^2 + 4*b^2)*cos(f*x + e)^2 + 3*a^2 + 4*b^2)*log(-1/2*cos(f*x + e 
) + 1/2) + 32*(2*a*b*cos(f*x + e)^3 - 3*a*b*cos(f*x + e))*sin(f*x + e))/(f 
*cos(f*x + e)^4 - 2*f*cos(f*x + e)^2 + f)
 

Sympy [F]

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

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

Output:

Integral((a + b*sin(e + f*x))**2*csc(e + f*x)**5, x)
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.34 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {3 \, a^{2} {\left (\frac {2 \, {\left (3 \, \cos \left (f x + e\right )^{3} - 5 \, \cos \left (f x + e\right )\right )}}{\cos \left (f x + e\right )^{4} - 2 \, \cos \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\cos \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + 12 \, b^{2} {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {32 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a b}{\tan \left (f x + e\right )^{3}}}{48 \, f} \] Input:

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

Output:

1/48*(3*a^2*(2*(3*cos(f*x + e)^3 - 5*cos(f*x + e))/(cos(f*x + e)^4 - 2*cos 
(f*x + e)^2 + 1) - 3*log(cos(f*x + e) + 1) + 3*log(cos(f*x + e) - 1)) + 12 
*b^2*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) + log(co 
s(f*x + e) - 1)) - 32*(3*tan(f*x + e)^2 + 1)*a*b/tan(f*x + e)^3)/f
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 217 vs. \(2 (102) = 204\).

Time = 0.15 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.97 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {3 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 16 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 24 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 24 \, b^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 144 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 24 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) - \frac {150 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, b^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 144 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 24 \, a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 24 \, b^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 16 \, a b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 3 \, a^{2}}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4}}}{192 \, f} \] Input:

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

Output:

1/192*(3*a^2*tan(1/2*f*x + 1/2*e)^4 + 16*a*b*tan(1/2*f*x + 1/2*e)^3 + 24*a 
^2*tan(1/2*f*x + 1/2*e)^2 + 24*b^2*tan(1/2*f*x + 1/2*e)^2 + 144*a*b*tan(1/ 
2*f*x + 1/2*e) + 24*(3*a^2 + 4*b^2)*log(abs(tan(1/2*f*x + 1/2*e))) - (150* 
a^2*tan(1/2*f*x + 1/2*e)^4 + 200*b^2*tan(1/2*f*x + 1/2*e)^4 + 144*a*b*tan( 
1/2*f*x + 1/2*e)^3 + 24*a^2*tan(1/2*f*x + 1/2*e)^2 + 24*b^2*tan(1/2*f*x + 
1/2*e)^2 + 16*a*b*tan(1/2*f*x + 1/2*e) + 3*a^2)/tan(1/2*f*x + 1/2*e)^4)/f
 

Mupad [B] (verification not implemented)

Time = 17.10 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.62 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {3\,a^2}{8}+\frac {b^2}{2}\right )}{f}+\frac {a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{64\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,a^2+2\,b^2\right )+\frac {a^2}{4}+12\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\frac {4\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{3}\right )}{16\,f}+\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a^2}{8}+\frac {b^2}{8}\right )}{f}+\frac {a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{12\,f}+\frac {3\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{4\,f} \] Input:

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

Output:

(log(tan(e/2 + (f*x)/2))*((3*a^2)/8 + b^2/2))/f + (a^2*tan(e/2 + (f*x)/2)^ 
4)/(64*f) - (cot(e/2 + (f*x)/2)^4*(tan(e/2 + (f*x)/2)^2*(2*a^2 + 2*b^2) + 
a^2/4 + 12*a*b*tan(e/2 + (f*x)/2)^3 + (4*a*b*tan(e/2 + (f*x)/2))/3))/(16*f 
) + (tan(e/2 + (f*x)/2)^2*(a^2/8 + b^2/8))/f + (a*b*tan(e/2 + (f*x)/2)^3)/ 
(12*f) + (3*a*b*tan(e/2 + (f*x)/2))/(4*f)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.30 \[ \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx=\frac {-32 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a b -9 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a^{2}-12 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}-16 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a b -6 \cos \left (f x +e \right ) a^{2}+9 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{4} a^{2}+12 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{4} b^{2}}{24 \sin \left (f x +e \right )^{4} f} \] Input:

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

Output:

( - 32*cos(e + f*x)*sin(e + f*x)**3*a*b - 9*cos(e + f*x)*sin(e + f*x)**2*a 
**2 - 12*cos(e + f*x)*sin(e + f*x)**2*b**2 - 16*cos(e + f*x)*sin(e + f*x)* 
a*b - 6*cos(e + f*x)*a**2 + 9*log(tan((e + f*x)/2))*sin(e + f*x)**4*a**2 + 
 12*log(tan((e + f*x)/2))*sin(e + f*x)**4*b**2)/(24*sin(e + f*x)**4*f)