The US national debt has exceeded $40 trillion for the first time in history, according to a US Treasury Department document.