This is perhaps more of a mathematical than an economic question, but since it's from an economic problem, I'm posing it here.
Suppose I have, in a macro model, a perfectly competitive final goods producer combining a continuum of differentiated intermediate goods using the Dixit-Stiglitz (CES) aggregator
$$ Y_t = \left[ \int_0^1 (Y_{i,t})^{\frac1\lambda} di \right]^\lambda $$
This producer chooses $Y_{i,t}$ for all $0 \le i \le 1$ to maximize profits, taken as given input and output prices,
$$ \max_{\{Y_{i,t}\}} P_t Y_t - \int_0^1 P_{i,t} Y_{i,t} di $$
The first-order condition (FOC) for this problem is obtained by taking the derivative of profit (let's call it $\Pi_t$) w.r.t. $Y_{i,t}$, and textbooks invariably give this as
$$ \frac{\partial}{\partial Y_{i,t}}\Pi_t = P_t \left[ \frac{ Y_t }{ Y_{i,t} } \right]^{\frac{\lambda-1}\lambda} - P_{i,t} $$
But how do you arrive there? Specifically, when taking the derivative of an integral such $\int_0^1 P_{j,t} Y_{j,t} dj$ (where I've renamed the integration dummy to avoid confusion) w.r.t. some $Y_{i,t}$ (with $i$ fixed), how does one proceed, mathematically?
My approach would've been to say that since the integral bounds do not depend on $i$, we can switch differentiation and integration by Leibniz rule to get that
$$ \frac{\partial}{\partial Y_{i,t}} \int_0^1 P_{j,t} Y_{j,t} dj = \int_0^1 \frac{\partial}{\partial Y_{i,t}} \left[ P_{j,t} Y_{j,t} \right] dj $$
The derivative inside the integral is $P_{i,t}$ if $i = j$, zero otherwise. So I would think that we should have
$$ \frac{\partial}{\partial Y_{i,t}} \int_0^1 P_{j,t} Y_{j,t} dj = \int_0^1 P_{i,t} \cdot \mathbf{1}(i = j) dj $$
(where $\mathbf{1}$ is the indicator function for the given condition). But since the integrand is then zero almost everywhere (except for at one point), the integral should evaluate to zero:
$$ \frac{\partial}{\partial Y_{i,t}} \int_0^1 P_{j,t} Y_{j,t} dj = 0 $$
Clearly that's not the standard result, which is that
$$ \frac{\partial}{\partial Y_{i,t}} \int_0^1 P_{j,t} Y_{j,t} dj = P_{i,t} $$
instead.
In the discrete case, the result is different, of course. If the integral is replaced with a finite sum (running from $i = 1$ to $N$ for some $N < \infty$), then everything works out. And since an integral is, in a sense, the continuous limit of a discrete sum, the standard result also makes sense.[1,2]
The same holds, mutatis mutandis, for the other integral encountered when deriving the FOC for the Dixit-Stiglitz aggregator ($\frac{\partial}{\partial Y_{i,t}} P_t Y_t$).
I don't doubt that the standard result is correct. However, I wish to understand why it is and how I can arrive at it in a way that's mathematically rigorous.
(There is a related question here, but the answer merely states that the continuous case "follows as a sort of limiting extension", which is too handwavy for me. It also links to Dingel's The basics of “Dixit-Stiglitz lite”, but there's nothing in there.)
Any help is welcome, especially pointers to relevant documents. Thanks!
Footnotes:
- My result also makes some intuitive sense to me: since there is a continuum of intermediate goods, it makes sense that a change in the amount used for production of just one (generally, a null set) would leave overall profits unchanged.
- Mathematically speaking, since the integral is from 0 to 1, I feel that the more appropriate discrete sum it's a limit of is perhaps actually $\sum_{i=1}^N \frac1N P_{i,t} Y_{i,t}$, and when letting $N \to \infty$ there the limit of the partial derivative is indeed zero.