ANSWER
Dave's savings at first was $300
EXPLANATION
Let the total savings of Dave and Sam be

Since their savings is in the ratio,

The total ratio

Dave's Savings at first is

and Sam's savings at first is

When each of them donate $40 each, then
Dave's savings is now

or

and Sam's savings is now

Or

The ratio of their savings is now

We can now write the proportion,

This implies that,

This simplifies to,

We cross multiply to get,

We expand to get,

We group like terms to get,

This simplifies to,

We divide through by -2, to get,

Dave's savings at first is,



Therefore Dave's savings at first was $300