To solve for the time it takes to travel a certain distance at a certain speed, use the formula,
time = distance / speed
Given that the entire journey takes four hours, add up the time it takes David to row upstream with that of him travelling downstream. This is mathematically represented as,
total time = time upstream + time downstream
4 = 3/(x - 1) + 3/(x +1)
Solving for x in the equation gives 2. Thus, David's speed in still water is 2 miles per hour.