The Geometry of Nutrient Space–Based Life-History Trade-Offs: Sex-Specific Effects of Macronutrient Intake on the Trade-Off between Encapsulation Ability and Reproductive Effort in Decorated Crickets

Life-history theory assumes that traits compete for limited resources, resulting in trade-offs. The most commonly manipulated resource in empirical studies is the quantity or quality of diet. Recent studies using the geometric framework for nutrition, however, suggest that trade-offs are often regulated by the intake of specific nutrients, but a formal approach to identify and quantify the strength of such trade-offs is lacking. We posit that trade-offs occur whenever life-history traits are maximized in different regions of nutrient space, as evidenced by nonoverlapping 95% confidence regions of the global maximum for each trait and large angles (θ) between linear nutritional vectors and Euclidean distances (d) between global maxima. We then examined the effects of protein and carbohydrate intake on the trade-off between reproduction and aspects of immune function in male and female Gryllodes sigillatus. Female encapsulation ability and egg production increased with the intake of both nutrients, whereas male encapsulation ability increased with protein intake but calling effort increased with carbohydrate intake. The trade-offs between traits was therefore larger in males than in females, as demonstrated by significant negative correlations between the traits in males, nonoverlapping 95% confidence regions, and larger estimates of θ and d. Under dietary choice, the sexes had similar regulated intakes, but neither optimally regulated nutrient intake for maximal trait expression. We highlight the fact that greater consideration of specific nutrient intake is needed when examining nutrient space–based trade-offs.


Introduction
Life-history traits are often negatively correlated with each other (Reznick 1985;Stearns 1992;Roff 2002). These negative correlations, referred to as life-history trade-offs, form the cornerstone of life-history theory and are central to predicting the optimal life history of an organism in a given environment (Stearns 1992;Reznick et al. 2000;Roff 2002;Roff and Fairbairn 2007). Phenotypic trade-offs exist because different life-history traits compete for a finite pool of resources, so that the allocation of resources to one trait necessarily means that there are fewer resources available to allocate to other traits (Stearns 1992;Roff 2002). In this way, trade-offs have the potential to constrain the evolution of life-history strategies, as both traits involved in the trade-off cannot be simultaneously maximized (Roff and Fairbairn 2007).
While trade-offs between life-history traits appear taxonomically widespread, positive phenotypic correlations are also commonly found in both laboratory and natural populations (Stearns 1992;Reznick et al. 2000;Roff 2002). One of the most prominent models explaining this variation in the sign of phenotypic correlations between lifehistory traits is the acquisition-allocation model (more commonly known as the Y-model) of Van Noordwijk and de Jong (1986). This model (and subsequent extensions) posits that the sign of the covariance between life-history traits depends critically on the relative variances in the acquisition and allo-cation of resources (Van Noordwijk and de Jong 1986;Roff and Fairbairn 2007). More specifically, if the sum of the variances in resource allocation to the two life-history traits (j 2 x1 1 j 2 x2 ) exceeds the variance in resource acquisition (j 2 T ), then a negative covariance between life-history traits will occur, whereas if j 2 T 1 (j 2 x1 1 j 2 x2 ), then a positive covariance will occur (Roff and Fairbairn 2007). In other words, if variation in resource acquisition is much larger than variation in resource allocation, trade-offs may be obscured. Despite the elegance of this theoretical prediction, direct empirical tests have proven challenging, due in part to the difficulties associated with quantifying resource acquisition (Stearns 1992;Roff 2002;Roff and Fairbairn 2007). Although a number of different measures have been used as proxies for resource acquisition, including body size at a given age (e.g., Dudycha and Lynch 2005) and lipid stores (e.g., Chippindale et al. 1998), a more powerful approach to examine trade-offs in life-history studies is to experimentally alter resource acquisition ability through dietary manipulation (Reznick 1985;Reznick et al. 2000;Roff and Fairbairn 2007). Indeed, empirical studies on a range of animal taxa have shown that manipulating the quantity and/or quality of the available diet can have a profound effect on the trade-off between different life-history traits (e.g., invertebrates [Hunt et al. 2004], fish [Kolluru and Grether 2005], amphibians [Lardner and Loman 2003], reptiles [Brown and Shine 2002], birds [Karell et al. 2007], and mammals [Hill and Kaplan 1999]).
Reproduction and immune function are major determinants of fitness and are therefore central to the life history of most organisms (Reznick 1985;Stearns 1992;Roff 2002). Both processes are energetically demanding and have been shown to trade off in a range of animal taxa (e.g., invertebrates [Schwenke et al. 2016], fish [Kalbe et al. 2009], amphibians [McCallum and Trauth 2007], reptiles [French et al. 2007], birds [Nordling et al. 1998], and mammals [Mills et al. 2009]). This energetic requirement of reproduction and immune function suggests that the competitive allocation of limiting resources is likely to be the basis for the trade-off between these traits (Zera and Harshman 2001). Indeed, numerous studies have shown that this trade-off is facultative, being less pronounced or absent when individuals have ad lib. access to food (e.g., French et al. 2007) or occurring only during energetically taxing reproductive periods (e.g., Adamo et al. 2001). However, the trade-off between reproduction and immune function may also be obligate, whereby physiological changes that occur during reproduction directly impact immune function or vice versa (e.g., Schuurs and Verheul 1990;Sadd and Siva-Jothy 2006). In such cases, the trade-off between reproduction and immune function should be independent of resource acquisition. To evaluate whether the trade-off between reproduction and immune function is facultative or obligate, therefore, requires having some insight into which resource limits investment in these traits and how that resource(s) is allocated (Zera and Harshman 2001;Schwenke et al. 2016).
It is likely that the sexes will adopt very different strategies when allocating resources to immune function and reproduction. This is because in most sexually reproducing species, males and females possess different optimal reproductive strategies that promote the evolution of sex differences in the trade-off between reproduction and immune function (Rolff 2002;Zuk and Stoehr 2002;Zuk 2009). Females typically invest heavily in reproduction, producing nutrient-rich eggs and providing more parental care, so that their reproductive success is limited by the number of offspring that can be produced and reared (Bateman 1948;Trivers 1972). As females can produce more offspring by living longer, they are expected to invest less in current reproduction and more in immune function (Rolff 2002;Zuk and Stoehr 2002;Zuk 2009). In contrast, males typically invest less in reproduction than females, and their reproductive success is limited by the number of mates they can fertilize (Bateman 1948;Trivers 1972), which is expected to favor a "live hard, die young" strategy characterized by investing heavily in current reproduction at the expense of immune function and life span (Rolff 2002;Zuk and Stoehr 2002;Zuk 2009). This divergence in reproductive strategies is predicted to result in males having a weaker immune system than females and exhibiting a stronger trade-off between reproduction and immune function (Rolff 2002;Zuk and Stoehr 2002;Zuk 2009). Mathematical models, however, have shown that this general pattern may not necessarily be favored under all conditions (Medley 2002;Stoehr and Kokko 2006;Restif and Amos 2010). For example, the above argument assumes that life span is more important to female than male fitness and that the primary benefit of an enhanced immune system is increased life span, but if these assumptions are relaxed, it is theoretically possible for this pattern to be reversed in the sexes (Stoehr and Kokko 2006). Empirical studies largely agree with the variability of outcomes highlighted by theoretical models. In birds and mammals, males typically have a reduced immune response relative to females (Poulin 1996;Zuk and McKean 1996;Moore and Wilson 2002), but this pattern is far from clear in arthropods (Sheridan et al. 2000). Far fewer studies have directly compared the tradeoff between immunity and reproduction in the sexes, and those that exist show a mixture of results, with the trade-off being stronger in males than in females in some species (e.g., McNamara et al. 2013) but the reverse pattern (e.g., Moreno et al. 2001; Barthel et al. 2015) or no sex difference (e.g., Fedorka et al. 2004) being observed in others. Clearly, more detailed empirical work is needed that directly compares how the sexes allocate resources to reproduction and immune function (Zuk 2009).
A limitation of most life-history studies using diet to manipulate resource acquisition is that typically only a few diets of poorly defined nutritional composition (e.g., "good" vs. "bad" diets) are used, and diet consumption is rarely measured (e.g., Hunt et al. 2004). This approach makes it difficult (if not impossible) to statistically partition the effects of specific nutrients from energy or to examine how nutrients interact to affect life-history traits. Furthermore, not measuring dietary intake ignores any effects of compensatory feeding. Compensatory feeding, the ability of an individual to increase consumption to compensate for reduced food quality (Simpson and Raubenheimer 2012), appears widespread in animals (Behmer 2009), which means that it is possible for individuals on poorer-quality diets to consume as much energy or nutrients as individuals on a high-quality diet. Compensatory feeding, therefore, has the potential to undermine the use of diet to manipulate resource acquisition in life-history studies. These limitations, however, can be resolved by measuring the precise intake of chemically defined (holidic) diets within the geometric framework for nutrition (Simpson and Raubenheimer 2012).
The geometric framework for nutrition is a state-space modeling approach that examines how an individual solves the problem of balancing the need for multiple nutrients in a complex, multidimensional nutritional environment (Simpson and Raubenheimer 2012). To determine the intake of nutrients that is optimal for a given life-history trait, individuals are constrained to feed on a range of diets of precise nutritional composition. These diets are typically arranged in a geometric array ( fig. 1A), being positioned along discrete nutritional rails where the ratio of nutrients is fixed (solid lines in fig. 1A) and on isocaloric lines across different nutritional rails where the nutrient ratio differs but the total nutritional (i.e., caloric) content of the diets is the same (dashed lines in fig. 1A). Consequently, diets differ in both the ratio of nutrients and overall nutritional content. Individuals are allowed to feed for a given period of time, and the consumption of diets (and therefore nutrients) is precisely measured. As individuals are constrained to a single diet in this array, they can feed only along the length of a given nutritional rail ( fig. 1B). Life-history traits can then be measured, mapped as a third axis on top of the two-dimensional nutrient intake data, and response surface methodologies (Lande and Arnold 1983;Box and Draper 1987) can be used to determine the linear and nonlinear effects of nutrient intake on the measured life-history traits (see South et al. 2011). Lifehistory optima can be formally demonstrated by the presence of significant negative quadratic terms in this analysis, and nonparametric thin-plate splines (Green and Silverman 1994) can be used to help visualize these optima by constructing nutritional landscapes ( fig. 1C). A separate set of individuals can then be provided with a choice of diets to determine how they actively regulate their intake of nutrients (Simpson and Raubenheimer 2012). Alternate diets are typically provided in pairs differing in both the nutrient ratio and overall energy content: in the example provided (red circles in fig. 1A), diets vary in nutrient ratio (i.e., 1∶8 or 8∶1) and total energetic content (i.e., 40% or 80%), and diet pairs can be created by matching diets across nutritional rails and caloric content (e.g., diets 1 vs. 3, 1 vs. 4, 2 vs. 3, and 2 vs. 4). The consumption of each diet in these pairs is again precisely measured over a given time period to determine the regulated intake point, defined as the point in nutrient space that individuals actively defend when given choice (Simpson and Raubenheimer 2012) and calculated as the average intake of nutrients across diet pairs. The regulated intake point can then be mapped onto the nutritional landscape (white cross in fig. 1C) to determine whether individuals are regulating their intake of nutrients to optimize certain life-history traits. If the regulated intake point coincides with the nutritional optima for a given life-history trait, it is taken as evidence for optimal nutrient regulation (Simpson and Raubenheimer 2012).
It has been argued that the above framework can also provide insight into the existence and the potential regulation of trade-offs between different life-history traits. That is, when the optimal expression of two life-history traits measured on the same individuals occurs in different regions of the nutritional landscape, a nutrient-space trade-off will exist because both traits cannot be optimized at the same intake of nutrients (Lee et al. 2008a;Maklakov et al. 2008;Cotter et al. 2011;Bunning et al. 2015Bunning et al. , 2016Jensen et al. 2015). It is important to note, however, that two life-history traits being optimized in the same region of the nutritional landscape does not preclude a trade-off existing due to other physiological constraints than nutrition. By estimating and comparing the regulated intake point to the nutritional optima for two traits, it is possible to determine not only whether nutrient regulation is optimal for either trait but also whether individuals prioritize one trait over the other through dietary choice (Bunning et al. 2015(Bunning et al. , 2016. The problem with these approaches, however, is that they are currently based on the visual inspection of the nutritional landscapes, which has the potential to make any outcomes highly subjective. This is because the nonparametric thinplate splines used to create nutritional landscapes are obtained from flexible interpolating functions that are subject to sampling error, which can create large uncertainty over the actual location of any nutritional optima for the two traits. Consequently, quantifying the existence and magnitude of trade-offs, as well as the implications of nutrient regulation under dietary choice, requires formally locating the nutritional optima for each life-history trait and quantifying any divergence that exists when this error is taken into consideration. A robust analytical approach to achieve this, however, is currently lacking. The decorated cricket (Gryllodes sigillatus) provides an excellent model to examine the nutritional basis of the trade-off between reproduction and immune function in the sexes. Unlike most insect species, male and female reproductive effort can be easily measured in G. sigillatus. Female reproductive effort can be measured as the number of eggs produced in a given time period (Archer et al. 2012a(Archer et al. , 2012b, whereas male reproductive effort can be measured as the time spent calling each night to attract a mate (Hunt et al. 2004;Archer et al. 2012aArcher et al. , 2012b. Producing a call is metabolically costly (Kavanagh 1987), and the number of females attracted increases with the amount of time spent calling in male G. sigillatus (Sakaluk 1987), as well as in a range of other cricket species (e.g., Bentsen et al. 2006;Jacot et al. 2008). Diet has sex-specific effects on age-dependent reproductive effort in G. sigillatus (Houslay et al. 2015). Females consuming a poor-quality diet produce fewer eggs and invest in egg production later in life compared to those consuming a high-quality diet, whereas male calling effort increased with age irrespective of diet quality (Houslay et al. 2015). Immune function is sexually dimorphic in G. sigillatus, with females having higher phenyloxidase activity and a greater encapsulation ability than males (Gershman et al. 2010a;Galicia et al. 2014). The reverse pattern, however, appears true for lytic activity (Galicia et al. 2014; but see Gershman et al. 2010a). Although the effect of nutrient intake on immune function has not been thoroughly investigated in G. sigillatus, diet quality (the relative percentage of rabbit food and bran) does not appear to alter phenyloxidase or lytic activity in the sexes (Galicia et al. 2014). We currently do not know, however, whether immune function is traded against calling effort in males or egg production in females or what role (if any) nutrition plays in mediating this trade-off.
In this study, we start by providing an analytical approach to formally document the existence and quantify the strength of life-history trade-offs when using the geometric framework for nutrition. Following convention, we view a life-history trade-off as a negative covariance between the two traits (Stearns 1992). However, because we are focusing on how this covariance is influenced by the intake of specific nutrients, we use the term nutrient space-based trade-offs. We then empirically test the utility of this approach by conducting two experiments to determine the effect of protein (P) and carbohydrate (C) intake on the nutrient space-based trade-off between reproduction and aspects of immune function in male and female G. sigillatus. In our first experiment, we restrict individual male and female crickets to one of 24 holidic diets differing in P∶C ratio and total nutritional content. This created a nutritional landscape with six nutritional rails along which male and female crickets could vary their intake of P and C by eating more or less of a given diet (table A1; fig. A1; tables A1, B1 and figs. A1, B1, B2 are available online). We measured the intake of nutrients during sexual maturation and examined how this influenced reproductive effort (calling effort in males and egg production in females) and several aspects of immune function (inactive and activated phenyl-oxidase activity and encapsulation ability) in the sexes and the extent to which these traits are subject to a nutrient space-based trade-off. In our second experiment, we examined how the sexes regulate their intake of P and C when given dietary choice. Males and females were given the choice between diets that differed in both the P∶C ratio and total nutritional content in four diet pairings (table A1; fig. A1). The total intake of P and C was again measured for crickets in each diet pairing during sexual maturation and the regulated intake point calculated for each sex and mapped onto their nutritional landscapes for reproduction and measures of immune function (from experiment 1) to determine whether nutrient regulation is optimal for these life-history traits.

Analytical Approach for Quantifying Nutrient
Space-Based Trade-Offs We propose that a nutrient space-based life-history tradeoff will occur whenever the optimal expression of two lifehistory traits measured on the same individuals occur in different regions of the nutritional landscape and that this will result in a negative covariance between the two lifehistory traits being examined. This does not mean, however, that a trade-off due to physiological constraints other than nutrition cannot exist when two life-history traits are optimized in the same region of the nutritional landscape. We argue that three steps are essential to provide a robust analytical approach for quantifying the strength of such trade-offs when using the geometric framework for nutrition. First, the linear and nonlinear effects of nutrient intake on life-history traits need to be estimated in a standardized way. While response surface methodologies offer a simple way to estimate these effects, any resulting parameters will be comparable only across different life-history traits, the sexes, or different species, if nutrient intake and life-history traits are provided in the same scale. This is because nutrient intake often differs markedly across the sexes and species, and life-history traits are frequently measured on different scales (e.g., days, growth rate, and size). While many different approaches exist to standardize biological data, we advocate standardizing nutrient intake and life-history traits to a z-score (z) by subtracting the population mean (m) from each data point (x i ) and dividing by the standard deviation (j) of the population (z p x i 2 m=j).
The z-scores are therefore provided in units of standard deviations above (positive scores) and below (negative scores) the population mean and have the useful property of altering the scale but not the underlying distribution of the traits being standardized. Second, when nutritional optima are formally detected for different life-history traits, it is necessary to locate the position of the global maximum for each trait in nutrient space Percentage nutrient B Figure 1: A hypothetical example demonstrating a typical protocol within the geometric framework for nutrition to study nutrient effects on life span. A, The geometric distribution of diets presented in nutrient space. This particular geometric distribution consists of nine different nutritional rails, each with a different fixed ratio of nutrient A to nutrient B (from left to right: 1∶8, 1∶5, 1∶3, 1∶2, 1∶1, 2∶1, 3∶1, 5∶1, and 8∶1). There are four different diets (black dots) located along each nutritional rail that have the same nutrient ratio but increase in total nutrition (i.e., energy or caloric content) as they move away from the origin. Across different nutritional rails, the four diets are arranged and also to estimate the 95% confidence region (CR) for this maximum. Locating the position of the global maximum is essential for determining the exact intake of nutrients that maximizes the expression of a life-history trait. As both the intake of nutrients and life-history traits are measured with error, the 95% CR is needed to determine how this uncertainty influences the position of the global maximum. Furthermore, it allows a direct test of whether individuals regulate their intake of nutrients optimally to maximize the trait under dietary choice: the regulated intake of nutrients can be considered optimal if this point resides within the 95% CR for the global maximum. Second-order (quadratic) parametric models are typically used to locate the global maximum on a response surface and to estimate the 95% CR of this point (Box and Draper 1987;Peterson et al. 2002). This approach assumes, however, that the data are normally distributed and that the global maximum is best located by a second-order quadratic approximation (Peterson et al. 2002). These assumptions are often not tenable for many nutritional and life-history data sets but can be overcome by using nonparametric bootstrap methods that are not reliant on a normal distribution and incorporate a flexible regression spline model. We develop a new R package (OptimaRegion; del Castillo et al. 2016) to perform this analysis with nutritional data (see below).
Finally, the nutritional landscapes for different lifehistory traits must be formally compared and the magnitude of any differences accurately quantified. A sequential model-building approach (Draper and John 1988) offers a well-established protocol for comparing the linear, quadratic, and correlational regression coefficients for different response surfaces (Draper and John 1988), and this approach has already been used extensively to formally compare nutritional landscapes for different life-history traits within (South et al. 2011;Bunning et al. 2015;House et al. 2015;Rapkin et al. 2016) and across (Bunning et al. 2016;Rapkin et al. 2016) the sexes. A limitation of this approach, however, is that only the sign and magnitude of the regression coefficients are compared. Thus, it is possible that the two life-history traits being compared show different linear and/or nonlinear regression coefficients but that the global maxima actually occupy the same region in nutrient space. The simplest way to formally demonstrate that the global maxima for two life-history traits occupy different regions in nutrient space is to visually compare the 95% CRs for the global maxima. If the 95% CRs are nonoverlapping, this provides clear evidence that the global maxima are located in different regions. It is important to note, however, that the reverse scenario is not always true: overlapping 95% CRs does not necessarily mean that there is no difference in the location of the two global maxima. In such instances, it is particularly important to quantify the exact magnitude of any divergence in the location of the global maxima, and we propose two additional measures based on geometric principles to characterize this in simple metric form. First, the divergence between the global maxima in nutrient space can be measured as the angle (v) between the linear nutritional vectors as where a is the linear effects of nutrient intake on the first lifehistory trait being compared, b is the linear effects of these nutrients for the second life-history trait, kak p ffiffiffiffiffiffiffiffi ffi a ⋅ a p , and kbk p ffiffiffiffiffiffiffiffi ffi b ⋅ b p . Larger values of v indicate a greater separation of the optima in nutrient space and therefore a larger trade-off between life-history traits ( fig. 2A, 2B), whereas as so that they are connected by isocaloric lines (dashed lines). These isocaloric lines connect diets that have different A∶B ratios but the same total nutritional content (which represents the percentage of nutrient A and B in the diet). This hypothetical nutrient space therefore consists of 36 unique diets that differ in both the A∶B ratio and total nutrition. B, The distribution of actual feeding data (small black dots) recorded from animals restricted to each of the 36 unique diets. The consumption of diet by each animal is precisely measured over a defined feeding period, and because the nutritional composition of the diets is known, this consumption of diet can be easily converted to an intake of nutrient A and B. As each animal is restricted to a single diet, they can feed only along the length of the nutritional rail by eating more or less of the diet (thereby ingesting more or less nutrients and energy). C, An example of a nutritional landscape for life span. For each animal where the intake of nutrient A and B has been measured, the researcher also measures life span. This enables life span to be superimposed on the nutrient intake data, and the linear and nonlinear effects of nutrient intake on life span can be quantified statistically using response surface methodologies. The relationship between nutrient intake and life span can also be visualized using thin-plate splines to plot the nutritional landscape in contour view. In the hypothetical example provided, the nutritional landscape is provided in contour view, where regions in red represent increased life span and regions in blue represent reduced life span. The peak in life span appears to be centered at 50 mg of nutrient A and 125 mg of nutrient B, which represents an A∶B ratio of 1∶2.5. To test whether animals regulate their intake of nutrients optimally for maximal life span, a researcher can present animals with alternate pairs of diets differing in the ratio of A to B and total nutrition. A typical dietary choice design might pair diets 1 and 3 (diet pair 1), 1 and 4 (diet pair 2), 2 and 4 (diet pair 3), and 2 and 3 (diet pair 4; red dots in A) and measure the consumption of both diets and the subsequent total intake of A and B over a predefined time period. The average intake of nutrient A and B across these diet pairs is referred to as the regulated intake point (RIP) and represents the point in nutrient space that individuals actively defend when given dietary choice. The RIP (white cross in C) can be mapped onto the nutritional landscape and its proximity to the peak used to determine whether dietary choice is optimal for life span or any other measured trait.
v approaches 07, the optima become more aligned in nutrient space, indicative of a weaker trade-off between lifehistory traits. We have already applied this approach to nutritional data (Bunning et al. 2015(Bunning et al. , 2016Rapkin et al. 2016). Second, the divergence between the global maxima in twodimensional nutrient space can be measured as the Euclidean distance (d) between the global maxima for each nutritional landscape as where x 1 ,y 1 and x 2 ,y 2 are the two nutrient coordinates for the global maxima of the first and second life-history traits being compared, respectively. When the nutritional optima for the two life-history traits are located on similar isocaloric lines, measures of v and d will be closely related: a larger v will be associated with a longer d ( fig. 2A-2C). However, when the nutritional optima are on different isocaloric lines, v may underestimate the true degree of divergence between optima, and d will provide a better metric of this difference ( fig. 2D). We provide analytical solutions in appendix B (apps. A-D are available online) showing that an increase in v and d results in a stronger negative covariance between the two life-history traits being examined.
To provide measures of v and d that are comparable across studies, we propose that these parameters be expressed as a percentage of their maximum value. As v measures the divergence between linear nutritional vectors, the maximum separation is always 1807. In the case of d, the maximum value will depend on the range of nutrient rails included in the geometric design of diets and how much individuals feed along these rails. Thus, the maximum d will vary between experiments, Figure 2: A hypothetical example illustrating how to quantify differences in the strength of nutritionally regulated trade-offs between two life-history traits. In each panel, the nutritional landscape of two competing life-history traits is provided in contour view, where the darker shading represents an increased expression of the trait and light shading represents a decreased expression of the trait. The dashed black lines in each panel are the A∶B nutritional rail that passes through the nutritional optimum for each trait. The pair of curved, solid black lines that connect the nutritional rails passing through the optima represents the angle (v) between these rails, and the red dashed line represents the Euclidean distance (d) between the global maxima for each life-history trait. A-C represent the case where the nutritional optima for both life-history traits occur at the same (or very similar) caloric intake. D represents the case where the nutritional optima for the two life-history traits are located at two different caloric intakes. and we propose that the highest intake of nutrients on the two most extreme nutritional rails be used in equation (2) to calculate the maximum d.
In summary, we propose that nutrient space-based tradeoffs occur when the global maxima for two life-history traits measured on the same individuals occur in different regions in nutrient space so that both traits cannot be maximized at a single intake of nutrients. We provide an analytical approach that provides an easy way to formally document the existence and quantify the strength of such nutrient space-based tradeoffs when using the geometric framework. We show that two life-history traits will exhibit a large nutrient space-based trade-off when the 95% CRs for the global maxima are not overlapping in nutrient space and there is a large v between the linear nutritional vectors for the two traits and/or a large d between the global maximum for each trait. This framework enables the strength of nutrient space-based trade-offs to be estimated in a standardized way that facilitates direct comparison between different life-history traits when using the geometric framework approach. Furthermore, visually comparing the regulated intake point to the 95% CRs for the global maxima for each life-history trait provides a useful way to formally demonstrate whether nutrient regulation is optimal for either trait and therefore whether individuals are able to prioritize one trait over the other through dietary choice.

Experimental Animals
Gryllodes sigillatus used in our experiments were taken from our mass colonies, which are housed in 12 transparent 15-L plastic containers in an environmental chamber (Percival I-66VL) maintained at 327 5 17C on a 14L∶10D light cycle. The crickets in our mass culture are the descendants of approximately 500 adults collected in Las Cruces, New Mexico, in 2001 and are used to initiate a laboratory culture maintained at a population size of approximately 5,000 crickets and allowed to breed panmictically. Crickets were provided with commercial cat food (Go-Cat Senior; Purina, St. Louis) and rat food (SDS Diets, Essex, UK) pellets. Water was provided ad lib. in 60-mL glass test tubes plugged with cotton wool, and there was an abundance of egg cartons to provide shelter. As soon as adults were detected, moistened cotton wool was provided in a petri dish (10 cm diameter) as an oviposition substrate. For each generation, crickets were randomly mixed between containers and were maintained at a density of approximately 300 crickets per container.
Experimental animals were collected as newly hatched nymphs from the oviposition pads, housed individually in a plastic container (5 cm # 5 cm # 5 cm), and provided with a piece of cardboard egg carton for shelter and water in a 2.5-mL test tube plugged with cotton wool. Crickets were fed dry cat pellets, and their enclosure was cleaned once a week. Experimental animals were checked daily for newly eclosed adults, and these were then randomly allocated to an experiment and diet treatment (see below).

Artificial Diets and Measuring Dietary Intake
We made 24 artificial, dry, and granular foods that varied in protein and carbohydrate content following the procedure outlined in Simpson and Abisgold (1985). Proteins consisted of a 3∶1∶1 mixture of casein, albumen, and peptone, with digestible carbohydrates consisting of a 1∶1 mixture of sucrose and dextrin. All diets contained Wesson's salts (2.5%), ascorbic acid (0.28%), cholesterol (0.55%), and vitamin mix (0.18%). After the appropriate dry weight of protein and carbohydrate had been added to the mixture, the remainder of the mixture was made up to the appropriate dilution with crystalline cellulose. The diets used in each experiment are presented in table A1, and figure A1 shows their distribution in nutrient space.
Each experimental cricket was housed in an individual transparent plastic container (20 cm # 10 cm # 10 cm) and given either one (experiment 1) or two (experiment 2) dishes of food of measured dry weight on their first day of adulthood. Food and water were provided in feeding platforms created by gluing the upturned plastic lid of a vial (1.6 cm diameter, 1.6 cm deep) in the center of a plastic petri dish (5.5 cm diameter) and changed every 2 days for a total of 16 days. The materials and design of the feeding platforms ensured that experimental animals could not consume anything other than the artificial diet(s) and water and that food could be collected (in the petri dish) if spilled during feeding. Food was kept in a drying oven at 307C for 72 h to remove moisture prior to weighing. Prior to weighing, any feces were removed from the feeding platform using a pair of fine forceps. Diet consumption was calculated as the difference in dry weight before and after feeding, and this was converted to a weight of P and C ingested by multiplying by the proportion of that nutrient in the diet following the protocol outlined in South et al. (2011).

Experiment 1: No Choice of Diet on Six Nutritional Rails
Experimental Design. On the day of eclosion to adulthood (day 0), 15 males and 15 females were randomly allocated to each of the 24 artificial diets (n p 720). Each individual was weighed at eclosion using an Ohaus electronic balance (Explorer Pro model EP214C), and their pronotum width was measured under a dissection microscope (Leica MZ6) fitted with an eyepiece graticule. There was no significant difference in the body size (male: F 23, 336 p 1:02, P p :44; female: F 23, 336 p 0:54, P p :96) or weight (male: F 23, 336 p 0:89, P p :61; female: F 23, 336 p 1:02, P p :44) of crickets across diets, thereby confirming our random allocation. On the night of day 7 posteclosion, each experimental cricket had its diet removed, and a virgin cricket of the opposite sex taken at random from the stock population was added to the container to allow mating overnight. On day 8, the mating partners were removed and the experimental individuals were provided with their specific diets as normal. We measured reproductive effort in the sexes on day 8 and 9 posteclosion and aspects of immune function on the same individuals between days 14 and 16 posteclosion (see below).
Measuring Reproductive Effort. We measured female reproductive effort as the number of eggs produced by a female on days 8 and 9. Each female was provided with a small petri dish (5.5 cm diameter) full of moist sand for oviposition. Females had access to this oviposition substrate continuously for this 2-day period, after which it was removed and replaced with a fresh petri dish every night until the end of the experiment (day 16). This was done to ensure that both sexes had the same potential for reproductive effort between days 8 and 9 and until the end of the experiment (see below). To count eggs, the content of each petri dish was emptied into a round container of water (10 cm diameter, 12 cm height) and swirled in a circular fashion for 20 s, and eggs were counted as they moved to the surface of the sand.
Male reproductive effort was measured as the amount of time a male spent calling to attract a mate each night, as this provides a good measure of male mating success (Bentsen et al. 2006). We measured the time each male spent calling on the nights of days 8 and 9 between 1800 and 0900 hours using a custom-built electronic monitoring device (Hunt et al. 2004). Full details of this device are provided in appendix C.
Measuring Aspects of Immune Function. One enzyme cascade that is particularly important in the insect immune system is the pro-phenoloxidase cascade (González-Santoyo and Córdoba-Aguilar 2012). Phenoloxidase is a coppercontaining enzyme that catalyzes the oxygenation of monophenols to o-diphenols and the oxidation of o-diphenols to o-quinones (González-Santoyo and Córdoba-Aguilar 2012). These are the key steps in the synthesis of melanin, a pigment found in the insect cuticle that is also used to encapsulate foreign bodies in the hemolymph (Götz 1986). Both endogenous and exogenous signals are known to trigger the activation of phenoloxidase in insects, and this activation occurs rapidly (i.e., minutes to hours; e.g., Korner and Schmid-Hempel 2004), providing protection against a wide range of pathogens, including nucleopolyhedroviruses, fungi, nematodes, and parasitoids (e.g., Ourth and Renis 1993;Hagen et al. 1994;Bidochka and Hajek 1998).
Here, we focus our examination of the immune function on the phenoloxidase cascade in G. sigillatus. We first measure the amounts of phenoloxidase circulating in the hemolymph before and after the insertion of a foreign body: we refer to these as inactive and activated phenoloxidase, respectively. We then measure how well crickets encapsulate this foreign body as it is engulfed by hemocytes through melanization. Thus, we examine phenoloxidase from the start to the end of the cascade (Tsakas and Marmaras 2010). It is important to note, however, that our estimates of phenoloxidase activity are potential responses because they measure in vitro the amount of the enzyme present, providing information about the potential of an individual to mount an immune response. In contrast, our estimate of encapsulation ability measures the response of an individual to a novel immune challenge and thus represents a realized immune response. We measured these aspects of the immune function of male and female crickets following the protocol outlined below.
Encapsulation Ability. At 14 days of age, crickets were coldanesthetized at 67C in a refrigerator for 10 min. During this period, an implant of nylon monofilament fishing line (2 mm length, 0.3 mm diameter) with a surface abraded with sandpaper and a hypodermic needle from a 30.5-gauge syringe were sterilized in 70% ethanol. A small hole was made ventrally between the fifth and sixth abdominal segments of the cricket using the needle, and the implant was inserted into the wound with dissection forceps until it was completely contained within the abdominal cavity of the cricket. After implantation, crickets were returned to their individual containers and provided with fresh diet and water. Previous work using this approach has shown that the greatest variation in melanization occurs 2 days after implantation (Gershman et al. 2010a). Therefore, 2 days after each cricket was implanted, it was placed in a 3-mL microcentrifuge tube and frozen at 2207C. Implants were dissected from frozen crickets, and any clumps of tissue were removed with a paper towel, and each implant was photographed and a darkness score was calculated following the protocol outlined in appendix C.
Inactive and Activated Phenoloxidase Activity. During implantation of the nylon monofilament, a 3-mL sample of hemolymph was collected with a glass pipette from the wound and mixed with 40 mL of #1 phosphate-buffered saline solution (PBS) in a 1.5-mL microcentrifuge tube. This was used to measure inactive phenoloxidase activity. Two days later, and just before each cricket was frozen, a further 3 mL of hemolymph was extracted and mixed with 40 mL of #1 PBS in a 1.5-mL microcentrifuge tube. This was used to measure activated phenoloxidase activity. Hemolymph samples were frozen and stored in a 2807C freezer to induce cell lysis and to prevent enzymatic reactions from proceeding. Phenoloxidase activity of our hemolymph samples was measured following the protocols outlined in appendix C.  A1). Consumption of both diets was measured every 2 days for a total of 16 days posteclosion under similar overall conditions as in experiment 1, with a random mate being assigned to each experimental cricket overnight on day 7.

Statistical Analyses
Characterizing the Linear and Nonlinear Effects of Nutrient Intake. We used a multivariate response surface approach to estimate the linear and nonlinear effects of P and C intake on our response variables (i.e., reproductive effort, encapsulation ability, inactive phenoloxidase activity, and activated phenoloxidase activity; South et al. 2011). Prior to analyses, we standardized nutrient intake and life-history data to a z-score (i.e., a mean of 0 and standard deviation of 1) to ensure that any differences in nutritional gradients were not driven exclusively by scale (South et al. 2011). Nonparametric thin-plate splines (TPSs) were used to visualize the nutritional landscapes for each life-history trait that was significantly influenced by nutrient intake. Thin-plate splines were constructed using the Tps function in the fields package (Nychka et al. 2015) of R (v. 2.15.1). To aid interpretation, all TPSs were constructed using unstandardized data. For each nutritional landscape, we used the smoothness l value that minimized the generalized cross-validation score (Green and Silverman 1994).
Estimating the Location of Each Nutritional Optimum and Its 95% CR. To estimate the location of the nutritional optima and their 95% CRs, we developed a novel nonparametric bootstrapping method that does not make any distributional assumptions and uses a flexible regression spline model. This approach is provided by the function OptRegionTps in the R package OptimaRegion (del Castillo et al. 2016). In brief, this function fits a two-dimensional TPS model to the experimental data using a penalized roughness approach and the Tps function in the fields package, where the user is able to define the smoothness parameter l (e.g., obtained by cross validation and the Tps function on the experimental data). This function yields the vector of predictions ŷ at all the experimental points using the Kimeldorf-Wahba predictorŷ p Td 1 oĉ, whereŵ p (d,ĉ) are fitted parameters, T is a matrix of polynomial basis functions (up to cubic degree), and ∑ is a matrix of radial basis functions computed at all pairs of points x i (see Nychka 2000 for further details). We computed residuals r i adjusted for small sample bias (Kauermann et al. 2012). We then applied bootstrapping to these residuals to create bootstrapped realizations y * (x) pŷ(x) 1 r * for each experimental data point (x) in our data set, where x p (x 1 , x 2 ) denotes the P and C intakes on the nutritional landscape. For each simulated set of y * (x), we fit a TPS(l) model and found parameter estimates w * . Following Yeh and Singh (1997), we repeated this procedure 1,000 times and computed Tukey's data depth for each generated w * vector, keeping the 100(1 2 a)% deepest (where in our case a p 0:95). This provides an approximate nonparametric bootstrap confidence region for the Tps coefficients w. The responses y * (x) that correspond to the parameter vectors w * inside of their CR were then maximized numerically using the nloptr package in R (Johnson 2014;Ypma 2014) with respect to the regressors (x 1 , x 2 ) yielding the bootstrapped response global maxima (x * ). The nonparametric bootstrapped CR for the location of the global maximum of the fitness function is approximated and displayed as the convex hull of all the bootstrapped peaks (x * ). We use the centroid (average) of all the maxima located as our point estimate of the global maximum (or nutritional optima) of the nutritional landscape. This constitutes a bagging estimate of the location of the maximum (Hastie et al. 2001). This procedure for computing the resulting CR is justified by recent work by Woutersen and Ham (2013), who have recently shown that better coverage of bootstrapped CRs of parametric functions (in our case, the vector function g(x; w) p arg max x∈C y(x), where C is the experimental region) can be obtained if the bootstrapped values of the function g(x; w) are generated from parameters w inside their 100(1 2 a)% CR, instead of directly generating an empirical distribution of g(x; w) and trimming it to get the desired CR. The rationale behind the Woutersen and Ham (2013) method is that it is better to sample from only "good" parameters w (those inside their CR) and use these for generating the values of g(x; w) rather than using both "good" and "bad" generated values of w.
Comparing the Sign and Magnitude of the Linear and Nonlinear Nutritional Gradients. We used a sequential modelbuilding approach (Draper and John 1988) to determine whether the linear and nonlinear (quadratic and correlational) effects of nutrient intake differed across our lifehistory traits within and between the sexes. Full details of this analysis, as applied to nutritional data, are provided in appendix D, and linear equations are provided in South et al. (2011).
Calculating the Angle and 95% Confidence Intervals (CIs) between Linear Nutritional Vectors. We used a Bayesian approach implemented in the MCMCglmm package of R (Hadfield 2010) to determine the magnitude of v and the degree of certainty associated with this estimate, measured as the 95% CIs. For each life-history trait being compared, we ran a separate linear model (R ∼ b 1 P 1 b 2 C 1 ε) using 400,000 Markov chain iterations with a burn-in of 20,000, a thinning interval of 25, and a relatively uninformative prior (v p 1, nu p 0:02), to create a posterior distribution of b for each nutrient. We used these distributions in equation (1) to generate 15,200 values for v. The median of these values was used as our point estimate of v, and the 95% CIs were estimated using the HPDinterval function. The associated R code for this procedure is available in the supplemental material, available online. 1 Calculating the Euclidean Distance and 95% CIs between Global Maxima. To determine the mean and median Euclidean distance between the locations of the maxima of two response surfaces, we developed a custom program CRcompare.R in the R package OptimaRegion (del Castillo et al. 2016). The program starts by calling the function OptRegionTps.R from the OptimaRegion package (del Castillo et al. 2016) twice, once for each of the two life-history traits being compared, to compute a CR on the maxima of each response surface. These CRs are a set of points obtained by repeatedly bootstrapping the residuals of the original TPS model, creating sample response data to which new TPS models are fitted and then optimized to obtain the location of their maxima. Our program then computes all possible pairwise Euclidean distances between the response maxima in each CR. Finally, it bootstraps the mean and median of these distances using R's package boot (Canty and Ripley 2016) to obtain 95% biascorrected and accelerated (see Efron and Tibshirani 1998) bootstrapped confidence intervals on the mean and median distance.
Testing for Dietary Choice and the Nonrandom Intake of Nutrients. To determine whether male and female crickets preferentially consumed one of the diets over the other in each diet pair contained in experiment 2, we compared the absolute consumption of each diet using a paired t-test. However, this approach does not account for the fact that our choice diets have different concentrations of P and C, meaning that crickets may actually eat more of a less concentrated diet (i.e., compensatory feeding) to increase their intake of P and/or C. We therefore investigated the nonrandom intake of nutrients in the sexes in two ways. First, we calculated the total intake of P and C for each diet pair and subtracted the expected intake of these nutrients if crickets were fed at random. This difference was compared to a mean of 0 (i.e., expected if crickets were feeding at random on diets) using a one-sample t-test. A value greater than 0, therefore, means that a cricket has consumed significantly more P or C than expected, a value less than 0 means that a cricket has consumed significantly less than expected, and a value that does not differ significantly from 0 means that crickets have consumed nutrients equally from both diets. Second, we used a MANOVA to compare the total intake of P and C across the sexes and diet pairs; sex, diet pair, and their interaction were included as fixed effects, and P and C intake were included as dependent variables. Univariate ANOVAs were used to determine which nutrients contribute to the overall multivariate effect. As there are four diet pairs, Tukey's honest significant difference (HSD) contrasts were used to determine how the intake of P and C differed across diet pairs for each sex.
Estimating and Comparing the Regulated Intake Point between the Sexes. We estimated the regulated intake point in each sex, defined as the point in nutrient space that individuals actively defend when given dietary choice, as the mean intake of P and C across diet pairs (Simpson and Raubenheimer 2012). We used an ANCOVA including sex as a fixed effect, P intake as a covariate, the interaction between sex and P intake as a fixed effect, and C intake as the dependent variable to determine whether the regulated intake point differed significantly across the sexes. Significance of the sex by P intake interaction term demonstrates that the sexes have different regulated intake points.
Determining Whether Nutrient Regulation Is Optimal for Trait Expression in the Sexes. To determine whether males and females optimally regulate their intake of nutrients to maximize trait expression, we mapped the regulated intake point (RIP) for each sex onto the nutritional landscape containing the 95% CR of the peak (global maximum) for each trait (see fig. 3). We consider nutrient regulation to be optimal for a given trait if the RIP overlaps the 95% CR of the global maximum on the nutritional landscape. All data from this study are deposited in the Dryad Digital Repository: https://doi.org/10.5061/dryad.qv437 (Rapkin et al. 2018).

Experiment 1: No Choice of Diet on Six Nutritional Rails
There was a clear significant linear effect of the intake of both nutrients on male calling effort, with the amount of calling increasing with the intake of C but decreasing with the intake of P (table 1; fig. 3A). There was also a significant negative quadratic effect of C intake on calling effort, and inspection of the nutritional landscape ( fig. 3A) reveals a peak in calling effort at a high intake of C and low intake of P centered around a ratio of 1 P ∶7.08 C (global maximum: P p 17:87 mg, C p 126:57 mg; fig. 3A). A significant negative correlational gradient for calling effort (table 1) provides further evidence that calling effort increases with C intake and decreases with P intake. The encapsulation ability of males increased with the P consumption but was independent of C (table 1; fig. 3B). There was also a significant negative quadratic effect of P intake on encapsulation ability (table 1), and inspection of the nutritional landscape ( fig. 3B) reveals a peak in encapsulation ability at a high intake of P and low intake of C centered around a ratio of 5.14 P ∶1 C (global maximum: P p 104:24 mg, C p 20:29 mg; fig. 3B). The significant negative correlational gradient further demonstrates that encapsulation ability is maximized on a high intake of P and low intake of C (table 1). In contrast to calling effort and encapsulation ability, the intake of P and C did not significantly influence inactive and activated phenoloxidase activity (table 1).
Formal statistical comparison of the traits that responded to P and C intake, using a sequential model-building approach, showed significant differences in the linear, quadratic, and correlational effects of nutrient intake on male calling effort and encapsulation ability (table 2). The difference in linear effects was due to encapsulation ability increasing with P intake but calling effort decreasing with the intake of this nutrient, and also because calling effort increased with C intake but encapsulation ability did not (table 2). The difference in quadratic effects reflects that there was a peak in encapsulation ability, but not calling effort, with P intake, and there was a peak in calling effort, but not encapsulation ability, with C intake (table 2). Finally, the difference in the correlational effects exists because the effect of the negative covariance between P and C intake is stronger on encapsulation ability than on calling effort (table 2). This pattern of nutritional effects on calling effort and encapsulation ability results in a significant negative  correlation between these traits across diets in our geometric design (r p 20:104; 95% CI p 20:154, 20.055; n p 360; P p :048) and leads to nutritional optima that are located in different regions in nutrient space ( fig. 3A, 3B), providing evidence of a trade-off between calling effort and encapsulation ability in males. Further evidence of a tradeoff between these traits in males is shown, using our proposed methodology, by the large angle between the linear nutritional vectors (v p 107:207; 95% CI: 93.267, 120.537) and the large Euclidean distance between the global maxima for calling effort and encapsulation ability (d p 145:05 mg; 95% CI: 143.60, 146.30 mg), which represents 78.41% and 59.56% of the maximum differences, respectively (maximal possible v p 1807; maximal possible d p 185:00). Further-more, comparison of figure 4A and 4B shows that there is no visible overlap in the 95% CRs for optimal calling effort and encapsulation ability. Collectively, this provides clear evidence of a trade-off between calling effort and encapsulation ability in males.
In females, reproductive effort increased linearly with the intake of P and C, with egg production being equally responsive to the intake of both nutrients (table 1; fig. 3C). There were also significant negative quadratic effects of P and C intake on egg production (table 1), and inspection of the nutritional landscape ( fig. 3C) shows a peak in egg production at a high intake of P and C centered around a ratio of 1 P ∶1.17 C (global maximum: P p 126:09 mg, C p 148:09 mg; fig. 3C). The significant positive correlational gradient provides further evidence that egg production is maximized on a high intake of both P and C (table 1). Female encapsulation ability also increased linearly with the intake of both nutrients, although this trait was slightly more responsive to the intake of P than C (table 1). There were also significant negative quadratic effects of P and C intake on encapsulation ability in females (table 1), and inspection of the nutritional landscape ( fig. 3D) shows a peak in encapsulation activity at a high intake of P and C centered around a ratio of 1.04 P ∶1 C (global maximum: P p 129:66 mg, C p 124:70 mg; fig. 3D). There was, however, no significant correlational effect of the two nutrients on female encapsulation ability (table 1). As for males, the intake of P and C did not significantly influence inactive or activated phenoloxidase activity (table 1). Formal statistical comparison of female traits that responded to P and C intake showed a significant difference in the linear effects of nutrient intake on female egg production and encapsulation ability but no difference in the quadratic or correlational effects (table 2). The difference in linear effects was due to egg production being more responsive to the intake of both nutrients than encapsulation ability (table 2). This pattern of nutritional effects on egg production and encapsulation ability in females leads to nutritional optima that are located in similar regions of nutrient space ( fig. 3C, 3D) and a significant positive correlation between these traits across diets (r p 0:260; 95% CI p 0:156, 0.361; n p 360; P p :0001). Consequently, using our proposed methodology, we found a small angle between the linear nutritional vectors (v p 16:717; 95% CI: 0.007, 34.647) and a short Euclidean distance between the global maxima for egg production and encapsulation ability (d p 33:83 mg; 95% CI: 29.90, 37.29 mg), which represents 9.28% and 13.64% of the maximum differences, respectively (maximal possible v p 1807; maximal possible d p 248:02). Furthermore, the 95% CRs for egg production and encapsulation ability are completely overlapping ( fig. 4C, 4D). Together, these results suggest that egg production and encapsulation ability in females do not trade off.
Formal statistical comparison using a sequential modelbuilding approach also showed significant differences in the linear, quadratic, and correlational effects of nutrient intake on reproductive effort and encapsulation ability between the sexes (table 2). For reproductive effort, the sex difference in the linear effects of nutrient intake is driven exclusively by P intake, having a negative effect on calling effort but a positive effect on egg production (table 2). The sex difference in the quadratic effect of nutrients is due to a peak in egg production, but not calling effort, with P intake and also because the peak in egg production with C intake has a more pronounced curvature than the peak for calling effort (table 2). The sex difference in the corre- lational effects of nutrients is due to egg production increasing but calling effort decreasing with the covariance between P and C intake (table 2). For encapsulation ability, the sex difference in the linear effects of nutrient intake is because C intake increases this trait in females but not in males and because encapsulation ability is more responsive to C intake in males than in females (table 2). The sex difference in the quadratic effects of nutrient intake is because there is a peak in encapsulation ability with C intake in females but not in males and also because the curvature of the peak in encapsulation ability with P intake is more pronounced in females than in males (table 2). The sex difference in the correlational effects of nutrient intake reflects the decrease in encapsulation ability with the covariance between P and C intake in males but not in females (table 2). This divergence in the effects of nutrient intake on reproductive effort and encapsulation ability between the sexes leads to nutritional optima that are located in different regions of nutrient space ( fig. 1) . 4).

Experiment 2: Measuring Nutrient Intake under Dietary Choice
MANOVA revealed that sex, diet pair, and the interaction between these fixed effects all significantly influenced the intake of nutrients when Gryllodes sigillatus was given dietary choice (table 3). For each diet pair, females consumed significantly more diet than males ( fig. 5A, 5B), resulting in a higher intake of both P and C in females than in males ( fig. 6; table 3). Both sexes consumed significantly more of the high-C diet than the high-P diet in each diet pair ( fig. 5A, 5B), which resulted in a significantly higher intake of C and a significantly lower intake of P than expected if individuals fed indiscriminately between diets ( fig. 5C, 5D). Despite this clear preference for the C-rich diet, significant differences in P and C intake across diet pairs within both sexes show that the intake of nutrients depended on the choice pair and was not tightly regulated at the same P and C intake across diet pairs in the sexes (table 3; fig. 6). Indeed, Tukey's HSD pairwise contrasts showed that the order of intake amounts across diet pairs was 1 ! 2 ! 4 ! 3 for P and 3 ! 1 ! 4 p 2 for C in males and 1 p 2 ! 4 ! 3 for P and 3 ! 1 ! 4 ! 2 for C in females ( fig. 6). The significant interaction term between sex and diet pair in our MANOVA model reflects this different ordering of diet pairs between the sexes (table 3; fig. 6). The regulated intake point was estimated at an intake of 29.51 5 1.30 mg of P and 59.12 5 1.96 mg of C in males and 55.06 5 2.35 mg of P and 101.12 5 3.17 mg of C in females, which corresponds to an overall regulated ratio of 1 P ∶2.00 C for males and 1 P ∶1.84 C for females ( fig. 6). ANCOVA showed that the intake of C differed significantly between the sexes (F 1, 156 p 29:96, P p :0001) but was not related to P intake (F 1, 156 p 1:85, P p :18), nor was there a significant interaction between sex and P intake (F 1, 156 p 0:78, P p :38). This nonsignificant interaction term demonstrates that the regulated intake point does not differ between the sexes ( fig. 6). In figure 4, we map the regulated intake points for the sexes onto the nutritional landscapes containing the 95% CR of the peak (global maximum) to determine whether males and females are regulating their intake of nutrients to optimize reproductive effort and/or encapsulation ability. In general, the regulated intake point was more closely aligned with the P∶C ratio of the global maximum for reproductive effort and encapsulation ability in females than in males ( fig. 4). However, with the exception of female encapsulation ability ( fig. 3D), the regulated intake point for all other traits in both sexes did not overlap with the 95% CR of the global maximum on the nutrient landscape, indicating suboptimal nutrient regulation for either of these traits ( fig. 4A-4C). The optimal regulation of nutrients by females to maximize encapsulation ability should be interpreted with a degree of caution, however, due to the large 95% CR associated with the peak expression of this trait ( fig. 4D).

Discussion
Here, we develop a novel analytical approach to formally identify and quantify the strength of nutrient space-based trade-offs when using the geometric framework for nutrition. We argue that nutrient space-based trade-offs will occur whenever life-history traits measured on the same individuals are maximized in different regions of nutrient space, as demonstrated by nonoverlapping 95% CRs of the global maxima for the two traits. Moreover, we show that the magnitude of this trade-off can be quantified by the angle between the linear nutritional vectors (v) and the Euclidean distance (d) between the global maxima for each trait. We then empirically test the utility of our approach by examining the effects of P and C intake on the trade-off between reproduction and aspects of immune function in male and female decorated crickets (Gryllodes sigillatus). The intake of P and C had significant but divergent effects on reproduction and encapsulation ability in both sexes but did not influence inactive or activated phenoloxidase activity. However, the divergence in the nutritional optima for these traits was much larger in males than in females, as illustrated by the significant negative correlation between these traits in males, the nonoverlapping 95% CRs on the global maxima for these traits, and the larger estimates of v and d in males. Collectively, this provides clear evidence that the trade-off between reproduction and encapsulation ability is sex specific in G. sigillatus and depends critically on the contrasting demands for the intake of P and C needed to maximize these traits in the sexes.
We found that the linear and nonlinear effects of P and C intake on reproduction in G. sigillatus were highly divergent between the sexes. Male calling effort was maximized at a high intake of C and low intake of P in a ratio of 1 P ∶7.08 C , whereas female egg production was maximized at a high intake of both nutrients in a ratio of 1 P ∶1.17 C . This divergence was confirmed by significant differences in the linear, quadratic, and correlational effects of P and C intake on reproductive effort in the sexes, a large angle (55.587) between the nutritional linear vectors, and a large Euclidean distance (d p 119:17 mg) between the global maxima for reproductive effort in the sexes. These differences in the optimal nutritional requirements for reproductive effort in G. sigillatus are reflective of the divergent reproductive Note: Univariate ANOVAs were used to determine how each of the nutrients contributed to the overall multivariate effect. As G. sigillatus is sexually size dimorphic, body weight was included as a covariate in both the multivariate and the univariate models. strategies of the sexes. A major determinant of mating success in male crickets is the amount of time spent producing an advertisement call (e.g., Bentsen et al. 2006;Jacot et al. 2008), which is known to be metabolically costly (e.g., Kavanagh 1987). To fuel this energetic activity, males require a high intake of C to provide an abundant source of energy that can be rapidly utilized after ingestion (Bonduriansky et al. 2008). In contrast, females require a relatively higher intake of P than males, as this macronutrient plays a key role in stimulating oogenesis and regulating vitellogenesis in insects (Wheeler 1996). The sex differences in the nutritional optima for reproduction that we document for G. sigillatus are consistent with other studies on field crickets (Teleogryllus commodus ]; Gryllus veletis [Harrison et al. 2014]) and Drosophila (Drosophila melanogaster [Reddiex et al. 2013;Jensen et al. 2015]). It contrasts, however, with a recent study on the ovoviviparous cockroach Nauphoeta cinerea, where both sexes maximized reproductive success at a high intake of C and low intake of P (1 P ∶8 C ; Bunning et al. 2016), most likely due to the unique action of endosymbionts that help recycle stored nitrogen for P synthesis in this species (Bunning et al. 2016).
We also found that the linear and nonlinear effects of P and C intake on encapsulation ability were divergent between the sexes in G. sigillatus. While a high intake of P was important for encapsulation ability in both sexes, this trait was maximized at a relatively higher intake of P to C in males (5.14 P ∶1 C ) than in females (1.04 P ∶1 C ). As shown Gray bars represent the consumption of the high-carbohydrate diet in the pair, whereas white bars represent the consumption of the high-protein diet in the pair. The actual P∶C ratios of alternate diets in each pair are provided above each bar, and the total nutrient content of each diet is provided within the bar. The asterisks above each diet pair represent a significant difference (tested using a paired t-test) in the consumption of diets at P ! :05. For each diet pair, males and females consumed significantly more of the high-carbohydrate diet than the high-protein diet. The difference in protein (white bars) and carbohydrate (gray bars) consumption from that expected if females (C) and males (D) fed at random from the diets in a pair. The asterisks above each bar represent a significant deviation from a mean of 0 (tested using an unpaired t-test), which is expected under random feeding. For each diet pair, males and females consumed significantly more carbohydrates than expected by random feeding and less protein.
for reproduction, this divergence was statistically confirmed by significant differences in the linear, quadratic, and correlational effects of P and C intake on encapsulation ability in the sexes. The degree of this divergence in nutrient effects, however, was not as large as documented for reproduction, with a smaller angle between the linear nutritional vectors (35.007) and a shorter Euclidean distance (d p 117:72 mg) between the global maximum for encapsulation ability than reproduction across the sexes. While the link between diet and encapsulation ability is well established in a range of insects (e.g., Anagnostou et al. 2010;Kelly 2016), the specific nutrients responsible for this relationship are seldom identified. In the few existing studies that have used well-defined diets of known composition, immune function is reliant on the intake of P (Lee et al. 2006(Lee et al. , 2008bCotter et al. 2011). These studies are, however, restricted to the larvae of a single species: the cotton leafworm (Spodoptera littoralis). For example, Lee et al. (2006) found that encapsulation ability, antimicrobial activity, and phenoloxidase activity in S. littoralis were all higher on P-biased (5 P ∶1 C and 2 P ∶1 C ) than C-biased (1 P ∶2 C and 1 P ∶5 C ) diets. Likewise, Cotter et al. (2011) found that both lysozyme activity and cuticular melanism (a proxy for the encapsulation process) increased with P intake. Our work therefore adds much-needed support for the relationship between P intake and encapsulation ability in another insect species, as well as providing the first documented example that this relationship differs between the sexes. Currently, we do not know why this sex difference exists, but it is possible that the higher intake of P needed to maximize encapsulation ability in males than in females reflects the sexual dimorphism in immune function in this species. Males on average have a lower encapsulation ability than females in G. sigillatus (Gershman et al. 2010b), and it is possible that they therefore require more P to activate this response compared to females. In contrast to encapsulation ability, P and C intake had little effect on inactive or activated phenoloxidase activity in G. sigillatus. Previous studies using the geometric framework have also found broadly similar results. For example, in S. littoralis, phenoloxidase activity was not influenced by either the quality of P contained in the diet (casein vs. zein; Lee et al. 2008b) or the absolute intake of P (Cotter et al. 2011; but see Lee et al. 2006). In the closely related African armyworm (Spodoptera exempta), however, phenoloxidase activity was shown to increase with P intake (Povey et al. 2009). The general lack of nutrient effects on phenoloxidase activity may reflect the different and varied physiological functions performed by this enzyme. In addition to its role in the immune system, phenoloxidase is also involved in cuticular melanization after moulting (e.g., Hiruma and Riddiford 1988), which is known to play an important role in key processes such as evaporative water loss (e.g., Rajpurohit et al. 2016) and thermoregulation (e.g., Yin et al. 2016) in insects. Furthermore, activation of the phenoloxidase cascade in the hemocoel of insects also results in the production of quinones and reactive oxygen species that do not dis- . The regulated intake point, calculated as the mean intake of nutrients across diet pairs, is also presented for males (filled black square) and females (filled black circle) at a P∶C ratio of 1∶2.00 and 1∶1.84, respectively. The red dashed lines and red solid lines represent the span of mean P and C intake between the four diet pairs within males and females, respectively. The dashed black lines represent the expected intake of nutrients at a P∶C ratio of 1∶8, 1∶3, and 1∶1 (from left to right), respectively. criminate self from nonself and hence are also known to destroy self-matter (e.g., Saul and Sugumaran 1989). Given the importance of such processes to fitness, phenoloxidase activity may be tightly regulated and insensitive to nutritional effects to help conserve their function. Clearly, more work is needed to empirically validate this idea. The large divergence that we document in the nutritional optima for calling effort and encapsulation ability suggests that males are unable to maximize both of these traits on the same diet. In contrast, the smaller divergence between the nutritional landscapes for egg production and encapsulation suggests that females are able to maximize both of these traits on a single diet. Studies using the geometric framework have taken the inability to maximize two life-history traits on a single diet as evidence of a nutrient space-based trade-off (e.g., Lee et al. 2008a;Maklakov et al. 2008;Cotter et al. 2011;Jensen et al. 2015). While we agree with the conclusion that life-history trade-offs may exist due to opposing nutritional requirements, these studies have not formally shown that a nutrient space-based trade-off actually exists or attempted to quantify the strength of any such trade-off. Using our novel analytical approach, we show that the 95% CRs on the global maxima for reproduction and encapsulation ability overlap in females but not in males. Furthermore, we found significant differences in the linear, quadratic, and correlational effects of nutrients on reproduction and encapsulation ability in males but only a difference in the linear effects in females. Finally, we found that v and d were both significantly larger in males than in females, as demonstrated by their nonoverlapping 95% CRs. Collectively, this provides strong evidence for the presence of a nutrient space-based trade-off between reproduction and encapsulation ability in males but not in females, a finding that is confirmed by the negative correlation between these traits in males and a positive correlation in females. This result is consistent with sexual selection theory, which predicts that males should invest more in sexual advertisement at the expense of immune function than females (e.g., Rolff 2002;Zuk and Stoehr 2002;Zuk 2009). While our study is the first to use the geometric framework to examine the nutritional basis of sex differences in the trade-off between reproduction and immune function, a number of studies have examined the trade-off between life span and reproduction Harrison et al. 2014;Jensen et al. 2015). In all of these studies, however, the opposite pattern was found, with the nutrient spacebased trade-off between life span and reproduction being larger in females than in males.
Not surprisingly given the important effects that P and C intake have on reproduction and encapsulation ability, we found that both sexes actively regulate their intake of these nutrients when given dietary choice. Both sexes, however, were shown to regulate their intake of nutrients to the same nutrient ratio (males: 1 P ∶2.00 C ; females: 1 P ∶1.84 C ). De-spite this regulation, mapping of the regulated intake points for each sex onto the nutritional landscapes for reproduction and encapsulation ability shows that this nutrient regulation did not optimize these traits for either sex. More specifically, the regulated intake point did not overlap with the 95% CR for the global maximum for reproduction or encapsulation ability, the only exception being encapsulation ability in females that was characterized by a considerably larger 95% CR ( fig. 3D). In each instance, the regulated intake point was markedly lower than the intake of nutrients needed to maximize these traits, and the P∶C ratio of the regulated intake point also did not align well with the optimal P∶C ratios for reproduction and encapsulation ability, especially in males. There are a number of possible reasons to explain these patterns. First, the lower absolute intake of P and C than is optimal may represent physiological constraints on feeding behavior. It is well established that dietary assimilation, digestion, absorption, and utilization can all constrain ingestion in animals (Henson and Hallam 1995) and that the efficiency of these processes is influenced by gut morphology (e.g., Penry and Jumars 1990). It is possible, therefore, that gut morphology and its effects on these physiological processes prevent individuals from ingesting more nutrients. Second, it is possible that the sexes in G. sigillatus are regulating the relative intake of P to C to maximize other, more heavily prioritized traits. In male G. sigillatus, mating success and cuticular hydrocarbon expression are maximized at a ratio of 1 P ∶1.5 C (Rapkin et al. 2017), and ampulla attachment time (which determines the number of sperm transferred to the female) is maximized at a P∶C ratio of 1 P ∶1.3 C . It is possible, therefore, that males regulate their intake of nutrients to maximize these traits at the expense of calling effort and encapsulation ability. By comparison, life span is maximized at a ratio of 1 P ∶8 C in female G. sigillatus (J. Hunt, unpublished data), so it is possible that females prioritize this trait over egg production and encapsulation ability when regulating their intake of nutrients. Third, both sexes may be regulating their intake of nutrients to balance the expression of both reproduction and encapsulation ability. In support of this view, the regulated intake points we estimate for males and females is close to midway between the optimal P∶C ratio for reproduction and encapsulation ability at 1 P ∶1.32 C and 1 P ∶1.06 C , respectively. Finally, it is possible that nutrient regulation under active dietary choice is genetically constrained. If the genes for nutrient regulation are positively genetically correlated across the sexes but the effects of nutrients on life-history traits are divergent between the sexes, this will generate intralocus sexual conflict (Bonduriansky and Chenoweth 2009) over the optimal intake of nutrients that may prevent the regulated intake point in the sexes from evolving to the optima for reproduction and encapsulation ability. There is currently, however, little support for this process in the single species where it has been thoroughly examined (D. melanogaster; Reddiex et al. 2013), so further work is needed to test this possibility in G. sigillatus.
In conclusion, our work provides an analytical approach for studying nutrient space-based life-history trade-offs, as well as statistical tools to do so. Largely due to recent developments in the geometric framework for nutrition, we now have a much better understanding of how the intake of specific nutrients influences life-history traits. We are now in the unique position where the integration of the geometric framework with existing life-history theory is very much needed if we are to further progress in our understanding of how nutrition regulates the trade-off between life-history traits. A particular strength of our analytical approach is that v and d are measured in standardized units and can be expressed as a percentage of the maximum value that is set by geometric design of the diets used. For example, the estimates of v and d were 78.14% and 59.56% of their maximum values in males, respectively, suggesting that the nutrient space-based trade-off between reproduction and encapsulation ability is actually much stronger than suggested by the phenotypic correlation between these traits (r p 20:104). This standardization facilitates the direct comparison of the strength of nutrient space-based trade-offs across different species and studies using different dietary designs and thereby offers a flexible path forward for empiricists working on a range of different systems. It has long been argued that it is best to examine life-history trade-offs using experimental manipulation or a quantitative genetic design (e.g., Reznick 1985). While our study did not adopt either of these designs and therefore provides weaker inference for life-history evolution in G. sigillatus (because the use of animals from mass colonies can bias estimates of correlations by masking line-specific variation in nutrient consumption and trait expression), the analytic approach we outline is also amenable to employing such designs in future studies. For example, nutrient space-based trade-offs can be examined by comparing nutritional landscapes across different levels of immune challenge (e.g., single vs. multiple challenges) or by incorporating genetic relatedness (e.g., full-sib genetic design or inbred lines), although this obviously becomes far more logistically demanding.