Improper parametric integral and differentiation under the integral sign While looking at an astrophysic problem, I encountered the following integral
$$ \rho_{\infty} (r) = \int_{r}^{a} \frac{\rho_{0} (r_{0})}{\sqrt{r_{0}^{2} - r^{2}}} d r_{0} \;\;\;\;\;\;\; (1)$$
The function $\rho_{0} : \, ]0,a] \mapsto \mathbb{R}^{+}$ is an $\textit{a priori}$ given and $\textit{smooth}$ function. If we consider the case $\rho_{0} = 1$, then the integral $(1)$ can be explicitly worked out and leads to $\rho_{\infty} (r) = \text{argch} \left(\frac{a}{r}\right) $. One should note that in this situation, $\rho_{\infty}$ is also a $\textit{smooth}$ function on $]0,a]$.
As $\rho_{\infty}$ in my situation appears to be $\textit{smooth}$, I want to estimate its derivative. Forgetting about the conditions of applicability of the theorem about differentiation under the integral, one can rewrite $\rho_{\infty}$ under the form
$$ \rho_{\infty} (r) = \int_{r}^{a} f (r_{0},r) \, d r_{0} $$
so that naively, its derivative should be given by $\rho_{\infty} \overset{?}{=} \int_{r}^{a} \frac{\partial f}{\partial r} d r_{0} - 1 \cdot f (r_{0},r)$. However, this leads to an undefined expression, since both of these terms are infinite.
My question is the following one. As $\rho_{\infty}$ is a $\textit{smooth}$ function, its derivative exists. But, how should I proceed to estimate $\frac{d \rho_{\infty}}{d r}$ in terms of $\rho_{0}$ ?
$\textbf{Bonus question}$
In fact, my final aim would be to $\textit{invert}$ the equation $(1)$, in order to express $\rho_{0}$ as a function of $\rho_{\infty}$. Any idea on a way to tackle this question ?
 A: The trick to find the derivative of $\rho_\infty$ is to add a well-chosen $0$. We can rewrite $(1)$ as
$$\begin{align}
\rho_\infty(r) &= \int_r^a \frac{\rho_0(r_0) - \rho_0(r) + \rho_0(r)}{\sqrt{r_0^2 - r^2}}\,dr_0\\
&= \rho_0(r)\operatorname{Ar cosh} \frac{a}{r} + \int_r^a \frac{\rho_0(r_0) -\rho_0(r)}{\sqrt{r_0^2-r^2}}\,dr_0.
\end{align}$$
The first term is evidently smooth on $]0,a[$, and now the integrand is better behaved near the lower integral limit. However, showing that you now can differentiate under the integral sign is still very fussy, so let's add a helpful $0$ again. Write
$$D(r_0,r) = \rho_0(r_0) - \rho_0(r) - \rho_0'(r)\cdot (r_0-r).$$
Since $\rho_0$ is smooth, you have $D(r+h,r) \in O(h^2)$, and
$$C(r_0,r) = \begin{cases}\frac{D(r_0,r)}{\sqrt{r_0^2-r^2}} &, r_0 > r\\ \quad 0 &, r_0 \leqslant r \end{cases}$$
is continuously differentiable on $(0,a]\times (0,a]$, so
$$\int_r^a C(r_0,r)\,dr_0$$
can be differentiated under the integral sign (since the integrand vanishes at $r$, the boundary term of Leibniz' rule is $0$).
The remaining part is
$$\int_r^a \frac{\rho_0'(r)\cdot(r_0-r)}{\sqrt{r_0^2-r^2}}\,dr_0 = \rho_0'(r)\int_r^a \sqrt{\frac{r_0-r}{r_0+r}}\,dr_0 = 2\rho_0'(r)r\int_0^{\frac{a-r}{a+r}} \frac{\sqrt{s}}{(1-s)^2}\,ds,$$
which can easily be differentiated.
I cannot offer an idea for your bonus question, unfortunately.
A: I think you have to look into "Abel transformations".
You can write:
$$
F(y)=2\int_y^\infty \frac{f(r)r\,dr}{\sqrt{r^2-y^2}} = 2 \left( \int_y ^{a} \frac{f(r)r\,dr}{\sqrt{r^2-y^2}} + \int_{a}^\infty \frac{f(r)r\,dr}{\sqrt{r^2-y^2}} \right)
$$
assuming that for some high $a$ 
$$
\int_{a}^\infty \frac{f(r)r\,dr} {\sqrt{r^2-y^2}} \rightarrow 0
$$
then you are able to calculate $f(r)$ as
$$
f(r)=-\frac{1}{\pi}\int_r^a\frac{d F}{dy}\,\frac{dy}{\sqrt{y^2-r^2}}.
$$
