  We consider a utility maximization problem for an investment-consumption
portfolio when the current utility depends also on the wealth process. Such
kind of problems arise, e.g., in portfolio optimization with random horizon or
with random trading times. To overcome the difficulties of the problem we use
the dual approach. We define a dual problem and treat it by means of dynamic
programming, showing that the viscosity solutions of the associated
Hamilton-Jacobi-Bellman equation belong to a suitable class of smooth
functions. This allows to define a smooth solution of the primal
Hamilton-Jacobi-Bellman equation, proving that this solution is indeed unique
in a suitable class and coincides with the value function of the primal
problem. Some financial applications of the results are provided.
