  We propose a new optimal model of product goodwill in a segmented market
where the state variable is described by a partial differential equation of the
Lotka--Sharp--McKendrick type. In order to maximize the sum of discounted
profits over a finite time horizon, we control the advertising efforts which
influence the state equation and the boundary condition. Moreover, we introduce
the mathematical representation of consumer recommendations in a segmented
market. Based on the semigroup approach, we prove the existence and uniqueness
of optimal controls. Using a maximum principle, we construct a numerical
algorithm to find the optimal solution. Finally, we examine several simulations
on the optimal goodwill model and discover two types of advertising strategies.
