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

Optimal result
Mathematica [B] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (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 = 80 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {(a+b) (a+5 b) \text {arctanh}(\cos (e+f x))}{2 f}-\frac {(a+b)^2 \cot (e+f x) \csc (e+f x)}{2 f}+\frac {2 b (a+b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \] Output:

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(1021\) vs. \(2(80)=160\).

Time = 7.04 (sec) , antiderivative size = 1021, normalized size of antiderivative = 12.76 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx =\text {Too large to display} \] Input:

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

Output:

((-a^2 - 2*a*b - b^2)*Cos[e + f*x]^4*Csc[e/2 + (f*x)/2]^2*(a + b*Sec[e + f 
*x]^2)^2)/(2*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2) - (2*(a^2 + 6*a*b + 5*b^2 
)*Cos[e + f*x]^4*Log[Cos[e/2 + (f*x)/2]]*(a + b*Sec[e + f*x]^2)^2)/(f*(a + 
 2*b + a*Cos[2*e + 2*f*x])^2) + (2*(a^2 + 6*a*b + 5*b^2)*Cos[e + f*x]^4*Lo 
g[Sin[e/2 + (f*x)/2]]*(a + b*Sec[e + f*x]^2)^2)/(f*(a + 2*b + a*Cos[2*e + 
2*f*x])^2) + (2*b*(12*a + 13*b)*Cos[e + f*x]^4*Sec[e]*(a + b*Sec[e + f*x]^ 
2)^2)/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2) + ((a^2 + 2*a*b + b^2)*Cos[e 
+ f*x]^4*Sec[e/2 + (f*x)/2]^2*(a + b*Sec[e + f*x]^2)^2)/(2*f*(a + 2*b + a* 
Cos[2*e + 2*f*x])^2) + (2*b^2*Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2*Sin[ 
(f*x)/2])/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2*(Cos[e/2] - Sin[e/2])*(Cos 
[e/2 + (f*x)/2] - Sin[e/2 + (f*x)/2])^3) + (Cos[e + f*x]^4*(a + b*Sec[e + 
f*x]^2)^2*(b^2*Cos[e/2] + b^2*Sin[e/2]))/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x 
])^2*(Cos[e/2] - Sin[e/2])*(Cos[e/2 + (f*x)/2] - Sin[e/2 + (f*x)/2])^2) + 
(2*Cos[e + f*x]^4*(a + b*Sec[e + f*x]^2)^2*(12*a*b*Sin[(f*x)/2] + 13*b^2*S 
in[(f*x)/2]))/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2*(Cos[e/2] - Sin[e/2])* 
(Cos[e/2 + (f*x)/2] - Sin[e/2 + (f*x)/2])) - (2*b^2*Cos[e + f*x]^4*(a + b* 
Sec[e + f*x]^2)^2*Sin[(f*x)/2])/(3*f*(a + 2*b + a*Cos[2*e + 2*f*x])^2*(Cos 
[e/2] + Sin[e/2])*(Cos[e/2 + (f*x)/2] + Sin[e/2 + (f*x)/2])^3) + (Cos[e + 
f*x]^4*(a + b*Sec[e + f*x]^2)^2*(b^2*Cos[e/2] - b^2*Sin[e/2]))/(3*f*(a + 2 
*b + a*Cos[2*e + 2*f*x])^2*(Cos[e/2] + Sin[e/2])*(Cos[e/2 + (f*x)/2] + ...
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.46, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 4621, 365, 361, 25, 359, 219}

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 ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4621

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

\(\Big \downarrow \) 365

\(\displaystyle -\frac {\frac {1}{3} \int \frac {\left (3 a^2 \cos ^2(e+f x)+b (6 a+5 b)\right ) \sec ^2(e+f x)}{\left (1-\cos ^2(e+f x)\right )^2}d\cos (e+f x)-\frac {b^2 \sec ^3(e+f x)}{3 \left (1-\cos ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 361

\(\displaystyle -\frac {\frac {1}{3} \left (\frac {\left (3 a^2+6 a b+5 b^2\right ) \cos (e+f x)}{2 \left (1-\cos ^2(e+f x)\right )}-\frac {1}{2} \int -\frac {\left (\left (3 a^2+6 b a+5 b^2\right ) \cos ^2(e+f x)+2 b (6 a+5 b)\right ) \sec ^2(e+f x)}{1-\cos ^2(e+f x)}d\cos (e+f x)\right )-\frac {b^2 \sec ^3(e+f x)}{3 \left (1-\cos ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\frac {1}{3} \left (\frac {1}{2} \int \frac {\left (\left (3 a^2+6 b a+5 b^2\right ) \cos ^2(e+f x)+2 b (6 a+5 b)\right ) \sec ^2(e+f x)}{1-\cos ^2(e+f x)}d\cos (e+f x)+\frac {\left (3 a^2+6 a b+5 b^2\right ) \cos (e+f x)}{2 \left (1-\cos ^2(e+f x)\right )}\right )-\frac {b^2 \sec ^3(e+f x)}{3 \left (1-\cos ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 359

\(\displaystyle -\frac {\frac {1}{3} \left (\frac {1}{2} \left (3 (a+b) (a+5 b) \int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)-2 b (6 a+5 b) \sec (e+f x)\right )+\frac {\left (3 a^2+6 a b+5 b^2\right ) \cos (e+f x)}{2 \left (1-\cos ^2(e+f x)\right )}\right )-\frac {b^2 \sec ^3(e+f x)}{3 \left (1-\cos ^2(e+f x)\right )}}{f}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {\frac {1}{3} \left (\frac {\left (3 a^2+6 a b+5 b^2\right ) \cos (e+f x)}{2 \left (1-\cos ^2(e+f x)\right )}+\frac {1}{2} (3 (a+b) (a+5 b) \text {arctanh}(\cos (e+f x))-2 b (6 a+5 b) \sec (e+f x))\right )-\frac {b^2 \sec ^3(e+f x)}{3 \left (1-\cos ^2(e+f x)\right )}}{f}\)

Input:

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

Output:

-((-1/3*(b^2*Sec[e + f*x]^3)/(1 - Cos[e + f*x]^2) + (((3*a^2 + 6*a*b + 5*b 
^2)*Cos[e + f*x])/(2*(1 - Cos[e + f*x]^2)) + (3*(a + b)*(a + 5*b)*ArcTanh[ 
Cos[e + f*x]] - 2*b*(6*a + 5*b)*Sec[e + f*x])/2)/3)/f)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

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

rule 361
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[x^m*(a + b*x^2)^(p + 1)*E 
xpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c 
- a*d)*x^(-m + 2))/(a + b*x^2)] - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], 
 x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && ILtQ[m/ 
2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])
 

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

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 [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(162\) vs. \(2(74)=148\).

Time = 1.21 (sec) , antiderivative size = 163, normalized size of antiderivative = 2.04

method result size
derivativedivides \(\frac {a^{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 )+2 a b \left (-\frac {1}{2 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {3}{2 \cos \left (f x +e \right )}+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+b^{2} \left (\frac {1}{3 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )^{3}}-\frac {5}{6 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {5}{2 \cos \left (f x +e \right )}+\frac {5 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )}{f}\) \(163\)
default \(\frac {a^{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 )+2 a b \left (-\frac {1}{2 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {3}{2 \cos \left (f x +e \right )}+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )+b^{2} \left (\frac {1}{3 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )^{3}}-\frac {5}{6 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {5}{2 \cos \left (f x +e \right )}+\frac {5 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2}\right )}{f}\) \(163\)
norman \(\frac {\frac {a^{2}+2 a b +b^{2}}{8 f}+\frac {\left (a^{2}+2 a b +b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{10}}{8 f}-\frac {\left (7 a^{2}+46 a b +55 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{8 f}-\frac {\left (9 a^{2}+66 a b +65 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{12 f}+\frac {\left (11 a^{2}+86 a b +75 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{8 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}+\frac {\left (a^{2}+6 a b +5 b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2 f}\) \(194\)
parallelrisch \(\frac {\frac {3 \left (a +b \right ) \left (\frac {\cos \left (3 f x +3 e \right )}{3}+\cos \left (f x +e \right )\right ) \left (a +5 b \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}-\frac {3 \left (\left (a^{2}+\frac {22}{3} a b +\frac {65}{9} b^{2}\right ) \cos \left (3 f x +3 e \right )+\frac {32 \left (a^{2}+2 a b +\frac {5}{3} b^{2}\right ) \cos \left (2 f x +2 e \right )}{3}+\frac {8 \left (a +5 b \right ) \left (a +b \right ) \cos \left (4 f x +4 e \right )}{3}+\left (a^{2}+\frac {22}{3} a b +\frac {65}{9} b^{2}\right ) \cos \left (5 f x +5 e \right )+2 \left (-a^{2}-\frac {22}{3} a b -\frac {65}{9} b^{2}\right ) \cos \left (f x +e \right )+8 a^{2}+\frac {16 a b}{3}-\frac {88 b^{2}}{9}\right ) \csc \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} \sec \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{128}}{f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(216\)
risch \(\frac {{\mathrm e}^{i \left (f x +e \right )} \left (3 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}+18 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+15 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+12 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}+24 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+20 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+18 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}+12 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-22 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+12 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}+24 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+20 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+3 a^{2}+18 a b +15 b^{2}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a^{2}}{2 f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a b}{f}+\frac {5 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b^{2}}{2 f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a^{2}}{2 f}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a b}{f}-\frac {5 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b^{2}}{2 f}\) \(367\)

Input:

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

Output:

1/f*(a^2*(-1/2*csc(f*x+e)*cot(f*x+e)+1/2*ln(csc(f*x+e)-cot(f*x+e)))+2*a*b* 
(-1/2/sin(f*x+e)^2/cos(f*x+e)+3/2/cos(f*x+e)+3/2*ln(csc(f*x+e)-cot(f*x+e)) 
)+b^2*(1/3/sin(f*x+e)^2/cos(f*x+e)^3-5/6/sin(f*x+e)^2/cos(f*x+e)+5/2/cos(f 
*x+e)+5/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. 193 vs. \(2 (74) = 148\).

Time = 0.08 (sec) , antiderivative size = 193, normalized size of antiderivative = 2.41 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {6 \, {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 4 \, {\left (6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 4 \, b^{2} - 3 \, {\left ({\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{5} - {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left ({\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{5} - {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{12 \, {\left (f \cos \left (f x + e\right )^{5} - f \cos \left (f x + e\right )^{3}\right )}} \] Input:

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.58 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {3 \, {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (6 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )}}{\cos \left (f x + e\right )^{5} - \cos \left (f x + e\right )^{3}}}{12 \, f} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.84 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {{\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \log \left ({\left | \cos \left (f x + e\right ) + 1 \right |}\right )}{4 \, f} + \frac {{\left (a^{2} + 6 \, a b + 5 \, b^{2}\right )} \log \left ({\left | \cos \left (f x + e\right ) - 1 \right |}\right )}{4 \, f} + \frac {a^{2} \cos \left (f x + e\right ) + 2 \, a b \cos \left (f x + e\right ) + b^{2} \cos \left (f x + e\right )}{2 \, {\left (\cos \left (f x + e\right )^{2} - 1\right )} f} + \frac {6 \, a b \cos \left (f x + e\right )^{2} + 6 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 12.54 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.20 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\frac {b^2}{3}+{\cos \left (e+f\,x\right )}^2\,\left (\frac {5\,b^2}{3}+2\,a\,b\right )-{\cos \left (e+f\,x\right )}^4\,\left (\frac {a^2}{2}+3\,a\,b+\frac {5\,b^2}{2}\right )}{f\,\left ({\cos \left (e+f\,x\right )}^3-{\cos \left (e+f\,x\right )}^5\right )}-\frac {\mathrm {atanh}\left (\cos \left (e+f\,x\right )\right )\,\left (a+b\right )\,\left (a+5\,b\right )}{2\,f} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 408, normalized size of antiderivative = 5.10 \[ \int \csc ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {12 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{4} a^{2}+72 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{4} a b +60 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{4} b^{2}-12 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{2} a^{2}-72 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{2} a b -60 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \sin \left (f x +e \right )^{2} b^{2}-9 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} a^{2}-66 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} a b -65 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} b^{2}+9 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a^{2}+66 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a b +65 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}+12 \sin \left (f x +e \right )^{4} a^{2}+72 \sin \left (f x +e \right )^{4} a b +60 \sin \left (f x +e \right )^{4} b^{2}-24 \sin \left (f x +e \right )^{2} a^{2}-96 \sin \left (f x +e \right )^{2} a b -80 \sin \left (f x +e \right )^{2} b^{2}+12 a^{2}+24 a b +12 b^{2}}{24 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} f \left (\sin \left (f x +e \right )^{2}-1\right )} \] Input:

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

Output:

(12*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)**4*a**2 + 72*cos(e + f 
*x)*log(tan((e + f*x)/2))*sin(e + f*x)**4*a*b + 60*cos(e + f*x)*log(tan((e 
 + f*x)/2))*sin(e + f*x)**4*b**2 - 12*cos(e + f*x)*log(tan((e + f*x)/2))*s 
in(e + f*x)**2*a**2 - 72*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)** 
2*a*b - 60*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)**2*b**2 - 9*cos 
(e + f*x)*sin(e + f*x)**4*a**2 - 66*cos(e + f*x)*sin(e + f*x)**4*a*b - 65* 
cos(e + f*x)*sin(e + f*x)**4*b**2 + 9*cos(e + f*x)*sin(e + f*x)**2*a**2 + 
66*cos(e + f*x)*sin(e + f*x)**2*a*b + 65*cos(e + f*x)*sin(e + f*x)**2*b**2 
 + 12*sin(e + f*x)**4*a**2 + 72*sin(e + f*x)**4*a*b + 60*sin(e + f*x)**4*b 
**2 - 24*sin(e + f*x)**2*a**2 - 96*sin(e + f*x)**2*a*b - 80*sin(e + f*x)** 
2*b**2 + 12*a**2 + 24*a*b + 12*b**2)/(24*cos(e + f*x)*sin(e + f*x)**2*f*(s 
in(e + f*x)**2 - 1))