I have a function which I would like to maximize over an independent variable range, say a->b. How would I do this in Mathematica? The documentation does not provide an answer.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The functions you are looking for are
MaximizeandNMaximize(similarly, there isMinimizeandNMinimize). Since you do not provide any details about the function itself, I shall call itfand assume that it takes one variable. Then to maximize over a given range, you specify both the function and the range, as followsor, if symbolic maximization is difficult to do, you can have it numerically maximized using the same form
For minimization, replace as appropriate.