# Functional derivatives of interpolated data

I have set of experimental data:

points={{0, 0}, {1, 2}, {3, 3}, {4, 4}, {5, 3.5}, {6, 3}, {7, 2.5}, {8, 2}, {9, 1}, {10, 0}}

and I would like:

1.) interpolate these points:

fun = Interpolation[points, InterpolationOrder -> 1]

2.) calculate integration:

int = 3 NIntegrate[ myfunction[x]^2/x, {x, 0, 10}]

3.) and finally calculate the functional derivatives $\frac{\partial { \rm int}}{\partial {\rm fun}[x]}$ and plot as a function of x.

I have problem with last point. Could anyone suggest how resolve this issue?

You can get the variational derivative by using EulerEquations in the VariationalMethods package:

Needs["VariationalMethods"];
points = {{0, 0}, {1, 2}, {3, 3}, {4, 4}, {5, 3.5}, {6, 3}, {7,
2.5}, {8, 2}, {9, 1}, {10, 0}};
fun = Interpolation[points, InterpolationOrder -> 1];
lagrangian[f_, x_] := 3 * f[x]^2/x;
eulerEquation = EulerEquations[lagrangian[y, x], y[x], x]
derivative = Subtract @@ eulerEquation  /. y -> fun
Plot[derivative, {x, 0, 10}]
`

Say, you put $F(f) = 3 \int_0^{10} f(x)^2 \frac{1}{x} \, \operatorname{d} x$. So, for a further function $u$, you obtain as the Fréchet derivative $$D F(f) \, u = 6 \int_0^{10} f(x) \, u(x) \frac{1}{x} \, \operatorname{d} x.$$

Note that $DF(f)$ is a linear form on some space of functions and cannot be plotted. What can be plotted is the $L^2$-gradient of $F$ at the point $f$:

$$(\operatorname{grad}_{L^2} (F)(f))(x) = 6 \, f(x)\frac{1}{x}.$$

But note that this might not be an $L^2$-function if $f$ does not vanish sufficiently fast at $0$.

Some people might call this entity "functional derivative", though.

Edit

Note that the gradient in the weighted $L^2$-space $L^2(]0,10],\tfrac{1}{x} \, \operatorname{d} x)$ would be $6\, f$, so there is a certain arbitrariness with the gradients. The only unambiguous entity here is the derivative $DF(f)$.