Answer
Amount invested in the first account is 2000 and the amount invested in the second account is 5000.
Work Step by Step
Suppose $x$ denotes the amount invested in the first account and $y$ denotes the amount invested in the second account .
As per the statement we can understand that $x+y=7000$ and $0.06x+0.08y=520$
The first equation can be written as:
$0.06x+0.06y=420$
After solving the second equation and third equation, we have
$0.02y=100$
or, $y=5000$
Now, $5000+x=7000 \implies x=2000$
Thus, we find that the amount invested in the first account is 2000 and the amount invested in the second account is 5000.