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} \] Output:
-a*x/b/(a^2+b^2)+x/b/(a+b*cot(x))+ln(b*cos(x)+a*sin(x))/(a^2+b^2)
Time = 0.14 (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)} \] Input:
Integrate[(x*Csc[x]^2)/(a + b*Cot[x])^2,x]
Output:
(-(a*x) + b*Log[b*Cos[x] + a*Sin[x]])/(a^2*b + b^3) + (x*Sin[x])/(b^2*Cos[ x] + a*b*Sin[x])
Time = 0.36 (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}\) |
Input:
Int[(x*Csc[x]^2)/(a + b*Cot[x])^2,x]
Output:
x/(b*(a + b*Cot[x])) - ((a*x)/(a^2 + b^2) - (b*Log[b*Cos[x] + a*Sin[x]])/( a^2 + b^2))/b
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 = 0.44 (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\) |
Input:
int(x*csc(x)^2/(a+b*cot(x))^2,x,method=_RETURNVERBOSE)
Output:
-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.08 (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 )}} \] Input:
integrate(x*csc(x)^2/(a+b*cot(x))^2,x, algorithm="fricas")
Output:
-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 \] Input:
integrate(x*csc(x)**2/(a+b*cot(x))**2,x)
Output:
Integral(x*csc(x)**2/(a + b*cot(x))**2, x)
Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (50) = 100\).
Time = 0.05 (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 )}} \] Input:
integrate(x*csc(x)^2/(a+b*cot(x))^2,x, algorithm="maxima")
Output:
-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.21 (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 )}} \] Input:
integrate(x*csc(x)^2/(a+b*cot(x))^2,x, algorithm="giac")
Output:
-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 \] Input:
int(x/(sin(x)^2*(a + b*cot(x))^2),x)
Output:
int(x/(sin(x)^2*(a + b*cot(x))^2), x)
Time = 0.16 (sec) , antiderivative size = 118, normalized size of antiderivative = 2.36 \[ \int \frac {x \csc ^2(x)}{(a+b \cot (x))^2} \, dx=\frac {-\cos \left (x \right ) \mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) b +\cos \left (x \right ) \mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -2 \tan \left (\frac {x}{2}\right ) a -b \right ) b -\cos \left (x \right ) a x -\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2}+1\right ) \sin \left (x \right ) a +\mathrm {log}\left (\tan \left (\frac {x}{2}\right )^{2} b -2 \tan \left (\frac {x}{2}\right ) a -b \right ) \sin \left (x \right ) a +\sin \left (x \right ) b x}{\cos \left (x \right ) a^{2} b +\cos \left (x \right ) b^{3}+\sin \left (x \right ) a^{3}+\sin \left (x \right ) a \,b^{2}} \] Input:
int(x*csc(x)^2/(a+b*cot(x))^2,x)
Output:
( - cos(x)*log(tan(x/2)**2 + 1)*b + cos(x)*log(tan(x/2)**2*b - 2*tan(x/2)* a - b)*b - cos(x)*a*x - log(tan(x/2)**2 + 1)*sin(x)*a + log(tan(x/2)**2*b - 2*tan(x/2)*a - b)*sin(x)*a + sin(x)*b*x)/(cos(x)*a**2*b + cos(x)*b**3 + sin(x)*a**3 + sin(x)*a*b**2)