So, let's create the equations
[tex]\begin{gathered} x+y=9 \\ 1x+1.5y=12 \end{gathered}[/tex]x are the pencils and y are the pens, which in total were 9
Then, we have to multiply the price of each by the amount x and y to have the total of 12 dollars