How to evaluate the following derivative of integral? I have an integral 
$$I(a)=\int_0^{a}\frac{\mathrm{d}r}{\sqrt{\int_{r}^{a}\mathrm{d}x\frac{f(x)}{x^2}}},$$ where $f(x)>0$ is some real valued function. I need to find the following:
$$\frac{\mathrm{d}I(a)}{\mathrm{d}a}~.$$
I did the following: first take derivative with respect to the outer $a$, and second take derivative with respect to the inner $a$. That is
$$\frac{\mathrm{d}I(a)}{\mathrm{d}a}=\frac{1}{\sqrt{\int_{a}^{a}\mathrm{d}x\frac{f(x)}{x^2}}}-\frac{1}{2}\int_0^{a}\frac{\mathrm{d}r}{\left(\int_{r}^{a}\mathrm{d}x\frac{f(x)}{x^2}\right)^{3/2}}\frac{f(a)}{a^2}.$$
However, this certainly does not look right, as the first term diverges. Can any one let me know where I went wrong?
 A: I suggest to analyse the square root term first. 
Now, considering that you have a generic $f(x)$, we cannot say that much. We may try some tricky substitution to make the integral to look prettier but who knows.
Let's say
$$\frac{1}{x^2} = t^2 ~~~~~~~ \text{d}x = -\frac{1}{t^2}\ \text{d}t = -x^2\ \text{d}t$$
hence you get
$$\int_a^r \frac{f(x)}{x^2}\ \text{d}x = \int_{1/a^2}^{1/r^2}\ f\left(\frac{1}{t}\right) t^2 \ \frac{-\text{d}t}{t^2} = \int_{1/r^2}^{1/a^2} f\left(\frac{1}{t}\right)\text{d}t$$
Knowing nothing about $f$ we assume it does converge in that range, and we may write the solution as $F(1/t)$ according to the fundamental theorem of calculus:
$$F(a^2) - F(r^2)$$
Hence now it's about the rest:
$$I(a) = \int_0^a\ \frac{\text{d}r}{\sqrt{F(a^2) - F(r^2)}}$$
Now the derivative.
$$\frac{\text{d}I(a)}{\text{d}a} = \int_0^a\ \text{d}r\ \left(\frac{\text{d}}{\text{d}a} \frac{1}{\sqrt{F(a^2) - F(r^2)}}\right) = \int_0^a\ \text{d}r\ \left(-\frac{1}{2}\left(F(a^2) - F(r^2)\right)^{-3/2}\frac{\text{d}}{\text{d}a}F(a^2)\right)$$
Namely, arranging things a bit
$$\frac{\text{d}I(a)}{\text{d}a} = -\frac{1}{2}\int_0^a\ \text{d}r\ \frac{1}{(F(a^2) - F(r^2))^{3/2}} \left(\frac{\text{d}}{\text{d}a}F(a^2)\right)$$
