# Definition of integral functional [duplicate]

I'm reading the section of Marion and Thornton devoted to basics on the Calculus of Variations, and came across this definition for the functional: $$J = \int f(y(x), y'(x);x) dx$$ implying that $$f$$ depends on both $$y(x)$$ and $$y'(x)$$.

I'm confused as to why $$f$$ depends explicitly on both $$y$$ and $$y'$$, since $$y'$$ is already specified by the choice of $$y$$.

Any help/explanation would be appreciated!