Integrand size = 21, antiderivative size = 52 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {(a+b)^2 \text {arctanh}(\cos (e+f x))}{f}+\frac {b (2 a+b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \] Output:
-(a+b)^2*arctanh(cos(f*x+e))/f+b*(2*a+b)*sec(f*x+e)/f+1/3*b^2*sec(f*x+e)^3 /f
Leaf count is larger than twice the leaf count of optimal. \(108\) vs. \(2(52)=104\).
Time = 0.84 (sec) , antiderivative size = 108, normalized size of antiderivative = 2.08 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {4 \left (b+a \cos ^2(e+f x)\right )^2 \left (-b^2-3 b (2 a+b) \cos ^2(e+f x)+3 (a+b)^2 \cos ^3(e+f x) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )\right ) \sec ^3(e+f x)}{3 f (a+2 b+a \cos (2 (e+f x)))^2} \] Input:
Integrate[Csc[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]
Output:
(-4*(b + a*Cos[e + f*x]^2)^2*(-b^2 - 3*b*(2*a + b)*Cos[e + f*x]^2 + 3*(a + b)^2*Cos[e + f*x]^3*(Log[Cos[(e + f*x)/2]] - Log[Sin[(e + f*x)/2]]))*Sec[ e + f*x]^3)/(3*f*(a + 2*b + a*Cos[2*(e + f*x)])^2)
Time = 0.26 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.92, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4621, 364, 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 \csc (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)}dx\) |
\(\Big \downarrow \) 4621 |
\(\displaystyle -\frac {\int \frac {\left (a \cos ^2(e+f x)+b\right )^2 \sec ^4(e+f x)}{1-\cos ^2(e+f x)}d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 364 |
\(\displaystyle -\frac {\int \left (b^2 \sec ^4(e+f x)+b (2 a+b) \sec ^2(e+f x)-\frac {(a+b)^2}{\cos ^2(e+f x)-1}\right )d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {(a+b)^2 \text {arctanh}(\cos (e+f x))-b (2 a+b) \sec (e+f x)-\frac {1}{3} b^2 \sec ^3(e+f x)}{f}\) |
Input:
Int[Csc[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]
Output:
-(((a + b)^2*ArcTanh[Cos[e + f*x]] - b*(2*a + b)*Sec[e + f*x] - (b^2*Sec[e + f*x]^3)/3)/f)
Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_))/((c_) + (d_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*((a + b*x^2)^p/(c + d*x^2)), x], x ] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && (In tegerQ[m] || IGtQ[2*(m + 1), 0] || !RationalQ[m])
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]
Time = 0.52 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.81
method | result | size |
derivativedivides | \(\frac {a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+2 a b \left (\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )+b^{2} \left (\frac {1}{3 \cos \left (f x +e \right )^{3}}+\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )}{f}\) | \(94\) |
default | \(\frac {a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )+2 a b \left (\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )+b^{2} \left (\frac {1}{3 \cos \left (f x +e \right )^{3}}+\frac {1}{\cos \left (f x +e \right )}+\ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )\right )}{f}\) | \(94\) |
norman | \(\frac {\frac {\left (8 a b +4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{f}-\frac {12 a b +8 b^{2}}{3 f}-\frac {\left (4 a b +4 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}+\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}\) | \(110\) |
parallelrisch | \(\frac {3 \left (a +b \right )^{2} \left (\frac {\cos \left (3 f x +3 e \right )}{3}+\cos \left (f x +e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )+6 \left (\frac {\left (a +\frac {2 b}{3}\right ) \cos \left (3 f x +3 e \right )}{3}+\frac {\left (2 a +b \right ) \cos \left (2 f x +2 e \right )}{3}+\left (a +\frac {2 b}{3}\right ) \cos \left (f x +e \right )+\frac {2 a}{3}+\frac {5 b}{9}\right ) b}{f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) | \(115\) |
risch | \(\frac {2 b \,{\mathrm e}^{i \left (f x +e \right )} \left (6 a \,{\mathrm e}^{4 i \left (f x +e \right )}+3 b \,{\mathrm e}^{4 i \left (f x +e \right )}+12 a \,{\mathrm e}^{2 i \left (f x +e \right )}+10 b \,{\mathrm e}^{2 i \left (f x +e \right )}+6 a +3 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a^{2}}{f}-\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a b}{f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b^{2}}{f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a^{2}}{f}+\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a b}{f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b^{2}}{f}\) | \(211\) |
Input:
int(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
Output:
1/f*(a^2*ln(csc(f*x+e)-cot(f*x+e))+2*a*b*(1/cos(f*x+e)+ln(csc(f*x+e)-cot(f *x+e)))+b^2*(1/3/cos(f*x+e)^3+1/cos(f*x+e)+ln(csc(f*x+e)-cot(f*x+e))))
Leaf count of result is larger than twice the leaf count of optimal. 101 vs. \(2 (50) = 100\).
Time = 0.08 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.94 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 6 \, {\left (2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}}{6 \, f \cos \left (f x + e\right )^{3}} \] Input:
integrate(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")
Output:
-1/6*(3*(a^2 + 2*a*b + b^2)*cos(f*x + e)^3*log(1/2*cos(f*x + e) + 1/2) - 3 *(a^2 + 2*a*b + b^2)*cos(f*x + e)^3*log(-1/2*cos(f*x + e) + 1/2) - 6*(2*a* b + b^2)*cos(f*x + e)^2 - 2*b^2)/(f*cos(f*x + e)^3)
\[ \int \csc (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 {\left (e + f x \right )}\, dx \] Input:
integrate(csc(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)
Output:
Integral((a + b*sec(e + f*x)**2)**2*csc(e + f*x), x)
Time = 0.03 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.58 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}\right )}}{\cos \left (f x + e\right )^{3}}}{6 \, f} \] Input:
integrate(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")
Output:
-1/6*(3*(a^2 + 2*a*b + b^2)*log(cos(f*x + e) + 1) - 3*(a^2 + 2*a*b + b^2)* log(cos(f*x + e) - 1) - 2*(3*(2*a*b + b^2)*cos(f*x + e)^2 + b^2)/cos(f*x + e)^3)/f
Time = 0.12 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.83 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left ({\left | \cos \left (f x + e\right ) + 1 \right |}\right )}{2 \, f} + \frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left ({\left | \cos \left (f x + e\right ) - 1 \right |}\right )}{2 \, f} + \frac {6 \, a b \cos \left (f x + e\right )^{2} + 3 \, 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)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")
Output:
-1/2*(a^2 + 2*a*b + b^2)*log(abs(cos(f*x + e) + 1))/f + 1/2*(a^2 + 2*a*b + b^2)*log(abs(cos(f*x + e) - 1))/f + 1/3*(6*a*b*cos(f*x + e)^2 + 3*b^2*cos (f*x + e)^2 + b^2)/(f*cos(f*x + e)^3)
Time = 0.12 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.02 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {{\cos \left (e+f\,x\right )}^2\,\left (b^2+2\,a\,b\right )+\frac {b^2}{3}}{f\,{\cos \left (e+f\,x\right )}^3}-\frac {\mathrm {atanh}\left (\cos \left (e+f\,x\right )\right )\,{\left (a+b\right )}^2}{f} \] Input:
int((a + b/cos(e + f*x)^2)^2/sin(e + f*x),x)
Output:
(cos(e + f*x)^2*(2*a*b + b^2) + b^2/3)/(f*cos(e + f*x)^3) - (atanh(cos(e + f*x))*(a + b)^2)/f
Time = 0.16 (sec) , antiderivative size = 266, normalized size of antiderivative = 5.12 \[ \int \csc (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {3 \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}+6 \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 +3 \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}-3 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a^{2}-6 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a b -3 \cos \left (f x +e \right ) \mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) b^{2}-6 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a b -4 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}+6 \cos \left (f x +e \right ) a b +4 \cos \left (f x +e \right ) b^{2}+6 \sin \left (f x +e \right )^{2} a b +3 \sin \left (f x +e \right )^{2} b^{2}-6 a b -4 b^{2}}{3 \cos \left (f x +e \right ) f \left (\sin \left (f x +e \right )^{2}-1\right )} \] Input:
int(csc(f*x+e)*(a+b*sec(f*x+e)^2)^2,x)
Output:
(3*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)**2*a**2 + 6*cos(e + f*x )*log(tan((e + f*x)/2))*sin(e + f*x)**2*a*b + 3*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)**2*b**2 - 3*cos(e + f*x)*log(tan((e + f*x)/2))*a**2 - 6*cos(e + f*x)*log(tan((e + f*x)/2))*a*b - 3*cos(e + f*x)*log(tan((e + f *x)/2))*b**2 - 6*cos(e + f*x)*sin(e + f*x)**2*a*b - 4*cos(e + f*x)*sin(e + f*x)**2*b**2 + 6*cos(e + f*x)*a*b + 4*cos(e + f*x)*b**2 + 6*sin(e + f*x)* *2*a*b + 3*sin(e + f*x)**2*b**2 - 6*a*b - 4*b**2)/(3*cos(e + f*x)*f*(sin(e + f*x)**2 - 1))