$\text{NPV} = (\\\$100,000 - \\\$22,958 - \\\$90,278) / 1.09 + (\\\$100,000 - \\\$12,331 - \\\$94,896) / 1.09^2 + (\\\$100,000 - \\\$3,008 - \\\$99,752)/ 1.09^3 + (\\\$100,000 - \\\$13,476 - \\\$$104,854)/ 1.09^4 + (\$100,000 - \$8,372 - \$110,220)/ 1.09^5 + \$1,000,000/ 1.09^5 - \$500,000
NPV = \$649,931\$104505.3926
Of course, most debt instruments don't work this way. For example, the 30-Year Treasury doesn't pay you your principal bank in chunks. It holds your money for the full 30 years and each year pays out interest. So, capital budgeting basically says, will I generate enough excess cash from operations to pay for debt and to cover my opportunity cost of capital employed. To do that, capital budgeting uses the weighted average cost of capital, which in our case is (1.09 + 1.05) / 2 = 1.07. So, I need to return at least 7% on my \$1m to make this project worth it, or $70,000 dollars. So, the calculation of cash flows now becomes: 100000 / 1.07 + ... +100000 / 1.07^5 + 1000000 / 1.07^5 - 5000001000000 = 623,005123005.92. So as you can see this gets prettyreasonably close to the above NPV calculated for debt and equity. The difference stems from the fact that in the above example we're paying the debt off as we go, and in the second we're assuming that the debt is paid off at the end of the five years.