My question is about equations (1) and (2) in Butters, Dorsey, and Gowrisankaran (2023). This is an economics paper in energy / battery storage. My question is about how to get from equation (1) to equation (2).
Supposedly, taking the first-order condition of equation (1) w.r.t. $q$, we'd get "price equal to the derivative of the expected future value from the choice $q^*$", i.e. something like $P = \beta E(V')$. Then "the corresponding single agent maximization problem needs to maximize the integral of price", which produces equation (2).
I'm not really sure how the first-order condition of equation (1) leads to the expression in equation (2), especially given that in equation (2), the integral is w.r.t. $Z$, and there's a negative sign in front of it.
Equation 1: value function of a group of agents \begin{align} &V(f,s,\tilde{Z}, \epsilon^L, \epsilon^P) = \\ & max_q \hspace{6pt} \{ P(Z, \tilde{Z}, \epsilon^P) \times q \times [\mathbb{1}_{q>0}v + \mathbb{1}_{q<0}\frac{1}{v}] \\ &+ \beta \int V(f-q, s+1, Z, \epsilon^{L'}, \epsilon^{P'})dG(\epsilon^{L'}, \epsilon^{P'}|\epsilon^L, \epsilon^P)\} \end{align}
where $Z = X - K\times q^*(f,s,\tilde{Z}, \epsilon^L, \epsilon^P) \times [\mathbb{1}_{q>0}v + \mathbb{1}_{q<0}\frac{1}{v}]+\epsilon^L$, with $X, K$ given. And \begin{align} -Fv \leq &q \leq F/v \\ 0 \leq f&-q \leq 1 \end{align}
Equation 2: value function of a single agent in a perfectly competitive market, taking price as given \begin{align} &W(f,s,\tilde{Z}, \epsilon^L, \epsilon^P) = \\ & max_q \hspace{6pt} \{ -\int_0^Z P(\zeta, \tilde{Z}, \epsilon^P) d\zeta \\ &+ \beta \int W(f-q, s+1, Z, \epsilon^{L'}, \epsilon^{P'})dG(\epsilon^{L'}, \epsilon^{P'}|\epsilon^L, \epsilon^P)\} \end{align}
where $Z = X - K\times q^*(f,s,\tilde{Z}, \epsilon^L, \epsilon^P) \times [\mathbb{1}_{q>0}v + \mathbb{1}_{q<0}\frac{1}{v}]+\epsilon^L$, with $X, K$ given. And \begin{align} -Fv \leq &q \leq F/v \\ 0 \leq f&-q \leq 1 \end{align}
This seems to be a pure mathematical derivation and has little to do with the context of the paper, so I'd simplify the problem as below:
Equation (1): \begin{align} V(x) = max_q \{ P(Z(q), x) \times q + \beta E[V(g(x, q))] \} \end{align}
where $Z'(q)=-K$
Equation (2): \begin{align} W(x) = max_q \{ -\int_0^Z P(\zeta, x) d\zeta + \beta E[W(g(x, q))] \} \end{align}