# Galerkin Method¶

Suppose we need to find the solution to equation

The key is that the solution can be approximated by

where \(\phi_i(x)\) are the basis functions.

**The purpose is to find the the coefficients** \(u_i\). Galerkin method has three steps.

- discretize the space \(x\) and function space: triangulation,
- discretize the function using weak form: assembly,
- error estimation.

Triangulation is basically setting up the basis function in a discretized space \(x\). One of the choice is the hat function.

At each point \(x\), there is a hat function responsible for the approximation within \([x-\Delta x, x+\Delta x]\).

Those hat functions forms the basis for the approximated solution

With this approximation, it requires the *test function* \(v\) to write down the weak form. Basically we multiply \(v\) on both sides of the equation then integrate by step. Then the differential equation can be rewrite into matrix form with basis \(\phi_i\),

We solve the coefficients \(\mathbf U\) from the matrix equation.

## References and Notes¶

- Freitag, K. J. (2007). Neural networks and differential equations.
- COMSOL Multiphysics has a nice article.