We will have the following:
First, we recall that the simple interest formula is given by:
[tex]A=P(1+rt)[/tex]Now, for the accounts that are described in the problem we will have that:
[tex]\begin{gathered} A_1+2P=2P(1+(0.04)(1))\Rightarrow A_1+2P=2P(1.04) \\ \\ A_2+P=P(1+(0.12)(1))\Rightarrow A_2+P=P(1.12) \end{gathered}[/tex]Now, we have that:
[tex]A_1+A_2=8740[/tex]Then:
[tex]\begin{gathered} A_1+A_2+2P+P=2P(1.04)+P(1.12) \\ \\ \Rightarrow8740+3P=3.2P\Rightarrow8740=0.2P \\ \\ \Rightarrow P=43710 \end{gathered}[/tex]So, the amount invested at 4% interest is $87 420.
And, the amount invested at 12% interest is $43 710.