Show that the following equation has exactly $n$ real roots. 
If $0<a_1< \cdots < a_n$, show that the following equation has exactly $n$ real roots.
  $$ \frac{a_1}{a_1-x}+\frac{a_2}{a_2-x}+ \frac{a_3}{a_3-x}+ \cdots + \frac {a_n}{a_n - x} = 2015$$

My working:
The LHS easily becomes $$a_1(a_2-x)...(a_n-x)+a_2(a_1-x)(a_3-x)...(a_nx)+.....+a_n(a_1-x)(a_2-x)...(a_{n-1} -x)$$
This shows it has $n$ roots
But what about exactly and real?
 A: Hint:
Let $x=a+ib$ a root
Using Complex conjugate root theorem, $a-ib$ also be another root
$$2015-2015=\sum_{r=1}^n\left(\dfrac{a_r}{a_r-(a-ib)}-\dfrac{a_r}{a_r-(a+ib)}\right)=\sum_{r=1}^n?$$
Equate the imaginary parts to find  $b=0$
A: Sketch the graph of the expression on the left hand side of the equation. Try cases n=1, 2 and 3 to get a feel for the general case.
Note that $f(x) = \dfrac{a_1}{a_1-x} + \dfrac{a_2}{a_2-x} + \dfrac{a_3}{a_3-x} + \dots + \dfrac{a_n}{a_n-x} $ has discontinuities/poles at $x=a_1, a_2, a_3, \dots, a_n$ and it is continuous everywhere else.
Also in each of the intervals $(-\infty, a_1), (a_1, a_2), (a_2, a_3), \dots, (a_n, \infty)$ the function $f(x)$ is a monotonically increasing function of $x$ because as $x$ increases each of the denominators decreases so each of the terms $\dfrac{a_i}{a_i-x}$ increases (because the $a_i$ are positive).
As $x$ approaches $-\infty$, each of the terms is small and positive and so $f(x)$ approaches 0 from above; as $x$ approaches $\infty$, each of the terms is small and negative and so $f(x)$ approaches 0 from below.
It should be clear from your sketch that the graph of $y=f(x)$ crosses the horizontal line $y=2015$ at exactly n points, one in each of the intervals $(-\infty, a_1), (a_1, a_2), (a_2, a_3), \dots, (a_{n-1}, a_n)$. So the equation $f(x) = 2015$ has exactly n real roots.
There is nothing special about the value 2015 - for any real value on the right hand side, the same argument shows that equation has exactly n real roots.
