Answer
$\dfrac{k(b-a)}{ab}$
Work Step by Step
We know that Hooke's Law states that $F=k x$
To calculate the work done, the limits for $x$ will be from $b$ to $a$ such that:
$W=\int_b^{a} (\dfrac{-k}{x^2}) dx=k[(\dfrac{1}{x})]_b^{a}$
or, $W=k[\dfrac{1}{a}-\dfrac{1}{b}]=\dfrac{k(b-a)}{ab}$