Mathematical modeling of brain evolution is scarce, possibly due in part to the difficulty of describing how brain relates to fitness. Yet such modeling is needed to formalize verbal arguments and deepen our understanding of brain evolution. To address this issue, we combine elements of life history and metabolic theories to formulate a metabolically explicit mathematical model for brain life history evolution. We assume that some of the brain's energetic expense is due to production (learning) and maintenance (memory) of skills (or cognitive abilities, knowledge, information, etc.). We also assume that individuals use skills to extract energy from the environment, and can allocate this energy to grow and maintain the body, including brain and reproductive tissues. Our model can be used to ask what fraction of growth energy should be allocated to the growth of brain and other tissues at each age under various biological settings as a result of natural selection. We apply the model to find uninvadable allocation strategies under a ``me-against-nature'' setting, namely when overcoming environmentally determined energy-extraction challenges does not involve any interactions with other individuals (possibly except caregivers), and using parameter values for modern humans. The uninvadable strategies yield predictions for brain and body mass throughout ontogeny, as well as for the ages at maturity, adulthood, and brain growth arrest. We find that (1) a me-against-nature setting is enough to generate adult brain and body mass of ancient human scale, (2) large brains are favored by intermediately challenging environments, moderately effective skills, and metabolically expensive memory, and (3) adult skill number is proportional to brain mass when metabolic costs of memory saturate the brain metabolic rate allocated to skills. Overall, our model is a step towards a quantitative theory of brain life history evolution yielding testable quantitative predictions as ecological, demographic, and social factors vary.