Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have many functions with two variables $x$ and $y$, for which I need to compute min and max to see if they are in the range I want them to be. For example:

$$z = 0.5 - 0.25 \cos(\pi x) - 0.25 \cos(\pi y),$$ where $x\in[0,1]$ and $y\in[0,1]$.

I tried Wolfram Alpha but for some reason it does not compute the min and max.


share|cite|improve this question
$$0.5-0.25(\cos(\pi x)+\cos(\pi y))$$ $$=0.5-0.5\cos\frac{\pi(x+y)}2\cos\frac{\pi(x-y)}2$$ Now you just need the min and max of $\displaystyle\cos\frac{\pi(x+y)}2\cos\frac{\pi(x-y)}2$ – Host-website-on-iPage Jul 9 '12 at 17:56
Is "many" about $10$ or about $10\,000$? Do you need exact bounds for the range, or would a reasonable approximation do? In the latter case computing 121 values might be the fastest solution. – Christian Blatter Jul 9 '12 at 18:15

For minimum, make $\cos \pi x$, $\cos\pi y$ as big as possible. That happens at $x=y=0$.

For maximum, make $\cos \pi x$, $\cos\pi y$ as small (big negative) as possible. That happens when $x=y=1$, since $\cos \pi=-1$.

Remark: For the other functions you are concerned about, one cannot make suggestions without at least seeing some examples. For the class of functions you are considering, there may be a simple general procedure. If the class is fairly general, we may need tools from the calculus. However, I would expect that Wolfram Alpha can usually handle such problems.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.