Integrand size = 14, antiderivative size = 50 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=-\frac {a x}{b \left (a^2+b^2\right )}+\frac {x}{b (a+b \cot (x))}+\frac {\log (b \cos (x)+a \sin (x))}{a^2+b^2} \]
Time = 0.15 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.96 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=\frac {-a x+b \log (b \cos (x)+a \sin (x))}{a^2 b+b^3}+\frac {x \sin (x)}{b^2 \cos (x)+a b \sin (x)} \]
Time = 0.37 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.08, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {4925, 3042, 3965, 25, 3042, 4013}
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 {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx\) |
\(\Big \downarrow \) 4925 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\int \frac {1}{a+b \cot (x)}dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\int \frac {1}{a-b \tan \left (x+\frac {\pi }{2}\right )}dx}{b}\) |
\(\Big \downarrow \) 3965 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\frac {a x}{a^2+b^2}-\frac {b \int -\frac {b-a \cot (x)}{a+b \cot (x)}dx}{a^2+b^2}}{b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\frac {b \int \frac {b-a \cot (x)}{a+b \cot (x)}dx}{a^2+b^2}+\frac {a x}{a^2+b^2}}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\frac {b \int \frac {b+a \tan \left (x+\frac {\pi }{2}\right )}{a-b \tan \left (x+\frac {\pi }{2}\right )}dx}{a^2+b^2}+\frac {a x}{a^2+b^2}}{b}\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle \frac {x}{b (a+b \cot (x))}-\frac {\frac {a x}{a^2+b^2}-\frac {b \log (a \sin (x)+b \cos (x))}{a^2+b^2}}{b}\) |
3.2.58.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[a*(x/(a^ 2 + b^2)), x] + Simp[b/(a^2 + b^2) Int[(b - a*Tan[c + d*x])/(a + b*Tan[c + d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]
Int[Csc[(c_.) + (d_.)*(x_)]^2*(Cot[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.)* ((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(e + f*x)^m)*((a + b*Cot[c + d*x])^(n + 1)/(b*d*(n + 1))), x] + Simp[f*(m/(b*d*(n + 1))) Int[(e + f* x)^(m - 1)*(a + b*Cot[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && NeQ[n, -1]
Result contains complex when optimal does not.
Time = 1.06 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.74
method | result | size |
risch | \(-\frac {2 i x}{a^{2}+b^{2}}-\frac {2 i x}{\left (i b \,{\mathrm e}^{2 i x}+a \,{\mathrm e}^{2 i x}+i b -a \right ) \left (i b +a \right )}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {i b -a}{i b +a}\right )}{a^{2}+b^{2}}\) | \(87\) |
-2*I/(a^2+b^2)*x-2*I*x/(I*b*exp(2*I*x)+a*exp(2*I*x)+I*b-a)/(I*b+a)+1/(a^2+ b^2)*ln(exp(2*I*x)+(I*b-a)/(I*b+a))
Time = 0.26 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.62 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=-\frac {2 \, a x \cos \left (x\right ) - 2 \, b x \sin \left (x\right ) - {\left (b \cos \left (x\right ) + a \sin \left (x\right )\right )} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) - {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + a^{2}\right )}{2 \, {\left ({\left (a^{2} b + b^{3}\right )} \cos \left (x\right ) + {\left (a^{3} + a b^{2}\right )} \sin \left (x\right )\right )}} \]
-1/2*(2*a*x*cos(x) - 2*b*x*sin(x) - (b*cos(x) + a*sin(x))*log(2*a*b*cos(x) *sin(x) - (a^2 - b^2)*cos(x)^2 + a^2))/((a^2*b + b^3)*cos(x) + (a^3 + a*b^ 2)*sin(x))
\[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=\int \frac {x \csc ^{2}{\left (x \right )}}{\left (a + b \cot {\left (x \right )}\right )^{2}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (50) = 100\).
Time = 0.22 (sec) , antiderivative size = 250, normalized size of antiderivative = 5.00 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=-\frac {8 \, a b x \cos \left (2 \, x\right ) + 4 \, {\left (a^{2} - b^{2}\right )} x \sin \left (2 \, x\right ) - {\left ({\left (a^{2} + b^{2}\right )} \cos \left (2 \, x\right )^{2} + 4 \, a b \sin \left (2 \, x\right ) + {\left (a^{2} + b^{2}\right )} \sin \left (2 \, x\right )^{2} + a^{2} + b^{2} - 2 \, {\left (a^{2} - b^{2}\right )} \cos \left (2 \, x\right )\right )} \log \left (\frac {{\left (a^{2} + b^{2}\right )} \cos \left (2 \, x\right )^{2} + 4 \, a b \sin \left (2 \, x\right ) + {\left (a^{2} + b^{2}\right )} \sin \left (2 \, x\right )^{2} + a^{2} + b^{2} - 2 \, {\left (a^{2} - b^{2}\right )} \cos \left (2 \, x\right )}{a^{2} + b^{2}}\right )}{2 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \cos \left (2 \, x\right )^{2} + {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sin \left (2 \, x\right )^{2} - 2 \, {\left (a^{4} - b^{4}\right )} \cos \left (2 \, x\right ) + 4 \, {\left (a^{3} b + a b^{3}\right )} \sin \left (2 \, x\right )\right )}} \]
-1/2*(8*a*b*x*cos(2*x) + 4*(a^2 - b^2)*x*sin(2*x) - ((a^2 + b^2)*cos(2*x)^ 2 + 4*a*b*sin(2*x) + (a^2 + b^2)*sin(2*x)^2 + a^2 + b^2 - 2*(a^2 - b^2)*co s(2*x))*log(((a^2 + b^2)*cos(2*x)^2 + 4*a*b*sin(2*x) + (a^2 + b^2)*sin(2*x )^2 + a^2 + b^2 - 2*(a^2 - b^2)*cos(2*x))/(a^2 + b^2)))/(a^4 + 2*a^2*b^2 + b^4 + (a^4 + 2*a^2*b^2 + b^4)*cos(2*x)^2 + (a^4 + 2*a^2*b^2 + b^4)*sin(2* x)^2 - 2*(a^4 - b^4)*cos(2*x) + 4*(a^3*b + a*b^3)*sin(2*x))
Leaf count of result is larger than twice the leaf count of optimal. 322 vs. \(2 (50) = 100\).
Time = 0.37 (sec) , antiderivative size = 322, normalized size of antiderivative = 6.44 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=-\frac {2 \, a x \tan \left (\frac {1}{2} \, x\right )^{2} - b \log \left (\frac {4 \, {\left (b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 4 \, a b \tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac {1}{2} \, x\right ) + b^{2}\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, b x \tan \left (\frac {1}{2} \, x\right ) + 2 \, a \log \left (\frac {4 \, {\left (b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 4 \, a b \tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac {1}{2} \, x\right ) + b^{2}\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right ) - 2 \, a x + b \log \left (\frac {4 \, {\left (b^{2} \tan \left (\frac {1}{2} \, x\right )^{4} - 4 \, a b \tan \left (\frac {1}{2} \, x\right )^{3} + 4 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, b^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, a b \tan \left (\frac {1}{2} \, x\right ) + b^{2}\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right )}{2 \, {\left (a^{2} b \tan \left (\frac {1}{2} \, x\right )^{2} + b^{3} \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, a^{3} \tan \left (\frac {1}{2} \, x\right ) - 2 \, a b^{2} \tan \left (\frac {1}{2} \, x\right ) - a^{2} b - b^{3}\right )}} \]
-1/2*(2*a*x*tan(1/2*x)^2 - b*log(4*(b^2*tan(1/2*x)^4 - 4*a*b*tan(1/2*x)^3 + 4*a^2*tan(1/2*x)^2 - 2*b^2*tan(1/2*x)^2 + 4*a*b*tan(1/2*x) + b^2)/(tan(1 /2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x)^2 + 4*b*x*tan(1/2*x) + 2*a*log(4 *(b^2*tan(1/2*x)^4 - 4*a*b*tan(1/2*x)^3 + 4*a^2*tan(1/2*x)^2 - 2*b^2*tan(1 /2*x)^2 + 4*a*b*tan(1/2*x) + b^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan (1/2*x) - 2*a*x + b*log(4*(b^2*tan(1/2*x)^4 - 4*a*b*tan(1/2*x)^3 + 4*a^2*t an(1/2*x)^2 - 2*b^2*tan(1/2*x)^2 + 4*a*b*tan(1/2*x) + b^2)/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1)))/(a^2*b*tan(1/2*x)^2 + b^3*tan(1/2*x)^2 - 2*a^3*tan( 1/2*x) - 2*a*b^2*tan(1/2*x) - a^2*b - b^3)
Timed out. \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=\int \frac {x}{{\sin \left (x\right )}^2\,{\left (a+b\,\mathrm {cot}\left (x\right )\right )}^2} \,d x \]