Let X and Y be two cars starting from points A and B respectively. Let the speed of car X be x km/hr and that of car Y be y km/hr.
Case I When two cars move in the same directions:
Suppose two cars meet at point Q. Then,
Distance travelled by car X=AQ,
Distance travelled by car Y=BQ
It is given that two cars meet in 9 hours.
∴ Distance travelled by car X in 9 hours =9x km.
⇒AQ=9x
Distance travelled by car y in 9 hours =9y km.
⇒BQ=9y
Clearly, AQ−BQ=AB
⇒9x−9y=90 [∵AB=90km]
⇒x−y=10 (i)
Case II When two cars move in opposite directions:
Suppose two cars meet at point P. Then,
Distance travelled by car X = AP,
Distance travelled by car Y = BP
In this case, two cars meet in 97 hours.
∴ Distance travelled by car X in 97 hours =97xkm
⇒BP=97y
Clearly, AP+BP=AB
⇒97x+97y=90
⇒97(x+y)=90
⇒x+y=70 .(ii)
Adding equations (i) and (ii), we get
2x+0=80⇒x=40
Putting in (ii), we get,
y=70−40=30
∴x=40 and y=30.
Hence, the speed of car X is 40 km/hr and speed of car Y is 30 km/hr.