Hi,

I did change the code I used before to:

isitminmaxorsad(f,xvalue):=block (errcatch (d: notdiffable,

a: subst(x=xvalue,diff(f,x)),

b: if a=0 then limit((1/diff(f,x)),x,xvalue,plus) else diffnotzero,

c: if a=0 then limit((1/diff(f,x)),x,xvalue,minus) else diffnotzero,

d: if (b=inf and c=inf) or (q=minf and p=minf) then saddle

elseif (b=minf and c=inf) then maximum

elseif (b=inf and c=minf) then minimum

elseif (c=diffnotzero) then diffnotzero

else undefined),

return (d));

With this code, the function “isitminmaxorsad(f,x)” becomes available.

This function (“isitminmaxorsad”) takes a first argument “f” which is a function and the second argument “x” which the corresponding x-value.

It checks for the characteristic of the function at the given x-value, for if it is either maxima, minima a saddle point or neither of those.

return values are:

maximum

minimum

diffnotzero

notdiffable

undefined

I would be happy to know if someone finds functions with points that are classified wrong or as undefined even if they are not.

Removable definition gaps are accepted as maxima, minima or saddle point by the code.

Björn

I did change the code I used before to:

isitminmaxorsad(f,xvalue):=block (errcatch (d: notdiffable,

a: subst(x=xvalue,diff(f,x)),

b: if a=0 then limit((1/diff(f,x)),x,xvalue,plus) else diffnotzero,

c: if a=0 then limit((1/diff(f,x)),x,xvalue,minus) else diffnotzero,

d: if (b=inf and c=inf) or (q=minf and p=minf) then saddle

elseif (b=minf and c=inf) then maximum

elseif (b=inf and c=minf) then minimum

elseif (c=diffnotzero) then diffnotzero

else undefined),

return (d));

With this code, the function “isitminmaxorsad(f,x)” becomes available.

This function (“isitminmaxorsad”) takes a first argument “f” which is a function and the second argument “x” which the corresponding x-value.

It checks for the characteristic of the function at the given x-value, for if it is either maxima, minima a saddle point or neither of those.

return values are:

maximum

minimum

diffnotzero

notdiffable

undefined

I would be happy to know if someone finds functions with points that are classified wrong or as undefined even if they are not.

Removable definition gaps are accepted as maxima, minima or saddle point by the code.

Björn