## Maximum values of a function

## Maximum values of a function

**Inspector_1998**(visitor)

(OP)

How do I get mathcad 5.0 to return a maximum value for a function without having to print out a table of values, looking at them to find the maximum, and typing it into my next equations, the function is a quadratic equation and has a maximum value. Help!

Flowerhopper cjomlo@iland.net

Flowerhopper cjomlo@iland.net

## RE: Maximum values of a function

but I'm not sitting in front of mathcad right now. (if you'd like to wait until january, I'll get you the answer then)

another way would be to calculate the derivative of the eqn, find the zero points of the derivative, and then figure out (either by looking at the sign of the second derivative or by checking values) which ones are max values and which are mins

## RE: Maximum values of a function

examplef(x):= 2+6x-x^2

x:=2

Given

x>0

P:= Maximize(f,x)

"answer" P=3

f(P)=11

## RE: Maximum values of a function

The obvious thing to do in this case is to differentiate the quadratic and then test the solutions (bearing in mind that quadratics often go to infinity) to that function.

The other more general alternative is to build a vector of values and then a vector of gradients and then search for points of inflexion.

Getting the index figure for each point of inflexion is /possible/, even in the very earliest version of Mathcad, you need to set up another vector that increments until a point of inflexion is found, I think using either "if" or the totally weird "until". I did this a long time ago and can't remember the details. If you can afford to wait three weeks then I'll look it up in my notes.

Cheers

Greg Locock