# Initial velocity certain equation

The question is:

Ball A is dropped from the top of a building of height h, and simultaneously Ball B is thrown vertically upward. If the two balls collid at height h/3, what is the initial velocity of Ball B?

The answer they are looking for is:
Vinitial = 1/2*sqrt(3gh)

But I have no idea how to get there. The closest I can get using the formulas I know is:
Vinitial = Vfinal - sqrt(2gh/3)

(g refers to the acceleration of gravity, -9.81m/s)

$x_A(t) = h - \frac{1}{2}g t^2$, hence if $x_A(t^*) =\frac{1}{3} h$, we have $\frac{1}{2}g (t^*)^2 = \frac{2}{3} h$, or $t^* = 2 \sqrt{\frac{h}{3g}}$.

$x_B(t^*) = v_0t^*-\frac{1}{2}g (t^*)^2$, so $v_0 = \frac{1}{t^*}x_B(t^*)+\frac{1}{2}g t^*= \frac{1}{3} \frac{h}{t^*} + \frac{1}{2}g t^* = \frac{1}{2} \sqrt{3gh}$.

Hint: $h(t)=h_0+v_0t+\frac{1}2gt^2$

Ball B starts at $h_0=0$ and $v_0=v_\text{initial}$.

Ball A starts at $h_0=h$ and $v_0=0$.

At time $t=t_\text{collision}$, $h(t_\text{collision})=h/3$ for both Ball A and Ball B.

Solve $h_A(t_\text{collision})=h/3$ for $t_\text{collision}$ in terms of $h$.

Set $h_A(t_\text{collision})=h_B(t_\text{collision})$ and solve for $v_\text{initial}$.

Continue from here: $$h/3 = h - gt^2/2\\ h/3 = V_0t - gt^2/2$$