Local extrema of a univariate or multivariate differentiable function under equality constraints can be obtained by using function extrema which takes four arguments :
Function returns sequence of two lists of points: local minima and maxima, respectively. Saddle and unclassified points are reported in the message area. Also, information about possible (non)strict extrema is printed out.
A single constraint/variable can be specified without list delimiters. A constraint may be specified as an equality or expression which is assumed to be equal to zero.
Number of constraints must be strictly less than number of variables. Additionally, denoting k -th constraint by gk(x1,x2,…,xn)=0 for k=1,2,…,m and letting g=(g1,g2,…,gm) , Jacobian matrix of g has to be full rank (i.e. equal to m ), since implicit differentiation is performed.
Variables may be specified with bounds, e.g. x=a..b, which is interpreted as x∈(a,b) . For semi-bounded variables one can use -infinity for a or +infinity for b . Also, parameter vars may be entered as e.g. [x1=a1,x2=a2,...,xn=an], in which case the critical point close to a=(a1,a2,…,an) is computed numerically, applying an iterative method with initial point a .
If order_size=<n> is specified as the fourth argument, derivatives up to order n are inspected to find critical points and classify them. For order_size=1 the function returns a single list containing all critical points found. The default is n=5 . If some critical points are left unclassified one might consider repeating the process with larger value of n , although the success is not guaranteed.
Input :
^
2,x)
Output :
Input :
Output :
Input :
^
2+a*x,x)
Output :
Input :
^
2-2x)*ln(x)*ln(1-x),x=0.5)
Output :
Input :
^
3-2x*y+3y^
4,[x,y])
Output :
^
(1/5)/3,(12^
(1/5))^
2/6]],[]
Input :
^
2+a*y^
2,x+y=a,[x,y])
Output :
^
4-1)/(2*a^
3),1/(2*a^
3)]],[]
Input :
^
2+y^
2,x*y=1,[x=0..inf,y=0..inf])
Output :
Input :
^
4-x1^
4-x2^
8+x1^
10,[x1,x2])
Output :
^
(1/6)/5,0],[-6250^
(1/6)/5,0]],[]
Input :
Output :