Top

A={{2,-1},{-1,2}}

b=A.{1,1}

Expand[(1/2){x,y}.A.{x,y}-{x,y}.b]

Plot3D[(1/2){x,y}.A.{x,y}-{x,y}.b,{x,-1,3},{y,-1,3}]

base=ContourPlot[(1/2){x,y}.A.{x,y}-{x,y}.b,{x,-1,3},{y,-1,3},ContourShading->None]

Case 1

x={2,-1}
g=A.x-b

path={x};
While[Norm[g]>0.01,
mu=(g.g)/(g.A.g);
x=x-mu g;
g=A.x-b;
AppendTo[path,x];
Echo[Show[base,Graphics[{Red,Line[path]}]]]
]

Case 2

x={0,-1}
g=A.x-b

path={x};
While[Norm[g]>0.01,
mu=(g.g)/(g.A.g);
x=x-mu g;
g=A.x-b;
AppendTo[path,x];
Echo[Show[base,Graphics[{Red,Line[path]}]]]
]

Other

A={{2,-1},{-4,10}}

PositiveDefiniteMatrixQ[A]

b=A.{1,1}

Expand[(1/2){x,y}.A.{x,y}-{x,y}.b]

Plot3D[(1/2){x,y}.A.{x,y}-{x,y}.b,{x,-1,3},{y,-1,3}]

base=ContourPlot[(1/2){x,y}.A.{x,y}-{x,y}.b,{x,-1,3},{y,-1,3},ContourShading->None]

Case 1

x={2,-1}
g=A.x-b

path={x};
While[Norm[g]>0.01,
mu=(g.g)/(g.A.g);
x=x-mu g;
g=A.x-b;
AppendTo[path,x];
Echo[Show[base,Graphics[{Red,Line[path]}]]]
]

Case 2

x={-1,-1/2}
g=A.x-b

path={x};
While[Norm[g]>0.01,
mu=(g.g)/(g.A.g);
x=x-mu g;
g=A.x-b;
AppendTo[path,x];
Echo[Show[base,Graphics[{Red,Line[path]}]]]
]