You would solve this with simultaneous equations, so if we write it as:
5n + 2p = 9
3n + 2p = 6
(subtract)
2n = 3
÷ 2
notebooks = 1.5
Now you would substitute it in:
(3 × 1.5) + 2p = 6
4.5 + 2p = 6
- 4.5
2p = 1.5
÷ 2
pens = 0.75
So your final answer is notebooks are $1.50 and pens are $0.75, I hope this helps!