Can anyone help me see where my reasoning is wrong?
My reasoning is as follows:
Vertical drop in falling through distance b on slope of 30 degrees = $b\,sin\,30=b/2$
Equating loss in PE to gain in KE leads to:
$\frac{mgb}{2}= \frac{1}{2}m{v_s}^2$
Where $v_s$ is the speed of the trolley when it has fallen a distance b so that the spring is still uncompressed and is just touching the fixed stop.
This gives:
$v_s=\sqrt{gb}$
Now the spring begins to compress. Once it has compressed by a length x the energy stored in the spring will be given by:
$\frac{\lambda\,x^2}{2a} = \frac{mgax^2}{2ca}$
Now this energy will be equal to the loss of PE from the trolley dropping a further distance of x on the slope which is a vertical drop of $x\,sin\,30=\frac{x}{2}$ plus the loss of KE of the trolley as it will slow down. Let us say the the velocity change is $\Delta v$ then the loss in KE = $\frac{1}{2}m{\Delta v}^2$ so I get:
$\frac{mgax^2}{2ca}=\frac{1}{2}mgx+\frac{1}{2}m{\Delta v}^2$
Which simplifies to:
$\Delta v=\sqrt{\frac{gx^2-gcx}{c}}$
And so the velocity required should equal $v_s - \Delta v$
Which is:
v =$\sqrt{gb}-\sqrt{\frac{gx^2-gcx}{c}}$
Which doesn't lead to the required answer.
Thanks for any advice, Mitch.

Assuming a spring constant
$$k=\frac{\frac{mga}{c}}{a}=\frac{mg}{c}$$
we have that
$$\frac{1}{2}m{v_s}^2+\frac{mgx}{2}= \frac{1}{2}m{v}^2+\frac{1}{2}\frac{mg}{c} {x}^2$$
$$\frac{1}{2}mgb+\frac{mgx}{2}= \frac{1}{2}m{v}^2+\frac{1}{2}\frac{mg}{c} {x}^2$$
$$gb+gx= {v}^2+\frac{g}{c} {x}^2$$
$$bc+xc= \frac{v^2c}g+{x}^2$$
$$\frac{v^2c}g=bc+xc-{x}^2=c(b+x)-x^2$$