Abstract. We formulate a computationally tractable extension of the classical Merton optimal consumptioninvestment problem to include the capital gains taxes. This is the continuous-time version of the model introduced by Dammon, Spatt, and Zhang [Rev. Financ. Stud., 14 (2001), pp. 583-616]. In this model the tax basis is computed as the average cost of the stocks in the investor's portfolio. This average rule introduces only one additional state variable, namely the tax basis. Since the other tax rules such as the first in first out rule require the knowledge of all past transactions, the average model is computationally much easier. We emphasize the linear taxation rule, which allows for tax credits when capital gains losses are experienced. In this context wash sales are optimal, and we prove it rigorously. Our main contributions are a first order explicit approximation of the value function of the problem and a unique characterization by means of the corresponding dynamic programming equation. The latter characterization builds on technical results isolated in the accompanying paper [I. Ben Tahar, H. M. Soner, and N. Touzi, SIAM J. Control Optim., 46 (2007), pp. 1779-1801. We also suggest a numerical computation technique based on a combination of finite differences and the Howard iteration algorithm. Finally, we provide some numerical results on the welfare consequences of taxes and the quality of the first order approximation.