I'm trying to solve the following problem: find
$$ \frac{\delta J[f](x)}{\delta f(x')} $$ where
$$ J[f](x) = \int_a^x \frac{1}{f(x')} \left( \int_b^{x'} f(x'')dx'' \right) dx' $$
I can't seem to find any resources that discuss how to deal with the nested structure here. For example, if one simply tries to vary f, i.e. perform
$$ f(x) + \epsilon \eta(x) := f(x) + \delta f(x)$$
in order to compute
$$ \delta J := J[f] - J[f+\delta f] $$
one finds
$$ \delta J = -\int_a^x \frac{1}{f^2(x')} \left( \int_b^{x'} f(x'')dx'' \right) \delta f(x') dx' + \int_a^x \frac{1}{f(x')} \left( \int_b^{x'} \delta f(x'') dx'' \right) dx' $$
The first term is already in the form that allows me to deduce the functional derivative, whereas the second is not. It would require me to somehow shift the $\delta f(x'')$ outside of the nested integral (without the limit depending on $ x' $, one would just switch variables $ x'' \leftrightarrow x' $ and to find the functional derivative).
Do you have any thoughts on this?
Thanks. Nick