User:FiveK/Taxable account after-tax balance

Text goes here

Converting the summation into the closed form equation for the sum of a geometric series gives

$$Basis = P + \tfrac{P*d*(1-z)*((1 + r - d*z)^n - 1)}{(r - d*z)}$$

The amount available after withdrawal is EOY - w * (EOY - basis)

EOY = P*(1 + r - d*z)^n

Amount= (EOY-w*(EOY-Basis))

= P*((1 + r - d*z)n*(r - d*z -(r-d)*w) + (r-d)*w)/(r - d*z)

Divide by P and let e = r - d*z

Amt/P	= (((1 - (1+e)n)*r + d*(1+e)n - d)*w + e*(1+e)n)/e

Let g = r - d

= ((g - (1+e)n*g)*w + e*(1+e)n)/e

Let f = w*g/e

= (1+e)n*(1-f) + f

Amount after withdrawal = P * [(1+e)n*(1-f) + f]