Mary invested one amount at 5% simple interest, and a second amount at 4% interest, earning $21.32 in one year. If she had switched the amounts, she would have earned $25.84. What were the two amounts?

$X @ 5%.

$Y @ 4%.

Eq1: 0.05x + 0.04y = 21.32
Eq2: 0.04x + 0.05y = 25.84.
Multiply Eq1 by 400 and Eq2 by -500:
Eq1: +20x + 16y = 8528.
Eq2: -20x - 25y = -12920.
Add the Eqs:
-9y = -4392
Y = $488

In Eq1, substitute 488 for Y:
0.05x + 0.04*488 = 21.32
0.05x + 19.52 = 21.32
0.05x = 21.32 - 19.52 = 1.8
X = 1.8 / 0.05 = $36.