Extremals of $\mathcal C^2$ functions on subsets of $\mathbb R^n$

In [64]:
x, y = var('x y')
f= (x^2-y^2)*exp(-x^2)
f.show()
P = plot3d(f,(x,-4,4),(y,-2,3))
P.show()
In [65]:
g=f.gradient()
g[0].show()
g[1].show()
plot_vector_field(f.gradient(), (x,-2,2), (y,-2,3))
Out[65]:
In [66]:
(f.hessian()[0,0]).show()
(f.hessian()[1,0]).show()
(f.hessian()[0,1]).show()
(f.hessian()[1,1]).show()