title: Find the local maximum of a function that takes two input variables, each with a different interval
body: <p>How would you find local maxima for the function below, with the two inputs having different intervals?</p>
  
  <pre><code>f &lt;- function(x, y) {
    y/50*(100*x)^0.9 + (50-y)/y*(80*(10-x))^0.8
  }
  # interval for y = (0, 50)
  # interval for x = (0, 10)
  </code></pre>
  
  <p>I looked into using the optim function, but I couldn't figure out how to set "par," intervals, and other arguments for the two input variables.</p>