David did w push-ups in gym class today. David did x more push-ups than Zachary. How many push-ups did Zachary and David do altogether?
Let's say that Zachary did y push-ups. 

Then we know that: 
David did w push-ups in gym class today.
David did x more push-ups than Zachary.

That means that: 
w = x + y

Now we can solve for y: 
y = w - x 

Now we know that: 
Zachary did y push-ups.
Zachary did w - x push-ups.

That means that the total number of push-ups that Zachary and David did is: 
w + (w - x) = 2w - x