What is the derivative of $\int_0^x \frac{f(y)}{\sqrt{x-y} }$? Suppose I have some integral $$\int_0^x \frac{f(y)}{\sqrt{x-y} }$$
How would I differentiate this with respect to $x$?
The Leibniz rule reads $$\frac{d}{dx} \int_0^x g(x,y) \ dy = g(x,x) +\int_0^x \frac{ \partial }{ \partial x} \frac{f(y)}{\sqrt{x-y}}  \ dy$$
for $$g(x,y)=\frac{f(y)}{\sqrt{x-y}}$$
But here by letting $y=x$ I get division by $0$, undefined.
I tried some values of $f(y)$ like for example $f(y)=1$ for which the integral gives $2 \ \sqrt{x} $ whose derivative is defined everywhere but not at $0$.
So how would I differentiate this integral?
 A: Substitution
One thing that comes to mind is to substitute $y\mapsto x-y$ in the integral:
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}\int_0^x\frac{f(y)}{\sqrt{x-y}}\,\mathrm{d}y
&=\frac{\mathrm{d}}{\mathrm{d}x}\int_0^x\frac{f(x-y)}{\sqrt{y}}\,\mathrm{d}y\tag{1a}\\
&=\frac{f(0)}{\sqrt{x}}+\int_0^x\frac{f'(x-y)}{\sqrt{y}}\,\mathrm{d}y\tag{1b}\\
&=\frac{f(0)}{\sqrt{x}}+\int_0^x\frac{f'(y)}{\sqrt{x-y}}\,\mathrm{d}y\tag{1c}
\end{align}
$$
Explanation:
$\text{(1a)}$: substitute $y\mapsto x-y$
$\text{(1b)}$: differentiate
$\text{(1c)}$: substitute $y\mapsto x-y$

Limiting a Truncated Integral
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}\int_0^{x-\epsilon}\frac{f(y)}{\sqrt{x-y}}\,\mathrm{d}y
&=\frac{f(x-\epsilon)}{\sqrt\epsilon}-\frac12\int_0^{x-\epsilon}\frac{f(y)}{\sqrt{x-y}^{\,3}}\,\mathrm{d}y\tag{2a}\\
&=\frac{f(x-\epsilon)}{\sqrt\epsilon}-\int_0^{x-\epsilon}f(y)\,\mathrm{d}\frac1{\sqrt{x-y}}\tag{2b}\\
&=\frac{f(x-\epsilon)}{\sqrt\epsilon}-\frac{f(x-\epsilon)}{\sqrt\epsilon}+\frac{f(0)}{\sqrt{x}}+\int_0^{x-\epsilon}\frac{f'(y)}{\sqrt{x-y}}\,\mathrm{d}y\tag{2c}\\
&=\frac{f(0)}{\sqrt{x}}+\int_0^{x-\epsilon}\frac{f'(y)}{\sqrt{x-y}}\,\mathrm{d}y\tag{2d}
\end{align}
$$
Explanation:
$\text{(2a)}$: differentiate
$\phantom{\text{(2a):}}$ as $\epsilon\to0^+$, this tends to $\infty-\infty$
$\text{(2b)}$: prepare to integrate by parts
$\text{(2c)}$: integrate by parts
$\text{(2d)}$: cancel
As $\epsilon\to0^+$, $\text{(2d)}$ matches $\text{(1c)}$.
A: I will assume that $f(x)$ is continuously differentiable. Then for $x > 0$,
$$ \int_{0}^{x} \frac{f(y)}{\sqrt{x-y}} \, \mathrm{d}y
= \stackrel{(y=xu)}= \int_{0}^{1} \frac{f(xu)\sqrt{x}}{\sqrt{1-u}} \, \mathrm{d}u, $$
and so, differentiating this with respect to $x$ and utilizing the Leibniz's rule gives
\begin{align*}
\frac{\mathrm{d}}{\mathrm{d}x} \int_{0}^{x} \frac{f(y)}{\sqrt{x-y}} \, \mathrm{d}y
&= \int_{0}^{1} \frac{\partial}{\partial x} \frac{f(xu)\sqrt{x}}{\sqrt{1-u}} \, \mathrm{d}u \tag{$y=xu$} \\
&= \int_{0}^{1} \frac{2uxf'(xu) + f(xu)}{2\sqrt{x}\sqrt{1-u}} \, \mathrm{d}u \\
&= \frac{1}{2x} \int_{0}^{x} \frac{2yf'(y) + f(y)}{\sqrt{x-y}} \, \mathrm{d}y \tag{$y=xu$}
\end{align*}

Remark. The formula
$$\frac{1}{\sqrt{\pi}} \frac{\mathrm{d}}{\mathrm{d}x} \int_{0}^{x} \frac{f(y)}{\sqrt{x-y}} \, \mathrm{d}y$$
is the half-derivative of $f(x)$ in fractional calculus.
