Aggregating in a Continuum I am working with the following Economic model of labour and consumption decisions:


I have a population whose mass is normalized to one of consumers.
They derive utility from consumption $c$,supplying labour $l$ and a public good $y$
This is summarized by a differentiable utility function $u(c,l,y)$
Agents derive earnings $z$ from suppliying labour according to:
$$z=nl$$
where $n$ corresponds to a "skill level" such that: $n\in[0,\infty[$. Such skill level is distributed according to distribution of skills $F(n)$ with density $f(n)$.
$c_n$, $z_n=nl_n$ and $u_n$ are used to denote the consumption, earnings, and utility level of an individual with skill level $n$
the individuals maximize their utility function subject to a constraint:
$$c_n=z_n-T(z_n)$$


where $T(\cdot)$ is a differentiable "tax function"

 7.The public good is produced according to the sum of this tax function:


$$y=\int_0^{\infty}f(s)T(z_s)ds$$

We can use the equations above to express the maximization problem of the consumer as:

$$\max_{z_n}u\left(z_n-T(z_n), z_n/n, \int_0^{\infty}f(s)T(z_s)ds\right)$$

The first order conditions to this problem write (ommitting the arguments of the function $u$ for notation compactness):

$$u_{c}(\cdot)(1-T'(z_n))+u_l(\cdot)/n+u_y(\cdot)\cdot  \frac{\partial y}{\partial z_n}=0$$

I am interested in studying the last term $\frac{\partial y}{\partial z_n}$. It seems intuitive that $\frac{\partial y}{\partial z_n}=0$ since:

$$\frac{\partial y}{\partial z_n}=\int_0^{\infty}\frac{\partial f(s)T(z_s)}{\partial z_n}ds=0$$

However, I am not sure about the mathematical requirement necessary for the last equation to make sense. It seems somewhat contradictory to the intuition yo get when aggregating using sums, for instance a discrete analogous would be given by:

$$\sum_{s=0}^{\infty} T(z_s)$$

and it is clear that the derivative of the last expression with respect to $z_n$ would be equal to one.

Could you help me out here? Maybe some broad claryfication of integral aggregation would be required. Thanks!
To obtain $\frac{\partial y}{\partial z_n}=0$, you implicitly assume that each consumer takes its own skill level as given. And in such a case, in reality the consumer optimizes with respect to labor supplied only. Perhaps it would be better to optimaze with respect to $l$ given $n$. 

Regarding aggregation the discrete analogous would not be what you write but

$$\sum_{s=0}^{\infty}p(s) T(z_s)$$

where $p(s)$ would be the proportion of the population having income $z_s$. 

Note that $y = E[T(z_s)]$, the expected value of individual tax burden w.r.t skill level. The density of $s$ plays in the continuous case the role of "population proportions" in the discrete setting