Let the following be displacement functions:

Where the dog's velocity is:

The inequalities can go either way since there is no information on the dog's velocity when the dog and the cat are in the same position. The speed must be h, but the velocity can be plus or minus.