Pattern Formation in a Spatial Public Goods Dilemma due to Diffusive or Directed Motion Authors: Yuxuan Zhao, Kaisheng Zhu, Yefei Zhang, Daniel B Cooney Published: 2026 ABSTRACT AbstractThe costly provision of public goods serves as a model problem for the evolution of cooperative behavior, presenting a social dilemma between the collective benefits of shared resources and the individual incentive to free-ride in resource production. The spatial structure of populations can also impact cooperation over public goods, as diffusion of public goods and intentional motion of individuals towards regions with greater resources can interact with population and public goods dynamics to produce heterogeneous patterns in the spatial distribution of strategies and resources. In this paper, we build off a model introduced by Young and Belmonte for the reaction dynamics of interacting individuals and an explicit public good, deriving a system of PDEs that describes the spatial profiles of strategies and the public good in the presence of both diffusive motion of individuals and resources and chemotaxis-like directed motion of individuals in response to gradients in the concentration of public goods. Through linear stability analysis, we show that spatial patterns in strategic and public goods profiles can emerge due to either Turing instability with high defector diffusivity or a directed-motion instability through strong sensitivity of cooperators towards increasing resource concentration. We further explore the emergent spatial patterns with a mix of weakly nonlinear stability analysis and numerical simulation, showing that, for a wide range of reaction parameters, diffusion-driven instability appears to increase cooperation and public goods across the spatial domain, while directed motion of cooperators towards public goods tends to decrease cooperation and environmental quality across the environment.Keywords: Public goods dilemma, Spatial pattern formation, Evolution of cooperation Introduction The production of public goods presents a social dilemma in the evolution of cooperative behavior, as the costly production of shared resources provides a tug-of-war between the collective benefit imparted by the resource and the individual incentives to cheat and rely on resources provided by peers. Such public goods dilemmas arise in many biological and social systems, ranging across scales from the production of beneficial enzymes in microbial populations (Helbing and Yu 2009; Maclean and Brandon 2008; MacLean et al. 2010; Vulic and Kolter 2001), to collective action problems in animal groups (Dobata et al. 2011; Levin 2014) and spillover effects of economic activity and international trade (Conybeare 1984). Many mathematical models have used evolutionary game theory or related eco-evolutionary models to describe the evolution of cooperative behavior in public goods dilemmas (Frank 2010; Archetti and Scheuring 2012; Fehr and Gächter 2000; Hauert et al. 2008a, b; Young and Belmonte 2018; Santos et al. 2008), and this modeling work has proposed many mechanisms for the emergence and maintenance for the cooperative maintenance of public goods. Such models of public goods dilemmas have particularly interesting features when considering the effects of space on public goods provision, as the spatial diffusion of public goods can benefit free-riding individuals (Driscoll and Pepper 2010; Allen et al. 2013; Yao and Cooney 2025) and individuals can also perform directed or diffusive motion towards regions of greater concentrations of public goods (Youk and Lim 2014; Young and Belmonte 2018; Funk and Hauert 2019; Yao et al. 2026). Such spatial models of public goods dilemmas have often considered systems of partial differential equations (PDEs) to describe the spatial dynamics of the strategic composition of populations, using the payoffs from public goods games to describe local reproduction or imitation dynamics and considering spatial motion through either purely diffusive motion (Wakano et al. 2009; Wakano and Hauert 2011; Park and Gokhale 2019; Gokhale and Park 2020; Aydogmus et al. 2017; Aydogmus 2018a) or through directed motion towards cooperators or away from defectors (Funk and Hauert 2019). These papers have demonstrated that the strategic dynamics can interact with the rules for spatial motion to produce spatial patterns in the profiles of strategies, with spatial clustering of individuals often resulting in an increased overall level of cooperation in the population (Wakano et al. 2009; Wakano and Hauert 2011). Similar spatial models have also been considered for two-player snowdrift games that feature coexistence of cooperators and defectors in the absence of space, showing that spatial patterns can tend to emerge due to Turing instability under purely diffusive motion (Yao et al. 2026; Cheng et al. 2024, 2026; Fahimipour et al. 2022; Lawton et al. 2024) or due to instabilities induced through directed motion through mechanisms of chemotaxis-like environmental-driven motion with environmental feedback (Yao and Cooney 2025) or payoff-driven motion in which individuals move towards regions featuring higher payoff for their strategy (Helbing 2009; Helbing and Yu 2009; DeForest and Belmonte 2013; Deforest and Belmonte 2018; Yao et al. 2026). The case of payoff-driven motion is particularly notable as it can tend to feature negative diffusive defects due to cooperators directing their motion towards regions with increasing densities of cooperators, often leading to a physically unrealistic scenario of short-wave / infinite-wavenumber instabilities (Helbing 2009; Fahimipour et al. 2022; Yao et al. 2026). While public goods games and other evolutionary game models can capture many features of the spatial dynamics of cooperation, models that explicitly incorporate the spatial profile of a public good can further permit exploration of key features of strategic and movement dynamics specific to the problem of public goods provision. Recent work has explored spatial models of public goods that incorporate the costly production of public goods, the diffusion of the public good across space, and the directed and diffusive motion of individuals across continuous space or metapopulation networks (Young and Belmonte 2018; Gerlee and Altrock 2019; Driscoll and Pepper 2010). In particular, Young and Belmonte (2018) formulated a metapopulation model in which cooperators pay a cost to produce a public good, both cooperators and defectors consume the good, and individuals with each strategy can perform directed motion towards patches with greater concentrations of public goods using a piecewise movement rule. Young and Belmonte (2018) considered a public good that did not diffuse between patches, and, under the assumption of fast public good dynamics, they were able to use a quasi-steady state approximation to reduce their model to a system of ODEs for the densities of cooperators and defectors in each patch of their metapopulation, showing that sufficiently fast motion of defectors could help to establish long-time survival of cooperation in their population. In this paper, we look to further explore the spatial dynamics for public goods models inspired by questions about the local ecological dynamics of cooperators, defectors, and public goods and the rules for motion of individuals and public goods in space. We consider a modified version of the metapopulation model introduced by Young and Belmonte (2018) that allows us to explore the spatial patterns generated by diffusion of the public good and both diffusive and directed motion for cooperators and defectors, formulating the rules for spatial motion as biased random walks of individuals to neighboring patches. We derive a PDE model for the spatial profiles of cooperators, defectors, and the public good in the continuum limit of infinitely many patches and infinitesimal distance between patches, capturing undirected spatial motion through diffusion terms and having both cooperators and defectors perform a chemotaxis-like directed motion up spatial gradients of the concentration of the public good. Our full model takes the form of a system of three reaction-diffusion-taxis PDEs which bear resemblance to prior models exploring collective behavior and directed motion in multi-species systems (Keller and Segel 1970; Hillen and Painter 2009; Amorim 2015; Alonso et al. 2016; Painter 2019; Deng et al. 2026; Wang et al. 2015; Owolabi et al. 2026), and we can also explore a special case of the model that reduces to a three-type reaction-diffusion system that have often been used to study Turing pattern formation with three interacting species (Turing 1952; Murray 2003; Satnoianu et al. 2000; Maini and Woolley 2019; Piskovsky 2025). We perform linear stability analysis to derive conditions for spatial pattern formation in both our full model and the special case of the reaction-diffusion system, showing that there can be Turing patterns in the reaction diffusion model due to increased diffusivity of defectors and that we can see a chemotaxis-like instability in the full model when cooperators have a sufficiently strong sensitivity to moving towards increasing concentration of the public good. The remainder of the paper is organized in the following manner. In Sect. 2, we recall the baseline Young-Belmonte model, we describe our modified version of this model to describe biased random walks along the metapopulation graph, and we present the PDE model we obtain in the continuum limit. We then present the stability analysis of our PDE models for both the case of Turing instability and a taxis-driven instability in Sect. 3, and we provide a weakly nonlinear stability analysis of both instabilities in Sect. 4. We provide numerical simulations of the reaction-diffusion model and our full reaction-diffusion-taxis model in Sect. 5, along with comparisons between our simulation results and the predictions of weakly nonlinear analysis. We discuss our results in Sect. 6 and we provide additional derivations in the Appendix, highlighting the derivation of our PDE model (Sect. A), comparing possible conditions for instability in our reaction-diffusion model (Sect. B), providing the asymptotic expansions of our PDE model for weakly nonlinear analysis (Sect. C), and analyzing the correlation between concentrations of cooperators, defectors, and the public good near the onset of the pattern-forming instability (Sect. D). Model Construction In this section, we will develop a spatial model for the public goods dilemma. We first introduce the ODE model proposed by Young and Belmonte (2018), which considers the dynamics of cooperators, defectors, and a public good on a discrete system of patches. We incorporate the reaction dynamics considered in the Young-Belmonte model, and we build on their framework by incorporating (potentially biased) random walks of individuals and the public good between patches, using these assumptions of movement between patches to derive a PDE model in the continuum limit. We start our discussion in Sect. 2.1 by formulating the reaction dynamics of the Young-Belmonte model and highlighting the assumptions used by Young and Belmonte (2018) for directed motion between patches. We then proceed to formulate our new assumptions on motion between patches in Sect. 2.2 and present our PDE model that we obtain in the continuum limit in Sect. 2.3. Finally, we summarize some of the key properties of the reaction dynamics for cooperators, defectors, and the public good in Sect. 2.4, which will prepare us for the linear stability analysis of our ODE reaction dynamics and spatial PDE models that is presented in Sect. 3. Background on Young-Belmonte Model for Public Goods Dilemma on Metapopulation Following the approach introduced by Young and Belmonte (2018), we consider a population structure consisting of multiple spatial sites that we refer to as patches. We assume that there are N patches, which we index by i∈{1,⋯,N}. Within each patch, there are two types of individuals. The first type, called cooperators, are those who contribute to the production of public goods; their population size in patch i is denoted by ui. The second type, called defectors, are those who consume public goods without contributing; their population size in patch i is denoted by vi. The amount of public goods in patch i is represented by ϕi. We assume that the growth of cooperators and defectors is proportional to the amount of available public goods, with growth rates ru and rv, respectively. Both types also experience natural death rates μu and μv. Crowding effects are taken into account, with both types sharing the same loss rate γ(ui+vi). In addition, cooperators suffer an extra cost for producing public goods, modeled as an additional loss rate c. The dynamics of the public goods are described as follows. Cooperators produce public goods at a rate equal to the additional cost c. Public goods are consumed by both types at rate κ, and the public good also decays naturally at rate δ. Now, putting these assumptions together, we can formulate an ODE system for patch i as follows The crowding term makes it possible for each patch to reach an internal coexistence equilibrium, where the size of each population is inversely related to γ. Our Table 1 shows default values for all parameters in Eq. (1) that we adopt from their use in the paper by Young and Belmonte (2018). In particular, the choices of the resource utilization rates ru and rv and the background death rates μu and μv for cooperators and defectors were chosen in the paper of Young and Belmonte (2018) to produce a stable coexistence equilibrium state featuring positive densities of both cooperators and defectors, and we will continue to follow this assumption due to our interest in exploring how rules for spatial motion of individuals and resources can destabilize a spatially uniform coexistence equilibrium. Table 1Default values for parameters for the reaction dynamics from Eq. (1), based on the values assumed in the model of Young and Belmonte (2018)ParametersDefault valuesruGrowth rate of cooperators5.0rvGrowth rate of defectors6.0cProducing rate1.0γCrowding effect rate1.0μuNatural death rate of cooperators2.0μvNatural death rate of defectors3.7κConsuming rate of goods1.0δDecay rate of public goods10-3 Default values for parameters for the reaction dynamics from Eq. (1), based on the values assumed in the model of Young and Belmonte (2018) Young and Belmonte (2018) consider the case of fast dynamics of the public good to make a quasi-steady state that the level of public good in patch i is takes the value allowing them to rewrite the per-capita growth rates for cooperators and defectors on patch i as Young and Belmonte (2018) then use these per-capita growth rates as a way to describe fitness-driven directed motion, introducing a system of ODEs describing both the reaction dynamics and directed motion across patches of their metapopulation network: where αij captures the connectivity or relative movement rates between patches i and j and the functions Hu(·) and Hv(·) describe how the fitnesses of individuals on each patch impact the rate of directed motion. The particular choice of directed motion model considered by Young and Belmonte (2018) involved taking Hu and Hv to depend on the per-capita fitness functions Fu and Fv in the following manner where [g(·)]+ and [g(·)]- denote the positive and negative part of the function g(·), respectively. The key assumption in their model of movement between edges is that individuals will move from patch j to patch i only if the per-capita fitness of their strategy is greater in patch i than in patch j, and, if that is the case, the rate of motion will be proportional to the difference in per-capita fitness of their strategy between the two patches. Young and Belmonte (2018) are able to analyze this piecewise model on their metapopulation network to characterize the long-time behavior under these movement rules, but the piecewise characterization of directed motion provides a potential obstacle to the derivation of continuum limits of the model and the use of PDE techniques to further study the resulting dynamics combining the public goods dilemma with directed spatial motion. In this paper, we explore a modified version of the Young-Belmonte model, in which we assume the same reaction terms within patches but consider different roles for spatial motion of individuals and public goods between patches. In particular, we will allow the public good to diffuse along edges of the metapopulation network, and we will formulate a model for biased random walks of cooperators and defectors between patches based on the profile of public goods across the metapopulation, allowing us to deduce the effects of diffusive motion of individuals and intentional motion towards more beneficial environments. We also restrict attention to the case of metapopulation networks consisting of spatial lattices, providing us the opportunity to derive PDE limits of the model in the case of infinitely many patches and infinitesimal distance between the patches. Formulation of Public Goods Model Based on Biased Random Walks Between Patches We assume that all colonies form an n-dimensional lattice of nodes, with n=1 or 2. To incorporate spatial distribution, we assume that cooperators and defectors in each patch can migrate to neighboring colonies. To clarify migration behavior, we assign to each patch three quantities, Ai, Bi, and Ci, which are functions of ui, vi, and ϕi, respectively. These quantities represent the attractiveness of patch i to cooperators, defectors, and public goods, and we refer to them as the attractions of patch i. Let N(i) denote the set of all neighboring colonies of patch i, excluding i itself. We assume that cooperators, defectors, and the public good can consider to move to a neighboring patch between times t and t+Δt with probabilities χu, χv, and χϕ, respectively. We assume that an individual can either choose to move to one of their neighboring patches (a patch in the neighborhood N(i) of patch i) or to choose to stay at the same patch due to attractiveness of neighboring patches and the current patch. Similarly, for the delivery of goods, we consider the possibility that goods either stay in the same patch or are transported to one of the neighboring colonies. Given that individuals or public good considers to move in a given time-step, we can define the conditional probability that an individual or a unit of public good moves to a patch j∈N(i)∪{i} by the following expressions: where f is a positive weighting function, wu, wv and wϕ are parameters that controls the influence of attractiveness, with In particular, individuals or public good can remain in the same location with probability Pu(i→i), Pv(i→i), and Pϕ(i→i) with probability that is weighted by the attractiveness of the current location. Based on our assumptions, we consider the a modified version of the Belmonte-Young model to describe public goods dynamics with spatial movement on a lattice metapopulation. We start with a discrete-time model with time-steps of length Δt, and we consider how the population and public goods concentrations at patch i change due to the following events that occur between a time t and time t+Δt. First, the cooperators, defectors, and public good undergo their reaction dynamics based on the rates described in Eq. (1) and the current values of ui(t), vi(t), and ϕt(t) at patch i at the beginning of the time-step. First, the cooperators, defectors, and public good undergo their reaction dynamics based on the rates described in Eq. (1) and the current values of ui(t), vi(t), and ϕt(t) at patch i at the beginning of the time-step. Next, individuals and public goods present after the reaction events can perform one step of a biased random walk based on the movement probabilities χu, χv, and χϕ and the conditional probabilities between neighboring patches defined in Eq. (6). Next, individuals and public goods present after the reaction events can perform one step of a biased random walk based on the movement probabilities χu, χv, and χϕ and the conditional probabilities between neighboring patches defined in Eq. (6). In particular, we choose to separate the reaction and movement dynamics into this sequence of events so that individuals cannot both die and be chosen to move within the same discrete time-step, which will help guarantee non-negativity of the quantities ui(t+Δt), vi(t+Δt), and ϕt(t+Δt) across the spatial domain. We will show that this choice of movement rules will lead to higher-order terms in the time-step Δt and the spatial grid step ℓ, and therefore our resulting PDE model will feature separate terms describing the continuous-time dynamics of reactions and movement. At time t+Δt, the values of u, v, and ϕ first change according the reaction dynamics motivated by Eq. (1). After this local update, they are redistributed across the grid due to migration or transport. Therefore, we can write the expected concentrations ui(t+Δt), vi(t+Δt), ϕt(t+Δt) of the cooperators, defectors, and public good at patch i and time t+Δt as Continuum Limit We can then derive our PDE model for the spatial dynamics of cooperators, defectors, and the public good by considering the limit as the time-step Δt→0 and the spacing between grid points ℓ→0, assuming the parabolic scaling relation that ℓ2Δt→D for some positive constant D in the joint limit as ℓ,Δt→0. We present the full derivation of this continuum limit in Sect. A of the appendix, and the argument makes substantial use of writing our rules for spatial movement in terms of the discrete Laplacian operator on our spatial lattice, which is given by Our derivation follows an approach that has often been used to derive chemotaxis-like models from biased random walk models for social systems (Short et al. 2010; Alsenafi and Barbaro 2018; Tse 2015), which has also been used recently to derive a model for spatial evolutionary games with environmental feedback and environment-driven motion (Yao and Cooney 2025). With our assumptions that Δt,ℓ→0 and ℓ2Δt→D, we show in Sect. A that we obtain following the continuum limit of Eq. (7), which describes the spatial profiles of cooperators u(t,x), defectors v(t,x), and the public good ϕ(t,x) through a system of three nonlinear PDEs: where Du=χuD/3, Dv=χvD/3 and Dϕ=χϕD/3 (in one-dimensional space) are positive diffusion coefficients that respectively govern the overall rate of motion for cooperators, defectors, and the public good. The system of PDEs provided by Eq. (9) constitutes the continuum limit of our discrete model, and will serve as the baseline model we explore for the spatial public goods dilemma in the presence of diffusion of the public good and the possibility of both diffusive and directed motion for cooperators and defectors. We see that the PDE for the change in the density of cooperators u(t,x) has terms describing spatial movement that can be decomposed into purely diffusive spatial movement of the form Du∇2u=DuΔu and a term describing directed motion -2Du∇·u∇lnf(wu,A) of cooperators towards nearby regions with increases attractiveness f(wu,A) for their strategy. An analogous decomposition holds for the densities of defectors and the public good, and the directed motion terms will be nonlinear provided that the attractiveness functions A(t,x), B(t,x), or C(t,x) are functions of any of the profiles of u(t,x), v(t,x), and ϕ(t,x). More generally, the choice of the sensitivity functions f sensitivity parameter w·, and attractiveness functions will shape the possibility of pattern-forming spatial dynamics. We will focus on the case of exponential mappings f(wu,A)=ewuA, f(wv,B)=ewvB, and f(wϕ,C)=ewϕC for convenience, as this choice of attractiveness-mapping function allows us to eliminate the natural logarithm that appear in each of our three PDEs. This choice is common in the derivation of the Keller-Segel model for chemotaxis based on biased random walks (Hillen and Painter 2009; Bubba et al. 2020) as well as related models of directed motion in social systems (Alsenafi and Barbaro 2018), while linear attractiveness mappings have been used to describe logarithmic chemotaxis models (Rodriguez and Bertozzi 2010) and related models in social systems (Short et al. 2008, 2010). Properties of ODE Reaction System Before analyzing the dynamical behavior of our PDE model for spatial public goods, we can explore the expected behavior of the reaction dynamics of cooperators, defectors, and public goods in the absence of space. In particular, we can look to characterize the equilibrium points of the ODE model, which we can use as a basis for exploring the stability of spatially uniform equilibrium states due to various rules for spatial movement in the full PDE model. The equilibrium states of the ODE system given in Eq. (1) can be obtained by setting the righthand side to zero, which gives us the following system of algebraic equations satisfied by equilibrium states (u0,v0,ϕ0): There are four non negative equilibrium solutions to this system of ODEs. The first is (u0,v0,ϕ0)=(0,0,0), which we denote by E0. This equilibrium features no population and no public good, and we refer to this equilibrium as the extinction state. We also see that there is a pair of equilibrium described by the following expression which we denote by E1 (for the positive root) and by E2 for the negative root. Both of these equilibria feature zero defectors, with only cooperators and public good present in this state. The final equilibrium features coexistence of cooperators, defectors, and the public good, with the level of each quantity given by where s=cru-rv/κc+μu-μv=c/(κϕ0). This equilibrium is denoted by E3, and we will focus on this coexistence equilibrium as a jumping-off point for possible spatial patterns emerging in the profiles of our three quantities. This equilibrium is of particular interest for the purpose of analyzing the qualitative effects of spatial pattern formation, as we can explore how the densities of both cooperators and defectors will change due to the spatial movement rules that each follow under different schemes of directed and undirected motion. In particular, we can explore how competition between these two strategies is shaped by the interaction between spatial movement and the reaction dynamics of public good production by cooperators and the consumption of public goods by both types. It is possible to check that, for each equilibrium point described above, a spatial state of the form (u(x),v(x),ϕ(x))=(u0,v0,ϕ0) for each point x in our spatial domain will constitute a homogeneous equilibrium state for our PDE model in Eq. (9). For this reason, we will study the stability of these ODE equilibrium points under the reaction dynamics, and then explore how the corresponding spatially uniform states can be destabilized due to diffusive or directed motion in our PDE model. Linear Stability Analysis of the ODE and PDE Models In this section, we will study the stability of the equilibrium points under the reaction dynamics (Sect. 3.1), as well as the stability of the uniform coexistence state for our PDE model (Sect. 3.2), focusing on both the special case of the reaction-diffusion system (Sect. 3.2.1) and the case of the full PDE model with directed motion (Sect. 3.2.2). Before proceeding to the stability calculations, we will first set the state of the one-dimensional spatial setting in which we explore pattern-forming behavior. In the following sections, we consider a specific form of the attraction function under which our general PDE system simplifies to a more tractable model. We set To begin our discussion on the choice of attraction functions, we first make the following assumptions For both cooperators and defectors, the more goods there are in the patch i, the more individuals want to migrate to i. For both cooperators and defectors, the more goods there are in the patch i, the more individuals want to migrate to i. The public good does not perform directed motion and only moves through purely diffusive motion in space. The public good does not perform directed motion and only moves through purely diffusive motion in space. With our assumption, a suitable choice of attractiveness can be Then our general PDE model from Eq. (9) can be reduced to For this PDE model, we will consider the analysis of the stability of spatially uniform states (u(x),v(x),ϕ(x))=(u0,v0,ϕ0) with concentrations of cooperators, defectors, and the public good at levels given by the coexistence equilibrium from the reaction dynamics. To do this, we will consider solutions of the form for a small parameter ε, allowing us to explore the behavior of solutions that are close to the uniform equilibrium coexistence state. Plugging in the ansatz from Eq. (15) and collecting all O(ε) terms, we obtain the following system of PDEs as the linearization of our system around the uniform coexistence equilibrium: We will use this linearized system of PDEs to determine the conditions required for spatial pattern formation due to the effects of increased diffusivity of defectors or increased sensitivity of cooperators in moving towards increasing concentrations of the public good. Before studying the stability of the uniform coexistence equilibrium for the PDE system, we will first look to characterize the stability of the equilibrium points of the original ODE system of Eq. (1). We highlight conditions for stability of these equilibria in the next section, showing that the coexistence equilibrium will be stable under the default parameter values from Table 1 and highlighting regions of potential bistability between equilibria in the ODE system. Equilibrium Stability of the ODE Model We start our linear stability analysis for the ODE model by considering the stability of the extinction equilibrium and the cooperator-only equilibria in Sect. 3.1.1. We then explore the stability of the coexistence equilibrium in Sect. 3.1.2, noting that this equilibrium will be stable for our default parameters and that this equilibrium will be bistable with the extinction state whenever it is stable. Stability of the Extinction and Cooperator-Only Equilibria We first study the stability of the extinction equilibrium E0. Linearizing the right-hand side of the ODE model (1) yields the following Jacobian matrix: Since J(E0) is a lower triangular matrix with all negative diagonal entries, all of its eigenvalues are negative whenever we consider positive reaction parameters. Therefore, the extinction equilibrium is always locally asymptotically stable for all biologically feasible parameters, so any stable equilibria featuring positive population will coexist in bistability with the extinction state. This extinction equilibrium is always stable because the per-capita rate of population growth of both cooperators and defectors is proportional to the concentration of public goods, so it is not possible for a small population of individuals to grow when there is only a small concentration of public goods present. Next, we consider the stability of the two cooperator-only equilibria E1 and E2. We again linearize the right-hand side of the ODE model (1) and obtain the following Jacobian matrix: for i∈{1,2}. Because there is only one nonzero entry in the middle row, we see that one eigenvalue of this Jacobian matrix is given by which corresponds to the eigenvalue determining whether a small population of defectors will be able to successfully invade the equilibrium coexistence of cooperators and public good. Therefore we see that a sufficient condition for the instability of E1 or E2 is If this inequality does not hold, then we can determine stability of our cooperator-only equilibria by considering the eigenvalues of the minor matrix As the trace of this matrix is always negative for positive reaction parameters, we see that conditions for stability of E1 and E2 of the form (u0,0,ϕ0) are that (rv-ru)ϕ0+c+μu-μv<0 and detJ22(Ei)>0. Under the default parameter values from Table 1, the ODE model (1), the two cooperator-only equilibria take the approximate values and we can check numerically that both equilibria are unstable. In particular, we see that, for the equilibrium E1, the inequality from Eq. (21) holds, and therefore this cooperator-only equilibrium will be unstable to invasion by a small group of defectors due to the abundance of public goods. For the equilibrium E2, instability occurs even in the subsystem consisting only of cooperators and the public good, as additional cooperators will be able to invade this equilibrium to a relatively high abundance of public goods proportional to the low density of cooperators present in the state E2. Stability of the Coexistence Equilibrium For our system from Eq. (1), we see that the linearization of the reaction dynamics near the coexistence equilibrium E3=(u0,v0,ϕ0) is given by the following Jacobian matrix We can calculate the trace, the sum of the principal minors of order two, and the determinant of J as We can then use these quantities to analyze the stability of the equilibrium, noting from the Routh-Hurwitz criteria that this equilibrium will be stable provided that the following three conditions hold: Remark 1 In order to have that E3 is stable under the dynamics of the ODE system, we require that det(J)<0 and S2>0. These inequalities imply that ruκϕ0 for the case of the coexistence equilibrium under the assumption that all of the reaction parameters in our ODE model are positive. We will use these observations about necessary conditions for existence and stability of the coexistence equilibrium to further understand conditions for the instability of uniform coexistence states under the dynamics of our PDE model. To calculate the coexistence equilibrium and evaluate its stability, we can look to the parameter values we assume in Table 1. We can use parameter values and the equilibrium relation We can show numerically that the Jacobian J at E3 has eigenvalues with negative real parts, and hence the ODE equilibrium E3 is stable for the parameters given in Table 1. Therefore, in the following sections, we focus on E3, which will describe the population and public good densities in the spatially homogeneous coexistence equilibrium in our PDE model (15). We want to examine whether spatial movement can induce pattern formation starting close to a coexistence state of the population, allowing us to explore how cooperators and defectors are helped or harmed by the emergence of spatial heterogeneity. Remark 2 Because the extinction equilibrium is stable for all non-negative reaction parameters, we see that the coexistence equilibrium can only coexist in bistability with the extinction equilibrium. This raises the potential concern that diffusive or directed motion may destabilize a spatially uniform coexistence equilibrium, resulting in the initial emergence of spatial patterns that later yield to a long-time extinction state. Such transient pattern formation that destabilizes one uniform equilibrium but results in the achievement of another uniform equilibrium has been observed in several examples of reaction-diffusion systems with bistable reaction dynamics (Krause et al. 2024; Huidobro and Endres 2024), and spatial instability of a positive uniform equilibrium has shown to give rise to an extinction equilibrium in a reaction-diffusion model for an economic-demographic system (Zincenko et al. 2018, 2021). While we numerically observe the achievement of heterogeneous patterned states starting from small perturbations of the uniform coexistence state in this paper, it is still important to understand the possible long-time outcomes of spatial models with multiple uniform states that correspond to stable equilibrium values of the reaction dynamics. Linear Stability Analysis of Our PDE Model In this subsection, we investigate the linear stability spatially uniform steady states of our PDE model under a regular spatial domain Ω such as [0, L]. We will present our analysis of diffusion-driven instabilities in the special case of reaction-diffusion dynamics in Sect. 3.2.1, and we study the case of spatial pattern formation due to differences in the strength of directed motion in Sect. 3.2.2. Finally, we provide additional commentary on the possibility of additional pattern-forming instabilities for different cases of the movement parameters. For the two cases we examine, we will impose zero-flux boundary conditions on the interval [0, L]: This assumption ensures that no net flow of individuals or resources occurs across the domain boundaries, and allows us to considering a family of sinusoidal perturbations for our ansatz for the small perturbations (u~(t,x),v~(t,x),ϕ~(t,x)) from the uniform equilibrium state to complete our linear stability analysis. We therefore consider perturbations of the form for any wavenumber k∈Z, and we substitute the ansatz from Eq. (30) into the linearized system Eq. (17). Plugging in this ansatz then allows us to see that (u~(t,x),v~(t,x),ϕ~(t,x)) will solve our linearized system provided that the temporal growth rate λ is a solution to the following eigenvalue problem: where the linearization matrix M(k) takes the form In particular, we can understand the components of the linearization matrix can be written in the form where the reaction matrix J is given by Eq. (24) and the movement matrix R is given by We note that the matrix J has eigenvalues only with negative real part due to the stability of the coexistence equilibrium under the reaction dynamics, and we can see that the matrix R will have all negative eigenvalues provided that the diffusivities Du, Dv, and Dϕ are all positive. We will therefore look to see whether there are spatial movement parameters and a finite wavenumber k for which it is possible that the matrix M=J+πkL2R can have a positive real part. Remark 3 As k→∞, the term πkL2R dominates M. Hence the eigenvalues of M converge to πkL2 times the eigenvalues of R, which are all negative. Therefore, there exists some K∈N such that all eigenvalues of M have negative real parts for all |k|>K. In other words, at most finitely many integer wavenumbers can destabilize M. Therefore we see that short-wave instabilities are not possible in either our reaction-diffusion model or in our model of directed motion towards increasing levels of public goods, which stands in contrast to the unphysical infinite wavenumber instabilities that can arise in evolutionary game models with nonlinear diffusion or payoff-driven directed motion (Helbing 2009; Xu et al. 2017; Funk and Hauert 2019; Fahimipour et al. 2022; Yao and Cooney 2025). Linear Stability Analysis of the Unbiased Model We start by analyzing the stability of the uniform coexistence state in the case of the reaction-diffusion dynamics for the unbiased model. We assume that wu=wv=0, and we look to determine how the change in the diffusivity of defectors Dv can induce pattern formation. Our choice of Dv as the bifurcation parameter of interest is based on the intuition gleaned from Turing pattern formation in the case of spatial evolutionary games (Yao et al. 2026), in which defectors play the role of inhibitors and cooperators play a role of activators in a system of two reaction-diffusion equations. In this case, our model in Eq. (15) becomes We are interested in how the diffusion coefficients determine the spatial instability. To see this, we use the fact that the linearized matrix M from Eq. (32) reduces to To determine conditions for instability of our system, we will look to apply the Routh-Hurwitz criteria for the 3×3 matrix M. To do this, we must calculate the quantities and can establish instability of the uniform state to a perturbation with wavenumber k by finding conditions under which one of the following three conditions holds We can see from Eq. (36) that the trace of our linearization M(k) is given by and therefore the uniform state cannot be destabilized through the trace of M(k) becoming positive. We may only expect to see the emergence of patterns when the determinant of M(k) becomes positive or because the inequality Q3(k)>Q1(k)Q2(k) is satisfied, so we calculate the sum of the principal minors and determinant of the linearization matrix. We first see that the sum of the principal minors is given by where and therefore we can deduce that Q2(k)=S2(k)>0. Next, we look to derive an expression for the quantity Q3(k)=-det(M(k)). By developing along the first column, we can calculate the determinant of linearization matrix to see that where Therefore we see that Q3,c(k)>0 for the parameter regime in which the coexistence equilibrium E3 is stable under the reaction dynamics, but the sign of Q3,v(k) does not have a conclusive sign just based on the stability conditions of the coexistence state. If Q3,v(k)>0, we can see that it is possible to achieve the condition Q3(k)<0 for a given wavenumber k by choosing the defector diffusivity to satisfy the following condition: In addition, we show in Sect. B of the appendix that the condition Q3(k)>Q1(k)Q2(k) cannot hold when Q3,v>0 for sufficiently small Du and Dϕ, so we are able to focus on studying the case of the formation of Turing patterns for the parameter regime in which Q3,v(k)>0 for some wavenumber and the spatially uniform equilibrium can be destabilized through the determinant of the linearization matrix becoming positive. In particular, this indicates that patterns will form in the unbiased model only through stationary Turing instabilities through an increase in the defector diffusivity Dv for small cooperator and public good diffusivity. Therefore we expect the patterns that emerge from small perturbations of the uniform coexistence state to eventually settle upon a steady-state solution in the long-time limit, rather than resulting in the long-time oscillations characteristic of a Turing-Hopf instability. Furthermore, we note that the term -DuDϕπkL6 will dominate the behavior of Q3,v(k) for large k, so there will be a threshold wavenumber kc∈Z≥0 such that Q3,V(k)<0 for all k≥kc. As Turing instability can occur for a wavenumber k0 when the defector diffusivity satisfies Dv>Dv∗(k), we can introduce the following threshold on defector diffusivity and we can look to characterize the Dv∗ that governs the onset of pattern formation. Due to lengthy expressions in these threshold quantities, we will turn to a numerical approach to characterize the onset of Turing patterns in this model for the case of the parameters provided in Table 1. To explore this threshold for pattern formation numerically, we plot the Dv∗(k) as a function of the wavenumber k in Fig. 1 for the case of Du=Dϕ=0.01 and the parameters of the reaction dynamics in Table 1. We observe numerically that Q3,v(k)>0 only for integer wavenumbers less than kc=13, so we can determine the threshold for pattern formation Dv∗ by considering the minimum over the thresholds Dv(k) among the integer wavenumbers k∈{1,2,…,12}. By zooming in on the wavenumbers with the lowest thresholds in Fig. 1, we can see minimal threshold occurs at the wavenumber k∗=8. We can then calculate from Eq. (44) and the parameters in Table 1 to determine that the threshold defector diffusivity for pattern formation is given by Dv∗=Dv∗(8)≈0.04861. Plots of the threshold value Dv∗(k) as a function of k with L=8, both for the range of integer wavenumbers between 1 and 12. The right panel shows a zoomed-in view of the left panel near the minimal threshold Dv∗ is attained as k=8, with Dv∗≈0.04861. The orange circles represent the thresholds obtained from the condition Q3(k)=-det(M(k))<0, the horizontal dashed line in the left panel indicates the limit of zero diffusivity Dv=0, and the vertical dotted lines in both panels highlights the threshold wavenumber for pattern formation given by k∗=8. The parameters for the reaction dynamics are taken from Table 1, and the PDE parameters are chosen as Du=Dϕ=0.01 (color figure online) We can further illustrate the behavior of the pattern-forming threshold by plotting the real part of the dominant eigenvalue for different values of the defector diffusivity Dv and wavenumber k in Fig. 2a and by plotting the threshold defector diffusivity Dv and the diffusivity of the cooperators and public good Du and Dv in Fig. 2b under the assumption that Du=Dϕ. The plot of the dispersion relation (featuring the maximum real part of the linearization matrix M(k)) allows us to see that that there is a region in parameter space for defector diffusivity Dv sufficiently close to Dv∗ in which there is a single unstable wavenumber k=k∗, which will allow us to perform weakly nonlinear stability analysis to analyze the long-time behavior of our emergent patterns when we are sufficiently close to the threshold for pattern formation. By characterizing the threshold Dv∗ as a function of the equal diffusivities Du=Dϕ, we will further be able to explore how the pattern-formation threshold can depend on changes in other parameters governing the movement of individuals or public good in our reaction-diffusion model. Dispersion relation and instability condition for the one-dimensional background domain [0, L] with L=8 and wavenumber k∗=8. The parameters for the reaction dynamics are taken from Table 1. In panel (a), we plot the dispersion relation describing the largest real part of the linearization matrix M(k) as a function of the wavenumber k for the choices of defector diffusivity of Dv=0.03, 0.04861, and 0.08. In panel (b), we plot the threshold Dv∗ for pattern-forming instability in the (Du,Dv)-plane, with the orange region describing the pattern-formation regime and the white region describing the regime of a locally stable uniform coexistence equilibrium. The black curve represents the boundary determined by evaluating the maximum value of the threshold Dv∗(k) from Eq. 44 over all feasible integer wavenumbers. In particular, when Du=Dϕ=0.01, the threshold value is (colorfigureonline)Dv∗≈0.04861 Linear Stability Analysis of the Biased Model We now consider the biased diffusion case, in which we assume wu>0 and wv>0. Since the parameters wu and wv control the sensitivity of public goods to cooperators and defectors, respectively, our aim is to investigate how these parameters influence the conditions for pattern-forming instability, with an emphasis on exploring how the sensitivity wu of cooperators in moving towards increasing concentrations of public good can help to destabilize the uniform coexistence state. For our model with biased directed motion, the lineriazation matrix takes the following form and we can look to use the Routh-Hurwitz criteria to determine conditions for instability. To apply the Routh-Hurwitz condtions, we introduce the following three quantities where Remark 4 The conditions for stability for the coexistence equilibrium E3 under the ODE reaction dynamics as well as the equilibrium condition c-κϕ0u0=κv0+δϕ0 from the third line of Eq. (10) require us to assume that rv>ru and c>κϕ0 if there is a spatially uniform coexistence equilibrium. Therefore we can deduce that the following coefficient functions satisfy P2,u(k), P2,v(k), P3,u(k), and P3,v(k) are positive for all relevant parameters. For the coefficient P2,c(k), we can find that as the sum of principal minors for the Jacobian matrix of the reaction dynamics will satisfy S2(J)>0 if the coexistence equilibrium is stable in the absence of spatial effects. Finally, we can determine the sign of the coefficient P3,c(k) provided that we assume that the diffusivity of the cooperators, defectors, and the public good all take the same value (which is our case of interest in determining whether changes in the sensitivities wu or wv of directed motion alone are capable of generating spatial patterns). Assuming that the diffusivities of the three species Du=Dv=Dϕ=:D¯, then we can show that the coefficient P3,c(k) satisfies Therefore, all coefficients of wu, wv, and the constant term in Eq. (47) are positive when we have the same diffusivities for all three quantities. As we have shown that Q1(k)=-tr(M(k)))>0 whenever the coexistence equilibrium is stable, we need to find values of wu that allow us to satisfy one of the remaining Routh-Hurwitz conditions for instability We can then use the expressions we derived for Q1(k), Q2(k), and Q3(k) to see that the uniform coexistence state will be unstable to perturbations with wavenumber k provided that the cooperator’s sensitivity wu towards climbing gradients in the concentration of public goods satisfies where the first term corresponds to the threshold on wu required to satisfy P3(k)<0 and the second term corresponds to the threshold wv required to achieve P3(k)>P1(k)P2(k). Furthermore, we can characterize the minimum cooperator movement sensitivity wu by considering the minimum threshold across wavenumbers k: Remark 5 It is somewhat easier to interpret the condition for instability of the uniform state due to the determinant becoming positive (corresponding to P3(k)=-det(M(k))>0), as P3,v(k)P3,u(k)wv+P3,c(k)P3,u(k)>0 for all wavenumbers k. In particular, we see that this threshold quantity is increasing in wv, so directed motion of defectors towards increasing public good abundance helps to suppress pattern formation. This calculation matches biological intuition, as if defectors are more capable of reaching regions with more abundant public goods, they will consume the public good more rapidly than cooperators and reduce the public good concentration back to the level expected in a uniform spatial equilibrium. It is especially notable that the threshold wu∗(k) is an affine function of the defector movement sensitivity wv with positive slope, so an increase in wv produces a corresponding proportional increase in the threshold cooperator movement sensitivity wu required for the onset of pattern formation. By contrast, it is difficult to analytically characterize the sign of the the constant term and the coefficient of wv in the second condition for instability on the righthand side of Eq. (52). We will resort to the use of numerical calculations to establish the conditions under which P3(k)>P1(k)P2(k) for the parameters provided in Table 1. Notably, we will see in Fig. 3 that the determinant condition is the condition achieving the minimum threshold for the parameters we consider, so our interpretation of the determinant condition may still be reflective of the underlying interactions between the directed motion of cooperators and defectors in the formation of spatial patterns in our PDE model. In particular, this suggests that we expect a stationary pattern-forming instability for the biased model in the case of increasing wu, our choice of equal diffusivities for the three species, and our default set of parameters. Threshold value wu∗(k) as a function of k with L=8. The ODE parameters are taken from Table 1, and the PDE parameters are chosen as Du=Dv=Dϕ=0.03. The orange circles represent the thresholds obtained from the condition P3<0, the dark blue triangles represent those obtained from P3>P1P2, the horizontal black dashed line corresponds to a cooperator movement sensitivity of wu=0, and the vertical black dotted line corresponds to the critical wavenumber k∗=8. The right panel shows a zoomed-in view of the left panel near the minimal wu∗(k). The minimal threshold is attained at k=8, with wu∗≈6.4603 (color figure online) In Fig. 3, we calculate the components of the thresholds from Eq. (52) on wu required to generate pattern formation due to achieving the conditions P3(k)<0 and P3(k)>P1(k)P2(k) for each wavenumber k. For the case of the reaction parameters from Table 1 and equal diffusivities Du=Dv=Dϕ for cooperators, defectors, and the public good, we see that the determinant condition produces a lower threshold for the onset of pattern formation than the combined condition on P1(k), P2(k), and P3(k). We also further zoom in on the wavenumbers with low threshold movement sensitivities wu∗(k), which allows us to see that the critical wavenumber is given by k∗=8 and allows us to apply Eq. (52) to see that the threshold cooperator movement sensitivity is given by wu∗≈6.4603. We can further explore the conditions for instability by plotting the dispersion relation for our linearized system and displaying the threshold cooperator movement sensitivity wu∗ for various defector movement sensitivities wv in Fig. 4. Since we want to understand how directed motion alone can produce linear instability, we set Du=Dv=Dϕ and explore how the uniform state can be destabilized by increasing the cooperator movement sensitivity wu∗. In particular, when L=8, wv=1, and we set Du=Dv=Dϕ=0.03, we can compute the threshold of wu at which the uniform coexistence state becomes unstable as wu∗≈6.4603 and that the most unstable wavenumber is k∗=8. We plot the dispersion relation for three values in wu in Fig. 4(left), showing that there are no unstable wavenumbers for wu=4, that there is a single unstable wavenumber k∗=8 when wu is slightly above the threshold wu∗, and that there is a range of unstable wavenumbers when wu=8. We then further illustrate the threshold condition wu∗ by considering how this threshold depends on the defector movement sensitivity wv, plotting in Fig. 4(right) the regions in the (wu,wv) plane that produce instability in the biased model. Notably we observe a linear dependence of the threshold wu∗ on the value of wv, recapitulating the linear dependence of the analytical threshold condition on wu to achieve det(M(k))>0 for the biased model. Dispersion relation and stability condition for the one-dimensional background domain [0, L] with L=8 and wavenumber k∗=8. The ODE parameters are taken from Table 1. The diffusion coefficients are set to be Du=Dv=Dϕ=0.03. In part (a), we choose wu=4, 6.4603, and 8. For the stability condition in the (wv,wu)-plane, the orange region corresponds to instability, while the white region corresponds to stability. The dark blue curve represents the boundary determined by Eq. (52). In particular, when wv=1, the threshold value is wu∗≈6.4603 (color figure online) Comments on Pattern Formation for More General Assumptions on Movement Parameters In the sections above, we have focused on the special cases of pattern formation for either the pure reaction-diffusion dynamics of the unbiased model and for the case of directed motion with equal diffusivities of the three species in the biased model. While we were able to derive conditions for the onset of instability in these two cases and used a mix of analytical and numerical approaches to demonstrate the formation of stationary patterns in these cases, it may be possible that other combinations of movement parameters can combine to produce spatial patterns, and that other choices of movement or reaction parameters could combine to produce Turing-Hopf bifurcations and corresponding oscillatory emerging patterns and the possibility of spatiotemporal chaos. A full characterization of the conditions for Turing and Turing-Hopf instabilities has been provided in a recent paper by Piskovsky (2025) for the case of reaction-diffusion systems with three species, so this approach could potentially be applied to understand the full range of stationary and oscillatory pattern-forming instabilities in the unbiased model for general values of Du, Dv, and Dϕ. Due to the complexity of the analytical conditions from Piskovsky (2025) and the number of parameters present in the reaction dynamics of our public goods model would likely require a primarily numerical exploration of the instabilities possible across the set of possible reaction parameters. To perform a systematic exploration of possible Turing and Turing-Hopf patterns in the unbiased model, it may make sense to constrain a numerical sweep across reaction parameters that correspond to ecologically feasible coexistence equilibrium states to further understand how generic stationary Turing patterns within our parameter space (Gellner et al. 2023; Gibbs et al. 2024). For the case of the biased model, there is also room to explore the role played by directed motion in promoting spatial patterns for the case in which there are unequal diffusivities among species. In particular, one could look to characterize the minimal cooperator sensitivity wu∗ to gradients in public good concentration required to generate spatial patterns when Dv≠Du, but Dv is no sufficiently large to generate a Turing instability in the unbiased model. Studying general conditions for pattern formation in the unbiased model can show how the chemotactic mechanism can work in concert with the Turing mechanism to help produce spatial patterns when neither mechanism is sufficient on its own, and one can explore whether the qualitative properties of the resulting patterns match behavior seen due to instabilities resulting from each of the two mechanisms. A similar analysis of the role of differential diffusion and differential directed motion was explored in the case of evolutionary games with diffusive and payoff-driven motion Yao et al. (2026), and further exploration on the mix of Turing and chemotactic instabilities could potentially generalize the approach of Piskovsky (2025) to understand general conditions for stationary and oscillatory pattern-forming instabilities in three-species models with both models of motion. Weakly Nonlinear Analysis of the PDE Model In this section, we apply weakly nonlinear analysis for our model near non-trivial equilibrium E3 with one-dimensional background space [0, L] with zero-flux boundary conditions. For both cases of the PDE model in which we found spatial instability, we will use perturbation expansions to study the approximate behavior of solutions to the PDE model when our bifurcation parameter is close to the threshold for the onset of pattern formation (exploring Dv close to Dv∗ in the unbiased model and wu close to wu∗ in the biased model). We focus on the case of the unbiased model in Sect. 4.1 and the case of the biased model in Sect. 4.2, showing that the pattern-forming instabilities in both models correspond to supercritical pitchfork bifurcations under the default parameters from Table 1. We then explore the robustness of this prediction by changing two of the reaction parameters in Sect. 4.3, showing that both subcritical and supercritical pitchfork bifurcations can be achieved as we vary the conversation rate ru of public good consumption into cooperator population growth or the baseline death rate μu for cooperators. Weakly Nonlinear Analysis of the Unbiased Model We begin with the weakly nonlinear analysis of the unbiased model of Eq. (35), consider the case of wu=wv=0. To do this, we consider a small ε>0, use Dv as the bifurcation parameter, and we introduce the following transformations: In these transformations, D~ is the controlling parameter, Dv∗ is the threshold that can be obtained by Eq. (44). We consider the following perturbation expansions for the profiles of cooperators, defectors, and the public good where (u0,v0,ϕ0) corresponds to the uniform equilibrium state and we consider solutions that depend only on the slow timescale T=ε2t (and not the original timescale t) due to our assumption that Dv is close to the threshold Dv∗ for the onset of pattern formation. Remark 6 We chose the slow timescale T=ε2t and the scaling of the perturbation of the defector diffusivity Dv=Dv∗+ε2D~ due to the boundary condition associated with our one-dimensional domain. In particular, both Turing instabilities and chemotactic instabilities typically take the form of a pitchfork bifurcation for the case of a one-dimensional spatial domain with zero-flux boundary conditions (Woolley 2022; Short et al. 2010; Cross and Hohenberg 1993), and the choice of O(ε2) scaling of time and our bifurcation parameter will allow us to use the self-consistency of our perturbation expansion to derive an ODE for the amplitude of our emerging patterns for diffusivity Dv close to the threshold for Turing instability. While we directly assume the scaling that will allow us to derive the appropriate amplitude equation for our two models, it was shown by Woolley (2022) that it is also possible to study these bifurcations using a more systematic expansion for the bifurcation parameter of the form and a hierarchy of time-scales (T1,T2,⋯) allowing for the following expansion of the O(1) time-derivative as With this approach, Woolley (2022) was able to demonstrate that the pattern-forming instability for two-species Turing patterns in one spatial dimension took the form of a pitchfork bifurcation for the case of zero-flux and periodic conditions and took the form of a transcritical bifurcation in the case of Dirichlet boundary conditions. By plugging the perturbation ansatz of Eq. (55) into Eq. (15), we show in Sect. C of the appendix that the functions in our expansion will satisfy a hierarchy of partial differential equations for each order of ε. Up to cubic order in ε, this hierarchy of equations will be given by where we consider the linearization LDv∗ at the critical defector diffusivity Dv∗ given by For Dv sufficiently close to Dv∗, we expect the solution of the linearized dynamics to be stationary on the original timescale t, and the growth of the amplitude of the sinusoidal pattern with the critical wavenumber k∗ to vary only on the slower timescale characterized by T=ε2t. In particular, we expect solutions to our equation at order O(ε) to take the form where A(T) is the amplitude of the sinusoidal profile of the O(ε)-solution and the vector q=(qu,qv,qϕ)T is an element of the kernel of the linearization matrix when applied to functions proportional to sinusoidal functions of the form cosπk∗Lx, which is given by We can then plug our expression from Eq. (60) for u1(T,x), v1(T,x), and ϕ1(T,x) into the right-hand side of Eq. (58c) to see that our solutions at order O(ε2) as an inhomogeneous system of ODEs for u2(T,x), v2(T,x), and ϕ2(T,x). This allows us to rewrite Eq. (58c) as We can then use the identity cos2πk∗Lx=121+cos2πk∗Lx to rewrite this equation as where the coefficients s0 and s2 are given by We guess a particular solution of u2,v2,ϕ2 in the form: Because we are assuming that the spatially uniform equilibrium is stable under the reaction dynamics and that k∗ is the only unstable wavenumber for our choice of diffusivity Dv close to Dv∗, we are able to deduce that the matrices MDv∗(0)=J and MDv∗(2k∗) are invertible, and we can therefore see that a particular solution to the O(ε2) is given by the functions where we denote the entries of tj by tj=(tj,u,tj,v,tj,ϕ)T for j=0,2. We can then use the solutions we have obtained for (u1(T,x),v1(T,x),ϕ1(T,x))T and (u2(T,x),v2(T,x),ϕ2(T,x))T to rewrite the right-hand side of our O(ε3) equation. In particular, we plug these expressions into Eq. (58d) and use the identity cosπk∗Lx3=34cosπk∗Lx+14cos3πk∗Lx to see that it is possible to write this equation in the form where the entries vector H1=(H1,u,H1,v,H1,ϕ)T of coefficients for the term proportional to cosπk∗Lx are given by To deduce the desired qualitative properties for our weakly nonlinear analysis, we do not need to use the coefficients of H3, the vector of coefficients for cos3πk∗Lx. Because the righthand side of Eq. (67) contains terms proportional to the function cosπk∗Lx that appears in the kernel of the linear operator LDv∗, we need to ensure that this term does not produce a resonant solution. We can apply the Fredholm alternative to see that the term H1cosπk∗Lx must be orthogonal to the kernel of the adjoint operator LDv∗†. Considering our solution space as L23[0,L], we then consider an element p∈kerLDv∗†, and we look to ensure that and we can therefore deduce that we need the coefficient function H1 to be orthogonal to the vector p=(pu,pv,pϕ)T. In particular, we can choose to scale the vector p so that p·q=1, and we can use the condition p·H1=0 and the expression from Eq. (68) to derive the following ODE for the amplitude function A(T): where Equation (70) is a cubic Stuart-Landau equation, and it describes how the amplitude of the pattern changes in the slow time variable T=ε2t. By characterizing the dynamics of A(T) and determining the long-time behavior of the amplitude, we can help to characterize the qualitative behavior of our approximate solution from the perturbation expansion for parameters close to the pattern-forming threshold. We use this amplitude equation to classify the pattern-forming bifurcation, and will use the long-time value of the amplitude to help characterize the total population size for each strategy and the total concentration of the public good across the spatial domain. Remark 7 In the derivation of the first and second-order perturbation solutions, we select a nonzero vector q in the kernel of MDv∗(k∗). The choice of q is not unique, as it can be multiplied by any nonzero scalar. However, such a rescaling does not affect the resulting perturbation solutions, as shown in Appendix D. Due to the complexity of the expressions, we determine the bifurcation type numerically. Using the reaction parameters from Table 1 and holding fixed the values of Du and Dϕ that we used for the linear stability analysis, we can compute the corresponding threshold values Dv∗ and use this to obtain the vectors p and q to derive the corresponding coefficients η and β for the Stuart-Landau equation. We then plot the values of η and β as a function of the cooperator diffusivity Du, showing that η>0 and β<0 for the parameters in Table 1 and the range of Du under consideration. These values of η and β suggest that the amplitude equation will undergo a supercritical pitchfork bifurcation as D~ increases past 0. In particular, this behavior of the amplitude equation rules out bistability of a pattern state and the uniform coexistence state for defector diffusivities Dv slightly below the threshold required for Turing instability under the default parameters, with stable uniform states expected for DvDv∗. η - Du graph and β - Du graph on the one-dimensional domain [0, L] with L=8. Wavenumbers k∗ are chosen based on Eqs. (44) and (45). The parameters are wu=0, wv=0, and the ODE parameters are taken from Table 1. The horizontal axis corresponds to the values of Du. In particular, when Du=Dϕ=0.01, the critical wavenumber is k∗=8. The horizontal dashed lines represent η=0 (left) and β=0 (right), separating regimes in which we expect a supercritical pitchfork bifurcation (η>0 and β<0) and in which subcritical bifurcations may be possible In particular, for the special case Du=Dϕ=0.01, we compute the corresponding threshold value Dv∗=0.04861, as in Fig. 2. In this case, we can compute that and the values of η and β are η≈2.5887 and β≈-0.4500. Remark 8 We note that all components of the vector q have the same sign, which implies that the deviation of the spatial profiles of cooperators, defectors, and public goods from the uniform coexistence state will be positivity correlated. However, this correlation is not always guaranteed. In Appendix D, we calculate the ratios between the coefficients qu, qv, and qϕ for the solution of the densities cooperators, defectors, and the public good are always correlated for the O(ε) problem near the pattern-forming threshold for both the unbiased and biased models. Namely, we are able to show that, for both models, the ratios of qu between qϕ and between qv and qϕ take the form Noting that we require that c-κϕ0>0 in order for the coexistence equilibrium to be biologically feasible, we can deduce From Eq. (73a) that the ratio quqϕ>0. Therefore qu and qϕ will have the same sign, and we can therefore conclude that the spatial profiles of cooperators and defectors will be spatially correlated in both models when the bifurcation parameter is slightly above the threshold for the onset of pattern formation. However, the lengthy expression for the ratio qvqϕ in Eq. (73b) does not produce conclusive evidence for its sign and the corresponding correlation of the defector density with the density of cooperators and defectors. Instead, we can use numerical calculations to check the scenarios in which the profiles of cooperators and defectors are correlated or anti-correlated in space, and we will use our analytical expression primarily to deduce the impact that key parameters have on their relative effect in facilitating or impeding spatial correlation. Namely, we see that increasing the movement parameters for defectors wv and Dv helps to facilitate spatial correlation in cooperators and defectors, while increasing diffusivity Dϕ of the public good impedes the establishment of such a correlation. Because we have seen that η>0 and β<0 for the case of our default parameters from Table 1, we can see that the qualitative behavior of the amplitude equation has the following behaviors as D~ passes through 0. When D~=0, Eq. (70) only has the trivial equilibrium A=0, which is stable at the bifurcation point. When D~=0, Eq. (70) only has the trivial equilibrium A=0, which is stable at the bifurcation point. When D~<0, Eq. (70) has only the trivial equilibrium A=0. In this case 74F(A)=ηD~A+βA3,F′(0)=ηD~<0, so A=0 is stable. When D~<0, Eq. (70) has only the trivial equilibrium A=0. In this case 74F(A)=ηD~A+βA3,F′(0)=ηD~<0, so A=0 is stable. When D~>0, Eq. (70) has three equilibria: 75A0=0,A+=-ηD~β,A-=--ηD~β, with 76F′(A0)=ηD~>0,F′(A+)=F′(A-)=-2ηD~<0. Therefore, A0 is unstable, while A+ and A- are stable. When D~>0, Eq. (70) has three equilibria: 75A0=0,A+=-ηD~β,A-=--ηD~β, with 76F′(A0)=ηD~>0,F′(A+)=F′(A-)=-2ηD~<0. Therefore, A0 is unstable, while A+ and A- are stable. We can illustrate the bifurcation structure by drawing the pitchfork bifurcation diagram, as shown in Fig. 6. In particular, we see that, as D~ increases through 0, we see that the uniform state with A(T)=0 becomes unstable, and two stable equilibria A± emerge continuously from the zero-amplitude state providing alternative stable states for the patterns. Due to our choice of zero-flux boundary conditions, the distinction between the positive amplitude solution A+ and the negative amplitude solution A- depends on whether the pattern achieves local maxima or local minima at the endpoints of the domain x=0 and x=L. Pitchfork bifurcation diagram for the Stuart-Landau equation from Eq. (70). The horizontal axis represents the bifurcation parameter D~, while the vertical axis shows the equilibrium amplitude A. The trivial branch A=0 is stable for D~<0 but becomes unstable when D~>0. For D~>0, two nontrivial equilibria A±=±-ηD~/β emerge, and both are stable. This corresponds to a supercritical pitchfork bifurcation Weakly Nonlinear Analysis of the Biased Model We now consider the weakly nonlinear analysis of the biased model, in which wu,wv≠0. In this case we use wu as the bifurcation parameter. And wu∗ is the threshold that can be obtained by Eq. (52). We apply the similar transformation as in Eq. (54): where w~ is the controlling parameter. We also use the same perturbations as in Eq. (55). Again, we show in Sect. C of the appendix that the functions in our expansion will satisfy a hierarchy of partial differential equations for each order of ε. Up to cubic order in ε, this hierarchy of equations will be given by where the linearization Lwu∗ at the critical sensitivity of public goods to the cooperators wu∗ given by We follow the same process as we did in Sect. 4.1. We expect solutions to our equation at order O(ε) to take the form where A(T) is the amplitude of the sinusoidal profile of the O(ε)-solution and the vector q=(qu,qv,qϕ)T is an element of the kernel of the linearization matrix when applied to functions proportional to sinusoidal functions of the form cosπk∗Lx, which in the directed motion model is given by We can then plug our expression from Eq. (79) for u1(T,x), v1(T,x), and ϕ1(T,x) into the righthand side of Eq. (78c) to see that our solutions at order O(ε2) as an inhomogeneous system of ODEs for u2(T,x), v2(T,x), and ϕ2(T,x). For the directed motion model, we see that the terms take the form Since cos2πk∗Lx=121+cos2πk∗Lx, these expressions allow us to rewrite Eq. (78c) similarly as where in the biased model Using these expressions for the inhomogeneous terms and a calculation that is analogous to the case of the unbiased motion model, we are able to see that where Again, we can plug expressions of (u1(T,x),v1(T,x),ϕ1(T,x))T and (u2(T,x),v2(T,x),ϕ2(T,x))T into (78d), then we obtain where H1=(H1,u,H1,v,H1,ϕ)T with After similar calculations with p=(pu,pv,pϕ)∈ker(Lwu∗†) and p·q=1, we can obtain the Stuart-Landau equation as where the coefficients, however, are given by We use the same approach as in the unbiased model. However, we now fix Du, Dv, and Dϕ and vary wv. We compute the corresponding threshold values of wu∗, from which we obtain the values of η and β, and determine the type of bifurcation, as shown in Fig. 7. The plots in Fig. 7 suggest that η>0 and β<0 for the range of values of defector’s sensitivity wv to public goods we consider, indicating that we will expect a supercritical pitchfork bifurcation for the pattern-forming instability in this parameter regime. η - wv graph, β - wv graph on the one-dimensional domain [0, L] with L=8. Wavenumbers k∗=8 are chosen based on Eqs. (52) and (53). The diffusivity parameters are Du=Dv=Dϕ=0.03, and the ODE parameters are taken from Table 1. The horizontal axis corresponds to the values of wv in both panels In particular, for the special case wv=1.0, we compute the corresponding threshold value wu∗=6.4603, as in Fig. 4. In this case, we can compute that and the values of η and β are η≈0.05706 and β≈-0.2302. Since η>0 and β<0, allowing us to deduce that the amplitude equation undergoes a supercritcial pitchfork bifurcation as the control parameter w~ increases past 0. In particular, we see that the unique stable equilibrium of the amplitude equation is A0=0 for w~<0. This equilibrium is unstable when w~>0, and, in this parameter regime, we see two symmetric stable equilibria with amplitudes that correspond to finite amplitude patterned states in the PDE model. Robustness of the Weakly Nonlinear Analysis under Alternative Reaction Parameters So far, we have only explored the form of pitchfork bifurcations obtained for the default reaction parameters from Table 1 and for various spatial movement parameters. We have seen that varying the cooperator diffusivity Du in the unbiased model and that varying the defector movement sensitivity wv does not impact the achievement of a supercritical pitchfork bifurcation as in the case of our default parameter set. However, we will now check how changing several reaction parameters could potentially impact the form of pattern-forming instabilities, exploring the role played in pattern-formation by the conversation rate ru of public good consumption into cooperator population growth and the background death rate μu of cooperators. We chose these parameters as representative of the growth and survival ability of cooperators, allowing us to explore how the qualitative properties of spatial patterns may depend on the fitness displayed by cooperators and defectors in the coexistence state and the relative risk of collapse to the locally stable extinction equilibrium for different reaction parameters. Because we are interested in the instability of the coexistence state, we should consider parameter regimes for ru and μu for which the coexistence equilibrium exists and is stable under the reaction dynamics. As the coexistence equilibrium E3=(u0,v0,ϕ0) has a density of public goods given by we can check the biological feasibility of the coexistence equilibrium by examining conditions under which the equilibrium public good concentration ϕ0 is stable. Furthermore, we also require from the stability conditions for the coexistence equilibrium E3 in Eqs. (25) and (26) that ru0). For both models, we see that the bifurcation remains supercritical for a wide range of ru and μu around the default parameter values from Table 1, and that several regions of subcritical bifurcations for high ru in the unbiased model, and for either low values of ru or high values of μu or ru in the biased model (Fig. 9). ru-β diagrams for the unbiased model (a) and the biased model (b), and μu-β diagrams for the unbiased model (c) and the biased model (d). The remaining reaction parameters are taken from Table 1. For the PDE parameters, we choose Du=Dϕ=0.01 and use Dv as the bifurcation parameter in the unbiased model. For the biased model, we choose Du=Dv=Dϕ=0.03, wv=1, and use wu as the bifurcation parameter. The horizontal dashed lines indicate the value β=0, which provides the boundary between a supercritical pitchfork bifurcation for β<0 and a subcritical pitchfork bifurcation for β>0. The regions featuring subcritical bifurcation are shaded in gray, and the vertical dotted lines indicate the default values of ru and μu given in Table 1 (color figure online) Notably, we see that all regions of subcritical bifurcations occur in parameter intervals adjacent the parameter boundaries in which a further change of ru or μu will result in the disappearance of the coexistence equilibrium (and the corresponding extinction of defectors under the reaction dynamics. The presence of a subcritical pattern-forming bifurcation expands the region of the movement parameters Dv or wu for which a stable patterned state can arise in the unbiased and biased models, respectively, allowing for a region of bistability between a patterned state and the uniform coexistence equilibrium when Dv or wu are slightly below the respective critical levels of Dv∗ or wu∗ that guarantees the local instability of the coexistence equilibrium. This presence of subthreshold patterns near the parameter regimes for elimination of the coexistence equilibrium state is reminiscent of behavior seen in other spatial models in which spatial pattern formation can serve as a resilience mechanism preventing extinction or competitive exclusion in a range of biological systems (DeAngelis 2012; Martínez-García et al. 2013; Rietkerk et al. 2021; Brennan et al. 2025; van der Voort et al. 2025; Banerjee et al. 2026). Numerical Simulation of Our Model In this section, we use numerical simulations to solve our model (15). We consider the zero-flux boundary conditions on the interval [0, L]: To perform our numerical simulations of our model from Eq. (15), we use the built-in pdepe function in MATLAB that implements numerical solutions through the method of lines, a spatial Petrov-Galerkin discretization, and variable-step time integration (Skeel and Berzins 1990; Inc 2024). For our spatial grid, we discretize the interval [0, L] into 128 equal subintervals. We consider initial conditions by generating a population and public goods densities at each grid point xi that are drawn from a random perturbation from the coexistence equilibrium point E3 according to the following formula where ζ is a small parameter and Ranu, Ranv,and Ranϕ are drawn independently from the uniform distribution on [-1,1]. To ensure reproducibility across simulations, we fix the random-number generator seed in MATLAB so that the random initial conditions are the same each time. We first represent the results from our numerical simulation of the reaction-diffusion dynamics of the unbiased model in Sect. 5.1, and then we present numerical dynamics of directed motion in the biased model in Sect. 5.2. In both of these sections, we provide comparisons between the results of numerical simulations with the analytical predictions provided from the weakly nonlinear stability analysis from Sect. 4. We further provided additional comparison between the weakly nonlinear predictions and numerical simulations in Sect. 5.3, highlighting how the rules for diffusive and directed motion impact qualitative properties of the spatial profiles of cooperators, defectors, and the public good. Simulations of the Unbiased Model We start by presenting the emergence of spatial patterns in numerical simulations for the reaction-diffusion model starting with a small initial perturbation from the uniform coexistence equilibrium. In the left panels of Fig. 10, we plot heat maps of u, v and ϕ over time, showing how four clusters of cooperators, defectors, and public good emerge over time and approach a spatially heterogeneous steady state. Thus, each horizontal line represents the spatial distribution of u, v, and ϕ over [0, L] at a given time. We used the same parameters as used for the linear stability analysis displayed in Fig. 2, for which instability was achieved by the critical wavenumber k∗=8, corresponding to a prediction of a spatial pattern with four peaks over the interval [0, L]. We therefore see good agreement with the emergent pattern and the qualitative properties suggested by linear stability analysis for a simulation with parameters close to the onset of Turing instability. Numerical simulation results of the unbiased model on the one-dimensional domain [0, L] with L=8. The parameters are ζ=0.01, wu=0, wv=0, Du=Dv=0.01, Dv=Dv∗(k∗)+ε2 with critical wavenumber k∗=8 and ε=0.01, and the ODE parameters are taken from Table 1. In the left panels, we present heatmaps of the spatial profiles of cooperators u(t, x), defectors v(t, x), and the public good ϕ(t,x), with the horizontal axes describing the spatial interval [0, L] and the vertical axes indicating time increasing from bottom to top. The right panels show the total mass of cooperators ∫0Lu(t,x)dx, defectors ∫0Lv(t,x)dx, and the public good ∫0Lϕ(t,x)dx across the spatial domain, each plotted as a function of time t. The horizontal dashed lines in the right-hand panels represent the total population sizes of cooperators and defectors, and the total concentration of public goods achieved at the spatially uniform coexistence state, which are respectively given by Lu0, Lv0, and Lϕ0 In addition, we calculate the total mass of cooperators, defectors, and the public good across the domain as a function of time, represented by the integrals ∫0Lu(t,x)dx, ∫0Lv(t,x)dx, and ∫0Lϕ(t,x)dx on the interval [0, L]. We plot these quantities in the right panels of Fig. 10, finding that the total concentration of cooperators, defectors, and public good initially increase in time before settling into a steady-state value greater than the corresponding concentrations achieved in the spatially uniform steady state. This numerical result suggests that the Turing patterning mechanism can help to promote the population size for each strategy and promote greater provision of public goods across the spatial domain. We can also provide a comparison between our numerical simulations and the analytical predictions for our patterned steady states that can be deduced from weakly nonlinear analysis. From the weakly nonlinear an analysis, we can consider the approximation provided by the asymptotic expansion of Eq. (55) and the expressions for the solutions at orders O(ε) and O(ε2) given by Eqs. (60) and (65), which tells us that an approximate solution for the unbiased model for small ε is given by We then look to compare these approximate steady-state profiles with the profiles obtained from numerical simulation at large time t=50,000 and for several values of the perturbation parameter ε, as shown in Fig. 11. We find that, when ε is relatively large, the prediction from Eq. (94) does not provide a good approximation for the numerical steady states, as even the location and number of peaks in the patterns do not agree. For two smaller values of ε, we see that there is good agreement between the analytical approximation and the numerical solutions, indicating that we can look to the properties of the approximate states to glean qualitative information about the emerging patterns for parameters close to the onset of instability. Snapshots of u, ϕ and their approximations at t=50,000. Here the orange lines represent the numerical solutions of our unbiased model from Eq. (15) at t=50,000, while the dark blue lines represent the approximations of the solutions obtained by the weakly nonlinear analysis. We set Dv=Dv∗(k∗)+ε2 with critical wavenumber k∗=8 for different values of ε, while using the same values of parameters and the same random initial condition as in Fig. 10 (color figure online) Remark 9 In the comparison we provide between the weakly nonlinear prediction, we need to account for the fact that there are two stable equilibria A± for the Stuart-Landau equation when the diffusivity Dv of defectors is sufficiently large. In particular, we need to choose which of our two equilibrium values A± we should use to compare the approximate solutions from Eq. (94) with the long-time outcome achieved under the numerical simulations. To generate Fig. 11, we perform this approach manually by checking whether A+ or A- appears to more closely match the numerically computed spatial profiles, and this choice between the positive and negative amplitude cases allows us to distinguish between the possibility of a spatial pattern with increased or decreased population and public goods near the spatial boundaries relative to the level expected in the spatially uniform state. We can also look to explore whether the steady-state amplitude selected by the numerical dynamics can be predicted from the initial condition provided through a small random perturbation of the uniform state, examining whether the long-time steady state can be determined from a numerical measurement of the amplitude of the initial profiles of strategies and public goods. We can also explore the time-dependent behavior of solutions, examining how solutions start from the perturbations of the uniform state up, start to grow exponentially with a spatial profile following the sinusoidal shape predicted by the most unstable wavenumber, and then settle upon a spatially heterogeneous equilibrium as described by the weakly nonlinear approximation. To quantify this initial exponential growth phase that occurs in proportion to the sinusoidal profile, we project each component of the solution onto the cosine shape with the critical wavenumber k∗ required for the onset of Turing instability. Specifically, we numerically compute the amplitudes Au(t), Av(t), and Aϕ(t) for the spatial profiles of cooperators, defectors, and the public good by calculating the following deviations of the numerical solutions for u(t, x), v(t, x), and ϕt(x) from the spatially uniform state u0, v0, and ϕ0: To illustrate the initial exponential growth of these cosine profiles, we plot the natural logarithms of these numerical amplitudes ln|Au(t)|, ln|Av(t)|, and ln|Aϕ(t)| as a function of time and compare them to the exponential growth rate predicted from the linear stability analysis from Sect. 3.2.1. We see that the numerical curves initially match closely with the predicted exponential growth close to the uniform steady state, but that the growth of the numerical amplitudes eventually saturates as the profiles of individuals and the public good reach the steady states observed in Fig. 12. Logarithmic projections of the three variables u, v, and ϕ onto the critical cosine mode with wavenumber k∗ as in (95). The solid colored curves represent the numerical amplitudes obtained from simulations, while the dashed lines indicate exponential growth with slope λ(k∗), as predicted by linear stability analysis. The close agreement in the early-time regime confirms that the numerical dynamics follow the theoretical growth rate before nonlinear saturation sets in Simulations of the Biased Model We now present the results for similar numerical simulations for our biased model, exploring the spatial patterns that emerge when cooperators have sufficiently strong sensitivity wu to gradients in the concentration of public goods. We present heatmaps of the densities of cooperators u(t, x), defectors v(t, x), and ϕ(t,x) change in time in the left panels of Fig. 13, showing how four clusters of cooperators, defectors, and the public good emerge from an initial condition featuring a near uniform spread of individuals. These simulations were run for the parameters used for our linear stability analysis introduced in Fig. 3, with the four emerging clusters across the domain [0, L] agreeing with the analytical prediction of a dominant wavenumber of k∗=8. In the right panels of Fig. 13, we also present the temporal dynamics for the total concentrations of the cooperators and defectors, and public good across the spatial domain as represented by the integrals ∫0Lu(t,x)dx, ∫0Lv(t,x)dx, and ∫0Lϕ(t,x)dx. We see that all three total concentrations decrease in time and settle to steady state values below the values that are achieved in the spatially uniform coexistence state, indicating that increased directed motion of cooperators towards regions with more abundant public goods can actually diminish overall population size and the overall public goods provision across the spatial domain We observe the same phenomenon as in the simulation of the unbiased model, as the agreement between the numerical solution and the analytical approximation appears to improve as ε decreases and we get closer to the threshold for the onset of pattern formation. In particular, we see excellent agreement between the numerical solution and analytical approximation for ε=0.01, relatively good agreement for ε=0.05, and substantial deviation between the numerical patterns and analytical approximation for ε=0.1. This suggests that the analytical approximation will yield strong predictions of the qualitative behavior of the patterns achieved for sufficiently small ε, but that we will have to rely on numerical calculations to characterize the resulting spatial patterns as we move further from the threshold cooperator sensitivity wu∗ (Fig. 14). Numerical simulation results of the biased model on the one-dimensional domain [0, L] with L=8. The parameters are wu=wu∗(k∗)+ε2 with critical wavenumber k∗=8, ε=0.01, ζ=0.01, wv=1, Du=Dv=Dϕ=0.03, and the ODE parameters are taken from Table 1. Initial conditions are random. In the left panels, we present heatmaps of the spatial profiles of cooperators u(t, x), defectors v(t, x), and the public good ϕ(t,x), with the horizontal axes describing the spatial interval [0, L] and the vertical axes indicating time increasing from bottom to top. The right panels show the total mass of cooperators ∫0Lu(t,x)dx, defectors ∫0Lv(t,x)dx, and the public good ∫0Lϕ(t,x)dx across the spatial domain, each plotted as a function of time t. The horizontal dashed lines in the right-hand panels represent the total populations of cooperators and defectors and the total public-good concentration in the spatially uniform coexistence state, which are given by Lu0, Lv0, and Lϕ0, respectively Snapshots of the numerically calculated spatial profiles in the biased model of cooperators u(t, x) and the the public good concentration ϕ(t,x) and their approximations at t=80,000. Here the solid orange curves represent solutions of our model (15), the dashed dark blue curves represent the approximation for the steady-state solution obtained by the weakly nonlinear analysis up to order O(ε2), and the horizontal black dashed lines represent the values of the size of the cooperator population u0 (left) and the concentration of public goods ϕ0 (right) at the spatially uniform coexistence equilibrium. We set wu=wu∗(k∗)+ε2 with critical wavenumber k∗=8 for different values of ε, while use the same values of parameters and the same random initial condition as in Fig. 13 (color figure online) Effects of Pattern-Forming Mechanisms on Cooperation and Public Goods Provision We have seen so far that the simulations of the two models suggest that individuals performing biased or unbiased directed motion may lead to different qualitative behaviors in the long-time support for cooperation and public good provision. We now look to explore these differences in a bit more detail, making use of the weakly nonlinear expansions and numerical simulations to determine how rules for spatial motion can impact the long-time success of the population and help determine spatial patterns that emerge in parameter regimes further from the onset of pattern formation. While weakly nonlinear stability analysis is typically used to determine the form of pattern-forming bifurcation and to validate numerical simulations of models close to the instability threshold, it is also possible to glean additional qualitative information about emergent patterns based on the approximate equilibrium solutions achieved through the weakly nonlinear expansion. In particular, we can integrate our expressions from Eq. (94) for the weakly nonlinear expansions u(T, x), v(T, x), and ϕ(T,x) across the interval [0, L] to see that the total mass of cooperators, defectors, and public good is given by where we observe that the integrals of the sinusoidal terms in Eq. (94) all vanish. We therefore see that the signs of the terms t0,u, t0,v, and t0,ϕ will determine whether the size of the cooperator and defector populations and the total concentration of public goods exceeds the masses Lu0, Lv0, and Lϕ0 achieved in the uniform state. We can then use the expressions for t0,u, t0,v, and t0,ϕ we found in Sect. 4 to explore when cooperation and public goods provision can improve in the presence of diffusive or directed motion rules. We provide a comparison of these values in Fig. 15 for our two models, considering how these constants depend on the diffusivity of cooperators Du in unbiased model and on the sensitivity wv of defectors towards climbing gradients in the public good concentration in the biased model. For the unbiased model, we see that the weakly nonlinear analysis predicts an increase in the total mass of cooperators, defectors, and the public good across the spatial domain relative to the spatially uniform state for the parameters used in Fig. 10, while we see that the mass of defectors can drop below that of the uniform equilibrium for different values of cooperator diffusivity. For the biased model, we see that the masses of cooperators, defectors, and the public good are all lower than the mass predicted for the spatial state for the case of the parameters in Fig. 13 and for all defector movement sensitivities wv considered in Fig. 15. Calculation of the components of the vector t0 in the O(ε2) term of the solutions of the weakly nonlinear analysis for both the unbiased and biased models. We plot these quantities as functions of the bifurcation parameter (Dv for the unbiased model and wu for the biased model). For each value of Du or wv, we compute the linear instability threshold Dv∗ (based on (45)) and wu∗ (based on (53)), and then evaluate the components of t0 using (66) for the unbiased model and (84) for the biased model. The horizontal dashed lines represent 0, while the vertical dotted lines indicate the values of Du or wv used in the numerical simulations shown in Figs. 10 and 13 for the unbiased and biased models, respectively. The horizontal axes correspond to Du in panel (a) and wv in panel (b), while the vertical axes show the values of the components of t0. The parameter values are the same as those used in Fig. 5 for panel (a) and Fig. 7 for panel (b) So far, we have seen that, in the weakly nonlinear regime, the total concentration of all three species increase under diffusion-driven instability and decrease under chemotactic instability for the default parameters in Table 1. However, we can also explore how robust these qualitative behaviors are under changes in reaction parameters, and we can use an approach similar to our weakly nonlinear analysis in Sect. 4.3 to see how the components of t0 vary under changes in ru and μu. Using the threshold parameters for the unbiased and biased models, we compute the the components of t0 based on (66) and (84) and display the resulting values in Fig. 16. We see that there is a reasonable large range of ru and μu for which the components of t0 have the same sign as in the case of the default parameter values, although the range is larger for the components t0,u and t0,ϕ associated with the change in total concentration for the cooperator and public good. We also compare the parameter regions featuring reversal of t0 from the default values in Table 1 and the regions featuring subcritical pattern-forming bifurcations (shaded in gray in Fig. 16), and we see that supercritical bifurcation is neither a necessary nor sufficient condition for seeing a change in the signs of the total concentration levels for each species. Calculation of the components of the vector t0 in the O(ε2) component of the solutions of the weakly nonlinear analysis for both the unbiased and biased models, plotted as a function of the reaction parameters ru (top two rows) and μu (bottom two rows). The remaining reaction parameters are taken from Table 1, and the vertical dashed lines indicate the default values of ru and μu. For the PDE parameters, we choose Du=Dϕ=0.01 and use Dv as the bifurcation parameter in the unbiased model. For the biased model, we choose Du=Dv=Dϕ=0.03, set wv=1, and use wu as the bifurcation parameter. The horizontal dashed lines indicate when the components t0,u, t0,v, and t0,ϕ cross 0, separating regimes in which pattern formation works to increase or decrease the total concentration of each species. The regions shaded in gray indicate values of ru and μu (color figure online) Remark 10 A particularly notable feature we observe in Fig. 16 is that while the components of t0 have the same sign for the default parameters, we can see that there are many parameter regimes in which the sign of t0,u disagrees with either t0,v or t0,ϕ. The disagreement between the sign for change in total concentration of cooperators and of defectors in the patterned state is consistent with our finding that the coefficients qu and qv for cooperators and defectors in our solution for the O(ε) problem, suggesting that the spatial anti-correlation of cooperators and defectors could correspond to a difference in how spatial patterns benefit the two types. However, the disagreement between t0,u and t0,ϕ may be a bit more surprising, as we show in Sect. D.2 that the spatial profiles of cooperators and defectors will be correlated due to the fact that the coefficients qu and qϕ for the solution to the linear problem are guaranteed to have the same sign. This means that, even though our mechanisms of diffusion-driven and chemotactic instable produce patterns that collocate the concentration of cooperators and public goods, the resulting patterns may still lead to a different prediction on the total concentration of cooperators and public goods across the spatial domain. An interesting observation we see from the weakly nonlinear analysis is that, for spatial movement parameters close to the onset of pattern formation, it appears that diffusive and biased spatial motion produce different predictions on how the overall population benefits from the formation of spatial patterns. For the parameters considered, the case of purely random diffusion with increased defector diffusivity appears to lead to increased cooperation and a greater total amount of public goods for the parameters while directed motion results in decreased population sizes for cooperators and defectors and a reduced total amount of the public good. We further explore this behavior in Fig. 17, exploring whether the trend of increase or decrease in cooperation and public goods provisions continue as we increase the spatial movement parameters away from the threshold for pattern formation. For a fixed large time t, we vary the control parameters used in the weakly nonlinear analysis (which are Dv for the unbiased model and wu for the biased model), then plot the total mass of cooperators and defectors across the domain as a function of the bifurcation parameter. For the baseline parameters we considered in the simulations for Figs. 10 and 13, we see that increasing defector diffusivity Dv in the unbiased model appears to increase the size of both populations and the overall level of public goods, while increasing the cooperator movement sensitivity wu tends to result in the decrease in cooperators, defectors, and the public good. Calculation of the total long-time population sizes for cooperators and defectors and the total level of public good across the spatial domain for both the biased and unbiased model. We plot these quantities as a a function of our bifurcation parameter of interest (Dv for the unbiased model and wu for the biased model). The horizontal dashed lines represent density achieved in the uniform coexistence state, while the vertical dashed lines indicate the threshold values Dv∗ and wu∗ for the onset of pattern formation. The horizontal axis shows the parameters Dv in (a) and wu in (b), whereas the vertical axis represents the total population and the total amount of goods as the system evolves until certain time t. We use the same random initial conditions as in Fig. 10 for (a) and Fig. 13 for (b) We can also explore the long-time spatial profiles achieved for spatial movement parameters further from the pattern-forming threshold. In Fig. 18, we show the emergence of mesa-like patterns in the reaction-diffusion case for cheater diffusivities Du much larger than the threshold Du∗, with the densities of cooperators and defectors both exceeding the values supported in the spatially uniform state across most of our spatial domain. For the case of directed motion, we see the spatial profiles of cooperators and defectors concentrate upon several spike-like concentrations as the chemotactic sensitivity wu of cooperators grows past the threshold level wu∗ required for the onset of spatial patterns, with the population achieving densities much lower than present in the uniform state at most locations in the spatial domain. This formation of mesa patterns in the reaction-diffusion case and the spike patterns in the chemotaxis case are consistent with the qualitative behaviors observed in related models for far-from-equilibrium behavior of reaction-diffusion models (Kolokolnikov et al. 2007; McKay and Kolokolnikov 2012) and in models of chemotaxis (Wang et al. 2015; Kong and Wang 2022; Kong et al. 2023; Potapov and Hillen 2005). Plots of numerical solutions for the spatial profiles of cooperators and defectors achieved after t=50,000 for the unbiased model (in part (a)) and after t=80,000 time-steps for unbiased model (in part (b)). For part (a), we simulate the unbiased model with defector diffusivity of Dv=0.075 (left) and Dv=0.25 (right), each greater than Dv∗=0.04861. For part (b), we simulate the unbiased model for cases of the cooperator’s sensitivity to public good concentration given by wu=7.5 (left) and wu=12 (right), each greater than wu∗=6.4603. All other parameters are the same as in Figs. 10 and 13. The orange solid lines denote u(t, x), the dark blue lines denote v(t, x), and the dashed lines show the corresponding steady states u0 and v0 (color figure online) Discussion In this paper, we have characterized how the interactions between cooperators, defectors, and an explicitly modeled public good can help to bring about patterns in the spatial profile of cooperative behavior and the provision of public goods, with emergent patterns shaped by the rules of spatial motion of individuals and public goods in continuous space. Starting from an individual-based description of birth and death events for cooperators and defectors, the production and decay of public goods, and the rules for spatial motion of individuals and goods due to random walks on a discrete spatial lattice, we derive and analyze systems of PDEs that can describe spatial pattern formation in the presence of purely diffusive motion for the individuals (our unbiased model) or in the case of a chemotaxis-like directed motion of individuals toward increasing concentrations of public goods (our model of biased directed motion). We see that either an increased diffusivity of defectors or an increased sensitivity of cooperators for directed motion can help to destabilize a spatially uniform coexistence equilibrium, and we use a mix of analytical and numerical exploration to further study the emergent patterns that arise through these rules for spatial motion. Through linear stability analysis, we were able to characterize distinct routes to pattern formation through either a Turing instability due to increased defector diffusivity or through a chemotactic instability through increased directed motion of cooperators. For the case of directed motion, we also saw that the threshold for instability had an increasing linear dependence on the strength wv for directed motion of defectors, indicating that increased movement of defectors towards regions of high public good concentration would help to suppress pattern formation through increased consumption of public goods at nascent peaks of cooperator and public good density. Although the the threshold on defector diffusivity Dv required for Turing pattern formation has a more complicated dependence on the diffusivities of cooperators Du and public good Dv, we can still potentially understand the three-species system in terms of activator-inhibitor dynamics by interpreting defectors as an inhibitor and interpreting cooperators and public goods as an activator subnetwork. Through the incorporation of weakly nonlinear analysis, we were able to observe that, close to their respective thresholds for instability, patterns formed due to either mechanism feature the emergence of spatial correlation of cooperator and public good density, resulting in hubs of abundant public goods and high densities of cooperation. By contrast, the spatial profiles of defectors could either be positively or negatively correlated with the density of cooperators, depending on the parameters chosen for the reaction dynamics and spatial motion. As weakly nonlinear analysis is only meant to reflect behavior of patterns only in a neighborhood of the pattern-forming threshold, we perform further numerical simulations to show that similar spatial clusters also emerge further from onset and observe that a similar correlation between cooperator and public good densities holds across a wide range of movement parameters. To further explore the qualitative properties of the pattern-forming instability, we combined a weakly nonlinear stability analysis and numerical simulations to analyze the stability of emergent patterns and to characterize how individuals of each strategy and the total level of public good either gain or lose from the spatial movement rules that promote spatially heterogeneous distributions of strategies and resources. An interesting feature in our results is that, for a wide range of parameters including the default parameter set from Table 1, the Turing instability resulted in spatial patterns with an increased size of the cooperator population and an increased overall abundance of public goods across the spatial domain, even though the spatial motion corresponds to undirected motion via simple random walks. Although weakly nonlinear stability analysis only characterizes behavior of patterns close to the threshold for instability and only predicts solutions whose mass deviates from the uniform state by a term of size O(ε2), the predictions made by weakly nonlinear analysis for the default parameters agreed with the results obtained by numerical simulation when our bifurcation parameters moved further beyond the threshold and achieved a much more substantial deviation from the uniform equilibrium values. A similar behavior was seen in a reaction-diffusion model with demographic dynamics arising from the payoff of a hawk-dove game and logistic density-dependent regulation (Yao et al. 2026), in which average payoff and average population size increased with diffusion-driven pattern formation. By contrast, we saw that directed motion of cooperators towards increasing levels of public goods actually results in spatial patterns with a worse collective outcome for both strategies than the population would experience in the absence of spatial motion. A similar behavior was seen numerically in a model of evolutionary games with environmental feedback and environment-driven motion (Yao and Cooney 2025), suggesting that this may be a fairly common phenomenon of a spatial social dilemma in the presence of directed motion towards public goods or shared resources. The use of weakly nonlinear analysis and the derivation of the Stuart-Landau amplitude equation for emergent patterns was helpful in our analysis to characterize our pattern-forming bifurcation as a supercritical pitchfork bifurcation for both the models with unbiased and biased motion for a relatively wide range of parameters around the default parameters from Table 1. By considering a wider range of reaction parameters, we were also able to observe parameter regions in which the pattern-forming bifurcations could correspond to subcritical pattern-forming bifurcations, suggesting the possible bistability between the uniform coexistence state and a spatially patterned state when reaction parameters were close to a threshold for biological infeasibility of the coexistence equilibrium state. This region of subcriticality is reminiscent of related results highlighting the role played by spatial pattern formation as a resilience mechanism near collapse of uniform equilibria of the reaction dynamics (DeAngelis 2012; Martínez-García et al. 2013; Rietkerk et al. 2021; van der Voort et al. 2025; Banerjee et al. 2026), and suggests that there may be a rich variety of spatial behaviors exhibited for different parameter regimes in both the unbiased and biased model (Dawes 2008; Breña-Medina and Champneys 2014; Paige et al. 2026). In addition to characterizing the type of bifurcation displayed by our pattern-forming instability, the resulting approximate expression we obtained from weakly nonlinear stability analysis close to the threshold for instability allowed us to obtain approximate expressions for the population sizes and public good abundance across the spatial domain in our patterned states. While the use of weakly nonlinear approximations has been used in the past to characterize qualitative features of species abundance in Turing patterns for predator–prey dynamics (Segel and Levin 1976), there is substantial room to further incorporate this approach to achieve a greater understanding of the levels of cooperation and average payoff in models of spatial pattern formation and in evolutionary games (Helbing and Yu 2009; Helbing 2009; DeForest and Belmonte 2013; Deforest and Belmonte 2018; Xu et al. 2017; Olson et al. 2022). Such asymptotic expansions for key functionals of the spatial profiles achieved in patterned states may also relevant in a range of PDE models for other models of social systems, such as models for economic aggregation into cities by diffusive or capital-induced labor migration (Juchem Neto and Claeyssen 2015; Neto et al. 2018, 2019; Zincenko et al. 2018, 2021; Morsky 2025) or other models of collective spatial dynamics in cities (Hasan et al. 2020; Shaw et al. 2024; Mauro et al. 2025; Lindstrom and Bertozzi 2020; Rogers 2011; Rogers and McKane 2012). As the bifurcation parameters moved beyond the threshold for the pattern-forming instability, we saw the emergence of spike patterns for the directed motion model with strong cooperator sensitivity wu, as well as the formation of mesa or plateau patterns for the reaction-diffusion model in the case of fast defector diffusivity. Asymptotic analysis of chemotaxis and reaction-diffusion models has explored the existence and stability of spike and mesa patterns (Kolokolnikov et al. 2007) in other PDE models displaying spatial pattern formation far from the pattern-formation threshold. In particular, both interior and boundary spikes have been seen as long-time behaviors for the Keller-Segel model with logistic population dynamics (Kong and Wang 2022; Kong et al. 2023), and analogous behavior has been demonstrated in chemotaxis-like models for economic aggregation (Kong et al. 2025) and urban crime (Tse and Ward 2016, 2018; Buttenschoen et al. 2020). The behavior we observe in our numerical simulations suggests that it may be possible to explore mesa-like or spike-like patterns in the far-from-threshold regime, which may allow us to further characterize the qualitative behavior of emergent patterns in the case of strong defector diffusion or fast directed motion of cooperators towards regions of increasing public good concentration. While we have focused on a particular choice of directed motion based on the spatial gradient of the concentration of public goods ϕ(t,x) in this paper, there are many ways we can formulate our models for directed motion based on the underlying rules for public goods production and the population dynamics of cooperators and defectors. In particular, one could consider directed motion of cooperators and defectors could based on the per-capita growth rate of each strategy, which would work analogously to models of payoff-driven motion in evolutionary games that describe how individuals move in the direction of increasing payoff for their strategy (Helbing 2009; DeForest and Belmonte 2013; Xu et al. 2017; Deforest and Belmonte 2018; Yao et al. 2026). Alternatively, one could consider other sensitivity functions like f(w,A)=1+wA, which would produce PDE models with spatial movement rules in the form of logarithmic chemotactic sensitivity that often arise in models arising as continuum limits of agent-based models of directed motion in biological and social systems (Sleeman et al. 2005; Kang et al. 2007; Short et al. 2010; Rodriguez and Bertozzi 2010). For further study, we provide detailed computations for the continuum limit in Appendix A and systematic computations for the perturbations equations for the PDE model of Eq. (15) in Appendix C, which we believe would benefit and facilitate future researchers. One complicating factor in interpreting analytical results for our model is that studying the spatial dynamics of cooperators, defectors, and the public good produces a system of three PDEs, and the resulting stability analysis of these models requires studying the eigenvalues of relatively full 3×3 matrices. It may be possible to consider simplified versions of this model in future work to obtain more interpretable formulas for the pattern-forming instability or the weakly nonlinear approximation by writing the spatial profile of the public good as a function of the strategic distribution of the population. Young and Belmonte (2018) are able to make such a reduction by assuming that the public good does not diffuse between spatial locations and the reaction dynamics of the public good are sufficiently fast relative to the demographic and movement dynamics of individuals in the population. In our PDE model featuring spatial diffusion of the public good, we could potentially try to assume fast spatiotemporal dynamics of the public good and use a parabolic-elliptic system or a Green’s function to represent the steady-state distribution of public goods in terms of the spatial densities of cooperators and defectors. Such a strategy has been frequently applied in establishing the connection between systems of local PDEs used to describe chemotaxis based on populations of individuals and their chemoattractants or chemorepellants (Topaz et al. 2006; Milewski and Xu 2008; Buttenschön et al. 2024), but additional care may be required in performing similar reductions of our public goods model due to the nonlinearity in the reaction dynamics for the public good due to consumption of the good by cooperators and defectors. The production of public goods and the sustainable harvest of common-pool resources can result in closely related social dilemmas for the evolution of cooperation behavior with a self-organized change in environments. Our analysis of the dynamics of cooperation with an explicit public good is therefore complementary to models that have studied the evolution of cooperative extraction of renewable or exhaustible resources (Weitz et al. 2016; Tilman et al. 2020; Mitchener 2022; Wang and Fu 2020), and we can look to compare the spatio-temporal dynamics achieved in our public goods models with related spatial models of evolutionary games with resource dynamics (Lin and Weitz 2019; Li et al. 2026; Betz et al. 2024; Cheng et al. 2024, 2026). Related spatial models for the short-range facilitation via public goods provision and long-range competition for resources have further shown a range of pattern-forming behaviors (Hermsen 2022; Doekes and Hermsen 2024) as associated evolution of cooperative behaviors, providing connections between models of the evolution of cooperation and related non-local PDE models for vegetation dynamics and ecological competition over natural resources (Aydogmus 2015, 2018b; Martínez-García et al. 2013, 2014; Kuehn and Gross 2013). Between these different frameworks for exploring cooperation and competition over public goods and common-pool resources, there is substantial room for further exploration of PDE models for the role of spatial dynamics in the emergence and stability of cooperative behavior. While much past work on spatial patterns and cooperative behavior has focused on game-theoretic models and rules for reproduction and spatial motion that may depend on the payoff from interactions generating payoff from games, the model considered in this paper works more directly with the ecological dynamics associated with the production, consumption, and movement of an explicit public good. We have seen that spatial patterns can emerge due to the interaction between the reaction terms introduced by Young and Belmonte (2018) and either differences in the diffusivities or the chemotactic sensitivity to gradients in public good concentration between the two strategies. In particular, both the Turing-type and chemotaxis-type mechanisms have generated spatial patterns via finite-wavenumber instabilities, allowing us to perform weakly nonlinear analysis and characterize the effects of the spatial movement rules on the total population size and public goods concentration across the spatial domain. By contrast, prior work on game-theoretic models has shown the possibility of infinite-number instabilities in spatial models with payoff-driven directed motion, so the cases of Turing instability and instability due to directed motion are not as directly comparable in models using payoff directly to determine environmental quality. For this reason, models of ecological feedback through either public goods production or the depletion of common-pool resources can be a particularly salient model problem for understanding how rules for directed and undirected spatial motion can help to promote the evolution of cooperative behavior and the promotion of socially beneficial steady-state profiles for the strategic composition of populations. Acknowledgements We would like to thank an anonymous reviewer, who provided many insightful suggestions that have helped improve the paper. Summary of Appendix Sections In the appendix, we provide additional derivations and calculations for formulating and analyzing our PDE models for the spatial public good with diffusive and directed motion. In Sect. A, we provide the full details for the heuristic derivation of our PDE model from a stochastic version of the Young-Belmonte public goods dilemma in which cooperators and defectors perform biased random walks towards patches with greater concentrations of the public good. We also provide additional details about the linear stability analysis for the reaction diffusion case in Sect. B, highlighting when we can deduce that instability of the uniform state can be deduced from the determinant of the linearization matrix becoming positive. We also provide addition derivations and calculations for the weakly nonlinear stability analysis in the appendix. We provide the details for the derivation of the hierarchy of PDEs for our asymptotic approximation of the PDE model close to the onset of the pattern-forming instability, which we then apply in Sect. 4 to study approximate solutions to our PDE model in this parameter regime. We also provide additional calculations for the solutions in the weakly nonlinear regime in Sect. D, highlighting our analytical characterization of the correlation between the concentration of cooperators and the public good in the patterned state and highlighting how the conclusions for the form of Stuart-Landau equation are invariant under certain choices for the form of the solutions to our perturbation expansion. Derivation of PDE Model from Stochastic Spatial Model In this section we provide a full heuristic derivation for the PDE system of Eq. (9) starting from the expected change in the density of cooperators, defectors, and the public good presented in Eq. (7) for the underlying stochastic spatial model. Our goal is to show that the continuum limit of Eq. (9) arises from performing a diffusive / parabolic scaling limit of biased random walks and local reaction events on a regular spatial lattice. Although the analysis of our PDE model focuses on the case of a one-dimensional spatial domain, we perform this derivation for a more general d-dimensional lattice with a von Neumann neighborhood (meaning that individuals have two neighbors in each of the d axes on the lattice). We consider a stochastic spatial model occurring on a d-dimensional lattice with spatial distance ℓ between the nearest neighbors on the lattice, with the temporal dynamics occuring discrete time with time-steps of length Δt. During each time interval from time t to time t+Δt, cooperators, defectors, and public goods undergo a single update containing two stages: first individuals and the public good undergo reaction dynamics based on the local state at each site and then individuals and the good can perform movement between neighboring sites on the lattice. In the reaction stage, the local population dynamics at each lattice node follows the reaction dynamics specified by the Young-Belmonte model, featuring reaction rates corresponding to the ODE dynamics formulated in Eq. (1). In particular, cooperators and defectors reproduce, public goods are produced and consumed, individuals die, and public goods decay. In the movement stage, cooperators, defectors, and public goods have probabilities χu, χv, and χϕ to consider moving to a neighboring lattice size during this time-step, and then individuals that consider moving will either move to a neighboring site or remain at their current site according to a biased random walk based on the strategic and public good composition within their local neighborhood. The jump probabilities in the biased random walk depend on the local environmental attractiveness, described by the functions Ai, Bi, and Ci, so that individuals preferentially move toward move favorable locations. We show that, when the spatial step size ℓ→0 and the time step Δt→0 with ℓ2∼Δt, the terms describing the biased random walk will converge to a linear diffusion term and a nonlinear advection term in our continuum PDE limit. The diffusion term describes undirected components of the underlying random walk, while the drift term arises from the spatial bias in the jump probabilities due to differences in the attractiveness of neighboring lattice sites. This limiting procedure leads to a system of reaction-advection–diffusion PDEs. We interpret ui(t),vi(t), and ϕi(t) as expected population densities at lattice site i. Using the rates of reactions from the Young-Belmonte model and considering a biased random walk based on the attractiveness Ai, Bi, and Ci of the lattice site i for cooperators, defectors, and the public good allow us to derive the following deterministic lattice equations for the expected densities of the three quantities at site i: where N(i) is the set of all neighboring nodes of i. In this section, we will explicitly carry out the derivation of the continuum PDE corresponding to the discrete dynamics of Eq. (97a) for the expected cooperator density, and we can carry out similar derivations for the defector and public good densities with an analogous approach. The effect of the biased movement rules can be written as the difference between incoming and outgoing fluxes at each lattice size. We use P and Q to respectively denote the the expected inflows into site i from neighboring sites the expected outflow from site i to its neighbors, and we see that P and Q are given by the following expressions: To pass to the continuum limit, we assume a regular square lattice in d dimensions with a von Neumann neighborhood and interpret lattice quantities as samples of a sufficiently smooth function g(x) at xi=iℓ. As ℓ→0+, we can use the symmetry of the von Neumann neighborhood to see that where z=2d denotes the number of neighbors of lattice site i and gα(xi) denotes the partial derivative of g(xi) with respect to the variable in each of the dimensions in {1,2,⋯,d} on our d-dimensional lattice. This expansion tells us that movement between nearest neighboring sites on the lattice produces a second-order spatial operator that tends to the Laplacian in the continuum limit under appropriate scaling of the spatial and temporal step-sizes. Here we allow an individual not only to move to one of its neighboring sites, but also to remain at its current site during a time step with a probability depending on the attractiveness of the current site. This means that the movement rule will depend on the attractiveness of the z neighboring sites and the original site i itself, so the total weight required for normalization of the transition probabilities involves calculated the attactiveness of 1+z possible destination sites. Using the expression from the nearest-neighbor expansion from Eq. (98) to approximate the normalization term for the jumped probabilities in the biased random walk, we can expand P and Q in powers of ℓ. For convenience, we write Sj:=uj+ujruϕj-c-γ(uj+vj)-μuΔt, then Since we assume ℓ2/Δt→D, then O(ℓΔt)=O(ℓ4), so we can put all ℓ2Δt terms into O(ℓ4), then Similarly, we can compute Q as The expression P-Q represents the net movement flux at lattice site i, which can be written in the following form: Writing the net movement term in divergence form identifies the corresponding flux, which allows us to understand the rules for directed and diffusive motion for our continuum limit. In particular, we see that the flux term features two terms reminiscent of the flux in models for chemotaxis (Keller and Segel 1970; Hillen and Painter 2009; Painter 2019; Short et al. 2008), where the first component corresponds to ordinary Fickian diffusion and the second component describes directed movement up the gradient of lnf(w,Ai) toward regions where the attractiveness f(w,Ai) is larger. Now, we can apply our expression for net spatial flux P-Q to Eq. (97a) to see that the expected change in the density of cooperators ui(t) satisfies We can take this finite different approximation for the time derivative of ui(t) and apply the limit as Δt→0, ℓ→0, and the the parabolic scaling assumption that ℓ2∝Δt to describe the continuum limit of our model. In particular, we assume that there is a positive constant D such that ℓ2/Δt→D as Δt,ℓ→0, which allows us to balance the spatial and time-steps our model to maintain a nonzero, finite diffusivity of the individuals and public good as our spatial and temporal steps tend to 0. Taking this scaling limit on both sides of the equation and denoting the densities u(t,x), v(t,x), and ϕ(t,x) as the limiting values of the lattice densities, we are able to deduce that the mean-field limit of our stochastic model as the following system of PDEs: where A(t,x), B(t,x), and C(t,x) describe the attractiveness of the location x in our domain at time t to cooperators, defectors, and the public good. If we denote the diffusivities of cooperators, defectors, and the public good by then we can obtain the following system of partial differential equations that describes a general form of the continuum limit of the Young-Belmonte model for public good production and arbitrary rules for directed motion for cooperators, defectors, and the public good: In the resulting PDE system, the diffusion terms arise from unbiased movement, while the advection terms originate from the spatial bias in the jump probabilities. The reaction terms correspond directly to the local birth-death processes in the stochastic model. Further Calculations for the Onset of Turing Instability via the Routh-Hurwitz Criteria In this section, we will provide further justification for relying on the condition of a positive determinant Q3(k)=-tr(M(k))>0 in the linearization matrix to identify the onset for pattern-forming bifurcation for the reaction-diffusion dynamics in the unbiased model (as discussed in Sect. 3.2.1. In particular, we will show that if the quantity Q3,v(k)>0, then it is not possible to achieve the condition Q3(k)>Q1(k)Q2(k) when the diffusivities Du and Dϕ of cooperators and the public good are sufficiently close to 0. This will allow us to show that there is a parameter regime in which we can use the condition Q3(k)=-det(M(k))<0 to identify the threshold for the onset of Turing pattern formation in the unbiased model. By writing our expressions for the quantities Q1(k)=-tr(M(k)), Q2(k)=S2(M(k)), and Q3(k)=-det(M(k)) as we can express the condition Q3(k)>Q1(k)Q2(k) in the form This condition is a quadratic inequality in the defector diffusivity Dv that can be rewritten in the form We showed in Sect. 3.2.1 that Q1,v(k),Q1,c(k),Q2,v,Q2,c,Q3,c>0 for all parameters, so the quadratic and linear terms in our inequality will be positive for the case in which Q3,v>0 (which is required to allow the condition Q3(k)=-det(M(k))>0 for sufficiently large Dv). To understand the sign of the constant term in our quadratic inequality, we can use the expressions from Eqs. (39), (41), and (43) to see that, in the limit of small Du and Dϕ, we have that Because the coexistence equilibrium E3 is stable under the reaction dynamics, we know that det(J)>tr(J)S2(J), and we can therefore deduce that, for a given wavenumber k, Q1,c(k)0, all three coefficients of the powers of Dv on the lefthand side of the inequality from Eq. (103) will be positive for sufficiently small Du and Dv, and therefore the lefthand side cannot be negative for those parameter values. As Turing instability can occur for sufficiently large Dv when Q3,v>0, we can therefore deduce that the minimal value of Dv for which Q3(k)=-det(M(k))>0 will be our threshold for the onset of pattern formation in the parameter regime for which Du and Dϕ are sufficiently small. We will therefore use the determinant condition for instability as our key condition for pattern formation in the reaction-diffusion model, and we will use this threshold value of Dv as our critical parameter for the weakly nonlinear stability in Sect. 4. Calculation of the Weakly Nonlinear Approximation In this section, we provide the details of the derivation of the order-by-order system of PDEs we derive from our perturbation equations as part of the weakly nonlinear stability analysis. In particular, we consider the dynamics of our PDE model when our bifurcation of parameters Dv or wu are close to the threshold for the onset of pattern formation for the cases of the unbiased and biased models, in which case we expect the exponential growth rate to be approximately zero starting from a small perturbation near the coexistence equilibrium. To perform this analysis, we introduce a small parameter ε to measure the distance from the bifurcation threshold, assuming that the bifurcation parameters take the form Dv=Dv∗+ε2D~ and wu=wu∗+ε2w~ respectively for the unbiased and biased model, which corresponds to exponential growth rates λ proportional to ϵ2t for the linearization performed in Sect. 3.2. With this slow growth of the amplitude of our sinusoidal perturbation arising in the linear analysis, we can look to perform a perturbation expansion in terms of our small parameter ε to analyze the behavior of our solution beyond the linear expansion. With this perturbation expansion, we can obtain a hierarchy of PDEs for our expanded solution that starts with the linearized PDE derived previously and that includes the effects of nonlinear interactions and nonlinear rules for directed motion to determine how the growth of patterns can saturate to produce a spatially heterogeneous steady state. By solving the hierarchy of PDEs in order, we encounter the possibility of having a resonant term at order O(ε3), so we need to apply the solvability condition from the Fredholm alternative to obtain an equation satisfied by the amplitude of our emergent patterns. We then use the resulting amplitude equation to characterize the form of the pattern-forming bifurcation and to describe an approximate expression for a patterned steady state for our PDE model. When the bifurcation parameter for the biased or unbiased model differs from the threshold value by a quantity on order ε2, we expect the temporal evolution of the pattern to occur on a similar timescale, This motivates the introduction of a slow time variable T=ε2t, which we will use to describe the temporal evolution of the amplitude of our spatial parameters. We then assume that, close to the onset of pattern formation, the solution of our PDE models can be written in terms of the following perturbation expansion in terms of the small parameter ε: where each term in expansion is either constant in time or depends on time only through the slow time variable T=ε2t. We will plug these perturbation expansions into both sides of our PDE model from Eq. (9). To represent the expansion of the righthand sides of each PDE, we introduce the notation Fu(j),Fv(j),Fϕ(j) to represent the terms obtained at order εj in the u-, v-, and ϕ-equations, respectively. This allows us to write the expansion of the righthand sides of Eq. (9) as We can also apply our expansion of the bifurcation parameter Dv=Dv∗+ε2D~ or wu=wu∗+ε2w~ to our key parameter for the unbiased and biased model and use the fact that the righthand side only depends on the slow timescale T=ϵ2t to see that we can collect all of the terms in our PDE at the order O(ε) to obtain the following system of equations which corresponds to the case of the linearization of our PDE model right at the critical bifurcation parameter (as this critical parameter value results in neither exponential decay nor exponential growth of the perturbation over time). We can then rewrite this linearized solution in the form which highlights the dependence of this linearized system on both the linearization J of the reaction dynamics at the coexistence equilibrium and a movement matrix R describing the effects of diffusive and directed motion in our PDE model. We can then use these two matrices to write our linearized operator for the system as L=-R∇2+J, and we can use our perturbation expansion to see that a copy of this operator will appear at each differential equation at order O(εj) due to its action on the terms uj, vj, and ϕj in our expansion for the cooperator, defector, and public goods densities. Notably, this linear operator will be evaluated in terms of either the critical parameter Dv∗ or wu∗ depending on whether we are analyzing the unbiased or biased model, but we retain the single notation for the linear operator L for simplicity in this section. We can similarly collect terms in the expanded form of our equation at order O(ε2) to obtain our next system of equations which includes how our linearized operator acts upon the terms u2, v2, and ϕ2 and a nonlinear term describing how the reaction dynamics and rules for directed spatial motion depend on nonlinear terms arising from products of the O(ϵ) solutions u1, v1, and ϕ1 and their derivatives. We can then rewrite this system in terms of the linearized operator L Notably, the righthand side features nonlinear terms highlighting interactions between the densities of cooperators, defectors, and public goods, with the nonlinearities depending only on terms u1, v1, and ϕ1 that can be obtained by solving the O(ε)-problem. To describe the behavior of our model at order O(ε3), we will further have to include how the linearized operator acts on the O(ε3) solution u3, v3, and ϕ3, as well as nonlineriaties arising from the products of solutions at orders O(ε) and O(ε3) and their derivatives. In addition, we see that additional terms arise at this order due to our assumptions on the form of the bifurcation parameters (Dv=Dv∗+ε2D~ for the unbiased model and wu=wu∗+ε2w~ for the biased model), which will result in O(ε3) terms due to the fact that u0 and v0 are constant densities and that we can write out the relevant movement terms in the linearized operator for the biased model as and we can write the relevant term in the biased model as We can similarly use the assumption of the presence of the slow timescale with the new time variable T=ϵ2t to see that time-derivatives of the quantities u1, v1, and ϕ1 will first appear at this order. In particular, we can see use the perturbation expansion for our solution and the fact that u0 is a constant density to see that the time derivatives of our solution for the density of cooperators is given by and therefore we can deduce that the term ∂u1∂T will appear to represent the time-derivative of the cooperator density in the O(ε3) equation. We can similarly see that the terms ∂v1∂T and ∂ϕ1∂T will appear in their respective equations at this order. Putting together all of the terms we have discussed above, we see that the problem for the unbiased model at order O(ε3) is given by while the O(ε3) problem for the biased model is given by We can further rewrite the problems at order ε3 respectively for the unbiased and biased models in terms of the linearized operator L as and Using this form of the problem will help us apply the solvability condition from the Fredholm alternative, which will allow us to obtain the amplitude equation for the pattern-forming bifurcation and assess qualitative properties of emergent spatial patterns in both models. Additional Insights from Weakly Nonlinear Analysis: Correlation of Cooperators and Public Good in Spatial Patterns In this section, we note several relevant properties that can be learned about spatial patterns from the solution to the O(ε) problem from weakly nonlinear stability analysis. We first show that the qualitative behavior of the amplitude equation and resulting patterns is independent of the choice of a representative element q of the kernel of the linearization matrix M(k), which we present in Sect. D.1. We then apply this in Sect. D.2 to show that we can pick a particular representation of the kernel that will help us determine that the spatial patterns of cooperators and public goods will feature similar peaks and troughs in their profiles across the domain. Independence of Qualitative Behavior of Amplitude Equation on Scaling of Kernel Vector In this section, we show that the choice of vector q in the kernel of MDu∗(k∗) in (61) does not affect the results of the weakly nonlinear analysis. In particular, we can use the expression we found in Sect. 4 to see that the weakly nonlinear approximation for our solution to both the biased and unbiased model can be expressed in the following form: where A(T) denotes the amplitude, which satisfies the cubic Stuart-Landau Eq. (70) with initial condition A(0). Because we would like to consider the rescaling of the vector q, we can try to divide q by a given constant and see if we can multiply the same constant by the amplitude A(T) to leave the qualitative behavior of the pattern unchanged. In particular, we need to show that multiplying the initial amplitude by a constant will produce a solution to the amplitude equation that is multiplied by the same constant. This motivates the following lemma, which will allow us to transfer a constant between the kernel vector q and the amplitude A(T) of our spatial pattern. Lemma 1 Assume that λ≠0. Let A1 and A2 satisfy If A1(0)=λA2(0), then A1(T)=λA2(T) for all T. Therefore we see that the nonzero equilibria of the second amplitude equation are given by so the resulting equilibrium amplitude satisfies A2∗=λA1∗ for each equilibrium of the original amplitude equation for A1(T). Rescaling q by a scalar factor λ≠0 rescales p by 1/λ since p·q=1, while t0 and t2 in (66) are multiplied by λ2. The coefficient η in the Stuart-Landau Eq. (70) remains unchanged, whereas β is multiplied by λ2, and the initial condition A(0) is scaled by 1/λ. Applying Lemma 1, these changes compensate each other, and all dependence on λ cancels in (109). Since the choice of eigenvector q does not affect the weakly nonlinear expansion, we may fix a qϕ=1 for q=(qu,qv,qϕ). This will allow us to simplify our analysis of qualitative properties of emergent patterns, as the signs of qv and qϕ can then be used to determine whether the peaks and troughs of our spatial patterns will be synchronized across the cooperator, defector, and public good densities. Correlation of Cooperators and Public Goods in Spatial Patterns In this section, we will look to calculate the kernel element q for the linearization matrix M(k) for the unbiased model. This will allow us use the weakly nonlinear expansion from Eq. (109) to determine whether we expect the cooperator, defector, and public good densities to be correlated in the patterned state. We will consider the expression for the linearization matrix M(k) for general values of the diffusivities Du, Dv, and Dϕ and the directed motion sensitivities wu and wv so that our analysis can be applied directly to understand properties of both the unbiased and biased models. We start with assuming a kernel vector of the form q=quqv1T, and our goal is to compute analytic expressions for qu and qv that allow us to see that M(k)q=0. The matrix M(k) is given by Assuming the critical eigenvalue is simple at the bifurcation point, the remaining two equations are linearly independent and uniquely determine qu and qv. The relation M(k)q=0 yields the linear system Then we can solve for qu and qv to see that Furthermore, we can use the scaling behavior demonstrated in Sect. D.1 to see that, for a more general element of the kernel q=quqvqϕT, the ratios of the coefficients of qu and qv with qϕ are given by Near the bifurcation point, the spatial pattern is well approximated by the critical linear mode, where q is the a representative vector in the kernel of M(k∗). Consequently, the signs of the components of q determine whether the variables attain maxima and minima at the same spatial locations. Because we assume that c>κϕ0 to satisfy the equilibrium conditions for the reaction dynamics, we can deduce from Eq. (111a) that quqϕ>0. Hence the u- and ϕ-components of the critical mode have the same sign and therefore attain spatial maxima and minima at the same locations in the patterned state. This calculation matches with our observation from numerical simulations that the cooperator density and the public good concentration exhibit similar peak and trough locations in both the unbiased and biased models. In contrast, it does not appear to be possible to determine the sign of qv analytically from Eq. (111b), and therefore it appears that we have to rely on numerically evaluating the expression for qv for given parameter values. Data Availability This manuscript contains no new data. The numerical simulations in this paper were implemented in Python and MATLAB. The code used to generate the figures and results is publicly available in the GitHub repository: yxuanzhao/BioMath-Public-Goods-Dilemma. Declarations Conflict of interest The authors declare that they have no conflict of interest. Footnotes DBC’s research is partially supported by the Simons Foundation through the Travel Support for Mathematicians Program (grant MPS-TSM-00007872). Publisher's Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Data Availability Statement This manuscript contains no new data. The numerical simulations in this paper were implemented in Python and MATLAB. The code used to generate the figures and results is publicly available in the GitHub repository: yxuanzhao/BioMath-Public-Goods-Dilemma.