Integrand size = 21, antiderivative size = 51 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {(a+2 b) \text {arctanh}(\cos (e+f x))}{2 f}-\frac {a \cot (e+f x) \csc (e+f x)}{2 f}+\frac {b \sec (e+f x)}{f} \] Output:
-1/2*(a+2*b)*arctanh(cos(f*x+e))/f-1/2*a*cot(f*x+e)*csc(f*x+e)/f+b*sec(f*x +e)/f
Leaf count is larger than twice the leaf count of optimal. \(123\) vs. \(2(51)=102\).
Time = 0.18 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.41 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {a \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}-\frac {a \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}-\frac {b \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {a \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}+\frac {b \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{f}+\frac {a \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {b \sec (e+f x)}{f} \] Input:
Integrate[Csc[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]
Output:
-1/8*(a*Csc[(e + f*x)/2]^2)/f - (a*Log[Cos[(e + f*x)/2]])/(2*f) - (b*Log[C os[(e + f*x)/2]])/f + (a*Log[Sin[(e + f*x)/2]])/(2*f) + (b*Log[Sin[(e + f* x)/2]])/f + (a*Sec[(e + f*x)/2]^2)/(8*f) + (b*Sec[e + f*x])/f
Time = 0.38 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.14, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4147, 360, 299, 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 \tan ^2(e+f x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \tan (e+f x)^2}{\sin (e+f x)^3}dx\) |
\(\Big \downarrow \) 4147 |
\(\displaystyle \frac {\int \frac {\sec ^2(e+f x) \left (b \sec ^2(e+f x)+a-b\right )}{\left (1-\sec ^2(e+f x)\right )^2}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 360 |
\(\displaystyle \frac {\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}-\frac {1}{2} \int \frac {2 b \sec ^2(e+f x)+a}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\) |
\(\Big \downarrow \) 299 |
\(\displaystyle \frac {\frac {1}{2} \left (2 b \sec (e+f x)-(a+2 b) \int \frac {1}{1-\sec ^2(e+f x)}d\sec (e+f x)\right )+\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}}{f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {1}{2} (2 b \sec (e+f x)-(a+2 b) \text {arctanh}(\sec (e+f x)))+\frac {a \sec (e+f x)}{2 \left (1-\sec ^2(e+f x)\right )}}{f}\) |
Input:
Int[Csc[e + f*x]^3*(a + b*Tan[e + f*x]^2),x]
Output:
((-((a + 2*b)*ArcTanh[Sec[e + f*x]]) + 2*b*Sec[e + f*x])/2 + (a*Sec[e + f* x])/(2*(1 - Sec[e + f*x]^2)))/f
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])
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[d*x *((a + b*x^2)^(p + 1)/(b*(2*p + 3))), x] - Simp[(a*d - b*c*(2*p + 3))/(b*(2 *p + 3)) Int[(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && NeQ[2*p + 3, 0]
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[(a + b*x^2)^(p + 1)*Expan dToSum[2*b*(p + 1)*x^2*Together[(b^(m/2)*x^(m - 2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d))/(a + b*x^2)] - (-a)^(m/2 - 1)*(b*c - a*d), x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IGtQ[m/2, 0] & & (IntegerQ[p] || EqQ[m + 2*p + 1, 0])
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 = 68, normalized size of antiderivative = 1.33
method | result | size |
derivativedivides | \(\frac {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 )+a \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}\) | \(68\) |
default | \(\frac {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 )+a \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}\) | \(68\) |
risch | \(\frac {{\mathrm e}^{i \left (f x +e \right )} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a +2 b \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{2 f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b}{f}+\frac {a \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{2 f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b}{f}\) | \(176\) |
Input:
int(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x,method=_RETURNVERBOSE)
Output:
1/f*(b*(1/cos(f*x+e)+ln(csc(f*x+e)-cot(f*x+e)))+a*(-1/2*csc(f*x+e)*cot(f*x +e)+1/2*ln(csc(f*x+e)-cot(f*x+e))))
Leaf count of result is larger than twice the leaf count of optimal. 124 vs. \(2 (47) = 94\).
Time = 0.10 (sec) , antiderivative size = 124, normalized size of antiderivative = 2.43 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {2 \, {\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - {\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - {\left (a + 2 \, b\right )} \cos \left (f x + e\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 4 \, b}{4 \, {\left (f \cos \left (f x + e\right )^{3} - f \cos \left (f x + e\right )\right )}} \] Input:
integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="fricas")
Output:
1/4*(2*(a + 2*b)*cos(f*x + e)^2 - ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*co s(f*x + e))*log(1/2*cos(f*x + e) + 1/2) + ((a + 2*b)*cos(f*x + e)^3 - (a + 2*b)*cos(f*x + e))*log(-1/2*cos(f*x + e) + 1/2) - 4*b)/(f*cos(f*x + e)^3 - f*cos(f*x + e))
\[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{3}{\left (e + f x \right )}\, dx \] Input:
integrate(csc(f*x+e)**3*(a+b*tan(f*x+e)**2),x)
Output:
Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**3, x)
Time = 0.04 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.49 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=-\frac {{\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - {\left (a + 2 \, b\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - 2 \, b\right )}}{\cos \left (f x + e\right )^{3} - \cos \left (f x + e\right )}}{4 \, f} \] Input:
integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="maxima")
Output:
-1/4*((a + 2*b)*log(cos(f*x + e) + 1) - (a + 2*b)*log(cos(f*x + e) - 1) - 2*((a + 2*b)*cos(f*x + e)^2 - 2*b)/(cos(f*x + e)^3 - cos(f*x + e)))/f
Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (47) = 94\).
Time = 0.44 (sec) , antiderivative size = 171, normalized size of antiderivative = 3.35 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {2 \, {\left (a + 2 \, b\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) - \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a + \frac {14 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {2 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + \frac {{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}}{8 \, f} \] Input:
integrate(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x, algorithm="giac")
Output:
1/8*(2*(a + 2*b)*log(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) - a*(co s(f*x + e) - 1)/(cos(f*x + e) + 1) + (a + 14*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 2*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1) + ( cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2))/f
Time = 7.34 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.86 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{8\,f}-\frac {\frac {a}{2}-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a}{2}+8\,b\right )}{f\,\left (4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {a}{2}+b\right )}{f} \] Input:
int((a + b*tan(e + f*x)^2)/sin(e + f*x)^3,x)
Output:
(a*tan(e/2 + (f*x)/2)^2)/(8*f) - (a/2 - tan(e/2 + (f*x)/2)^2*(a/2 + 8*b))/ (f*(4*tan(e/2 + (f*x)/2)^2 - 4*tan(e/2 + (f*x)/2)^4)) + (log(tan(e/2 + (f* x)/2))*(a/2 + b))/f
Time = 0.15 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.65 \[ \int \csc ^3(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx=\frac {4 \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 +8 \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 -\cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a -8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b +4 \sin \left (f x +e \right )^{2} a +8 \sin \left (f x +e \right )^{2} b -4 a}{8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} f} \] Input:
int(csc(f*x+e)^3*(a+b*tan(f*x+e)^2),x)
Output:
(4*cos(e + f*x)*log(tan((e + f*x)/2))*sin(e + f*x)**2*a + 8*cos(e + f*x)*l og(tan((e + f*x)/2))*sin(e + f*x)**2*b - cos(e + f*x)*sin(e + f*x)**2*a - 8*cos(e + f*x)*sin(e + f*x)**2*b + 4*sin(e + f*x)**2*a + 8*sin(e + f*x)**2 *b - 4*a)/(8*cos(e + f*x)*sin(e + f*x)**2*f)