Let the investment in first account be x and this account is earning 3% interest
So Interest on this account is 3% of x = 0.03x
So the investment in second account would be (7000-x) and this account is earning 7% interest
So the interest on this account is 7% of (7000-x) = 0.07*(7000-x)
Given that total interest for the year is $262
So we have
0.03x + 0.07(7000-x) = 262
0.03x - 0.07x + 0.07*7000 = 262
-0,04x + 490 = 262
-0.04x = 262-490
-0.04x = - 228
0.04x = 228x
x = 228/0.04
x = 5700
Therefore Investment in one account s 5700 and the investment in other account is 7000-5700 = 1300