John has $6000 to invest. He invests part of it at 5% and the rest at 8%. How much should be invested at each rate to yield 6% on the total amount?

there are several similar problems in the related questions below.