Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If you're maximizing over any function $f$, you can just solve the problem separately for each $x$, and it reduces to the standard problem where you only have an integral over $y$. Calculus of variations becomes necessary if you have some constraint on $f$ etc.