We present a mathematical simplification for the evolutionary dynamics of a heritable trait within a two-sex population. This trait is assumed to control the timing of sex-specific life-history events, such as the age of sexual maturity and end of female fertility, and each sex has a distinct fitness trade-off associated with the trait. We provide a formula for the fitness landscape of the population and show a natural extension of the result to an arbitrary number of heritable traits. Our method can be viewed as a dynamical systems generalisation of the Price equation to include two sexes, age structure and multiple traits. We use this formula to examine the effect of grandmothering, whereby post-fertile females subsidise their daughter's fertility by provisioning grandchildren. Grandmothering can drive a shift towards increasingly male-biased mating sex ratios due to a post-fertile life stage in females, while male fertility continues to older ages. Our fitness landscapes show a net increase in fitness for both males and females at longer lifespans, and as a result, we find that grandmothering alone provides an evolutionary trajectory to higher longevities.