I have a function $f:\mathbb R^2\rightarrow \mathbb R: (x_1,x_2)^T\mapsto \sin(\frac{x_1}2)\cos(\frac{x_2}2)-\frac1{10}\sin(2x_2)+\frac2{10}\sin(2x_1)$ and for the points: $$p_o=(0,0) \ \ p_1= (\pi,\pi)\ \ p_2 = (0,\pi)$$ I want to find a quadratic interpolation function (which should be unique) of the form $\lambda: (x_1,x_2) \mapsto g+\sum_{i,j = 1}^2 g_{ij}x_ix_j + 2g_1x_1 + 2g_2x_2$ which has the same value as $f$ in the points $p_0,p_1,p_2,\frac12(p_0+p_1),\frac12(p_1+p_2),\frac12(p_0+p_2)$
So my idea to solve this was to make a system of linear equations to find the coefficients $g_i$. However, I am getting a matrix of the form:
$$A = \begin{bmatrix} \pi^2 & \pi^2 & \pi^2 & \pi^2 & 2\pi & 2\pi \\ 0 & 0 & \pi^2 & 0 & 0 & 2\pi \\ \pi^2/4 & \pi^2/4 & \pi^2/4 & \pi^2/4 & \pi & \pi \\ \pi^2/4 & \pi^2/2 & \pi^2 & \pi^2/2 & \pi & 2\pi \\ 0 & 0 & \pi^2/4 & 0 & 0 & \pi \end{bmatrix} , \ \ B =\begin{bmatrix}0 \\ 0\\ 0.5 \\ 0 \\ 0 \end{bmatrix} $$ with the columns in the order of $g_{11},g_{12},g_{22},g_{21},g_{1},g_{2}$ and each row corresponding to the points (in the same order as above).
With this system I dont get a unique solution.. I have checked multiple times for calculation mistakes but I cant seem to find any... Is my overall approach to find a solution wrong, or did I make a mistake somewhere? I have been stuck with this exercise for a while now so Any help would be appreciated!
Three mistakes: you only wrote five equations when you should have written six of them, you dropped the unkown $g$, and you introduced two terms $g_{12}x_1x_2$ and $g_{21}x_1x_2$, which cannot be separated.
Rewrite with
$$f(x,y):=ax^2+bxy+cy^2+dx+ey+f$$ and plug the six points.