3.288 \(\int \frac {1}{a \cot (x)+b \csc (x)} \, dx\)

Optimal. Leaf size=12 \[ -\frac {\log (a \cos (x)+b)}{a} \]

[Out]

-ln(b+a*cos(x))/a

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3160, 2668, 31} \[ -\frac {\log (a \cos (x)+b)}{a} \]

Antiderivative was successfully verified.

[In]

Int[(a*Cot[x] + b*Csc[x])^(-1),x]

[Out]

-(Log[b + a*Cos[x]]/a)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 3160

Int[((a_.) + csc[(d_.) + (e_.)*(x_)]*(b_.) + cot[(d_.) + (e_.)*(x_)]*(c_.))^(-1), x_Symbol] :> Int[Sin[d + e*x
]/(b + a*Sin[d + e*x] + c*Cos[d + e*x]), x] /; FreeQ[{a, b, c, d, e}, x]

Rubi steps

\begin {align*} \int \frac {1}{a \cot (x)+b \csc (x)} \, dx &=\int \frac {\sin (x)}{b+a \cos (x)} \, dx\\ &=-\frac {\operatorname {Subst}\left (\int \frac {1}{b+x} \, dx,x,a \cos (x)\right )}{a}\\ &=-\frac {\log (b+a \cos (x))}{a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 12, normalized size = 1.00 \[ -\frac {\log (a \cos (x)+b)}{a} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Cot[x] + b*Csc[x])^(-1),x]

[Out]

-(Log[b + a*Cos[x]]/a)

________________________________________________________________________________________

fricas [A]  time = 1.20, size = 12, normalized size = 1.00 \[ -\frac {\log \left (a \cos \relax (x) + b\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*cot(x)+b*csc(x)),x, algorithm="fricas")

[Out]

-log(a*cos(x) + b)/a

________________________________________________________________________________________

giac [A]  time = 0.12, size = 13, normalized size = 1.08 \[ -\frac {\log \left ({\left | a \cos \relax (x) + b \right |}\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*cot(x)+b*csc(x)),x, algorithm="giac")

[Out]

-log(abs(a*cos(x) + b))/a

________________________________________________________________________________________

maple [A]  time = 0.11, size = 13, normalized size = 1.08 \[ -\frac {\ln \left (b +a \cos \relax (x )\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a*cot(x)+b*csc(x)),x)

[Out]

-ln(b+a*cos(x))/a

________________________________________________________________________________________

maxima [B]  time = 0.40, size = 45, normalized size = 3.75 \[ -\frac {\log \left (a + b - \frac {{\left (a - b\right )} \sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}}\right )}{a} + \frac {\log \left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1\right )}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*cot(x)+b*csc(x)),x, algorithm="maxima")

[Out]

-log(a + b - (a - b)*sin(x)^2/(cos(x) + 1)^2)/a + log(sin(x)^2/(cos(x) + 1)^2 + 1)/a

________________________________________________________________________________________

mupad [B]  time = 3.28, size = 36, normalized size = 3.00 \[ \frac {\mathrm {atan}\left (\frac {a\,{\sin \left (\frac {x}{2}\right )}^2}{-1{}\mathrm {i}\,a\,{\sin \left (\frac {x}{2}\right )}^2+a\,1{}\mathrm {i}+b\,1{}\mathrm {i}}\right )\,2{}\mathrm {i}}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(b/sin(x) + a*cot(x)),x)

[Out]

(atan((a*sin(x/2)^2)/(a*1i + b*1i - a*sin(x/2)^2*1i))*2i)/a

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{a \cot {\relax (x )} + b \csc {\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a*cot(x)+b*csc(x)),x)

[Out]

Integral(1/(a*cot(x) + b*csc(x)), x)

________________________________________________________________________________________