Coughing up mucus?

Me

My 5 week old just coughed up some mucus. He has deemed to be way more mucusy since right after the doctor switched him to nutramigen. Could the mucus really be due to that or is it for some other reason? He has seemed mucusy for a few days but I haven’t actually seen him cough up any until just now