Mary has a total of $5000 invested in two accounts. One account pays 5% and the other 8%. Her interest in the first year was $331. Write and solve a system of equations to find out how much she has invested in both accounts.

x = 5000-y

.05x + .08y = 331

Substitute 5000-y for x in second equation and solve for y. Insert that value into the first equation and solve for x. Check by inserting both values into the second equation.

Where can I find those interest rates?

Let's represent the amount invested in the 5% account as "x" and the amount invested in the 8% account as "y".

We can create a system of equations based on the given information:

Equation 1: The total amount invested is $5000:
x + y = 5000

Equation 2: The interest earned in the first year is $331:
0.05x + 0.08y = 331

To solve this system of equations, we can use the substitution or elimination method. Let's use the substitution method:

From Equation 1, we have:
x = 5000 - y

Plugging this value into Equation 2, we get:
0.05(5000 - y) + 0.08y = 331

Simplifying the equation:
250 - 0.05y + 0.08y = 331
0.03y = 331 - 250
0.03y = 81
y = 81 / 0.03
y = $2700

By substituting this value back into Equation 1, we can find x:
x = 5000 - y
x = 5000 - 2700
x = $2300

Therefore, Mary has $2300 invested in the 5% account and $2700 invested in the 8% account.