Need immediate help on this question. Any help is appreciated!

Cost formulas for objects A and B

A) 3A^2 + 100A+400

B) 6B^2+150B+600

A+B = 500

^2 means to square

What is the combination of A and B that would yield the lowest cost? I don't need the answer. Just the formula if there is one or the steps to take to get to the answer. Thanks a lot