Distance = Rate * Time

Get this in your head. Think on it, over and over.

Rule #1 - Name Stuff.

The only thing missing in this problem is the time it took to do ONE of the trips. Name that.

y hrs = Time to make the trip to his friend's house at x km/h.

This makes (4 hrs - y hrs) the time it took to make the return trip.

Trip To

Distance = Rate * Time

(20 km) = (x km/h) * (y hrs)

Trip Back

Distance = Rate * Time

(20 km) = (x km/h - 2 km/h) * (4 hrs - y hrs)

We are tasked with writing an equation for 'x'. This requires us to get rid of the 'y's. Solve and substitute.

Trip To (Solve for y)

(20 km) / (x km/h) = (y hrs)

Trip From (Substitute)

(20 km) = (x km/h - 2 km/h) * (4 hrs - ((20 km) / (x km/h)))

And thus we see an equation for 'x'. It isn't real pretty, but it is done. It isn't real pretty, and that's why we have Part B of the problem statement.

Let's see if you can get it from here.

P.S. Don't forget "Distance = Rate * Time"