us citizens – Leaving USA with other passport than used for entry

I am a dual citizen of Germany and USA and I will enter the USA soon with my US passport which is set to expire in 2 weeks. I plan on staying there for about 1 month before returning to my country of residence, the UK.

Will the expiry of my US passport cause any problems? Can I use the German one to leave the USA and enter the UK?