Two Maxima No Minimum

211 days ago by ianabc

The function below has 2 maxima and 0 other critical points. The maxima are identified using the 2nd derivative test, i.e. requiring that solutions of \frac{\partial f}{\partial x}=\frac{\partial f}{\partial y} = 0 satisfy


\frac{\partial^2 f}{\partial x^2}\frac{\partial^2 f}{\partial y^2} - \frac{\partial f}{\partial x\partial y}\frac{\partial f}{\partial y\partial x} > 0

and

\frac{\partial^2 f}{\partial x^2} < 0



x, y = var('x y') f(x,y) = -(x^2 - 1)^2 - (x^4*y - x - 1)^2 jsmath(f) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ -{\left(x^{2} - 1\right)}^{2} - {\left(x^{4} y - x - 1\right)}^{2}
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ -{\left(x^{2} - 1\right)}^{2} - {\left(x^{4} y - x - 1\right)}^{2}
fx = diff(f, x) fy = diff(f, y) fxx = diff(f, x, x) fyy = diff(f, y, y) fxy = diff(f, x, y) D = fxx * fyy - fxy * fxy 
       
sols = solve([fx == 0, fy ==0], (x, y), solution_dict=True) sols 
       
[{y: 2, x: 1}, {y: 0, x: -1}]
[{y: 2, x: 1}, {y: 0, x: -1}]
for solution in sols: x0 = solution[x] y0 = solution[y] print "(", x0.n(digits=3), ", ", y0.n(digits=3), ") : ", D.substitute(x=x0, y=y0), ", ", fxx.substitute(x=x0, y=y0) 
       
( 1.00 ,  2.00 ) :  (x, y) |--> 16 ,  (x, y) |--> -106
( -1.00 ,  0.000 ) :  (x, y) |--> 16 ,  (x, y) |--> -10
( 1.00 ,  2.00 ) :  (x, y) |--> 16 ,  (x, y) |--> -106
( -1.00 ,  0.000 ) :  (x, y) |--> 16 ,  (x, y) |--> -10
plot3d(f, (x,-1.1, 1.1), (y, -0.5, 2.5))