How do I find the extrema of the function x^3+6 x^2-13 x-42?

In the optimizing section there is function that calculates minima but not all the extrema. And how to I do for the multiple variable functions, like, (-x-2)^2+(-y-3)^2?

3 Comments

your title and the question are differents
I guess I messed up there, I actually want to know the method for both types of functions.
Please post two separate questions.

Sign in to comment.

 Accepted Answer

For polynomials, the extrema are always one of the infinities.
Take the highest order term. If it is an even power, then both extrema have the same sign, which will be the same as the sign of that highest-order term. If the highest order term is an odd power, then the extrema have opposite signs, with the limit towards +infinity having the same sign as the highest-order term, and the limit towards -infinity having the opposite sign as the highest-order term.
If you want to find all the minima and all the maxima, and you have a routine to find minima, then use it once to find the minima, and then feed in the negative of the expression and find the minima of that and invert their signs to get the maxima.

6 Comments

I want to know the maxima and minima not the limits. Yeah I thought of using the simmetric function but isn't there another way?
Differentiate, find the zeros of that, differentiate a second time, evaluate at the zeros to determine whether each is a min, max, or saddle.
Yeah, on this function you can do that. However, I just gave a simple example where you can find zeros of the derivative. The function I was trying to optimize was a problem from Stewart's Early Trancendentals on page 456, 7ed: 0<x<60
ArcCos[(-625 + 2 (9 + x Cos[20 \[Degree]])^2 + (31 - x Sin[20 \[Degree]])^2 + (-6 + x Sin[20 \[Degree]])^2)/(2 Sqrt[(9 + x Cos[20 \[Degree]])^2 + (31 - x Sin[20 \[Degree]])^2] Sqrt[(9 + x Cos[20 \[Degree]])^2 + (-6 + x Sin[20 \[Degree]])^2])]
The procedure is the same, but you might need to use numeric techniques to find the zeros of the derivative. At the same time, as you have a division, you might end up needing to use more advanced analysis to find interior limits at discontinuities.
Have you considered using the Symbolic Toolbox ?
No, I'm actually new at Matlab, you mean symbolic math toolbox, right?
Yes, the symbolic math toolbox.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!