Simple Analytical mechanics problem I am trying to solve a simple problem stated as follows:

"There are two cartesian reference frames k $(o;x,y,z)$ and K $(O;X,Y,Z)$ with the first one being still (inertial) and the second one (K) with its plane $XY$ that oscillates vertically so that $X$ maintain itself parallel to $x$ and $Y$ maintain itself parallel to $y$; the origin O of K moves along the $z$ axis of k with the law $O = a*cos(k*t)$; a "car" that can be represented as a point $P$ of mass $m$ moves in the K frame along the $X$ axis with constant velocity $v$. When $t = 0$ a stone $S$ of mass $M$ is thrown from the car along the $X$ axis in its positive direction with initial velocity $V$. Considering that on the stone is acting the force of gravity, prove that if $v$ is not equal to $V$ the two masses will never collide again in the future while if $v = V$ the two masses will always collide after a certain period of time $t_0 > 0$, independently of the values of the constants $a$ and $k$".

I thought I have correctly written the equations of motion (both in the frames k and K) of the stone and the car but I struggle proving that if $v = V$ the stone will be able to fall on the car at some point in the future: in the transformation of coordinates from K to k I assumed that the rotation matrix is the identity and that only a translation is present, hence in k the car moves with the laws $x = v*t + x_0$ and $z = a*cos(k*t)$ while the stone moves with the following laws: $x= V*t + x_0$ and $z = -(1/2)*g*t^2 + a$, so how will the $z$ coordinates of the car and the stone ever be the same for $t > 0$? I must be missing something very trivial here. Can anybody point me to the right direction? Many thanks!!
 A: The problem question is false
Let's "c" denote the car and "M" the mass that is thrown from the car. The equations of motion that you found are indeed correct (in the inertial frame, with $x_0=0$):
$$x_c(t)=vt\quad\quad z_c(t)=a\cos(kt)$$
$$x_M(t) = Vt\quad\quad z_M(t)=a-\dfrac{1}{2}gt^2$$
If $V\ne v$ than the x coordinates of the the car and $M$ are never equal (the fastest one is always ahead).
If $V=v$ than the x coordinates are always equal and you only have to prove that there exists a time $t_0$ such that
$$z_c(t_0) = z_M(t_0)$$
which is a solution greater than zero of the equation
$$a-\dfrac{1}{2}gt^2=a\cos(kt)$$
The problem is that this equation doesn't always have a solution, you can graph it with $a=1$ and $k=1$ and you will see that the parabola is all under the cosine function and they are equal in zero.
When do they meet?
Let's call
$$f(t)= a\cos(kt)-a+\dfrac{1}{2}gt^2$$
We know $f(0)=0$ and we want to find a condition for the existence of a positive solution. $f(+\infty)=+\infty$. If $f$ decreases after zero it becomes negative, and there has to be a zero between 0 and infinity. This happens when
$$f'(t)<0$$
immediately after zero. We have
$$f'(t)=-ak\sin(kt)+gt=-ak^2t+gt+o(t)$$ using little o notation.
This way we know the derivative is negative immediately after zero when
$$ak^2>g$$
You can also verify this by playing with sliders in desmos:
https://www.desmos.com/calculator/voyefnfsr5
