Explanation:
x = the total money she had first.
x - x×1/4 - (x - x×1/4)×1/2 = 15
you see, first we needed to deduct 1/4 of x from x. that left us with (x - x×1/4). and from that we need to deduct 1/2.
now, we can simplify :
(x - x×1/4) = (x×4/4 - x×1/4) = x×3/4
x×3/4 - x×3/4 × 1/2 = 15
x×3/4 - x×3/8 = 15
we multiply both sides by 8 (4 is a factor of 8, so this handled both fractions perfectly) :
x×3×2 - x×3 = 120
6x - 3x = 120
3x = 120
x = $40
she had $40 at the beginning.