  We study utility maximization problem for general utility functions using
dynamic programming approach. We consider an incomplete financial market model,
where the dynamics of asset prices are described by an $R^d$-valued continuous
semimartingale. Under some regularity assumptions we derive backward stochastic
partial differential equation (BSPDE) related directly to the primal problem
and show that the strategy is optimal if and only if the corresponding wealth
process satisfies a certain forward-SDE. As examples the cases of power,
exponential and logarithmic utilities are considered.
