# Integrating nonlinear force term in FEM

I had a similar question to Finite element method applied to 1D structural problem - what is wrong with body force? I did some work on it as per answers, but it seems that is not working.

Quadratic 1D element runs from 1 to 5. Nodes are $x_1=1, x_2=3,x_3=5$. $x_{global} = [1,3,5]^T$ Element length $h=4$, Jacobian for given element $J=h/2=2$

$$N_1(x) = \frac{(x-x_2)(x-x_3)}{(x_1-x_2)(x_1-x_3)}$$ $$N_2(x) = \frac{(x-x_1)(x-x_3)}{(x_2-x_1)(x_2-x_3)}$$ $$N_3(x) = \frac{(x-x_1)(x-x_2)}{(x_3-x_1)(x_3-x_2)}$$ $$N_1(\xi)= -\frac{1}{2}\xi(1-\xi)$$ $$N_2(\xi) = (1-\xi^2)$$ $$N_3(\xi) = \frac{1}{2}\xi(1+\xi)$$

$N^T = [N_1 \hspace{6pt} N_2 \hspace{6pt} N_3]$

Body force term $b=5x^3$

$$f(x) = \int_1^5 N(x)^T \times(5x^3)dx$$ I get $f(x) = [34.0 \hspace{6pt} 456.0 \hspace{6pt} 358.0 ]^T$

If I writee $x=\sum N(\xi)x_{global}$, after simplification, I get $x=x_1 + (h/2)(1+\xi)$

Then, if I integrate problem in isoparametric coordinates, $$f(\xi) = \int_{-1}^1 N(\xi)^T \times 5 \times \big ( x_1 + (h/2)(1+\xi) \big )^3 \times J d\xi$$ I get $f(\xi) = [-18.0 \hspace{6pt} 184.0 \hspace{6pt} 174.0 ]^T$

So, $f(x),f(\xi)$ are not equal. If I make $b$ constant, then both force terms are equal. But not when $b$ is nonlinear. Can someone comment what went wrong?

$$\mathbf{f}^e = [-34 \quad 456 \quad 358]^T$$ The sum of the three components is 780 which is also the integral $\int_1^5 f(x) dx$.
Some other comments: note that $f$ is neither a function of $x$ nor of $\xi$ in the integrals in your post. The first component of the force vector is -34 and not +34.