Assume we have a number line, where the tail of the worm is at x=0. This means that the head of the worm is at x=15.
Also, we know that the coordinate of the head of the worm follows this equation:
[tex] x_H(t) = 15+2t [/tex]
Where [tex] t [/tex] is the time in seconds. In fact, we know that the worm gains 2 centimeters per second.
Now, assume that the ant also starts at x=0, and walks with a certain rate of [tex] v_A [/tex] centimeters per second. This means that the equation for the position of the ant is
[tex] x_A(t) = v_At [/tex]
Now, we know that after 5 seconds the ant is in the same position as the head of the worm, which means
[tex] x_A(5) = x_H(5) [/tex]
We know the equation for both expressions, so let's subtitute them in:
[tex] 5v_A = 15+2\cdot 5 \iff 5v_A = 15+10 \iff 5v_A = 25 \iff v_A = 5 [/tex]
So, the ant walks at a rate of 5cm per second.