\(\int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx\) [8]

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

Optimal result

Integrand size = 32, antiderivative size = 61 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2 c \text {arctanh}(\cos (e+f x))}{2 f}-\frac {a^2 c \cot ^3(e+f x)}{3 f}-\frac {a^2 c \cot (e+f x) \csc (e+f x)}{2 f} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(172\) vs. \(2(61)=122\).

Time = 0.35 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.82 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=a^2 c \left (\frac {\cot \left (\frac {1}{2} (e+f x)\right )}{6 f}-\frac {\csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {\cot \left (\frac {1}{2} (e+f x)\right ) \csc ^2\left (\frac {1}{2} (e+f x)\right )}{24 f}+\frac {\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}-\frac {\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {\sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {\tan \left (\frac {1}{2} (e+f x)\right )}{6 f}+\frac {\sec ^2\left (\frac {1}{2} (e+f x)\right ) \tan \left (\frac {1}{2} (e+f x)\right )}{24 f}\right ) \] Input:

Integrate[Csc[e + f*x]^4*(a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x]),x]
 

Output:

a^2*c*(Cot[(e + f*x)/2]/(6*f) - Csc[(e + f*x)/2]^2/(8*f) - (Cot[(e + f*x)/ 
2]*Csc[(e + f*x)/2]^2)/(24*f) + Log[Cos[(e + f*x)/2]]/(2*f) - Log[Sin[(e + 
 f*x)/2]]/(2*f) + Sec[(e + f*x)/2]^2/(8*f) - Tan[(e + f*x)/2]/(6*f) + (Sec 
[(e + f*x)/2]^2*Tan[(e + f*x)/2])/(24*f))
 

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {3042, 3429, 3042, 3185, 3042, 3087, 15, 3091, 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 ^4(e+f x) (a \sin (e+f x)+a)^2 (c-c \sin (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \sin (e+f x)+a)^2 (c-c \sin (e+f x))}{\sin (e+f x)^4}dx\)

\(\Big \downarrow \) 3429

\(\displaystyle a^2 c^2 \int \frac {\cot ^4(e+f x)}{c-c \sin (e+f x)}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a^2 c^2 \int \frac {1}{(c-c \sin (e+f x)) \tan (e+f x)^4}dx\)

\(\Big \downarrow \) 3185

\(\displaystyle a^2 c^2 \left (\frac {\int \cot ^2(e+f x) \csc ^2(e+f x)dx}{c}+\frac {\int \cot ^2(e+f x) \csc (e+f x)dx}{c}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle a^2 c^2 \left (\frac {\int \sec \left (e+f x-\frac {\pi }{2}\right ) \tan \left (e+f x-\frac {\pi }{2}\right )^2dx}{c}+\frac {\int \sec \left (e+f x-\frac {\pi }{2}\right )^2 \tan \left (e+f x-\frac {\pi }{2}\right )^2dx}{c}\right )\)

\(\Big \downarrow \) 3087

\(\displaystyle a^2 c^2 \left (\frac {\int \cot ^2(e+f x)d(-\cot (e+f x))}{c f}+\frac {\int \sec \left (e+f x-\frac {\pi }{2}\right ) \tan \left (e+f x-\frac {\pi }{2}\right )^2dx}{c}\right )\)

\(\Big \downarrow \) 15

\(\displaystyle a^2 c^2 \left (\frac {\int \sec \left (e+f x-\frac {\pi }{2}\right ) \tan \left (e+f x-\frac {\pi }{2}\right )^2dx}{c}-\frac {\cot ^3(e+f x)}{3 c f}\right )\)

\(\Big \downarrow \) 3091

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

Int[Csc[e + f*x]^4*(a + a*Sin[e + f*x])^2*(c - c*Sin[e + f*x]),x]
 

Output:

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

Defintions of rubi rules used

rule 15
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ 
{a, m}, x] && NeQ[m, -1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3087
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> Simp[1/f   Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + 
f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n - 1) 
/2] && LtQ[0, n, m - 1])
 

rule 3091
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[b*(a*Sec[e + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m 
 + n - 1))), x] - Simp[b^2*((n - 1)/(m + n - 1))   Int[(a*Sec[e + f*x])^m*( 
b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] & 
& NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]
 

rule 3185
Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[1/a   Int[Sec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x 
] - Simp[1/(b*g)   Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /; Fre 
eQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]
 

rule 3429
Int[sin[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ 
.)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[a^n*c^n 
  Int[Tan[e + f*x]^p*(a + b*Sin[e + f*x])^(m - n), x], x] /; FreeQ[{a, b, c 
, d, e, f, m}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && EqQ[p + 2*n, 
 0] && IntegerQ[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.87 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.56

method result size
parallelrisch \(-\frac {a^{2} c \left (\cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}+3 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-3 \cot \left (\frac {f x}{2}+\frac {e}{2}\right )+12 \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{24 f}\) \(95\)
derivativedivides \(\frac {-a^{2} c \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+a^{2} c \cot \left (f x +e \right )+a^{2} c \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 )+a^{2} c \left (-\frac {2}{3}-\frac {\csc \left (f x +e \right )^{2}}{3}\right ) \cot \left (f x +e \right )}{f}\) \(100\)
default \(\frac {-a^{2} c \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+a^{2} c \cot \left (f x +e \right )+a^{2} c \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 )+a^{2} c \left (-\frac {2}{3}-\frac {\csc \left (f x +e \right )^{2}}{3}\right ) \cot \left (f x +e \right )}{f}\) \(100\)
risch \(\frac {a^{2} c \left (6 i {\mathrm e}^{4 i \left (f x +e \right )}+3 \,{\mathrm e}^{5 i \left (f x +e \right )}+2 i-3 \,{\mathrm e}^{i \left (f x +e \right )}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{3}}+\frac {a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{2 f}-\frac {a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{2 f}\) \(103\)
norman \(\frac {-\frac {a^{2} c}{24 f}-\frac {3 a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}-\frac {7 a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{8 f}-\frac {11 a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{8 f}-\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{8 f}+\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{8 f}-\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{8 f}+\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{11}}{8 f}+\frac {a^{2} c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{12}}{24 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} \left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{3}}-\frac {a^{2} c \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}\) \(216\)

Input:

int(csc(f*x+e)^4*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x,method=_RETURNVERBO 
SE)
 

Output:

-1/24*a^2*c*(cot(1/2*f*x+1/2*e)^3-tan(1/2*f*x+1/2*e)^3+3*cot(1/2*f*x+1/2*e 
)^2-3*tan(1/2*f*x+1/2*e)^2-3*cot(1/2*f*x+1/2*e)+12*ln(tan(1/2*f*x+1/2*e))+ 
3*tan(1/2*f*x+1/2*e))/f
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 137 vs. \(2 (55) = 110\).

Time = 0.09 (sec) , antiderivative size = 137, normalized size of antiderivative = 2.25 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {4 \, a^{2} c \cos \left (f x + e\right )^{3} + 6 \, a^{2} c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, {\left (a^{2} c \cos \left (f x + e\right )^{2} - a^{2} c\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 3 \, {\left (a^{2} c \cos \left (f x + e\right )^{2} - a^{2} c\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right )}{12 \, {\left (f \cos \left (f x + e\right )^{2} - f\right )} \sin \left (f x + e\right )} \] Input:

integrate(csc(f*x+e)^4*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="f 
ricas")
 

Output:

1/12*(4*a^2*c*cos(f*x + e)^3 + 6*a^2*c*cos(f*x + e)*sin(f*x + e) + 3*(a^2* 
c*cos(f*x + e)^2 - a^2*c)*log(1/2*cos(f*x + e) + 1/2)*sin(f*x + e) - 3*(a^ 
2*c*cos(f*x + e)^2 - a^2*c)*log(-1/2*cos(f*x + e) + 1/2)*sin(f*x + e))/((f 
*cos(f*x + e)^2 - f)*sin(f*x + e))
 

Sympy [F]

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

integrate(csc(f*x+e)**4*(a+a*sin(f*x+e))**2*(c-c*sin(f*x+e)),x)
 

Output:

-a**2*c*(Integral(-sin(e + f*x)*csc(e + f*x)**4, x) + Integral(sin(e + f*x 
)**2*csc(e + f*x)**4, x) + Integral(sin(e + f*x)**3*csc(e + f*x)**4, x) + 
Integral(-csc(e + f*x)**4, x))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 120 vs. \(2 (55) = 110\).

Time = 0.04 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.97 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {3 \, a^{2} c {\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 )} + 6 \, a^{2} c {\left (\log \left (\cos \left (f x + e\right ) + 1\right ) - \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + \frac {12 \, a^{2} c}{\tan \left (f x + e\right )} - \frac {4 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a^{2} c}{\tan \left (f x + e\right )^{3}}}{12 \, f} \] Input:

integrate(csc(f*x+e)^4*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="m 
axima")
 

Output:

1/12*(3*a^2*c*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) 
 + log(cos(f*x + e) - 1)) + 6*a^2*c*(log(cos(f*x + e) + 1) - log(cos(f*x + 
 e) - 1)) + 12*a^2*c/tan(f*x + e) - 4*(3*tan(f*x + e)^2 + 1)*a^2*c/tan(f*x 
 + e)^3)/f
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (55) = 110\).

Time = 0.35 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.28 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 12 \, a^{2} c \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}\right ) - 3 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {22 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a^{2} c}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3}}}{24 \, f} \] Input:

integrate(csc(f*x+e)^4*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x, algorithm="g 
iac")
 

Output:

1/24*(a^2*c*tan(1/2*f*x + 1/2*e)^3 + 3*a^2*c*tan(1/2*f*x + 1/2*e)^2 - 12*a 
^2*c*log(abs(tan(1/2*f*x + 1/2*e))) - 3*a^2*c*tan(1/2*f*x + 1/2*e) + (22*a 
^2*c*tan(1/2*f*x + 1/2*e)^3 + 3*a^2*c*tan(1/2*f*x + 1/2*e)^2 - 3*a^2*c*tan 
(1/2*f*x + 1/2*e) - a^2*c)/tan(1/2*f*x + 1/2*e)^3)/f
 

Mupad [B] (verification not implemented)

Time = 35.44 (sec) , antiderivative size = 132, normalized size of antiderivative = 2.16 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}-\frac {a^2\,c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{8\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (-c\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+c\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+\frac {c\,a^2}{3}\right )}{8\,f}+\frac {a^2\,c\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{24\,f}-\frac {a^2\,c\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{2\,f} \] Input:

int(((a + a*sin(e + f*x))^2*(c - c*sin(e + f*x)))/sin(e + f*x)^4,x)
 

Output:

(a^2*c*tan(e/2 + (f*x)/2)^2)/(8*f) - (a^2*c*tan(e/2 + (f*x)/2))/(8*f) - (c 
ot(e/2 + (f*x)/2)^3*((a^2*c)/3 + a^2*c*tan(e/2 + (f*x)/2) - a^2*c*tan(e/2 
+ (f*x)/2)^2))/(8*f) + (a^2*c*tan(e/2 + (f*x)/2)^3)/(24*f) - (a^2*c*log(ta 
n(e/2 + (f*x)/2)))/(2*f)
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.25 \[ \int \csc ^4(e+f x) (a+a \sin (e+f x))^2 (c-c \sin (e+f x)) \, dx=\frac {a^{2} c \left (2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2}-3 \cos \left (f x +e \right ) \sin \left (f x +e \right )-2 \cos \left (f x +e \right )-3 \,\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{3}\right )}{6 \sin \left (f x +e \right )^{3} f} \] Input:

int(csc(f*x+e)^4*(a+a*sin(f*x+e))^2*(c-c*sin(f*x+e)),x)
 

Output:

(a**2*c*(2*cos(e + f*x)*sin(e + f*x)**2 - 3*cos(e + f*x)*sin(e + f*x) - 2* 
cos(e + f*x) - 3*log(tan((e + f*x)/2))*sin(e + f*x)**3))/(6*sin(e + f*x)** 
3*f)