A retiring employee receives an annual pension proportional to the square root of the number of years of his service. Had he served $a$ years more, his pension would have been $p$ dollars greater, whereas had he served $b$ years more $(b\ne a)$, his pension would have been $q$ dollars greater than the original annual pension. Find his annual pension in terms of $a,b,p$ and $q$.
$\text{(A) } \frac{p^2-q^2}{2(a-b)}\quad \text{(B) } \frac{(p-q)^2}{2\sqrt{ab}}\quad \text{(C) } \frac{ap^2-bq^2}{2(ap-bq)}\quad \text{(D) } \frac{aq^2-bp^2}{2(bp-aq)}\quad \text{(E) } \sqrt{(a-b)(p-q)}$
Note the original pension as $k\sqrt{x}$, where $x$ is the number of years served. Then, based on the problem statement, two equations can be set up. 
\[k\sqrt{x+a} = k\sqrt{x} + p\]
\[k\sqrt{x+b} = k\sqrt{x} + q\]
Square the first equation to get
\[k^2x + ak^2 = k^2x + 2pk\sqrt{x} + p^2.\]
Because both sides have \[k^2x\], they cancel out. Similarly, the second equation will become $bk^2 = q^2 + 2qk\sqrt{x}.$ Then, $a$ can be multiplied to the second equation and $b$ can be multiplied to the first equation so that the left side of both equations becomes $abk^2$. Finally, by setting the equations equal to each other, \[bp^2 + 2bpk\sqrt{x} = aq^2 + 2aqk\sqrt{x}.\] Isolate $k\sqrt{x}$ to get $\fbox{D} = \frac{aq^2-bp^2}{2(bp-aq)}$.