Constipated 9 week old

Just switched my son from infamil newborn formula to gentlease two days ago. He also had his 2 month vaccines two days ago. He seems to be constipated. His poop was almost solid yesterday, and he struggles to get it out. Oddly he also pooped 4 times yesterday. Any idea what might be causing the problem or any suggestions what I can do to give my poor baby some relief?