Answer
a) $ \frac{(m_f-m_s)g}{m_s}$
b) $\frac{m_fa_sh_0}{(m_f-m_s)(g+a_s)}$
Work Step by Step
a) We know that the net forces must cancel if the spider is to climb without the fly falling. Thus, it follows:
$m_sg+m_sa=m_fg\\ m_sa=m_fg-m_sg \\ m_sa=(m_f-m_s)g \\ a=\frac{(m_f-m_s)g}{m_s}$
b) We first find the value of a:
$m_sa_s+m_sg=m_fg-m_fa$
$ a=\frac{(m_f-m_s)g-m_sa_s}{m_f}$
We know that $y=\frac{1}{2}a_st^2$.
We find that the value of $t^2$ is:
$t^2=\frac{2h_0}{a_s+a}$
Using substitution, it follows:
$h=\frac{m_fa_sh_0}{(m_f-m_s)(g+a_s)}$