Quiet@Remove["Global`*"];
$HistoryLength=2;
SetDirectory[NotebookDirectory[]];

(*example 1*)
exp=(x^2)+x*y+(y^2);
{0==D[exp,x],0==D[exp,y]}//Solve

constrainFunction=2(x^2)+3(y^2)-5;
ContourPlot[constrainFunction==0,{x,-3,3},{y,-3,3}];

lagrangeFunction=exp+λ*constrainFunction;
{0.==D[lagrangeFunction,x],0.==D[lagrangeFunction,y],0.==D[lagrangeFunction,λ]}//Solve