Derivative with respect to function I am looking to calculate the derivative of a functional $\phi(\rho)$ with respect to $\rho$, that looks like $$\phi[\rho](x)=\rho(x)\int_0^1\log|x-y|\rho(y)dy.$$
I have read that the Gateaux derivative or Frechet derivative and calculus of variations are the right key words to look for. However I am very new to functional analysis and I am not sure who to proceed. Could someone help?
PS: I need this for a computation so numerically I wanted to do $(\phi(\rho+tu)-\phi(\rho))/t$ for a small $t$ to approximate the derivative. Is this correct? I wouldn't mind to have an analytic result though. Thank you!
 A: You want the best linear approximation to the map $\Phi : \rho \mapsto \phi[\rho](x)$. Somewhere there must be a topological linear space $X$. For example, perhaps $\rho \in C[0,1]$ and $\Phi : C[0,1]\rightarrow\mathbb{R}$. In any case, if $\rho \in X$ is fixed and $\delta\in X$ is allowed to vary, the derivative at $\rho$ is the best linear approximation of the following with respect to $\delta$:
\begin{align}
    \Phi(\rho+\delta)-\Phi(\rho)= &(\rho(x)+\delta(x))\int_{0}^{1}\log|x-y|\{\rho(y)+\delta(y)\}dy \\
   & -\rho(x)\int_{0}^{1}\log|x-y|\rho(y)dy \\
   = & \delta(x)\int_{0}^{1}\log|x-y|\rho(y)dy+\rho(x)\int_{0}^{1}\log|x-y|\delta(y)dy \\
   & + \delta(x)\int_{0}^{1}\log|x-y|\delta(y)dy
\end{align}
So the derivative at $\rho$ is a linear map which, when applied to $\delta$, gives
$$
        \Phi'(\rho)\delta = \delta(x)\int_{0}^{1}\log|x-y|\rho(y)dy+\rho(x)\int_{0}^{1}\log|x-y|\delta(y)dy.
$$
A: The approach to this problem is to take a "tangent function" $d\rho$ and compute
$$\frac{d}{d\epsilon} \phi(\rho + \epsilon d\rho) {\Huge\vert}_{\epsilon\to 0},$$
the directional derivative of $\phi$ in the $d\rho$ direction. This yields
$$d\rho(x)\int_0^1 \log|x-y|\rho(y)\,dy+\rho(x)\int_0^1 \log|x-y|d\rho(y)\,dy.$$
The gradient of $\phi$ (with respect to the $L^2$ inner product on your function space) is then the function $\nabla \phi$ for which 
$$\langle \nabla \phi, d\rho\rangle = \int_0^1 \nabla \phi(y) d\rho(y)\,dy$$
is the directional derivative of $\phi$ in the $d\rho$ direction, for any $d\rho$. Manipulating the above formula for the directional derivative yields
$$\int_0^1 \left[\left(\int_0^1 \log|y-z|\rho(z)\,dz\right)\delta(x-y) + \rho(x)\log|x-y|\right]d\rho(y)\,dy$$
and the function in brackets is the gradient of your functional.
