\(\int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx\) [716]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 12 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {\log (a+b \cot (x))}{b} \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3587, 31} \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {\log (a+b \cot (x))}{b} \]

[In]

Int[Csc[x]^2/(a + b*Cot[x]),x]

[Out]

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

Rule 31

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

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \cot (x)\right )}{b} \\ & = -\frac {\log (a+b \cot (x))}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.67 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=\frac {\log (\sin (x))-\log (b \cos (x)+a \sin (x))}{b} \]

[In]

Integrate[Csc[x]^2/(a + b*Cot[x]),x]

[Out]

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

Maple [A] (verified)

Time = 0.53 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.08

method result size
derivativedivides \(-\frac {\ln \left (a +b \cot \left (x \right )\right )}{b}\) \(13\)
default \(-\frac {\ln \left (a +b \cot \left (x \right )\right )}{b}\) \(13\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{b}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{b}\) \(43\)

[In]

int(csc(x)^2/(a+b*cot(x)),x,method=_RETURNVERBOSE)

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (12) = 24\).

Time = 0.26 (sec) , antiderivative size = 45, normalized size of antiderivative = 3.75 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {\log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right ) - \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right )}{2 \, b} \]

[In]

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

[Out]

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

Sympy [F]

\[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=\int \frac {\csc ^{2}{\left (x \right )}}{a + b \cot {\left (x \right )}}\, dx \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {\log \left (b \cot \left (x\right ) + a\right )}{b} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.83 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {\log \left ({\left | a \tan \left (x\right ) + b \right |}\right )}{b} + \frac {\log \left ({\left | \tan \left (x\right ) \right |}\right )}{b} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 26.57 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.33 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {2\,a\,\mathrm {tan}\left (x\right )}{b}+1\right )}{b} \]

[In]

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

[Out]

-(2*atanh((2*a*tan(x))/b + 1))/b