The algebra for the taxable comparison will need a little work. I've been thinking about doing that...maybe this will provide incentive to do so.

Not as bad as I feared. The Roth vs. Taxable comparison doesn't change because the "ordinary marginal tax bracket at withdrawal" is irrelevant for both Roth and Taxable.

Ok, here goes. To complicate things, assume unequal tax brackets at contribution and withdrawal.

a = ordinary tax rate at contribution time, fraction. E.g., 0.25

b = expense ratio difference, fraction. E.g., 0.007

e = ordinary tax rate at withdrawal time, fraction. E.g., 0.15

i = taxable investment return, fraction. E.g., 0.05

n = number of years

P = Principal available for investment

w = tax rate on long term capital gains, fraction. E.g., 0.15

y = fraction of investment return subject to annual tax. E.g., 0.5 (1/2 from dividends, 1/2 from appreciation)

z = tax rate on annual investment returns, fraction. E.g., 0.15

In the discussion below, references to "Roth" or "Traditional" (unless followed immediately by "IRA") refer to a 401k-like account with expense ratios higher than available on the open market.

The equation for tax-advantaged accounts is straightforward because there are only ordinary taxes and those happen only once, either at contribution or withdrawal.

Roth: (1-a) * P * (1+i-b)^n

Traditional: P * (1+i-b)^n * (1-e)

**Roth vs. Traditional**The P * (1+i-b)^n terms can be eliminated from both equations above so we get Roth - Traditional = (1-a) - (1-e) = e-a. In other words, when the withdrawal tax rate is higher, choose Roth; when the contribution tax rate is higher, choose Traditional. When they are equal, choose either (but see

http://www.bogleheads.org/forum/viewtopic.php?f=10&t=140758 for another layer of complexity).

Taxable is messier because taxes occur at contribution, during investment growth, and at withdrawal.

Taken in pieces:

Amount contributed = (1-a) * P

After 1 year, before tax = (1-a) * P * (1 + i)

Tax on the first year = (1-a)*P* i*y*z

After 1 year, after tax = (1-a)*P * (1 + i*(1-y*z))

After n years, before withdrawal = (1-a)*P * (1 + i*(1-y*z))^n

Taxable amount to withdraw = (1-a)*P * (1 + i*(1-y*z))^n - (1-a)*P

Tax on above amount = w * ((1-a)*P * (1 + i*(1-y*z))^n - (1-a)*P)

Taxable amount after withdrawal after tax = (1-a) * P * (1 + i*(1-y*z))^n - w * ((1-a) * P * (1 + i*(1-y*z))^n - (1-a)*P)

**Roth vs. Taxable**The (1-a)*P term cancels from both the Roth and taxable equations, leaving

Roth - Taxable = (1+i-b)^n - (1-w) * (1+i*(1-y*z))^n - w

If the equation above is positive, Roth is better.

If the equation above is negative, Taxable is better.

Assume i = 0.05, w = 0.15, y = 0.5, z = 0.15 and look at the resulting equation as a function of b and n:

(1.05 - b)^n - 0.85 * 1.04625^n - .15

The curvature of this equation as a function of n depends on the value of b.

If b<=0.375% (=i*y*z), it starts positive and stays positive. In other words, if the Roth expense ratio is 0.375% or less above the taxable, Roth is always better.

If n=1, we get 0.0106875 - b. In other words, if the Roth expense ratio is more than 1.06875% above the taxable, taxable is always better (for >1 year).

If b = 0.7%, the Roth is better for 45 years (see plot in previous post), after which taxable would be better. But if you retire in <45 years, you could roll the Roth over to a Roth IRA and get a low expense ratio.

**Traditional vs. taxable**The P term cancels from both the Traditional and taxable equations, leaving

Traditional - Taxable = (1-e)/(1-a)*(1+i-b)^n - (1-w) * (1+i*(1-y*z))^n - w

If the equation above is positive, Traditional is better.

If the equation above is negative, Taxable is better.

Assume i = 0.05, a = 0.25, e = 0.15, w = 0.15, y = 0.5, z = 0.15 and look at the resulting equation as a function of b and n:

0.85/0.75*(1.05 - b)^n - 0.85 * 1.04625^n - .15

The curvature of this equation as a function of n depends on the value of b.

If b<=0.375% (=i*y*z), it starts positive and stays positive. In other words, if the Traditional expense ratio is 0.375% or less above the taxable, Traditional is always better.

If n=1, we get 0.1506875 - 85/75*b. In other words, the Traditional expense ratio has to be more than 13.3% above the taxable for taxable to be better always (for >1 year).

If b = 1.22%, the Traditional is better for 30 years (see plot below), after which taxable would be better. But if you retire in <30 years, you could roll the Traditional over to a tIRA and get a low expense ratio.

And all this is based on all the assumptions listed. As the saying goes, YMMV. But you could take these formulas, put them in Excel, and enter the values specific to your situation.