  In this paper we formulate and solve an optimal problem for Stochastic
process with a regime absorbing state. The solution for this problem is
obtained through a system of partial differential equations. The method is
applied to obtain an explicit solution for the Merton portfolio problem when an
asset has a default probability in case of a log utility.
