So let's say the amounts are "a" and "b", at 6% and 8% respectively.
how much is 6% of a? well (6/100) * a, or 0.06a.
how much is 8% of b? well (8/100) * b, or 0.08b.
so hmm whatever "a" and "b" amounts are, we know that their yield is $100, thus
0.06a + 0.08b = 100.
now, there's more money in "a" than in "b", 500 bucks more, so whatever "b" is, we know that
a = b + 500.
how much was deposited in the 6% one? well, a = b + 500.