Integrate $\int \frac{x\cos x}{\sin^2x}dx$ 
$$\int \frac{x\cos x}{\sin^2x}dx$$

$$\int \frac{x\cos x}{\sin^2x}dx=\int \frac{x\cos x}{1-\cos^2x}dx=\int \frac{x\cos x}{(1-\cos x)(1+\cos x)}dx$$
How can I find the two fractions? if there are at all? 

Since you wanted to solve using partial fractions,
$$\int\frac{x\cos x}{(1+\cos x)(1-\cos x)}dx=\frac{1}{2}\int\frac{x(1+\cos x)-x(1-\cos x)}{(1+\cos x)(1-\cos x)}dx$$
$$=\frac{1}{2}\int\frac{x}{1-\cos x}dx- \frac{1}{2}\int{\frac{x}{1+\cos x}}dx$$
$$= \frac{1}{2}\int \frac{x}{2\sin^2\frac{x}{2}}dx- \frac{1}{2}\int \frac{x}{2\cos^2\frac{x}{2}}dx$$
$$= \frac{1}{2}\int x\sec^2\frac{x}{2}dx-\frac{1}{2}\int x\csc^2\frac{x}{2}dx$$
Now use integration by parts.
I will solve one term
$$\int x\sec^2\frac{x}{2}dx=2x\tan\frac{x}{2}-2\int\tan\frac{x}{2}dx$$
