We want to find a
primitive function
for the function
-
![{\displaystyle {}f(x)={\frac {x^{2}}{(x\cos x-\sin x)^{2}}}\,.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/feb4b4e0e798aa5c1abfbea741035e25f17d1b02)
We first determine the derivative of
-
This is
-
![{\displaystyle {}-{\frac {\cos x-x\sin x-\cos x}{(x\cos x-\sin x)^{2}}}={\frac {x\sin x}{(x\cos x-\sin x)^{2}}}\,.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/398ed8ef05d59bc116f15c202a3d296225d1effc)
Therefore, we write
as a product
.
We apply
integration by parts,
where we integrate the first factor and differentiate the second factor. The derivative of the second factor is
-
![{\displaystyle {}{\left({\frac {x}{\sin x}}\right)}'={\frac {\sin x-x\cos x}{\sin ^{2}x}}\,.}](https://wikimedia.org/api/rest_v1/media/math/render/svg/103a4261e287be267c9571de8180fbe43ebb1350)
Hence, we have
![{\displaystyle {}{\begin{aligned}\int _{}^{}f(x)\,dx&={\frac {1}{x\cos x-\sin x}}\cdot {\frac {x}{\sin x}}-\int _{}^{}{\frac {1}{x\cos x-\sin x}}\cdot {\frac {\sin x-x\cos x}{\sin ^{2}x}}\,dx\\&={\frac {1}{x\cos x-\sin x}}\cdot {\frac {x}{\sin x}}+\int _{}^{}{\frac {1}{\sin ^{2}x}}\,dx\\&={\frac {1}{x\cos x-\sin x}}\cdot {\frac {x}{\sin x}}-\cot x.\end{aligned}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c3b12ab2429456a20d05bfd7261e4d877944315a)