The evolution of population dynamics in a stochastic environment is analysed under a general form of density-dependence with genetic variation in
r
and
K
, the intrinsic rate of increase and carrying capacity in the average environment, and in
σ
e
2
, the environmental variance of population growth rate. The continuous-time model assumes a large population size and a stationary distribution of environments with no autocorrelation. For a given population density,
N
, and genotype frequency,
p
, the expected selection gradient is always towards an increased population growth rate, and the expected fitness of a genotype is its Malthusian fitness in the average environment minus the covariance of its growth rate with that of the population. Long-term evolution maximizes the expected value of the density-dependence function, averaged over the stationary distribution of
N
. In the
θ
-logistic model, where density dependence of population growth is a function of
N
θ
, long-term evolution maximizes E[
N
θ
]=[1−
σ
e
2
/(2
r
)]
K
θ
. While
σ
e
2
is always selected to decrease,
r
and
K
are always selected to increase, implying a genetic trade-off among them. By contrast, given the other parameters,
θ
has an intermediate optimum between 1.781 and 2 corresponding to the limits of high or low stochasticity.