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+(-a*d+b*c)*ln(c+d*cot(x))/d^2

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 28, normalized size of antiderivative = 1.00, 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 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])

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])

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.38, size = 56, normalized size = 2.00 \[ \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]))

________________________________________________________________________________________

fricas [B]  time = 1.17, size = 76, normalized size = 2.71 \[ -\frac {2 \, b d \cos \relax (x) - {\left (b c - a d\right )} \log \left (2 \, c d \cos \relax (x) \sin \relax (x) - {\left (c^{2} - d^{2}\right )} \cos \relax (x)^{2} + c^{2}\right ) \sin \relax (x) + {\left (b c - a d\right )} \log \left (-\frac {1}{4} \, \cos \relax (x)^{2} + \frac {1}{4}\right ) \sin \relax (x)}{2 \, d^{2} \sin \relax (x)} \]

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))

________________________________________________________________________________________

giac [B]  time = 0.15, size = 68, normalized size = 2.43 \[ -\frac {{\left (b c - a d\right )} \log \left ({\left | \tan \relax (x) \right |}\right )}{d^{2}} + \frac {{\left (b c^{2} - a c d\right )} \log \left ({\left | c \tan \relax (x) + d \right |}\right )}{c d^{2}} + \frac {b c \tan \relax (x) - a d \tan \relax (x) - b d}{d^{2} \tan \relax (x)} \]

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))

________________________________________________________________________________________

maple [A]  time = 0.10, size = 56, normalized size = 2.00 \[ -\frac {b}{d \tan \relax (x )}+\frac {\ln \left (\tan \relax (x )\right ) a}{d}-\frac {\ln \left (\tan \relax (x )\right ) c b}{d^{2}}-\frac {\ln \left (c \tan \relax (x )+d \right ) a}{d}+\frac {\ln \left (c \tan \relax (x )+d \right ) c b}{d^{2}} \]

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.32, size = 46, normalized size = 1.64 \[ \frac {{\left (b c - a d\right )} \log \left (c \tan \relax (x) + d\right )}{d^{2}} - \frac {{\left (b c - a d\right )} \log \left (\tan \relax (x)\right )}{d^{2}} - \frac {b}{d \tan \relax (x)} \]

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))

________________________________________________________________________________________

mupad [B]  time = 3.07, size = 35, normalized size = 1.25 \[ -\frac {b}{d\,\mathrm {tan}\relax (x)}-\frac {2\,\mathrm {atanh}\left (\frac {2\,c\,\mathrm {tan}\relax (x)}{d}+1\right )\,\left (a\,d-b\,c\right )}{d^2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

________________________________________________________________________________________