# Plot the minimum of a function of two variables , where the minimum is taken with respect to just one variable

Suppose I have a function $f(x,y)$ of two variables $x$ and $y$. Suppose that: for each fixed $y$, the function $f(x,y)$ is non-zero, odd and periodic in $x$, with one maximum and one minimum in the period $x \in [0, h(y)]$. So here the period $h(y)$ depends on $y$.

Now I define the function $g(y) = \min_{x} f(x,y)$ , i.e. $g$ is defined as the minimum of $f(x,y)$ in $x$ for each $y$.

How can I plot $g(y)$?

• A concrete example of f[x,y] would be helpful. – Chris K Nov 1 '17 at 18:21
• is this the problem you're facing Plot[g[y],{y,0,h[y]}] namely the h[y] in the range for y? – user42582 Nov 1 '17 at 18:53
• My function is complicated (it involves elliptic functions depending on $x$ and $y$ in a nontrivial way) so perhaps better to avoid it as an example here @ChrisK – Alex Nov 1 '17 at 20:51
• You are much more likely to get help if you provide an example. – Carl Woll Nov 2 '17 at 5:15
• @Alex correct me if I'm wrong but your problem, then, is not with Plot but with NMinValue possibly; also, it would be a good idea-like others have suggested already-if you could provide a minimally functional instance of your problem in order for more knowledgeable users to provide concrete guidance; this is too hand-wavy, if I may say so – user42582 Nov 2 '17 at 7:08