Let the principal of the investment be represnted below
[tex]p_1=20000-p_2[/tex]Therefore,
[tex]\begin{gathered} I=\frac{prt}{100} \\ for\text{ the first one } \\ I=\frac{(20000-p_2)\times7\times1}{100}=\frac{140000-7p_2}{100} \\ \end{gathered}[/tex][tex]\begin{gathered} \text{For the second one} \\ I=\frac{p_2\times10\times1}{100}=\frac{10p_2}{100}=\frac{p_2}{10} \end{gathered}[/tex]Therefore,
[tex]\begin{gathered} \frac{140000-7p_2}{100}+\frac{p_2}{10}=1580 \\ \frac{140000-7p_2+10p_2}{100}=1580 \\ 140000-7p_2+10p_2=158000 \\ 3p_2=158000-140000 \\ p_2=\frac{18000}{3} \\ p_2=6000 \end{gathered}[/tex][tex]\begin{gathered} P_1=20000-6000 \\ p_1=14000 \end{gathered}[/tex]He invested $14000 in the first account and $6000 in the second account.