Solving a differential equation can be done by several methods
Direct method: paper, pen, maths… nothing more
<aside> đź’ˇ
This method is called “strong form” of the equilibrium problem. It is only possible to solve it for simple elements
</aside>
Variational Method: based on the principle of minimum potential energy which states that the displacement configuration that satisfies equilibrium conditions is the one that minimizes the total potential energy (which is the sum of the strain energy and the potential energy of external loads)
Galerkin Method of Weighted Residuals: this method is based on the idea that the weak form can be deduced of the strong force by stating that the solution of the differential equation is represented in a basis of n elements (n being the number of node).
First, it needs to be said that a differential equation has an infinite number of solution as rotating or shifting the initial curve does not impact the second derivative.
Therefore, we need to define boundary condition (which are just known values of f), so that the solution to the function is unique.
Dirichlet boundary condition states that $u(\delta\Omega) = C$ where $\delta\Omega$ represents the boundaries of the domain of definition of x and C is constant.
Let’s come back to the strong form to prove it, we can define a function $v(x)$ called “test function” and say that:
$f(x) = u''(x) \implies f(x)v(x) = u''(x)v(v) \implies \int_\Omega f(x)v(x) = \int_\Omega u''(x)v(x)$.
<aside> đź’ˇ
This has to remain true for any given test function
</aside>
In order to make sure that the weak form is stable, we should be able to recover the strong form from it.

If we take a function v defined as 0 everywhere but at a specific node, we can prove that the value
$f(x) = u''(x)$ at one point x
Therefore, we visually proved that the weak and strong form are equivalent.

The weak form is great but we have an issue:
Since we aim to approximate the function f using simpler u functions, we want u to not involve a double derivative in the equation as it would lead to constant functions (as seen on the image).
In order to avoid that, we can use Integration By Part on the weak form to end up with:
$$ \int_\Omega u''(x)v(x) = \newline [u'(x)v(x)]^\Omega - \int_\Omega u'(x)v'(x)dx \newline = \int_\Omega f(x)v(x)dx $$
