Clear[f,g,x,y,gf,gg];
f[x_,y_]=x+y;
g[x_,y_]=(x^2)+((y^2)/2);
gf={D[f[x,y],x],D[f[x,y],y]};
gg={D[g[x,y],x],D[g[x,y],y]};
Solve[{gf==lambda gg,g[x,y]==1},{lambda,x,y}]

Clear[f,g,x,y,gf,gg];
f[x_,y_]=(x^2)+((y^2)/2);g[x_,y_]=x+y;
gf={D[f[x,y],x],D[f[x,y],y]};
gg={D[g[x,y],x],D[g[x,y],y]};
Solve[{gf==lambda gg,g[x,y]==2},{lambda,x,y}]

Clear[f,g,x,y,gf,gg];
f[x_,y_]=2 π (x^2)+2 π x*y;
g[x_,y_]=π (x^2) *y;
fx=D[f[x,y],x];
gx=D[g[x,y],x];
fy=D[f[x,y],y];
gy=D[g[x,y],y];
eqns={fx==lambda*gx,fy==lambda*gy,g[x,y]==100};
FindRoot[eqns,{{lambda,-1},{x,1},{y,1}}]

Clear[f,g,x,y,gf,gg];
f[x_,y_]=2 π (x^2)+2 π x*y;
g[x_,y_]=π (x^2) *y;
fx=D[f[x,y],x];
gx=D[g[x,y],x];
fy=D[f[x,y],y];
gy=D[g[x,y],y];
eqns={fx==lambda*gx,fy==lambda*gy,g[x,y]==1100};
FindRoot[eqns,{{lambda,-1},{x,1},{y,1}}]

Clear[f,g,x,y,gf,gg];
f[x_,y_]=5 (x^2)+2 x y+3 (y^2)+800;g[x_,y_]=x+y;
gf={D[f[x,y],x],D[f[x,y],y]};
gg={D[g[x,y],x],D[g[x,y],y]};
Solve[{gf==lambda gg,g[x,y]==39},{lambda,x,y}]

Problem 19 (section 15.3)

Clear[f,x,y];
f[x_,y_]=x+y-(x-y)^2;
ContourPlot[f[x,y],{x,0,1},{y,0,1},ContourLabels->All,RegionFunction->Function[{x,y},x+y<1]]

Problem 8 (section 15.3)

Clear[f,x,y];
f[x_,y_]=x^2+3*y;
xmin=-5; xmax=5; ymin=-5;ymax=5;
theconstraint=ContourPlot[ x^2-y^2==6 ,{x,xmin,xmax},{y,ymin,ymax}];
thecontours=ContourPlot[f[x,y],{x,xmin,xmax},{y,ymin,ymax},ContourLabels->All];
Show[thecontours,theconstraint]

Problem 17 (section 15.3)

Clear[f,x,y];
f[x_,y_]=x^2*y+3*y^2-y;
xmin=-5; xmax=5; ymin=-5;ymax=5;
theconstraint=ContourPlot[ x^2+y^2==10 ,{x,xmin,xmax},{y,ymin,ymax}];
thecontours=ContourPlot[f[x,y],{x,xmin,xmax},{y,ymin,ymax},ContourLabels->All];
Show[thecontours,theconstraint]