Integrand size = 21, antiderivative size = 52 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {a^2 \text {arctanh}(\cos (e+f x))}{f}+\frac {(2 a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \] Output:
-a^2*arctanh(cos(f*x+e))/f+(2*a-b)*b*sec(f*x+e)/f+1/3*b^2*sec(f*x+e)^3/f
Time = 0.47 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.27 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {3 a^2 \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 )+3 (2 a-b) b \sec (e+f x)+b^2 \sec ^3(e+f x)}{3 f} \] Input:
Integrate[Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^2,x]
Output:
(3*a^2*(-Log[Cos[(e + f*x)/2]] + Log[Sin[(e + f*x)/2]]) + 3*(2*a - b)*b*Se c[e + f*x] + b^2*Sec[e + f*x]^3)/(3*f)
Time = 0.40 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.90, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4147, 25, 300, 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 \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \tan (e+f x)^2\right )^2}{\sin (e+f x)}dx\) |
\(\Big \downarrow \) 4147 |
\(\displaystyle \frac {\int -\frac {\left (b \sec ^2(e+f x)+a-b\right )^2}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\frac {\int \frac {\left (b \sec ^2(e+f x)+a-b\right )^2}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 300 |
\(\displaystyle -\frac {\int \left (\frac {a^2}{1-\sec ^2(e+f x)}-b^2 \sec ^2(e+f x)-(2 a-b) b\right )d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-a^2 \text {arctanh}(\sec (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*Tan[e + f*x]^2)^2,x]
Output:
(-(a^2*ArcTanh[Sec[e + f*x]]) + (2*a - b)*b*Sec[e + f*x] + (b^2*Sec[e + f* x]^3)/3)/f
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^ (p_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Simp[1/(f*ff^ m) Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m + 1 )), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[( m - 1)/2]
Time = 2.17 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.87
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin \left (f x +e \right )^{4}}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin \left (f x +e \right )^{4}}{3 \cos \left (f x +e \right )}-\frac {\left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}\right )+\frac {2 a b}{\cos \left (f x +e \right )}+a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}\) | \(97\) |
default | \(\frac {b^{2} \left (\frac {\sin \left (f x +e \right )^{4}}{3 \cos \left (f x +e \right )^{3}}-\frac {\sin \left (f x +e \right )^{4}}{3 \cos \left (f x +e \right )}-\frac {\left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}\right )+\frac {2 a b}{\cos \left (f x +e \right )}+a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}\) | \(97\) |
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 )}+2 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 {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f}\) | \(134\) |
Input:
int(csc(f*x+e)*(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
Output:
1/f*(b^2*(1/3*sin(f*x+e)^4/cos(f*x+e)^3-1/3*sin(f*x+e)^4/cos(f*x+e)-1/3*(2 +sin(f*x+e)^2)*cos(f*x+e))+2*a*b/cos(f*x+e)+a^2*ln(csc(f*x+e)-cot(f*x+e)))
Time = 0.10 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.67 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {3 \, a^{2} \cos \left (f x + e\right )^{3} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 3 \, a^{2} \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*tan(f*x+e)^2)^2,x, algorithm="fricas")
Output:
-1/6*(3*a^2*cos(f*x + e)^3*log(1/2*cos(f*x + e) + 1/2) - 3*a^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 \tan ^2(e+f x)\right )^2 \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc {\left (e + f x \right )}\, dx \] Input:
integrate(csc(f*x+e)*(a+b*tan(f*x+e)**2)**2,x)
Output:
Integral((a + b*tan(e + f*x)**2)**2*csc(e + f*x), x)
Time = 0.03 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.31 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=-\frac {3 \, a^{2} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, a^{2} \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*tan(f*x+e)^2)^2,x, algorithm="maxima")
Output:
-1/6*(3*a^2*log(cos(f*x + e) + 1) - 3*a^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
Leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (50) = 100\).
Time = 0.66 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.67 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {3 \, a^{2} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) + \frac {8 \, {\left (3 \, a b - b^{2} + \frac {6 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {3 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}{{\left (\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{3}}}{6 \, f} \] Input:
integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
Output:
1/6*(3*a^2*log(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) + 8*(3*a*b - b^2 + 6*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 3*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 3*a*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/( (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)^3)/f
Time = 8.88 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.65 \[ \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {4\,a\,b-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (8\,a\,b-4\,b^2\right )-\frac {4\,b^2}{3}+4\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}^3} \] Input:
int((a + b*tan(e + f*x)^2)^2/sin(e + f*x),x)
Output:
(a^2*log(tan(e/2 + (f*x)/2)))/f - (4*a*b - tan(e/2 + (f*x)/2)^2*(8*a*b - 4 *b^2) - (4*b^2)/3 + 4*a*b*tan(e/2 + (f*x)/2)^4)/(f*(tan(e/2 + (f*x)/2)^2 - 1)^3)
Time = 0.14 (sec) , antiderivative size = 168, normalized size of antiderivative = 3.23 \[ \int \csc (e+f x) \left (a+b \tan ^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}-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 ) \sin \left (f x +e \right )^{2} a b +2 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b^{2}+6 \cos \left (f x +e \right ) a b -2 \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 +2 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*tan(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 - 3*cos(e + f*x )*log(tan((e + f*x)/2))*a**2 - 6*cos(e + f*x)*sin(e + f*x)**2*a*b + 2*cos( e + f*x)*sin(e + f*x)**2*b**2 + 6*cos(e + f*x)*a*b - 2*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 + 2*b**2)/(3*cos(e + f*x)*f*(sin(e + f*x)**2 - 1))