# What is the difference between test functions and basis functions of the FEM?

I'm a novice to the finite elements method (FEM) and I'm finding quite hard to find the actual difference between Test functions and Basis functions.

I would be glad if somone could explain me that and point out how can they differ from one another and in which cases its useful that they differ (or not).

They are completely different terms.

The following answer summarizes the derivation of FEM, but not in detail.
If you need more details let me know or check the literature.

Let's start with the strong formulation Laplace Equation in $Ω⊂ℝ^d$: \begin{align*}-Δu&=f\quad\text{ in }Ω \\ u&=0\quad \text{ on }Ω \end{align*}

The weak formulation is: Find $u∈V_1$ such that: $$(∇u,∇φ) = (f,φ), \qquad ∀φ∈V_2. \label{b}\tag{1}$$

If $V_1=V_2$ these methods are named Galerkin-Methods, otherwise Petrov-Galerkin-Methods. $V_1$ is called Ansatz-space, and $V_2$ is called Test-space. The name comes from "testing" (multiplying) the original strong formulation. Hence, the name test-function for functions $φ∈V_2$.

For convenience lets just consider Galerkin-Methods in this answer: $$V:=V_1=V_2.$$ (For example $V=H^1_0(Ω)$.)
The weak formulation \eqref{b} can't be solved on a computer as it is. We need to choose a finite dimensional subspace $V_h⊂V$, to get the following (approximated) weak equation: Find $u_h∈V_h$, such that $$(∇u_h,∇φ_h) = (f,φ_h), \qquad ∀φ_h∈V_h. \label{c}\tag{2}$$

Still this equation can't be solved on a computer. $V_h$ is finite dimensional, but that does not mean that there is a finite amount of $φ_h∈V_h$. But since that space is finite dimensional it is sufficient to test with a basis. So let $\{φ_h^i, i=1,…,n\}$ be a basis of $V_h$. Then the following equation system is equivalent to \eqref{c}: $$(∇u_h,∇φ^i_h) = (f,φ^i_h), \qquad ∀ i=1,…,n. \label{a}\tag{3}$$

The next step would be to express $u_h$ in the basis with $u_h(x)=\sum_{j=1}^n u_h^jφ_h^j(x)$, plug it in and derive the linear equation system $\textbf{A}_h\textbf{u}_h = \textbf{f}.$

Everything so far has been done with arbitrary function spaces. The idea of FEM is just to choose $V_h$ as a local polynomial space, e.g. piecewise bi-linear functions, in which you can easily find a basis.

The test-function is the function $φ$ with which you multiply the equation. Using the names from above $φ$ is an element of $V$, to be exact of $V_{2}$.
A basis-function $φ_h^i$ is part of a basis of the finite dimensional subspace $V_h⊂V.$

In equation \eqref{a} where you multiply with a basis-function $φ_h^i$, that basis-function is also a test-function.
In the representation $u_h(x)=\sum_{j=1}^n u_h^jφ_h^j(x)$, I would not call $φ_h^j$ a test-function, as you don't test anything.

• thanks for your answer, perfect. I had that confusion because, from the few examples I've seen, the basis functions and the test functions were the same. – arocha Sep 1 '17 at 9:05