Observed phenotypic variation in the lateral root branching density (LRBD) in maize (Zea mays) is large (1-41 cm(-1) major axis [i.e. brace, crown, seminal, and primary roots]), suggesting that LRBD has varying utility and tradeoffs in specific environments. Using the functional-structural plant model SimRoot, we simulated the three-dimensional development of maize root architectures with varying LRBD and quantified nitrate and phosphorus uptake, root competition, and whole-plant carbon balances in soils varying in the availability of these nutrients. Sparsely spaced (less than 7 branches cm(-1)), long laterals were optimal for nitrate acquisition, while densely spaced (more than 9 branches cm(-1)), short laterals were optimal for phosphorus acquisition. The nitrate results are mostly explained by the strong competition between lateral roots for nitrate, which causes increasing LRBD to decrease the uptake per unit root length, while the carbon budgets of the plant do not permit greater total root length (i.e. individual roots in the high-LRBD plants stay shorter). Competition and carbon limitations for growth play less of a role for phosphorus uptake, and consequently increasing LRBD results in greater root length and uptake. We conclude that the optimal LRBD depends on the relative availability of nitrate (a mobile soil resource) and phosphorus (an immobile soil resource) and is greater in environments with greater carbon fixation. The median LRBD reported in several field screens was 6 branches cm(-1), suggesting that most genotypes have an LRBD that balances the acquisition of both nutrients. LRBD merits additional investigation as a potential breeding target for greater nutrient acquisition. © 2014 American Society of Plant Biologists. All Rights Reserved.