How can I write $\frac{1}{x\text{sin}(x)}$ in terms of partial fractions? I was trying to write the function $\frac{1}{x\text{sin}(x)}$ in terms of partial fractions, so that I could integrate the function. If I had the form
$$\frac{1}{x\text{sin}(x)} = \frac{A}{x} + \frac{B}{\text{sin}(x)}$$ 
I then have
$$ 1 = A\text{sin}(x) + Bx $$
I think it is best to look at $0 < x < \pi$. The above equation should hold for all $0 < x < \pi$. If I choose $x = \frac{\pi}{2}$ and $x=\frac{\pi}{4}$ to find my coefficients, I find that 
$$ A = 1+\sqrt{2}$$
$$ B = -\frac{2\sqrt{2}}{\pi}$$
However, if I choose $x=\frac{\pi}{2}$ and $x=\frac{\pi}{3}$ to find my coefficients, I find that
$$ A = \frac{6\sqrt{3}+8}{11}$$ 
$$ B = \frac{6-12\sqrt{3}}{11\pi}$$
I am wondering what is going wrong? The suspicion might be that it is wrong to decompose $\frac{1}{x\text{sin}(x)}$ in the manner as I have done, but it also means:
1) Can I NOT express it in terms of partial fractions? 
2) How does one approach the integral then (I have tried partial fractions, substitution, and integration by parts)?
 A: The technique of partial fractions is an extremely specific one. It applies in exactly one situation: when the function you are integrating is a fraction in which both the numerator and denominator are polynomials. What you're looking at is not of that form, so partial fractions can't apply. Here's a more familiar version of this phenomenon: to solve $x^2=2x$, you can use the "technique" of dividing by $x$ to obtain the result $x=2$ (and the "lost" solution $x=0$). But to solve $x^2=2x+1$, you can't use that technique - dividing by $x$ here doesn't get you anything useful. Likewise, the technique of partial fractions doesn't apply to every fraction, just a certain kind.
For this integral, it's unlikely that any technique will work; $\frac{1}{x\sin{x}}$ is not a well-behaved function. A sufficiently clever use of integration by parts might work, but I doubt it. Some integrals just can't be solved (technically, the phrase is "can't be solved with elementary functions", but that's a bit off-topic right now). If you have reason to believe you can solve this integral - for example, if you encountered this integral as part of an assignment - then you should look for a way to get around actually doing the integral. Maybe you made an error in determining which integral to do, or maybe there's a clever way to get the answer without integrating at all.
A: We can represent the function of interest in a partial fraction expansion, but the expansion is given in terms of an infinite series.  
To show this we rely on THIS ANSWER, in which I showed, using real analysis only, that we could represent the cosecant function as the partial fraction expansion
$$\pi\csc(\pi y)=\sum_{n=-\infty}^\infty \frac{(-1)^n}{y-n} \tag 1$$
Now, letting $y=x/\pi $ in $(1)$ and multiplying the resulting equation by $1/\pi$ yields
$$\frac{1}{\sin(x)}=\sum_{n=-\infty}^\infty \frac{(-1)^n}{x-n\pi}\tag 2$$
Dividing both sides of $(2)$ by $x$ and using the expansion
$$\frac{1}{x(x-n\pi)}=\frac{1}{n\pi (x-n\pi)}-\frac{1}{n\pi x}$$
for $n\ne 0$, we obtain
$$\frac{1}{x\sin(x)}=\frac1{x^2}+\sum_{n=1}^\infty\left(\frac{(-1)^{n-1}}{n\pi(x+n\pi)}-\frac{(-1)^{n-1}}{n\pi(x-n\pi)}\right) \tag 3$$
Equation $(3)$ provides a partial fraction expansion representation of the function $\frac{1}{x\sin(x)}$ which converges for $x\ne k\pi$.  We also see explicitly the second order pole at $x=0$ from the term $\frac1{x^2}$. 
A: You might use the formula 
$$ \sin x = x\prod_{n\in\mathbb{N}}\left(1-\frac{x^2}{n^2\pi^2}\right)$$
so that $1/(x\sin x)$ is an infinite rational product, that might be writable as an infinite rational sum.
