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} \]
[Out]
Time = 0.14 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4429, 45} \[ \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx=-\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} \]
[In]
[Out]
Rule 45
Rule 4429
Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {(a+b x)^2}{c+d x} \, dx,x,\cot (x)\right ) \\ & = -\text {Subst}\left (\int \left (-\frac {b (b c-a d)}{d^2}+\frac {b (a+b x)}{d}+\frac {(-b c+a d)^2}{d^2 (c+d x)}\right ) \, dx,x,\cot (x)\right ) \\ & = \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} \\ \end{align*}
Time = 2.17 (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} \]
[In]
[Out]
Time = 0.76 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.17
method | result | size |
derivativedivides | \(-\frac {b \left (\frac {b \cot \left (x \right )^{2} d}{2}+2 \cot \left (x \right ) a d -\cot \left (x \right ) c b \right )}{d^{2}}-\frac {\left (d^{2} a^{2}-2 c d a b +b^{2} c^{2}\right ) \ln \left (c +d \cot \left (x \right )\right )}{d^{3}}\) | \(62\) |
default | \(-\frac {b \left (\frac {b \cot \left (x \right )^{2} d}{2}+2 \cot \left (x \right ) a d -\cot \left (x \right ) c b \right )}{d^{2}}-\frac {\left (d^{2} a^{2}-2 c d a b +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 -c b \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 ) c a b}{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 ) c a b}{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\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (51) = 102\).
Time = 0.28 (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 )}} \]
[In]
[Out]
Time = 36.28 (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}} \]
[In]
[Out]
none
Time = 0.21 (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}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (51) = 102\).
Time = 0.31 (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}} \]
[In]
[Out]
Time = 27.29 (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} \]
[In]
[Out]