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} \]
ln(tan(1/2*x))/(b+c)-b*ln(b+c+2*a*tan(1/2*x)-(b-c)*tan(1/2*x)^2)/(b^2-c^2) -2*a*c*arctanh((a-(b-c)*tan(1/2*x))/(a^2+b^2-c^2)^(1/2))/(b^2-c^2)/(a^2+b^ 2-c^2)^(1/2)
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)} \]
((2*a*c*ArcTanh[(a + (-b + c)*Tan[x/2])/Sqrt[a^2 + b^2 - c^2]])/Sqrt[a^2 + b^2 - c^2] - (b + c)*Log[Cos[x/2]] + (-b + c)*Log[Sin[x/2]] + b*Log[c + b *Cos[x] + a*Sin[x]])/((-b + c)*(b + c))
Time = 0.60 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {3042, 4897, 3042, 4902, 27, 2159, 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)+c \csc (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc (x)^2}{a+b \cot (x)+c \csc (x)}dx\) |
\(\Big \downarrow \) 4897 |
\(\displaystyle \int \frac {\csc (x)}{a \sin (x)+b \cos (x)+c}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\csc (x)}{a \sin (x)+b \cos (x)+c}dx\) |
\(\Big \downarrow \) 4902 |
\(\displaystyle 2 \int \frac {\cot \left (\frac {x}{2}\right ) \left (\tan ^2\left (\frac {x}{2}\right )+1\right )}{2 \left (-\left ((b-c) \tan ^2\left (\frac {x}{2}\right )\right )+2 a \tan \left (\frac {x}{2}\right )+b+c\right )}d\tan \left (\frac {x}{2}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \int \frac {\left (\tan ^2\left (\frac {x}{2}\right )+1\right ) \cot \left (\frac {x}{2}\right )}{2 a \tan \left (\frac {x}{2}\right )-\left ((b-c) \tan ^2\left (\frac {x}{2}\right )\right )+b+c}d\tan \left (\frac {x}{2}\right )\) |
\(\Big \downarrow \) 2159 |
\(\displaystyle \int \left (\frac {2 \left (b \tan \left (\frac {x}{2}\right )-a\right )}{(b+c) \left (2 a \tan \left (\frac {x}{2}\right )-\left ((b-c) \tan ^2\left (\frac {x}{2}\right )\right )+b+c\right )}+\frac {\cot \left (\frac {x}{2}\right )}{b+c}\right )d\tan \left (\frac {x}{2}\right )\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\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}\) |
(-2*a*c*ArcTanh[(a - (b - c)*Tan[x/2])/Sqrt[a^2 + b^2 - c^2]])/((b^2 - c^2 )*Sqrt[a^2 + b^2 - c^2]) + Log[Tan[x/2]]/(b + c) - (b*Log[b + c + 2*a*Tan[ x/2] - (b - c)*Tan[x/2]^2])/(b^2 - c^2)
3.5.60.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p _.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x ], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
Int[u_, x_Symbol] :> With[{w = Block[{$ShowSteps = False, $StepCounter = Nu ll}, Int[SubstFor[1/(1 + FreeFactors[Tan[FunctionOfTrig[u, x]/2], x]^2*x^2) , Tan[FunctionOfTrig[u, x]/2]/FreeFactors[Tan[FunctionOfTrig[u, x]/2], x], u, x], x]]}, Module[{v = FunctionOfTrig[u, x], d}, Simp[d = FreeFactors[Tan [v/2], x]; 2*(d/Coefficient[v, x, 1]) Subst[Int[SubstFor[1/(1 + d^2*x^2), Tan[v/2]/d, u, x], x], x, Tan[v/2]/d], x]] /; CalculusFreeQ[w, x]] /; Inve rseFunctionFreeQ[u, x] && !FalseQ[FunctionOfTrig[u, x]]
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\) |
1/(b+c)*(b/(-b+c)*ln(-tan(1/2*x)^2*b+c*tan(1/2*x)^2+2*a*tan(1/2*x)+b+c)+(- 2*a-2*b*a/(-b+c))/(-a^2-b^2+c^2)^(1/2)*arctan(1/2*(2*(-b+c)*tan(1/2*x)+2*a )/(-a^2-b^2+c^2)^(1/2)))+ln(tan(1/2*x))/(b+c)
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 ] \]
[-1/2*(sqrt(a^2 + b^2 - c^2)*a*c*log((a^4 + 3*a^2*b^2 + 2*b^4 + (a^2 - b^2 )*c^2 + 2*(a^2*b + b^3)*c*cos(x) + (a^4 - b^4 - 2*(a^2 - b^2)*c^2)*cos(x)^ 2 + 2*((a^3 + a*b^2)*c - (a^3*b + a*b^3 - 2*a*b*c^2)*cos(x))*sin(x) + 2*(2 *a*b*c*cos(x)^2 - a*b*c + (a^3 + a*b^2)*cos(x) - (a^2*b + b^3 - (a^2 - b^2 )*c*cos(x))*sin(x))*sqrt(a^2 + b^2 - c^2))/(2*b*c*cos(x) - (a^2 - b^2)*cos (x)^2 + a^2 + c^2 + 2*(a*b*cos(x) + a*c)*sin(x))) + (a^2*b + b^3 - b*c^2)* log(2*b*c*cos(x) - (a^2 - b^2)*cos(x)^2 + a^2 + c^2 + 2*(a*b*cos(x) + a*c) *sin(x)) - (a^2*b + b^3 - b*c^2 - c^3 + (a^2 + b^2)*c)*log(1/2*cos(x) + 1/ 2) - (a^2*b + b^3 - b*c^2 + c^3 - (a^2 + b^2)*c)*log(-1/2*cos(x) + 1/2))/( a^2*b^2 + b^4 + c^4 - (a^2 + 2*b^2)*c^2), 1/2*(2*sqrt(-a^2 - b^2 + c^2)*a* c*arctan((b*c*cos(x) + a*c*sin(x) + a^2 + b^2)*sqrt(-a^2 - b^2 + c^2)/((a^ 3 + a*b^2 - a*c^2)*cos(x) - (a^2*b + b^3 - b*c^2)*sin(x))) - (a^2*b + b^3 - b*c^2)*log(2*b*c*cos(x) - (a^2 - b^2)*cos(x)^2 + a^2 + c^2 + 2*(a*b*cos( x) + a*c)*sin(x)) + (a^2*b + b^3 - b*c^2 - c^3 + (a^2 + b^2)*c)*log(1/2*co s(x) + 1/2) + (a^2*b + b^3 - b*c^2 + c^3 - (a^2 + b^2)*c)*log(-1/2*cos(x) + 1/2))/(a^2*b^2 + b^4 + c^4 - (a^2 + 2*b^2)*c^2)]
\[ \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 \]
Exception generated. \[ \int \frac {\csc ^2(x)}{a+b \cot (x)+c \csc (x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(c^2-b^2-a^2>0)', see `assume?` f or more de
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} \]
2*(pi*floor(1/2*x/pi + 1/2)*sgn(-2*b + 2*c) + arctan(-(b*tan(1/2*x) - c*ta n(1/2*x) - a)/sqrt(-a^2 - b^2 + c^2)))*a*c/(sqrt(-a^2 - b^2 + c^2)*(b^2 - c^2)) - b*log(-b*tan(1/2*x)^2 + c*tan(1/2*x)^2 + 2*a*tan(1/2*x) + b + c)/( b^2 - c^2) + log(abs(tan(1/2*x)))/(b + c)
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 )} \]
log(tan(x/2))/(b + c) - (log(2*a - 2*b*tan(x/2) - ((tan(x/2)*(6*b*c - 8*a^ 2 - 8*b^2 + 2*c^2) - 4*a*c + (2*(b - c)*(a^2*b - b*c^2 + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2))*(a*b + a*c + 4*a^2*tan(x/2) + 3*b^2*tan(x/2) - 3*c^2*tan (x/2)))/((b^2 - c^2)*(a^2 + b^2 - c^2)))*(a^2*b - b*c^2 + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2)))/((b^2 - c^2)*(a^2 + b^2 - c^2)))*(b*(a^2 - c^2) + b^3 + a*c*(a^2 + b^2 - c^2)^(1/2)))/((b^2 - c^2)*(a^2 + b^2 - c^2)) - (log(2*a - 2*b*tan(x/2) - ((tan(x/2)*(6*b*c - 8*a^2 - 8*b^2 + 2*c^2) - 4*a*c + (2* (b - c)*(a^2*b - b*c^2 + b^3 - a*c*(a^2 + b^2 - c^2)^(1/2))*(a*b + a*c + 4 *a^2*tan(x/2) + 3*b^2*tan(x/2) - 3*c^2*tan(x/2)))/((b^2 - c^2)*(a^2 + b^2 - c^2)))*(a^2*b - b*c^2 + b^3 - a*c*(a^2 + b^2 - c^2)^(1/2)))/((b^2 - c^2) *(a^2 + b^2 - c^2)))*(b*(a^2 - c^2) + b^3 - a*c*(a^2 + b^2 - c^2)^(1/2)))/ ((b^2 - c^2)*(a^2 + b^2 - c^2))