# What is the difference between trial and test functions in the context of numerical integration?

I know that in, for example, Galerkin's method we try to approximate the solution via a sum

$$\sum_{j=1}^{n} u_{j} a\left(e_{j}, e_{i}\right)$$

with $$a\langle \cdot ,\cdot \rangle$$ a bilinear form and $$u_j$$ are the test functions. However I have come across a sentence 'Each row of a Galerkin system matrix is associated with a locally supported test function, while each matrix column is associated with a trial function. ' and I'm not sure what the trial functions are. Can anybody help or point me to a definition?

• See here. They use trial functions to name the functions in the space where the solution of the integral equation are found. – user647486 Apr 20 at 15:48

Then somewhere in the answer you will find the following expression: $$\begin{bmatrix} f_1 & f_2 & f_3 & f_4 & f_5 & \cdots \end{bmatrix} \times \\ \begin{bmatrix} E_{0,0}^{(1)} & E_{0,1}^{(1)} & 0 & 0 & 0 & \cdots \\ E_{1,0}^{(1)} & E_{1,1}^{(1)}+E_{0,0}^{(2)} & E_{0,1}^{(2)} & 0 & 0 & \cdots \\ 0 & E_{1,0}^{(2)} & E_{1,1}^{(2)}+E_{0,0}^{(3)} & E_{0,1}^{(3)} & 0 & \cdots \\ 0 & 0 & E_{1,0}^{(3)} & E_{1,1}^{(3)}+E_{0,0}^{(4)} & E_{0,1}^{(4)} & \cdots \\ \cdots & \cdots & \cdots & \cdots & \cdots & \cdots \end{bmatrix} \begin{bmatrix} T_1 \\ T_2 \\ T_3 \\ T_4 \\ T_5 \\ \cdots \end{bmatrix}$$ In short: $$\sum_i\sum_j f_i\,S_{ij}\,T_j$$ So $$f_i$$ is the discretization of a test function $$f(x)$$ and it is associated with a matrix row $$(i)$$;
$$T_j$$ is the discretization of a trial function $$T(x)$$ and it is associated with a matrix column $$(j)$$.