This is a classic work problem and it is always difficult to justify the way it works.
1/5 + 1/2 = 1/x => x = 10/7
You can think of it this way:
The husband's rate is Job/2 hr; the wife's rare is Job/5 hrs.
Let x be the total hours spent working together.
(Job/5)x + (Job/2)x = Job
Divide through by Job and then by x to get the equation I started with.
In other problems Job might be square feet painted, then square feet painted/2 is square feet per hour which is then multiplied by hours to get square feet..