0% found this document useful (0 votes)
12 views2 pages

Extremevalues 3

Uploaded by

Chandan To
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Extremevalues 3

Uploaded by

Chandan To
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

clear

syms x y a
a=1;
f=x^3+y^3-3*a*x*y

f =

fx = diff(f,x);
fy = diff(f,y);
S = vpasolve([fx==0, fy==0],[x y]);
ml = [S.x S.y];
fprintf('Critical Points are ( %f, %f) \n',ml(1,:))

Critical Points are ( 0.000000, 0.000000)

fprintf('Critical Points are ( %f, %f) \n',ml(4,:))

Critical Points are ( 1.000000, 1.000000)

xsy=size(ml);
ed=xsy(:,1);
fsurf(f)

for i=[1 ed]


A=diff(fx,x)
AV=subs(A,{x y},{ml(i,:)});
B=diff(fx,y)

1
C=diff(fy,y)
Con=A*C-B^2;
ConV=subs(Con,{x y},{ml(i,:)});
fV=subs(f,{x y},{ml(i,:)});
if (ConV>0 & AV<0)
fprintf('Maximum at ( %f, %f) and Max. Value= %f \n',ml(i,:),fV)
elseif (ConV>0 & AV>0)
fprintf('Minimum at ( %f, %f) and Min. Value= %f \n',ml(i,:),fV)
elseif (ConV<0)
fprintf('Saddle Point at ( %f, %f) \n',ml(i,:))
else
fprintf('Fuurther Investigation required at ( %f, %f) \n',ml(i,:))
end
end

A =
B =
C =
Saddle Point at ( 0.000000, 0.000000)
A =
B =
C =
Minimum at ( 1.000000, 1.000000) and Min. Value= -1.000000

You might also like