Artificial intelligent assistant

Formula that predicts the location of moving enemy A rocket that explodes not on impact, but explodes on a timer will be shot from myself to the enemy. The timer can only be inputted at the start of the shot. The rocket can only go straight and has a speed of 1500m/s . The enemy is moving away from me in a straight line at a speed of 400m/s. The distance between myself and my enemy is 5000m. I need a formula that predicts the precise time until the rocket should explode so that it will explode directly on my enemy's location.

If they are going directly away from you, the problem is only one dimensional. Let us put you at $x=0$. Your enemy starts off at $x=5000$.

Your enemies position as a function of time is

$$ x_{enemy}=5000+400t $$

The rocket's position as a function of time is

$$ x_{rocket}=0+1500t $$

Set $x_{enemy}=x_{rocket}$ and solve for the $t$ at which they meet.

$$ 5000+400t=1500t\\\ 5000+400t-400t=1500t-400t\\\ 5000=1100t\\\ \frac{5000}{1100}=\frac{1100t}{1100}\\\ \frac{50}{11} = t\\\ $$

It takes $\frac{50}{11}=4\frac{6}{11}$ seconds.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 539af4503f44046d5c647a800490e3ad