We study the welfare function of the deterministic and stochastic shallow lake problem. We show that the welfare function is the viscosity solution of the associated Bellman equation, we establish several properties including its asymptotic behaviour at infinity and we present a convergent monotone numerical scheme.