Fichiers Sage
var('x, y') f(x,y) = x^2+x*y+y^2+y show(f)
%md # Recherche des points critiques et des valeurs extrêmes
gradf = f.gradient() show(gradf)
eq1 = gradf[0](x,y) == 0 eq2 = gradf[1](x,y) == 0 show(eq1) show(eq2)
solve([eq1, eq2], (x,y))
hessf = f.hessian() show(hessf)
%md # Graphique
r = 2 G = plot3d(f(x,y), (x, -r, r), (y, -r, r), plot_points=15, color='orange', mesh=1, opacity=.7) G += points((1/3, -2/3), color='red', pointsize=10) show(G)
show(G, aspect_ratio=[3, 3, 1])