I am asking this question coming from a background in continuum modelling. This is a simplified example which should illustrate the problem I am facing.
Consider the functional \begin{equation} F \left[ f \right] = \int_{ 0 }^{ L } f \left( x \right) \, dx, \end{equation} then the functional derivative is just \begin{equation} \frac{ \delta F }{ \delta f } = \frac{ \partial f }{ \partial f } = 1. \end{equation}
Alternatively, \begin{equation} \left< f \right> = \frac{ 1 }{ L } \int_{ 0 }^{ L } f \left( x \right) \, dx. \end{equation} So it is also valid to write \begin{equation} F = \int_{ 0 }^{ L } \frac{ 1 }{ L } \left[ \int_{ 0 }^{ L } f \left( x \right) \, dx \right] \, dx^{ \prime } \end{equation} $ f \left( x \right) $ may be expressed as a Taylor expansion from some point $ x^{ \prime } $, i.e., \begin{equation} f \left( x \right) = f \left( x^{ \prime } \right) + \left( x - x^{ \prime } \right) f^{ \prime } \left( x \right) + \frac{ 1 }{ 2 } \left( x - x^{ \prime } \right)^{ 2 } f^{ \prime \prime } \left( x^{ \prime } \right) + ... \end{equation} If the expansion is infinite, then it shouldn't matter from which point $ x^{ \prime } $ the perturbation occurs. In this sense, $ x^{ \prime } $ could be continuously varied. Substituting this into $ F $ gives \begin{equation} F \left[ f \right] = \frac{ 1 }{ L } \int_{ 0 }^{ L } \left[ \int_{ 0 }^{ L } \left[ f \left( x^{ \prime } \right) + \left( x - x^{ \prime } \right) f^{ \prime } \left( x^{ \prime } \right) + ... \right] \, dx \right] \, dx^{ \prime }. \end{equation} However taking the functional derivative yields \begin{equation} \frac{ \delta F }{ \delta f } = \frac{ 1 }{ L } \int_{ 0 }^{ L } \left[ \frac{ \partial f }{ \partial f } - \frac{ \partial \left( x - x^{ \prime } \right) }{ \partial x^{ \prime } } \frac{ \partial f^{ \prime } }{ \partial f^{ \prime } } + ... \right] \, dx = \frac{ 1 }{ L } \int_{ 0 }^{ L } \left[ 1 + 1 + 1 +... \right] \, dx = \infty. \end{equation} This divergence is clearly incorrect. However, conceptually I don't see what my mistake is, although my suspicion is that it is something to do with treating $ x^{ \prime } $ as a variable. Is there a way to make this work?