Integrand size = 17, antiderivative size = 120 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=-\frac {2 a c \text {arctanh}\left (\frac {a-(b-c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2+b^2-c^2}}+\frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tan \left (\frac {x}{2}\right )-(b-c) \tan ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2} \]
[Out]
Time = 0.59 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {4482, 12, 1642, 648, 632, 212, 642} \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=-\frac {2 a c \text {arctanh}\left (\frac {a-(b-c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2+b^2-c^2}}-\frac {b \log \left (2 a \tan \left (\frac {x}{2}\right )-\left ((b-c) \tan ^2\left (\frac {x}{2}\right )\right )+b+c\right )}{b^2-c^2}+\frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c} \]
[In]
[Out]
Rule 12
Rule 212
Rule 632
Rule 642
Rule 648
Rule 1642
Rule 4482
Rubi steps \begin{align*} \text {integral}& = \int \frac {\csc (x)}{c+b \cos (x)+a \sin (x)} \, dx \\ & = 2 \text {Subst}\left (\int \frac {1+x^2}{2 x \left (b+c+2 a x+(-b+c) x^2\right )} \, dx,x,\tan \left (\frac {x}{2}\right )\right ) \\ & = \text {Subst}\left (\int \frac {1+x^2}{x \left (b+c+2 a x+(-b+c) x^2\right )} \, dx,x,\tan \left (\frac {x}{2}\right )\right ) \\ & = \text {Subst}\left (\int \left (\frac {1}{(b+c) x}+\frac {2 (-a+b x)}{(b+c) \left (b+c+2 a x-(b-c) x^2\right )}\right ) \, dx,x,\tan \left (\frac {x}{2}\right )\right ) \\ & = \frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c}+\frac {2 \text {Subst}\left (\int \frac {-a+b x}{b+c+2 a x+(-b+c) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b+c} \\ & = \frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \text {Subst}\left (\int \frac {2 a+2 (-b+c) x}{b+c+2 a x+(-b+c) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^2-c^2}+\frac {(2 a c) \text {Subst}\left (\int \frac {1}{b+c+2 a x+(-b+c) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^2-c^2} \\ & = \frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tan \left (\frac {x}{2}\right )-(b-c) \tan ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2}-\frac {(4 a c) \text {Subst}\left (\int \frac {1}{4 \left (a^2+b^2-c^2\right )-x^2} \, dx,x,2 a+2 (-b+c) \tan \left (\frac {x}{2}\right )\right )}{b^2-c^2} \\ & = -\frac {2 a c \text {arctanh}\left (\frac {a-(b-c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2+b^2-c^2}}+\frac {\log \left (\tan \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tan \left (\frac {x}{2}\right )-(b-c) \tan ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2} \\ \end{align*}
Time = 0.98 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.87 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\frac {\frac {2 a c \text {arctanh}\left (\frac {a+(-b+c) \tan \left (\frac {x}{2}\right )}{\sqrt {a^2+b^2-c^2}}\right )}{\sqrt {a^2+b^2-c^2}}-(b+c) \log \left (\cos \left (\frac {x}{2}\right )\right )+(-b+c) \log \left (\sin \left (\frac {x}{2}\right )\right )+b \log (c+b \cos (x)+a \sin (x))}{(-b+c) (b+c)} \]
[In]
[Out]
Time = 1.05 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.02
method | result | size |
default | \(\frac {\frac {b \ln \left (-\tan \left (\frac {x}{2}\right )^{2} b +c \tan \left (\frac {x}{2}\right )^{2}+2 a \tan \left (\frac {x}{2}\right )+b +c \right )}{-b +c}+\frac {\left (-2 a -\frac {2 b a}{-b +c}\right ) \arctan \left (\frac {2 \left (-b +c \right ) \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}-b^{2}+c^{2}}}\right )}{\sqrt {-a^{2}-b^{2}+c^{2}}}}{b +c}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{b +c}\) | \(123\) |
risch | \(\text {Expression too large to display}\) | \(1342\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 260 vs. \(2 (110) = 220\).
Time = 1.67 (sec) , antiderivative size = 669, normalized size of antiderivative = 5.58 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\left [-\frac {\sqrt {a^{2} + b^{2} - c^{2}} a c \log \left (\frac {a^{4} + 3 \, a^{2} b^{2} + 2 \, b^{4} + {\left (a^{2} - b^{2}\right )} c^{2} + 2 \, {\left (a^{2} b + b^{3}\right )} c \cos \left (x\right ) + {\left (a^{4} - b^{4} - 2 \, {\left (a^{2} - b^{2}\right )} c^{2}\right )} \cos \left (x\right )^{2} + 2 \, {\left ({\left (a^{3} + a b^{2}\right )} c - {\left (a^{3} b + a b^{3} - 2 \, a b c^{2}\right )} \cos \left (x\right )\right )} \sin \left (x\right ) + 2 \, {\left (2 \, a b c \cos \left (x\right )^{2} - a b c + {\left (a^{3} + a b^{2}\right )} \cos \left (x\right ) - {\left (a^{2} b + b^{3} - {\left (a^{2} - b^{2}\right )} c \cos \left (x\right )\right )} \sin \left (x\right )\right )} \sqrt {a^{2} + b^{2} - c^{2}}}{2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )}\right ) + {\left (a^{2} b + b^{3} - b c^{2}\right )} \log \left (2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )\right ) - {\left (a^{2} b + b^{3} - b c^{2} - c^{3} + {\left (a^{2} + b^{2}\right )} c\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (a^{2} b + b^{3} - b c^{2} + c^{3} - {\left (a^{2} + b^{2}\right )} c\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b^{2} + b^{4} + c^{4} - {\left (a^{2} + 2 \, b^{2}\right )} c^{2}\right )}}, \frac {2 \, \sqrt {-a^{2} - b^{2} + c^{2}} a c \arctan \left (\frac {{\left (b c \cos \left (x\right ) + a c \sin \left (x\right ) + a^{2} + b^{2}\right )} \sqrt {-a^{2} - b^{2} + c^{2}}}{{\left (a^{3} + a b^{2} - a c^{2}\right )} \cos \left (x\right ) - {\left (a^{2} b + b^{3} - b c^{2}\right )} \sin \left (x\right )}\right ) - {\left (a^{2} b + b^{3} - b c^{2}\right )} \log \left (2 \, b c \cos \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + c^{2} + 2 \, {\left (a b \cos \left (x\right ) + a c\right )} \sin \left (x\right )\right ) + {\left (a^{2} b + b^{3} - b c^{2} - c^{3} + {\left (a^{2} + b^{2}\right )} c\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (a^{2} b + b^{3} - b c^{2} + c^{3} - {\left (a^{2} + b^{2}\right )} c\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{2} b^{2} + b^{4} + c^{4} - {\left (a^{2} + 2 \, b^{2}\right )} c^{2}\right )}}\right ] \]
[In]
[Out]
\[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\int \frac {\csc ^{2}{\left (x \right )}}{a + b \cot {\left (x \right )} + c \csc {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.18 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, b + 2 \, c\right ) + \arctan \left (-\frac {b \tan \left (\frac {1}{2} \, x\right ) - c \tan \left (\frac {1}{2} \, x\right ) - a}{\sqrt {-a^{2} - b^{2} + c^{2}}}\right )\right )} a c}{\sqrt {-a^{2} - b^{2} + c^{2}} {\left (b^{2} - c^{2}\right )}} - \frac {b \log \left (-b \tan \left (\frac {1}{2} \, x\right )^{2} + c \tan \left (\frac {1}{2} \, x\right )^{2} + 2 \, a \tan \left (\frac {1}{2} \, x\right ) + b + c\right )}{b^{2} - c^{2}} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{b + c} \]
[In]
[Out]
Time = 35.16 (sec) , antiderivative size = 531, normalized size of antiderivative = 4.42 \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{b+c}-\frac {\ln \left (2\,a-2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {\left (\mathrm {tan}\left (\frac {x}{2}\right )\,\left (-8\,a^2-8\,b^2+6\,b\,c+2\,c^2\right )-4\,a\,c+\frac {2\,\left (b-c\right )\,\left (a^2\,b-b\,c^2+b^3+a\,c\,\sqrt {a^2+b^2-c^2}\right )\,\left (4\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^2+a\,b+a\,c+3\,\mathrm {tan}\left (\frac {x}{2}\right )\,b^2-3\,\mathrm {tan}\left (\frac {x}{2}\right )\,c^2\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )}\right )\,\left (a^2\,b-b\,c^2+b^3+a\,c\,\sqrt {a^2+b^2-c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )}\right )\,\left (b\,\left (a^2-c^2\right )+b^3+a\,c\,\sqrt {a^2+b^2-c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )}-\frac {\ln \left (2\,a-2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {\left (\mathrm {tan}\left (\frac {x}{2}\right )\,\left (-8\,a^2-8\,b^2+6\,b\,c+2\,c^2\right )-4\,a\,c+\frac {2\,\left (b-c\right )\,\left (a^2\,b-b\,c^2+b^3-a\,c\,\sqrt {a^2+b^2-c^2}\right )\,\left (4\,\mathrm {tan}\left (\frac {x}{2}\right )\,a^2+a\,b+a\,c+3\,\mathrm {tan}\left (\frac {x}{2}\right )\,b^2-3\,\mathrm {tan}\left (\frac {x}{2}\right )\,c^2\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )}\right )\,\left (a^2\,b-b\,c^2+b^3-a\,c\,\sqrt {a^2+b^2-c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )}\right )\,\left (b\,\left (a^2-c^2\right )+b^3-a\,c\,\sqrt {a^2+b^2-c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2+b^2-c^2\right )} \]
[In]
[Out]