Integrand size = 21, antiderivative size = 53 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {b (b c-a d) \cot (x)}{d^2}-\frac {(a+b \cot (x))^2}{2 d}-\frac {(b c-a d)^2 \log (c+d \cot (x))}{d^3} \] Output:
b*(-a*d+b*c)*cot(x)/d^2-1/2*(a+b*cot(x))^2/d-(-a*d+b*c)^2*ln(c+d*cot(x))/d ^3
Time = 1.78 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.17 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {2 b d (b c-2 a d) \cot (x)-b^2 d^2 \csc ^2(x)+2 (b c-a d)^2 (\log (\sin (x))-\log (d \cos (x)+c \sin (x)))}{2 d^3} \] Input:
Integrate[((a + b*Cot[x])^2*Csc[x]^2)/(c + d*Cot[x]),x]
Output:
(2*b*d*(b*c - 2*a*d)*Cot[x] - b^2*d^2*Csc[x]^2 + 2*(b*c - a*d)^2*(Log[Sin[ x]] - Log[d*Cos[x] + c*Sin[x]]))/(2*d^3)
Time = 0.32 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 4844, 49, 2009}
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 ^2(x) (a+b \cot (x))^2}{c+d \cot (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc (x)^2 (a+b \cot (x))^2}{c+d \cot (x)}dx\) |
\(\Big \downarrow \) 4844 |
\(\displaystyle -\int \frac {(a+b \cot (x))^2}{c+d \cot (x)}d\cot (x)\) |
\(\Big \downarrow \) 49 |
\(\displaystyle -\int \left (\frac {(a d-b c)^2}{d^2 (c+d \cot (x))}-\frac {b (b c-a d)}{d^2}+\frac {b (a+b \cot (x))}{d}\right )d\cot (x)\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {(b c-a d)^2 \log (c+d \cot (x))}{d^3}+\frac {b \cot (x) (b c-a d)}{d^2}-\frac {(a+b \cot (x))^2}{2 d}\) |
Input:
Int[((a + b*Cot[x])^2*Csc[x]^2)/(c + d*Cot[x]),x]
Output:
(b*(b*c - a*d)*Cot[x])/d^2 - (a + b*Cot[x])^2/(2*d) - ((b*c - a*d)^2*Log[c + d*Cot[x]])/d^3
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}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFac tors[Cot[c*(a + b*x)], x]}, Simp[-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])
Time = 0.48 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.17
method | result | size |
derivativedivides | \(-\frac {b \left (\frac {\cot \left (x \right )^{2} b d}{2}+2 \cot \left (x \right ) a d -\cot \left (x \right ) b c \right )}{d^{2}}-\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (c +d \cot \left (x \right )\right )}{d^{3}}\) | \(62\) |
default | \(-\frac {b \left (\frac {\cot \left (x \right )^{2} b d}{2}+2 \cot \left (x \right ) a d -\cot \left (x \right ) b c \right )}{d^{2}}-\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \ln \left (c +d \cot \left (x \right )\right )}{d^{3}}\) | \(62\) |
risch | \(\frac {2 i b \left (-2 a d \,{\mathrm e}^{2 i x}+b c \,{\mathrm e}^{2 i x}-i b d \,{\mathrm e}^{2 i x}+2 a d -b c \right )}{\left ({\mathrm e}^{2 i x}-1\right )^{2} d^{2}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) a^{2}}{d}-\frac {2 \ln \left ({\mathrm e}^{2 i x}-1\right ) a b c}{d^{2}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) b^{2} c^{2}}{d^{3}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) a^{2}}{d}+\frac {2 \ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) a b c}{d^{2}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i d -c}{i d +c}\right ) b^{2} c^{2}}{d^{3}}\) | \(202\) |
Input:
int((a+b*cot(x))^2*csc(x)^2/(c+d*cot(x)),x,method=_RETURNVERBOSE)
Output:
-b/d^2*(1/2*cot(x)^2*b*d+2*cot(x)*a*d-cot(x)*b*c)-(a^2*d^2-2*a*b*c*d+b^2*c ^2)/d^3*ln(c+d*cot(x))
Leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (51) = 102\).
Time = 0.10 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.43 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {b^{2} d^{2} - 2 \, {\left (b^{2} c d - 2 \, a b d^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2} - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \cos \left (x\right )^{2}\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 ) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2} - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \cos \left (x\right )^{2}\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right )}{2 \, {\left (d^{3} \cos \left (x\right )^{2} - d^{3}\right )}} \] Input:
integrate((a+b*cot(x))^2*csc(x)^2/(c+d*cot(x)),x, algorithm="fricas")
Output:
1/2*(b^2*d^2 - 2*(b^2*c*d - 2*a*b*d^2)*cos(x)*sin(x) + (b^2*c^2 - 2*a*b*c* d + a^2*d^2 - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*cos(x)^2)*log(2*c*d*cos(x)*s in(x) - (c^2 - d^2)*cos(x)^2 + c^2) - (b^2*c^2 - 2*a*b*c*d + a^2*d^2 - (b^ 2*c^2 - 2*a*b*c*d + a^2*d^2)*cos(x)^2)*log(-1/4*cos(x)^2 + 1/4))/(d^3*cos( x)^2 - d^3)
Time = 6.23 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.09 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=- \frac {b^{2} \cot ^{2}{\left (x \right )}}{2 d} - \frac {\left (a d - b c\right )^{2} \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^{2}} - \frac {\left (2 a b d - b^{2} c\right ) \cot {\left (x \right )}}{d^{2}} \] Input:
integrate((a+b*cot(x))**2*csc(x)**2/(c+d*cot(x)),x)
Output:
-b**2*cot(x)**2/(2*d) - (a*d - b*c)**2*Piecewise((cot(x)/c, Eq(d, 0)), (lo g(c + d*cot(x))/d, True))/d**2 - (2*a*b*d - b**2*c)*cot(x)/d**2
Time = 0.04 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.74 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (c \tan \left (x\right ) + d\right )}{d^{3}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\tan \left (x\right )\right )}{d^{3}} - \frac {b^{2} d - 2 \, {\left (b^{2} c - 2 \, a b d\right )} \tan \left (x\right )}{2 \, d^{2} \tan \left (x\right )^{2}} \] Input:
integrate((a+b*cot(x))^2*csc(x)^2/(c+d*cot(x)),x, algorithm="maxima")
Output:
-(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(c*tan(x) + d)/d^3 + (b^2*c^2 - 2*a*b* c*d + a^2*d^2)*log(tan(x))/d^3 - 1/2*(b^2*d - 2*(b^2*c - 2*a*b*d)*tan(x))/ (d^2*tan(x)^2)
Leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (51) = 102\).
Time = 0.19 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.62 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right )}{d^{3}} - \frac {{\left (b^{2} c^{3} - 2 \, a b c^{2} d + a^{2} c d^{2}\right )} \log \left ({\left | c \tan \left (x\right ) + d \right |}\right )}{c d^{3}} - \frac {3 \, b^{2} c^{2} \tan \left (x\right )^{2} - 6 \, a b c d \tan \left (x\right )^{2} + 3 \, a^{2} d^{2} \tan \left (x\right )^{2} - 2 \, b^{2} c d \tan \left (x\right ) + 4 \, a b d^{2} \tan \left (x\right ) + b^{2} d^{2}}{2 \, d^{3} \tan \left (x\right )^{2}} \] Input:
integrate((a+b*cot(x))^2*csc(x)^2/(c+d*cot(x)),x, algorithm="giac")
Output:
(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(abs(tan(x)))/d^3 - (b^2*c^3 - 2*a*b*c^ 2*d + a^2*c*d^2)*log(abs(c*tan(x) + d))/(c*d^3) - 1/2*(3*b^2*c^2*tan(x)^2 - 6*a*b*c*d*tan(x)^2 + 3*a^2*d^2*tan(x)^2 - 2*b^2*c*d*tan(x) + 4*a*b*d^2*t an(x) + b^2*d^2)/(d^3*tan(x)^2)
Time = 15.96 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.74 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=-\frac {\frac {b^2}{2\,d}+\frac {b\,\mathrm {tan}\left (x\right )\,\left (2\,a\,d-b\,c\right )}{d^2}}{{\mathrm {tan}\left (x\right )}^2}-\frac {2\,\mathrm {atanh}\left (\frac {\left (d+2\,c\,\mathrm {tan}\left (x\right )\right )\,{\left (a\,d-b\,c\right )}^2}{d\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}\right )\,{\left (a\,d-b\,c\right )}^2}{d^3} \] Input:
int((a + b*cot(x))^2/(sin(x)^2*(c + d*cot(x))),x)
Output:
- (b^2/(2*d) + (b*tan(x)*(2*a*d - b*c))/d^2)/tan(x)^2 - (2*atanh(((d + 2*c *tan(x))*(a*d - b*c)^2)/(d*(a^2*d^2 + b^2*c^2 - 2*a*b*c*d)))*(a*d - b*c)^2 )/d^3
Time = 0.16 (sec) , antiderivative size = 194, normalized size of antiderivative = 3.66 \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=\frac {-8 \cos \left (x \right ) \sin \left (x \right ) a b \,d^{2}+4 \cos \left (x \right ) \sin \left (x \right ) b^{2} c d -4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{2} a^{2} d^{2}+8 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{2} a b c d -4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} d -2 \tan \left (\frac {x}{2}\right ) c -d \right ) \sin \left (x \right )^{2} b^{2} c^{2}+4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{2} a^{2} d^{2}-8 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{2} a b c d +4 \,\mathrm {log}\left (\tan \left (\frac {x}{2}\right )\right ) \sin \left (x \right )^{2} b^{2} c^{2}+\sin \left (x \right )^{2} b^{2} d^{2}-2 b^{2} d^{2}}{4 \sin \left (x \right )^{2} d^{3}} \] Input:
int((a+b*cot(x))^2*csc(x)^2/(c+d*cot(x)),x)
Output:
( - 8*cos(x)*sin(x)*a*b*d**2 + 4*cos(x)*sin(x)*b**2*c*d - 4*log(tan(x/2)** 2*d - 2*tan(x/2)*c - d)*sin(x)**2*a**2*d**2 + 8*log(tan(x/2)**2*d - 2*tan( x/2)*c - d)*sin(x)**2*a*b*c*d - 4*log(tan(x/2)**2*d - 2*tan(x/2)*c - d)*si n(x)**2*b**2*c**2 + 4*log(tan(x/2))*sin(x)**2*a**2*d**2 - 8*log(tan(x/2))* sin(x)**2*a*b*c*d + 4*log(tan(x/2))*sin(x)**2*b**2*c**2 + sin(x)**2*b**2*d **2 - 2*b**2*d**2)/(4*sin(x)**2*d**3)