Derivative of definite integrals - how did MWG arrived at this result? Microeconomics For a wage as a function of profit: $w(\pi)$ and profit $\pi \in [\pi_{min},\pi_{max}]$, the owner of a company sets the minimum wage to satisfy the following condition:
obs $e = \{e_l, e_h\}$ but in this case effort is observable and contractible, and $f(\pi|e)$ is the pdf of $\pi$, thus:
$$\min_{w(\pi)}  \int^{\pi_{max}}_{\pi_{min}}w(\pi)f(\pi|e)d\pi$$
subject to manager's participation condition:
$$\int^{\pi_{max}}_{\pi_{min}}v(w(\pi))f(\pi|e)d\pi-g(e) = \bar{u}$$
after doing a lagrange optimization F.O.C
$$-f(\pi|e) + \gamma v'(w(\pi))f(\pi|e)=0$$
What exactly I do not understand is how the author took the derivative of the integrand and disappeared with the integral signs... why does it work?
edit: Just in case, you can find this situation in MWG page 480-481, but it happens often in microeconomics.
The minimization problem
$$\min_{w(\cdot)}  \int^{\pi_{max}}_{\pi_{min}}w(\pi)f(\pi|e)d\pi$$
s.t
$$\int^{\pi_{max}}_{\pi_{min}}v(w(\pi))f(\pi|e)d\pi-g(e) = \bar{u},$$
is evidently an infinite dimensional optimization problem. The FOC, a la Lagrange, comes from standard consideration for such problems.
To make this more explicit, define the objective and constrain functionals $\Phi$ and $G$ (on an appropriate function space, say the Banach space $C[\pi_{min}, \pi_{max}]$) by
$$
\Phi(w(\cdot)) =  \int^{\pi_{max}}_{\pi_{min}}w(\pi)f(\pi|e)d\pi
$$
and
$$
G(w(\cdot)) = \bar{u} - \int^{\pi_{max}}_{\pi_{min}}v(w(\pi))f(\pi|e)d\pi + g(e). 
$$
Then the problem is simply
$$
\min_{w(\cdot)} \Phi(w(\cdot)) \;\; s.t. \;\; G(w(\cdot)) = 0,
$$
which is a standard sort of optimization problem over an infinite dimensional space.
The necessary Lagrangian FOC (as in the finite dimensional setting) would be
$$
D_{w} \Phi + \lambda D_{w} G = 0,
$$
where $\lambda$ is the Lagrange multiplier.
Here, the appropriate notion of the derivative $D_{w}$ is the Frechet derivative.
In this specific case, $\Phi$ is a linear functional. Just as in the finite dimensional setting, the derivative of a linear functional is itself, i.e.
$$
D_{w} \Phi = f,
$$
and, an integration by parts calculation would tell us
$$
D_{w} G = v'(w(\pi))f(\pi|e).
$$
So one arrives at the FOC
$$
-f(\pi|e) + \gamma v'(w(\pi))f(\pi|e)=0.
$$

...this situation ...happens often in microeconomics.

By &quot;this&quot;, you mean &quot;solving&quot; such problems by differentiating under the integral sign then setting the integrand equal to identically zero.
Yes, this somewhat loose approach---with various accompanying hand-wavy justifications---often suffices in economic contexts.