1. Nájdite lokálne extrémy funkcie

f[x_, 
        y_] = (-2*x^3 - 3*y^2 + 
            7)*(x^2 + 2*y^2)^(1/2)

He1[x_, y_]=

Det[{{D[f[x, y], x, x] // Simplify, 
          D[f[x, y], x, y] // Simplify}, {D[f[x, y], x, y] // Simplify, 
          D[f[x, y], y, y] // Simplify}}]

He2[x_,y_]=D[f[x,y],x,x]

fx[x_,y_]=D[f[x,y],x]//Simplify

fy[x_,y_]=D[f[x,y],y]//Simplify

Solve[{fx[x,y]==0,fy[x,y]==0},{x,y}]//N

He1[x,y]/.%

He2[x,y]/.%%

f[x,y]/.%%%

graf = 
      Plot3D[f[x, y], {x, -1, 1}, {y, -1, 1}, 
        ViewPoint -> {-1.234,  3.019,  0.901}]

2. Nájdite viazané lokálne extrémy funkcie f(x, y) = x^2 * y^3(12 - x - y) pri väzbe x + 3 = 0.

Clear All

f[x_, y_] = x^2*y^3*(12 - x - y)

h[x_] = x + 3

F[x_]=f[x,x+3]

Solve[{D[F[x],x]==0},{x,y}]//N

D[F[x],x,x]/.%
F[x]/.%%

Plot[F[x],{x,-4,4}]

h[x]/.%%%%

graf=Plot3D[f[x,y],{x,-4,4},{y,0,10}]

3. Nájdite globálne extrémy funkcie f(x, y) = x^2 + y^2 - 12x + 16y na množine danej nerovnosťou
 x^2 + y^2 ≤ 25.

Clear All

f[x_,y_]=x^2+y^2-12*x+16*y

g[x_,y_]=x^2+y^2-25

He1[x_,y_]= Det[{{D[f[x,y],x,x]//Simplify,
        D[f[x,y],x,y]//Simplify},{D[f[x,y],y,x]//Simplify,
        D[f[x,y],y,y]//Simplify}}]

He2[x_,y_]=D[f[x,y],x,x]

Solve[{D[f[x,y],x]==0,D[f[x,y],y]==0},{x,y}]//N

f[x,y]/.%

6^2+(-8)^2

Bod nepatrí do množiny M.

fi[x_,y_]=f[x,y]+l*g[x,y]

He11[x_,y_]= Det[{{D[fi[x,y],x,x]//Simplify,
        D[fi[x,y],x,y]//Simplify},{D[fi[x,y],y,x]//Simplify,
        D[fi[x,y],y,y]//Simplify}}]

He21[x_,y_]=D[fi[x,y],x,x]

Solve[{D[fi[x,y],x]==0,D[fi[x,y],y]==0,g[x,y]==0},{x,y,l}]//N

He11[x,y]/.%
He21[x,y]/.%%

f[x,y]/.%%%

graf=Plot3D[f[x,y],{x,-8,8},{y,-10,10}]

ParametricPlot3D[{u,v,(u-6)^2+(v+8)^2-100},{u,-10,10},{v,-10,10}, BoxRatios->{1,1,3}]
ParametricPlot3D[{5*Cos[u],5*Sin[u],v},{u,0,2*Pi},{v,-100,300},BoxRatios->{1,1,3}]

Show[%,%%,ViewPoint->{-3.011, 0.754, 1.347}]