Gọi a,b lần lượt là số mol của Mg, Fe (a,b > 0)
\(Mg\left(a\right)+2HCl\rightarrow MgCl_2\left(a\right)+H_2\left(a\right)\)
\(Fe\left(b\right)+2HCl\rightarrow FeCl_2\left(b\right)+H_2\left(b\right)\)
\(n_{H_2}=0,2\left(mol\right)\Rightarrow a+b=0,2\left(I\right)\)
\(m_{Cu}=6,4g\)
\(MgCl_2\left(a\right)+2NaOH\rightarrow Mg\left(OH\right)_2\left(a\right)+2NaCl\)
\(FeCl_2\left(b\right)+2NaOH\rightarrow Fe\left(OH\right)_2\left(b\right)+2NaCl\)
\(m_{Mg\left(OH\right)_2,Fe\left(OH\right)_2}=12\left(g\right)\)
\(\Rightarrow58a+90b=12\left(II\right)\)
Từ (I) và (II) \(\Rightarrow a=0,1875;b=0,0125\)
\(\Rightarrow m_{Mg}=4,5\left(g\right);m_{Fe}=0,7\left(g\right)\)
\(\Rightarrow\%m_{Cu}\approx55,17\%;\%m_{Fe}\approx6\%;\%m_{Mg}\approx38,83\%\).