---
title: "Shape functions for a beam element"
subject: "Computational Techniques in Civil Engineering"
chapter: 4
key: "semester_8/computational_techniques_in_civil_engineering:beam-shape-function"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/beam-shape-function
site: BCT Engineering
---

# Shape functions for a beam element

Computational Techniques in Civil Engineering · Chapter 4: Finite element method

- Asked in: 2077 Chaitra, 8 marks
- Video: [Beams (1/3): Intro and FE Formulation](https://www.youtube.com/watch?v=mbzX3dLUVT4) — Mike Foster
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/beam-shape-function
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-4

## Question

Derive shape functions for a beam element.

## Short answer

For a two-node Euler–Bernoulli beam of length L, the cubic Hermite shape functions are N1=1-3x²/L²+2x³/L³, N2=x-2x²/L+x³/L², N3=3x²/L²-2x³/L³, N4=-x²/L+x³/L². They interpolate deflection and slope, with N1(0)=1, N1′(0)=0, etc. N1+N3=1 ensures rigid-body translation.

## Answer

#### Beam element
A two-node beam element of length $L$ (Euler-Bernoulli) has at each node a transverse deflection $v$ and a rotation $\theta=dv/dx$: $\{d\}=\{v_1,\theta_1,v_2,\theta_2\}^T$. Because the bending moment $EI\,d^2v/dx^2$ must be finite, both $v$ and $dv/dx$ must be continuous at the nodes, so the displacement function must contain a cubic, the lowest polynomial with four constants:
$$
v(x)=\alpha_1+\alpha_2x+\alpha_3x^2+\alpha_4x^3=[1\ \ x\ \ x^2\ \ x^3]\{\alpha\}
$$
$$
\theta(x)=\alpha_2+2\alpha_3x+3\alpha_4x^2
$$

#### Nodal conditions
At $x=0$: $v=v_1$, $\theta=\theta_1$. At $x=L$: $v=v_2$, $\theta=\theta_2$.
$$
\begin{Bmatrix}v_1\\\theta_1\\v_2\\\theta_2\end{Bmatrix}=\begin{bmatrix}1&0&0&0\\0&1&0&0\\1&L&L^2&L^3\\0&1&2L&3L^2\end{bmatrix}\begin{Bmatrix}\alpha_1\\\alpha_2\\\alpha_3\\\alpha_4\end{Bmatrix}\ \Rightarrow\ \{d\}=[C]\{\alpha\}
$$
$$
\{\alpha\}=[C]^{-1}\{d\}=\begin{bmatrix}1&0&0&0\\0&1&0&0\\-\dfrac{3}{L^2}&-\dfrac{2}{L}&\dfrac{3}{L^2}&-\dfrac{1}{L}\\\dfrac{2}{L^3}&\dfrac{1}{L^2}&-\dfrac{2}{L^3}&\dfrac{1}{L^2}\end{bmatrix}\{d\}
$$

#### Shape functions
$$
v(x)=[1\ x\ x^2\ x^3][C]^{-1}\{d\}=[N_1\ N_2\ N_3\ N_4]\{d\}
$$
$$
\begin{aligned}
N_1&=1-\frac{3x^2}{L^2}+\frac{2x^3}{L^3}\\
N_2&=x-\frac{2x^2}{L}+\frac{x^3}{L^2}\\
N_3&=\frac{3x^2}{L^2}-\frac{2x^3}{L^3}\\
N_4&=-\frac{x^2}{L}+\frac{x^3}{L^2}
\end{aligned}
$$
These are the Hermite cubic functions. With $s=x/L$: $N_1=1-3s^2+2s^3$, $N_2=L(s-2s^2+s^3)$, $N_3=3s^2-2s^3$, $N_4=L(-s^2+s^3)$.

#### Properties
| Function | $v(0)$ | $v'(0)$ | $v(L)$ | $v'(L)$ |
|---|---|---|---|---|
| $N_1$ | 1 | 0 | 0 | 0 |
| $N_2$ | 0 | 1 | 0 | 0 |
| $N_3$ | 0 | 0 | 1 | 0 |
| $N_4$ | 0 | 0 | 0 | 1 |

Also $N_1+N_3=1$, so a rigid-body translation is represented.

#### Use: stiffness matrix
Curvature $\kappa=\dfrac{d^2v}{dx^2}=[B]\{d\}$ with $[B]=\left[-\dfrac{6}{L^2}+\dfrac{12x}{L^3},\ -\dfrac{4}{L}+\dfrac{6x}{L^2},\ \dfrac{6}{L^2}-\dfrac{12x}{L^3},\ -\dfrac{2}{L}+\dfrac{6x}{L^2}\right]$, and
$$
[k]=\int_0^L EI\,[B]^T[B]\,dx=\frac{EI}{L^3}\begin{bmatrix}12&6L&-12&6L\\6L&4L^2&-6L&2L^2\\-12&-6L&12&-6L\\6L&2L^2&-6L&4L^2\end{bmatrix}
$$

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why must the displacement function include a cubic?
   A. Four nodal conditions (v and slope at both ends) need four constants and v, slope must be continuous
   B. Because moment is cubic
   C. Because load is cubic
   D. To make the stiffness matrix diagonal
   Answer: A. A cubic is the lowest polynomial with four constants. (Key point: Why a cubic)

2. Which holds for the Hermite functions?
   A. N2(0)=0, N2'(0)=1, N2(L)=0, N2'(L)=0
   B. N2(0)=1
   C. N1'(0)=1
   D. N3(0)=1
   Answer: A. N2 represents unit rotation at node 1 with all other conditions zero. (Key point: Properties of shape functions)

3. How is the stiffness matrix obtained from the shape functions?
   A. k = integral of EI B^T B dx, with B = d^2N/dx^2
   B. k = integral of N dx
   C. k = inverse of C
   D. k = B d
   Answer: A. Curvature kappa = [B]{d}, then k = integral of EI B^T B dx. (Key point: Stiffness matrix derivation)

4. What does N1 + N3 = 1 show?
   A. Rigid-body translation is represented
   B. Rotation is zero
   C. Symmetry of k
   D. Slope continuity
   Answer: A. If v1 = v2 and slopes are zero, v equals that value everywhere. (Key point: Rigid-body translation)

## Related in Computational Techniques in Civil Engineering

- [Shape functions, eight-noded rectangular element](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Ashape-function-eight-noded-rectangle) — Computational Techniques in Civil Engineering, chapter 4, asked 2×
- [Shape functions for quadrilateral element](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Ashape-function-quadrilateral) — Computational Techniques in Civil Engineering, chapter 4
- [Shape functions, ten-node triangular element](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Ashape-function-ten-node-triangle) — Computational Techniques in Civil Engineering, chapter 4, asked 2×
- [Shape functions, six-node triangular element](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asix-node-triangle-shape-function) — Computational Techniques in Civil Engineering, chapter 4
- [Isoparametric formulation; eight-noded shape functions](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Aisoparametric-eight-noded) — Computational Techniques in Civil Engineering, chapter 4
- [Iso/super/sub-parametric; Hermite shape function](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Ahermite-beam-shape-isoparametric) — Computational Techniques in Civil Engineering, chapter 4

## Related in other subjects

- [Derive shape functions of CST element](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Acst-shape-functions-derivation) — Finite Element Method, chapter 5
- [Linear shape functions for one-dimensional element](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Alinear-bar-shape-functions) — Finite Element Method, chapter 5
- [Shape functions of four-node rectangular element](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Arectangular-element-shape-functions) — Finite Element Method, chapter 5
- [Shape functions of eight-node serendipity element](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Aeight-node-serendipity-shape-functions) — Finite Element Method, chapter 7
