Integrand size = 21, antiderivative size = 55 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b) f}-\frac {\text {arctanh}(\cos (e+f x))}{(a+b) f} \] Output:
b^(1/2)*arctan(a^(1/2)*cos(f*x+e)/b^(1/2))/a^(1/2)/(a+b)/f-arctanh(cos(f*x +e))/(a+b)/f
Result contains complex when optimal does not.
Time = 1.01 (sec) , antiderivative size = 239, normalized size of antiderivative = 4.35 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {\sqrt {b} \arctan \left (\frac {\left (-\sqrt {a}-i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}-\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}+\frac {\sqrt {b} \arctan \left (\frac {\left (-\sqrt {a}+i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}+\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right )}{\sqrt {a}}-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{(a+b) f} \] Input:
Integrate[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]
Output:
((Sqrt[b]*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*S in[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e] )^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[a] + (Sqrt[b]*ArcTan[((-Sqrt[a] + I*Sqr t[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a ] + Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]])/Sqrt[ a] - Log[Cos[(e + f*x)/2]] + Log[Sin[(e + f*x)/2]])/((a + b)*f)
Time = 0.24 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.98, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4621, 383, 218, 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 \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sin (e+f x) \left (a+b \sec (e+f x)^2\right )}dx\) |
\(\Big \downarrow \) 4621 |
\(\displaystyle -\frac {\int \frac {\cos ^2(e+f x)}{\left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )}d\cos (e+f x)}{f}\) |
\(\Big \downarrow \) 383 |
\(\displaystyle -\frac {\frac {\int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}-\frac {b \int \frac {1}{a \cos ^2(e+f x)+b}d\cos (e+f x)}{a+b}}{f}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle -\frac {\frac {\int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}}{f}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle -\frac {\frac {\text {arctanh}(\cos (e+f x))}{a+b}-\frac {\sqrt {b} \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}}{f}\) |
Input:
Int[Csc[e + f*x]/(a + b*Sec[e + f*x]^2),x]
Output:
-((-((Sqrt[b]*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[a]*(a + b))) + ArcTanh[Cos[e + f*x]]/(a + b))/f)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
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[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Sym bol] :> Simp[(-a)*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(a + b*x^2), x], x] + Simp[c*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(c + d*x^2), x], x] /; Free Q[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3]
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.42 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.29
method | result | size |
derivativedivides | \(\frac {-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}+\frac {b \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) | \(71\) |
default | \(\frac {-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 a +2 b}+\frac {b \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 a +2 b}}{f}\) | \(71\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f \left (a +b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f \left (a +b \right )}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a \left (a +b \right ) f}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{2 a \left (a +b \right ) f}\) | \(147\) |
Input:
int(csc(f*x+e)/(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)
Output:
1/f*(-1/(2*a+2*b)*ln(1+cos(f*x+e))+1/(a+b)*b/(a*b)^(1/2)*arctan(a*cos(f*x+ e)/(a*b)^(1/2))+1/(2*a+2*b)*ln(-1+cos(f*x+e)))
Time = 0.10 (sec) , antiderivative size = 156, normalized size of antiderivative = 2.84 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\left [\frac {\sqrt {-\frac {b}{a}} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt {-\frac {b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}, \frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\frac {a \sqrt {\frac {b}{a}} \cos \left (f x + e\right )}{b}\right ) - \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )} f}\right ] \] Input:
integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")
Output:
[1/2*(sqrt(-b/a)*log(-(a*cos(f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b) /(a*cos(f*x + e)^2 + b)) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b)*f), 1/2*(2*sqrt(b/a)*arctan(a*sqrt(b/a)*cos(f*x + e) /b) - log(1/2*cos(f*x + e) + 1/2) + log(-1/2*cos(f*x + e) + 1/2))/((a + b) *f)]
\[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\int \frac {\csc {\left (e + f x \right )}}{a + b \sec ^{2}{\left (e + f x \right )}}\, dx \] Input:
integrate(csc(f*x+e)/(a+b*sec(f*x+e)**2),x)
Output:
Integral(csc(e + f*x)/(a + b*sec(e + f*x)**2), x)
Time = 0.11 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.16 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {\frac {2 \, b \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (f x + e\right ) + 1\right )}{a + b} + \frac {\log \left (\cos \left (f x + e\right ) - 1\right )}{a + b}}{2 \, f} \] Input:
integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")
Output:
1/2*(2*b*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - log(cos(f* x + e) + 1)/(a + b) + log(cos(f*x + e) - 1)/(a + b))/f
Time = 0.17 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.33 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {b \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a f + b f\right )}} - \frac {\log \left ({\left | \cos \left (f x + e\right ) + 1 \right |}\right )}{2 \, {\left (a f + b f\right )}} + \frac {\log \left ({\left | \cos \left (f x + e\right ) - 1 \right |}\right )}{2 \, {\left (a f + b f\right )}} \] Input:
integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")
Output:
b*arctan(a*cos(f*x + e)/sqrt(a*b))/(sqrt(a*b)*(a*f + b*f)) - 1/2*log(abs(c os(f*x + e) + 1))/(a*f + b*f) + 1/2*log(abs(cos(f*x + e) - 1))/(a*f + b*f)
Time = 0.20 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.24 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=-\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\left (2\,a^3+2\,a\,b^2\right )-\frac {\cos \left (e+f\,x\right )\,\left (8\,a^5+8\,a^4\,b-8\,a^3\,b^2-8\,a^2\,b^3\right )}{4\,{\left (a+b\right )}^2}}{2\,a\,b\,\left (a+b\right )}\right )}{f\,\left (a+b\right )}-\frac {\mathrm {atanh}\left (\frac {\cos \left (e+f\,x\right )\,\sqrt {-a\,b}}{b}\right )\,\sqrt {-a\,b}}{f\,\left (a^2+b\,a\right )} \] Input:
int(1/(sin(e + f*x)*(a + b/cos(e + f*x)^2)),x)
Output:
- atanh((cos(e + f*x)*(2*a*b^2 + 2*a^3) - (cos(e + f*x)*(8*a^4*b + 8*a^5 - 8*a^2*b^3 - 8*a^3*b^2))/(4*(a + b)^2))/(2*a*b*(a + b)))/(f*(a + b)) - (at anh((cos(e + f*x)*(-a*b)^(1/2))/b)*(-a*b)^(1/2))/(f*(a*b + a^2))
Time = 0.16 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.53 \[ \int \frac {\csc (e+f x)}{a+b \sec ^2(e+f x)} \, dx=\frac {-\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\sqrt {a +b}\, \tan \left (\frac {f x}{2}+\frac {e}{2}\right )-\sqrt {a}}{\sqrt {b}}\right )+\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\sqrt {a +b}\, \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+\sqrt {a}}{\sqrt {b}}\right )+\mathrm {log}\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a}{a f \left (a +b \right )} \] Input:
int(csc(f*x+e)/(a+b*sec(f*x+e)^2),x)
Output:
( - sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b)) + sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b)) + log(tan((e + f*x)/2))*a)/(a*f*(a + b))