# Is the equality $\frac{d}{dk}\int_{-k}^k \sqrt{f_0(y)f_1(y)}\,\mathrm{d}y=\sqrt{f_0(k)f_1(k)}-\sqrt{f_0(-k)f_1(-k)}$ correct?

Probably it is trivial but I need to be sure about the correctness of the following expression:

$$\frac{d}{dk}\int_{-k}^k \sqrt{f_0(y)f_1(y)} \, \mathrm{d}y=\sqrt{f_0(k)f_1(k)}-\sqrt{f_0(-k)f_1(-k)}$$

I dont know if necessary but $f_i$ are some density functions.

Thanks!

-

## 2 Answers

You had a minus where you need a plus.

Here's the plodding traditional way: $$\frac{d}{dk} \int_0^k \sqrt{f_0(y)f_1(y)} \,dy = \sqrt{f_0(k)f_1(k)},$$ and $$\frac{d}{dk} \int_{-k}^0 \sqrt{f_0(y)f_1(y)} \,dy = \frac{d}{dk} \int_k^0 \sqrt{f_0(-u)f_1(-u)} \, (-du) = \frac{d}{dk} \int_0^k \sqrt{f_0(-u)f_1(-u)} \, du$$ $$= +\sqrt{f_0(-k)f_1(-k)}.$$ Now add the two together.

Here's another way. The area under the function between $-k$ and $k$ has two boundaries that move as $k$ changes. The size of the boundary times the rate at which the boundary moves equals the rate at which the area changes. The sizes of the boundaries are the two terms being added in our bottom-line answer. The two moving boundaries are moving at the same rate: the rate of change of $k$. So the sum of the sizes times the rate of change of $k$ equals the rate of change of area. Hence the sum of the sizes is the rate of change of area with respect to $k$.

-
PS: The second method I give above is how I saw instantly that it should have been a plus. It took me a minute to see that by the first method. So the second point of view can be quite useful. –  Michael Hardy Mar 2 '13 at 23:26

Let $g(y) = \sqrt{f_0(y)f_1(y)}$. Let $G(y)$ be a primitive of $g$. Then, $$\frac{d}{dk}\int_{-k}^k g(y) \mathrm{d} y = \frac{d}{dk}(G(k) - G(-k))$$ Taking the derivative and heeding the chain rule, we have: $$G'(k) - (-1)G'(-k) = \sqrt{f_0(k)f_1(k)} + \sqrt{f_0(-k)f_1(-k)}$$

-