3.720 \(\int \frac{(a+b \cot (x)) \csc ^2(x)}{c+d \cot (x)} \, dx\)

Optimal. Leaf size=28 \[ \frac{(b c-a d) \log (c+d \cot (x))}{d^2}-\frac{b \cot (x)}{d} \]

[Out]

-((b*Cot[x])/d) + ((b*c - a*d)*Log[c + d*Cot[x]])/d^2

________________________________________________________________________________________

Rubi [A]  time = 0.0818833, antiderivative size = 28, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {4344, 43} \[ \frac{(b c-a d) \log (c+d \cot (x))}{d^2}-\frac{b \cot (x)}{d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-((b*Cot[x])/d) + ((b*c - a*d)*Log[c + d*Cot[x]])/d^2

Rule 4344

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFactors[Cot[c*(a + b*x)], x]}, -Dist[d
/(b*c), Subst[Int[SubstFor[1, Cot[c*(a + b*x)]/d, u, x], x], x, Cot[c*(a + b*x)]/d], x] /; FunctionOfQ[Cot[c*(
a + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Csc] || EqQ[F, csc])

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{(a+b \cot (x)) \csc ^2(x)}{c+d \cot (x)} \, dx &=-\operatorname{Subst}\left (\int \frac{a+b x}{c+d x} \, dx,x,\cot (x)\right )\\ &=-\operatorname{Subst}\left (\int \left (\frac{b}{d}+\frac{-b c+a d}{d (c+d x)}\right ) \, dx,x,\cot (x)\right )\\ &=-\frac{b \cot (x)}{d}+\frac{(b c-a d) \log (c+d \cot (x))}{d^2}\\ \end{align*}

Mathematica [A]  time = 0.329919, size = 56, normalized size = 2. \[ \frac{\sin (x) (a+b \cot (x)) (-(b c-a d) (\log (\sin (x))-\log (c \sin (x)+d \cos (x)))-b d \cot (x))}{d^2 (a \sin (x)+b \cos (x))} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((a + b*Cot[x])*(-(b*d*Cot[x]) - (b*c - a*d)*(Log[Sin[x]] - Log[d*Cos[x] + c*Sin[x]]))*Sin[x])/(d^2*(b*Cos[x]
+ a*Sin[x]))

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 56, normalized size = 2. \begin{align*} -{\frac{b}{d\tan \left ( x \right ) }}+{\frac{\ln \left ( \tan \left ( x \right ) \right ) a}{d}}-{\frac{\ln \left ( \tan \left ( x \right ) \right ) cb}{{d}^{2}}}-{\frac{\ln \left ( c\tan \left ( x \right ) +d \right ) a}{d}}+{\frac{\ln \left ( c\tan \left ( x \right ) +d \right ) cb}{{d}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cot(x))*csc(x)^2/(c+d*cot(x)),x)

[Out]

-b/d/tan(x)+1/d*ln(tan(x))*a-1/d^2*ln(tan(x))*c*b-1/d*ln(c*tan(x)+d)*a+1/d^2*ln(c*tan(x)+d)*c*b

________________________________________________________________________________________

Maxima [A]  time = 0.979703, size = 62, normalized size = 2.21 \begin{align*} \frac{{\left (b c - a d\right )} \log \left (c \tan \left (x\right ) + d\right )}{d^{2}} - \frac{{\left (b c - a d\right )} \log \left (\tan \left (x\right )\right )}{d^{2}} - \frac{b}{d \tan \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(b*c - a*d)*log(c*tan(x) + d)/d^2 - (b*c - a*d)*log(tan(x))/d^2 - b/(d*tan(x))

________________________________________________________________________________________

Fricas [B]  time = 2.95262, size = 209, normalized size = 7.46 \begin{align*} -\frac{2 \, b d \cos \left (x\right ) -{\left (b c - a d\right )} \log \left (2 \, c d \cos \left (x\right ) \sin \left (x\right ) -{\left (c^{2} - d^{2}\right )} \cos \left (x\right )^{2} + c^{2}\right ) \sin \left (x\right ) +{\left (b c - a d\right )} \log \left (-\frac{1}{4} \, \cos \left (x\right )^{2} + \frac{1}{4}\right ) \sin \left (x\right )}{2 \, d^{2} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 11.5975, size = 31, normalized size = 1.11 \begin{align*} - \frac{b \cot{\left (x \right )}}{d} - \frac{\left (a d - b c\right ) \left (\begin{cases} \frac{\cot{\left (x \right )}}{c} & \text{for}\: d = 0 \\\frac{\log{\left (c + d \cot{\left (x \right )} \right )}}{d} & \text{otherwise} \end{cases}\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-b*cot(x)/d - (a*d - b*c)*Piecewise((cot(x)/c, Eq(d, 0)), (log(c + d*cot(x))/d, True))/d

________________________________________________________________________________________

Giac [B]  time = 1.15447, size = 92, normalized size = 3.29 \begin{align*} -\frac{{\left (b c - a d\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right )}{d^{2}} + \frac{{\left (b c^{2} - a c d\right )} \log \left ({\left | c \tan \left (x\right ) + d \right |}\right )}{c d^{2}} + \frac{b c \tan \left (x\right ) - a d \tan \left (x\right ) - b d}{d^{2} \tan \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(b*c - a*d)*log(abs(tan(x)))/d^2 + (b*c^2 - a*c*d)*log(abs(c*tan(x) + d))/(c*d^2) + (b*c*tan(x) - a*d*tan(x)
- b*d)/(d^2*tan(x))