This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
By the way, tell your professor:
To determine the maximum and minimum values in your MATLAB function, all three variables must be declared as global variables in your M-file.
In general, the experts on MATLAB Answers discourage the use of global variables. They can cause problems that are difficult to debug. Your code's answers may change due to something happening in a completely different file.