I am given a differential equation in $x \in [0, L]$

\begin{align} \lambda\frac{d^2u}{dx^2} + q = 0 \end{align}

where $q = a + bx$. The solution is subject to the boundary conditions

\begin{align} u(0) = 0 \ \ and \ \ \lambda\frac{du}{dx}\bigg |_{x = L} = 0 \end{align}

Now I want to find an approximate solution using a three-node element. The shape function is given as

\begin{align} \mathbf{N} = \begin{bmatrix} -\frac{1}{2}s(1-s) & (1-s^2) & \frac{1}{2}s(1+s) \end{bmatrix} \end{align}

The task is the solve the system but what I am wondering is what I need to calculate in order to do this? For example I have seen equations such as

\begin{align} \mathbf{k} = \int_{-1}^1\mathbf{B^TBJ}ds \end{align}

and

\begin{align} \mathbf{m} = \int_{-1}^1\mathbf{N^TNJ}ds \end{align}

But how should I use this information in order to achieve the final solution?

• Two remarks. (1) As an inexperienced user, I would rather start with linear instead of quadratic elements. For the problem at hand, this perfectly possible. (2) Related: be extremely cautious with higher order (i.e. non-linear) elements, because they easily exhibit spurious behavior. As is clearly exemplified in : Understand 1D FEM solution using quadratics elements . Unfortunately, my knowledge about FEM has become more rustier than I hoped for, so this is all for the moment being. – Han de Bruijn Apr 22 '18 at 20:24
• Related question & answer @ : Understanding Galerkin method of weighted residuals ? – Han de Bruijn May 1 '18 at 19:55
• It's not really the quadratic functions that is my problem (the topic is a bit confussing, sorry), I just don't know how to approach the problem correctly. Like I don't know what I am suppossed to do with the differential equation – Kristoffer Jerzy Linder May 17 '18 at 12:19
• Doesn't the above comment with "Related question & answer" help? Actually, I've made sort of a copy and paste of a deleted answer to you for that answer. – Han de Bruijn May 17 '18 at 16:01