Show that the solution to $Ax = b$ is a critical points of $f(x)$

57 Views Asked by At

Given the system of linear equations (the matrix of the system is symmetric and positive definite): $$\left\{\begin{matrix} 10x + 5y = 5\\ 5x + 3y = 4 \end{matrix}\right.$$

The solution to the system is $x = -1, y = 3$.

Now, the solution to $Ax = b$ is a critical point of quadratic form $f(x) = \frac{1}{2}x^TAx - b^Tx+ c$. The critical point of this function can be found by setting gradient of this function equal to zero: $$\nabla f = \frac{1}{2}x^TA + \frac{1}{2}Ax - b^T = \frac{1}{2}Ax + \frac{1}{2}A^Tx - b = \frac{1}{2}(A+A^T)x - b = Ax - b = 0$$ So, $Ax = b$ can be solved by finding an $x$ that minimizes $f(x)$.

Next, the quadratic function expressed with the given matrix $A$ is of the form: $$f(x) =\begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} 10 & 5\\ 5 & 3 \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} - \begin{bmatrix} 5 & 4 \end{bmatrix}\begin{bmatrix} x\\ y \end{bmatrix} = 10x^2 + 10xy + 3y^2 - 5x - 4y$$

Finally, when I am minimizing the function above (in Matlab, for instance) it gives the following results:

fun = @(x)10x(1)^2 + 10x(1)x(2) + 3x(2)^2 - 5x(1) - 4x(2); x0 = [-2,2]; x = fminsearch(fun,x0)

x =

-0.5000 1.5000 that is definetly not an answer to the system above. Where am I wrong?