Another complication is the question 'who is selling these bonds?' If the bonds are being sold by the US government, then our math is done and correct. This is because it is presumed that the US government will never fall and never default on their bonds. Is this actually true? History tells us that no government is forever, but right now it seems the US government is a pretty safe bet for the next couple of years. Also, if the US government falls, it's likely that the economy of the entire world will be wrecked, so it's not clear than anything other than cows, bushels of corn, and perhaps gold would have any value. So we don't worry about this case.
Suppose the bonds are being sold by the Philippine government. These bonds will have to pay a premium, as the bonds are going to be a little trickier to buy, a little trickier to sell if we decide not to keep them the entire two years, and there's a somewhat greater chance of the Philippine government falling or defaulting on these bonds. Much more importantly, with Philippine bonds you have a currency risk: if the peso falls in value while you are holding the bonds, you lose that money. Because of this, when US bonds are paying 3%, Philippine bonds are paying more like 5%.
Suppose the bond are being sold by General Motors. At the time of this writing, 8/05, GM has a serious problem with their retirement and health care obligations, and a lot of people are quite worried about GM's viability as a business. GM has to pay nearly 4% interest to sell these same bonds.
Corporate bonds have two major drawbacks: the interest they pay is fully taxible, and they are generally callable. Callable means if you buy a bond at a very good interest rate, later when rates go down the company will call the bonds and pay you back, cutting off your interest payments. If interest rates go up, you are stuck with a bond that's performing below average. Callable bonds are a heads-they-win tails-I-lose proposition.
There's a company, Standard and Poor's, that rates governments and companies to help people value their bonds. S&Ps highest rating is AAA, followed by AA, A, BBB, BB, etc. Bonds rated BBB and better are called "Investment Grade." Bonds rated BB, B, CCC, CC, and C are called "junk bonds." This doesn't mean your bonds are worthless. It just means you're going to have to pay an interest rate premium to sell your bonds. Bonds rated D and worse are in default, meaning the bonds are not being paid off.
Bond funds are like stock mutual funds. They have some people who manage the funds, and choose which bonds to buy, sell, or hold. The advantage of a bond fund is that the managers have a good research staff, so when you see Dallas Fort Worth Airport bonds available at a very good price, the bond fund managers know it's because if Delta Airlines goes bankrupt (likely) then the airport is in real trouble and could also go bankrupt.
The disadvantage of a bond fund is that you aren't guaranteed that you will get your money back. If you buy a five year bond and hold it for five years, you'll get the promised interest payments and then at the end you'll get your money back. With a bond fund, the share price in the fund goes up and down and so does your money.
Also, if you have specific needs for cash, you can taylor a bund fund to supply that cash. For example, if you have a child starting college in 4 years, you can have your money split evenly in four, five, six, and seven year bonds - just as the tuition comes due each year, your bonds pay off and you get a check in the mail. With a bond fund you assume the risk of the value of the fund at each of the four particular days when you need cash to write a check for tuition. If the fund is particularly low in value one year, you may need to redeem more than 25% of the total to pay the tuition.
Finally, someone has to pay all those managers. If you buy bonds from Treasury Direct, you pay nothing but the price of the bonds. If you use an on-line discount broker like Ameritrade, you'll pay a small fee like $25 for the total transaction. In the bond fund, the manager's salaries are paid from the profits from the bonds.
A popular way to invest in bonds is called laddering. Let's say you're in your 40s and investing for retirement. You could split your money into bonds that come due in 1, 2, 3, 4 and 5 years. Then each year as the bonds come due, you can reinvest that money in a new 5 year bond. In any given year, 20% of your total investment in bonds will be available to you for emergencies. If interest rates change, you also spread out the effects of the change. One year of very low interest rates will only effect 20% of your total investment.
Interestingly, studies have shown that the best bond performance is realized with a five year ladder. Shorter term bonds pay lower interest rates, and longer term 10 and 20 year bonds lock up your money for too long and make you miss many good deals. In a 30 year study, 20 year bonds averages 8%, while a 5 year bond ladder averaged 8.5%.