Optimal. Leaf size=53 \[ -\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} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4344, 43} \[ \frac {b \cot (x) (b c-a d)}{d^2}-\frac {(b c-a d)^2 \log (c+d \cot (x))}{d^3}-\frac {(a+b \cot (x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 43
Rule 4344
Rubi steps
\begin {align*} \int \frac {(a+b \cot (x))^2 \csc ^2(x)}{c+d \cot (x)} \, dx &=-\operatorname {Subst}\left (\int \frac {(a+b x)^2}{c+d x} \, dx,x,\cot (x)\right )\\ &=-\operatorname {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*}
________________________________________________________________________________________
Mathematica [A] time = 0.56, size = 62, normalized size = 1.17 \[ \frac {2 b d \cot (x) (b c-2 a d)+2 (b c-a d)^2 (\log (\sin (x))-\log (c \sin (x)+d \cos (x)))-b^2 d^2 \csc ^2(x)}{2 d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.47, size = 182, normalized size = 3.43 \[ \frac {b^{2} d^{2} - 2 \, {\left (b^{2} c d - 2 \, a b d^{2}\right )} \cos \relax (x) \sin \relax (x) + {\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 \relax (x)^{2}\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 ) - {\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 \relax (x)^{2}\right )} \log \left (-\frac {1}{4} \, \cos \relax (x)^{2} + \frac {1}{4}\right )}{2 \, {\left (d^{3} \cos \relax (x)^{2} - d^{3}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.16, size = 139, normalized size = 2.62 \[ \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left ({\left | \tan \relax (x) \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 \relax (x) + d \right |}\right )}{c d^{3}} - \frac {3 \, b^{2} c^{2} \tan \relax (x)^{2} - 6 \, a b c d \tan \relax (x)^{2} + 3 \, a^{2} d^{2} \tan \relax (x)^{2} - 2 \, b^{2} c d \tan \relax (x) + 4 \, a b d^{2} \tan \relax (x) + b^{2} d^{2}}{2 \, d^{3} \tan \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.13, size = 119, normalized size = 2.25 \[ -\frac {b^{2}}{2 d \tan \relax (x )^{2}}+\frac {\ln \left (\tan \relax (x )\right ) a^{2}}{d}-\frac {2 \ln \left (\tan \relax (x )\right ) a b c}{d^{2}}+\frac {\ln \left (\tan \relax (x )\right ) b^{2} c^{2}}{d^{3}}-\frac {2 b a}{d \tan \relax (x )}+\frac {b^{2} c}{d^{2} \tan \relax (x )}-\frac {\ln \left (c \tan \relax (x )+d \right ) a^{2}}{d}+\frac {2 \ln \left (c \tan \relax (x )+d \right ) a b c}{d^{2}}-\frac {\ln \left (c \tan \relax (x )+d \right ) b^{2} c^{2}}{d^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 92, normalized size = 1.74 \[ -\frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (c \tan \relax (x) + d\right )}{d^{3}} + \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\tan \relax (x)\right )}{d^{3}} - \frac {b^{2} d - 2 \, {\left (b^{2} c - 2 \, a b d\right )} \tan \relax (x)}{2 \, d^{2} \tan \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.07, size = 92, normalized size = 1.74 \[ -\frac {\frac {b^2}{2\,d}+\frac {b\,\mathrm {tan}\relax (x)\,\left (2\,a\,d-b\,c\right )}{d^2}}{{\mathrm {tan}\relax (x)}^2}-\frac {2\,\mathrm {atanh}\left (\frac {\left (d+2\,c\,\mathrm {tan}\relax (x)\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} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 55.64, size = 58, normalized size = 1.09 \[ - \frac {b^{2} \cot ^{2}{\relax (x )}}{2 d} - \frac {\left (a d - b c\right )^{2} \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^{2}} - \frac {\left (2 a b d - b^{2} c\right ) \cot {\relax (x )}}{d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________