You need to establish a system of equations to solve this problem.
The first one is
Where x and y are the values invested in the two different accounts
The second equation is:
Now, from equation (1) you need to clear y, as follows:
Now, replace y into equation (2):