QMy husband and I save approximately $2,500 a month of our combined income. We both also contribute to 401(k)s that are matched by our employers. Aside from a mortgage and a $40,000 student loan, we have no debt and a healthy emergency savings account. My question is, should we be paying off this student loan as quickly as possible? Or should we be investing half of our monthly savings in an index fund or something else?

JENNIFER, APPLE VALLEY

QIt's wonderful that you're such good savers. The 18th-century British conservative Edmund Burke once wrote, "All government, indeed every human benefit and enjoyment, every virtue, and every prudent act, is founded on compromise and barter." Sad to say, compromise in government is a word that has fallen into disrepute in recent years.

However, the same shouldn't happen when it comes to finance. Most household finance questions are best understood initially as stark choices to make the trade-offs clear. But the answers should reflect the virtue and prudence of compromise.

What does that mean in your case? I'd put a hefty percentage of your monthly savings toward your student loan debt. But I'd also consider investing some of the money into a well diversified portfolio held in taxable accounts. Yes, you'll pay taxes on dividends, realized capital gains, and interest payments along the way with this taxable account. But the big advantage of creating a long-term savings portfolio in taxable accounts is flexibility. Specifically, if you pull money out of a 401(k) you'll pay a 10 percent penalty plus your ordinary income tax rate on the withdrawal. You could borrow from the plan, but that maneuver reduces the long-term return on retirement savings.

Yet with a taxable account you can tap the money at any time without penalty. You'll pay Uncle Sam a long-term capital gains tax rate when you cash it in -- assuming you've owned the investment for more than a year -- but it's still at a lower rate than ordinary income tax rates. Another benefit to investing in taxable accounts is tax diversification. For instance, in retirement it may be a tax smart move to leave tax-sheltered savings alone and tap into taxable accounts, and vice versa. The good news is that you will have the option of choosing the best course at that time.

Of course, a key question is how you would divide the savings. I'd play with the numbers. Perhaps it would make sense for you to put two-thirds toward student loans and one-third into long-term savings? Or 80 percent/20 percent or 50/50? Regardless of what you choose, you can't go wrong.

Chris Farrell is economics editor for American Public Media's "Marketplace Money." Send questions to cfarrell@mpr.org.