Let the initial savings at first be = x
Given ratio is [tex]\frac{5}{4}[/tex] and after donating $40 to charity, the ratio becomes [tex]\frac{13}{10}[/tex]
Hence, the relation becomes:
[tex]\frac{5x-40}{4x-40}=\frac{13}{10}[/tex]
[tex]10(5x-40)=13(4x-40)[/tex]
= [tex]50x-400=52x-520[/tex]
[tex]-2x=-120[/tex] or
[tex]2x=120[/tex]
[tex]x=60[/tex]
So , Dave's saving at first was 5x = 5*60 = $300
and Sam's saving at first was 4x = 4*60= $240