Let's say X is the amount you invest in stock, and B is the amount you invest in bonds.
How much income will your stocks generate in a year? They will generate X * 0.05
How much income will your bonds generate in a year? They will generate B * 0.08
And you need the sum of these two amounts to be greater than or equal to 20,000
So your equation is:
X*0.05 + B*0.08 >= 20,000
This is the correct answer, but just in case your teacher is looking for X in terms of B, just move the B term to the other side of the equation:
X*0.05 >= 20,000 - B*0.08
and divide both sides by 0.05:
X >= 400,000 - B*1.6