Answer :
Let's define the next variables
x: amount of money invested in one account
y: amount of money invested in the other account
Milan had $10,000 to invest, then
x + y = 10000 (eq. 1)
The interest Milan gets after one year are: 0.06x and 0.09y. He received a total of $840 in interest, then
0.06x + 0.09y = 840 (eq. 2)
Isolating x from equation 1:
x = 10000 - y
Replacing this result into equation 2,
0.06(10000 - y) + 0.09y = 840
0.06(10000) - 0.06(y) + 0.09y = 840
600 + 0.03y = 840
0.03y = 840 -600
0.03y = 240
y = 240/0.03
y = 8000
Then,
x = 10000 - y
x = 10000 - 8000
x = 2000
He invested $2000 in the account that paid 6% simple interests per year and $8000 in the account that paid 9% simple interests per year