We solve an agent's optimization problem of meeting demands for cash over time with cash deposited in bank or invested in stock. The stock pays dividends and uncertain capital gains, and a commission is incurred in buying and selling of stock. We use a stochastic maximum principle to obtain...