Leibniz's Rule for integrals with infinity in the bounds - FOC quantile regression Hi I came across one application of Leibniz's rule in quantile regression:
$$ \frac{\partial E[\rho_\tau(y-c)]}{\partial c} = \frac{\partial}{\partial c} \left[(1-\tau) \int_{-\infty}^{c}(c-y) f_Y(y) \,dy \, + \tau \int_{c}^{\infty} (y-c) f_Y(y) dy \right]$$ where I am now a little confused as to which values to use for $ a'({\theta}), b'(\theta)$ in the Leibniz rule definition $F(\theta) = \int_{a(\theta)}^{b(\theta)} f(\theta, x) dx$ and $$ \frac{d}{d\theta} F(\theta) = f(\theta, b(\theta))b'(\theta) - f(\theta, a(\theta))a'(\theta) + \int_{a(\theta)}^{b(\theta)} \frac{\partial f(\theta, x)}{\partial \theta} dx$$.
Since now, my $a(\theta) = -\infty$, naively you get $\frac{d}{dc}(-\infty) = 0$ which leads to the correct result if used for all infinite values, but doesn't feel quite right. Is this the way to go, or should one instead use a distributional argument when plugging in $\infty$ into $f_Y(y)$ as a density?
The answer at Quantile regression: Loss function unfortunately doesn't specify the first order condition that I'm interested in.
Thank you guys!

There's a better way of solving your initial expression using integration by parts.  We'll work through the derivation for the first term in brackets on the r.h.s. of your initial formula.
First,
$${\partial \over \partial c}\int_{-\infty}^c(c-y)f(y)dy = {\partial \over \partial c}\int_{-\infty}^c cf(y)dy -{\partial \over \partial c}\int_{-\infty}^cyf(y)dy $$
The second term on the r.h.s. evidently equals $-cf(c)$.  The first term can be handled via integration by parts, which we briefly review:
$${\partial fg \over \partial x} = g {\partial f \over \partial x} + f{\partial g \over \partial x}$$
Identifying $f$ in the above with $c$ and $g$ with $\int_{-\infty}^c f(y)dy$ allows us to derive:
$${\partial \over \partial c}c\int_{-\infty}^c f(y)dy = F(c)+cf(c)$$
Combining the expressions for the two terms leaves us with:
$${\partial \over \partial c}\int_{-\infty}^c(c-y)f(y)dy = F(c)$$
A similar application of integration by parts to the second term in brackets allows us to conclude that:
$${\partial \over \partial c}\int_c^{-\infty}(y-c)f(y)dy = - (1 -F(c))$$
and the final expression is:
$$\frac{\partial E[\rho_\tau(y-c)]}{\partial c} = (1-\tau)F(c) - \tau (1-F(c))$$
which a small amount of algebra reveals will equal $0$ for $F(c) = \tau$, or, $c = F^{-1}(\tau)$.
