We'll show that
$$\frac{x}{10^7} = e^{-\left(\frac{y}{10^7}\right)},$$
The point $Q$ moves at a constant speed of $10^7$, so we have $dy/dt = 10^7.$ Since $P$ moves at a speed that is proportional to the distance $x$ left to travel we have $dx/dt = -x.$ From this we see that
$$dy/dx = -\frac{10^7}{x},$$
which gives
$$y = -10^7 \ln{cx},$$
for some constant $c.$
We can work out the value of $c$ using our initial conditions. At the start, the point $P$ still needs to travel the whole length of the line segment $AB$, which is $10^7$. Therefore $x_0 = 10^7$. The point $Q$ hasn't gone anywhere yet, so $y_0 = 0.$
Plugging this into the expression above gives
$$0 = -10^7 \ln{c10^7},$$
so
$$e^0 = 1 = c10^7.$$
Therefore,
$$c = \frac{1}{10^7},$$
so
$$y = -10^7 \ln{\frac{x}{10^7}},$$
and
$$\frac{x}{10^7} = e^{-\left(\frac{y}{10^7}\right)},$$
which is what we wanted to show.