What Is a Shape Function in FEA? Explained With Worked Examples
What shape functions are, how to derive them for a bar, why they sum to one, and how they give strain, stiffness, triangle area coordinates and the isoparametric Jacobian, with every number worked and checked by a script, plus where they fit in Ansys elements and CFD.

A shape function in FEA is the interpolation function that gives the value of a field, such as displacement or temperature, anywhere inside an element from the values at its nodes: . Each shape function equals 1 at its own node and 0 at every other node, and together they always add up to 1. The solver only computes nodal values; shape functions fill in everything between the nodes.
Key takeaways
- For a 2-node bar with nodes at 2 mm and 6 mm, and . With nodal temperatures of 50 °C and 90 °C, the temperature at x = 3.5 mm is 0.625 × 50 + 0.375 × 90 = 65 °C.
- Linear shape functions give a constant strain inside each element. A steel bar element (A = 100 mm², E = 200 GPa, L = 500 mm) has stiffness AE/L = 40,000 N/mm, so a 0.05 mm stretch means 20 MPa of stress.
- One quadratic element reproduces exactly. One linear element over the same span is off by up to 1.0, and two linear elements by up to 0.25.
- In a 4-node quadrilateral, the same four shape functions map a −1 to 1 square onto the real element. The determinant of the Jacobian (det J) must stay positive. Drag one node inside the element and det J falls to −1.875, which is an invalid element.
- 2-point Gauss quadrature (points at ±1/√3) integrates polynomials up to degree 3 exactly. That is why commercial elements such as Ansys SOLID185 and SOLID186 come with a choice of full or reduced integration.
This guide is for mechanical, aerospace and civil students learning FEA, and for freshers preparing for CAE interviews. It builds shape functions from a 1D bar up to triangles and isoparametric quadrilaterals, with every number checked by a script. It also covers how shape functions decide stiffness, integration and mesh quality, and where they fit in CFD. Notation follows common textbooks; your course may use or instead of .
What is a shape function in FEA?
A shape function is a simple polynomial, defined inside one element, that weights the value at node . The field at any point is the sum of each nodal value times its shape function. Because is 1 at node and 0 at the other nodes, the interpolated field passes exactly through every nodal value.
Here can be any unknown the governing equation solves for: displacement in structural analysis, temperature in heat transfer, or pressure or velocity in a finite-element flow solver. The are the nodal unknowns (the degrees of freedom), and is the number of nodes in the element. You will also see them called interpolation functions or basis functions.
The idea that makes the finite element method work is that these functions are local. Each is non-zero only on the elements that share node , its "support". That is why the global stiffness matrix is sparse: a node only couples to its neighbours. If you are new to the method itself, start with our beginner's guide to FEA with a worked example, then come back here.
Why does FEA need shape functions?
FEA needs shape functions for three jobs. They interpolate the field between nodes so that results exist everywhere. Their derivatives give strains, stresses, heat fluxes and other gradients. And they turn the governing differential equation into algebra by letting the solver integrate stiffness, mass and load terms element by element.
- Interpolation. The solver returns nodal values only. Contour plots, probes and stresses at integration points all come from .
- Gradients. Strain is the derivative of displacement, so strain inside an element is . The polynomial order of therefore decides how well an element can represent bending or a stress gradient.
- Integration. The element stiffness matrix is an integral of shape-function derivatives over the element. Choosing fixes that integral, and the number of Gauss points needed to evaluate it.
How do you derive the shape functions of a 1D bar element?
Assume the field varies linearly along the element, . Then force it to equal at node 1 () and at node 2 (). Solving the two equations for and and regrouping by and gives two linear shape functions, and .
From and , with :
Substituting back and collecting terms:
With the local coordinate starting at node 1 (, ), this is the familiar , .
Worked example. A rod element has nodes at mm and mm, so mm. The solver gives nodal temperatures of 50 °C and 90 °C. What is the temperature at mm?
The temperature gradient is °C/mm, and it is the same everywhere in the element. That is the price of linear shape functions: the derivative is piecewise constant, so it jumps from one element to the next.
What are the properties of shape functions?
Valid shape functions satisfy four properties: the Kronecker delta property (1 at their own node, 0 at the others), partition of unity (they sum to 1), completeness (they reproduce constant and linear fields exactly) and compatibility (the field stays continuous across element boundaries). Together these make the solution converge as the mesh is refined.
| Property | What it means | Check on the bar above |
|---|---|---|
| Kronecker delta | if , else 0 | , |
| Partition of unity | at every point, so a rigid-body shift gives zero strain | 0.625 + 0.375 = 1 |
| Completeness | Reproduces any linear field: | 0.625(2) + 0.375(6) = 3.5 ✓ |
| Compatibility (C⁰) | Neighbouring elements agree along shared nodes and edges, so there are no gaps or overlaps | Both elements use the same at a shared node |
| Local support | is non-zero only on elements touching node | Gives a sparse, banded stiffness matrix |
A common exam slip is to state that shape functions "sum to zero". They sum to one. It is their derivatives that sum to zero, which is why a rigid translation produces no strain.
What do quadratic shape functions look like, and why use them?
A 3-node quadratic element adds a mid-side node, so the field can curve inside one element. In natural coordinates () the shape functions are , and . Their derivatives vary linearly, so strain can change inside the element. That is why quadratic elements capture bending and stress gradients with far fewer elements.
At they evaluate to −0.125, 0.75 and 0.375. They still sum to 1, but one is negative. Negative values are normal for higher-order shape functions. That is also why a lumped mass matrix built naively from quadratic shape functions can have zero or negative corner masses.
Worked example: interpolating on . The nodes sit at 0, 1 and 2, with values 0, 1 and 4.
- One linear element (nodes at 0 and 2) gives against the exact 2.25. The worst error, at x = 1, is 1.0.
- Two linear elements (0-1 and 1-2) give . The worst error drops to 0.25, a factor of 4 for halving the element size, which is the convergence expected of linear elements.
- One quadratic element gives , exactly. A quadratic element contains in its polynomial, so it reproduces it with zero error.
For more on mid-side nodes and when they pay off, see higher-order elements in FEA.
How do shape functions give the stiffness matrix?
Strain is the derivative of displacement, so the strain-displacement matrix is made of shape-function derivatives. The element stiffness matrix is the integral of over the element volume. For a 2-node bar, is constant, and the integral gives the familiar matrix.
Worked example. Take a steel bar element with A = 100 mm², L = 500 mm and E = 200 GPa (200,000 N/mm², a typical value for steel). Then:
If node 1 is fixed and node 2 moves 0.05 mm, the strain is . The stress is MPa, and the nodal forces are N. Every number here comes from the two shape functions and their derivatives. For a full multi-element version, see our worked stepped-bar finite element derivation.
What are the shape functions of a linear triangle (CST)?
For a 3-node triangle, the shape functions are area coordinates. Join a point P to the three corners: is the area of the sub-triangle opposite node divided by the total area. They are linear in x and y, so strain is constant across the element, hence the name constant strain triangle.
In coefficient form, with the triangle's area:
where , , and the other coefficients follow by cycling the node numbers.
Worked example. The nodes are at (1, 1), (5, 2) and (2, 4) mm, so the area A = 5.5 mm². For point P = (2.5, 2.25), the sub-areas opposite nodes 1, 2 and 3 are 2.125, 1.625 and 1.75 mm².
The coefficient formula gives the same numbers: , , , and . Completeness checks out too: and , which is P itself.
Now give the nodes x-displacements of 0, 0.0012 and 0.0004 mm. Then mm, and the strain is at every point of the element. Because one triangle can hold only one strain value, a bending stress gradient needs several CSTs through the thickness. This is the main reason meshing guides steer you towards quads or 6-node triangles. Our post on tria elements covers the practical side.
What is an isoparametric element, and what is the Jacobian?
An isoparametric element uses the same shape functions for its geometry and its field. Each 4-node quadrilateral is mapped from a parent square with natural coordinates from −1 to 1. The Jacobian matrix converts derivatives and areas between the two, and its determinant must stay positive.
The bilinear (Q4) shape functions, with the corner coordinates , are:
The same functions place any point in the real element, and . The Jacobian follows from their derivatives:
Areas transform with its determinant:
Worked example. The nodes, taken anticlockwise, are at (0, 0), (4, 0), (5, 3) and (1, 2).
- The centre of the parent square, (ξ, η) = (0, 0), maps to (2.5, 1.25). The point (0.5, 0.5) has and maps to (3.75, 2.06).
- At the centre, , so . At the four corners det J is 2.0, 3.0, 2.75 and 1.75, all positive, so the mapping is valid.
- Summing det J at the four 2×2 Gauss points (each with weight 1) gives an area of 9.5. The shoelace formula on the corner coordinates also gives exactly 9.5, which confirms the mapping.
- Now drag node 4 inside to (3.5, 0.6), making the element concave. Det J at node 4 becomes −1.875. The mapping folds over itself, and the solver will stop with a negative-Jacobian error or return nonsense.
This is what the "Jacobian" check in a pre-processor's element-quality tools measures: how far det J varies across an element compared with an ideal shape. Our post on 2D element quality criteria lists the usual limits.
How many Gauss points does an element need?
An n-point Gauss rule integrates polynomials up to degree 2n − 1 exactly. A 2-point rule, with points at ±1/√3 and weights of 1, is exact up to cubics. That makes 2×2 points full integration for a 4-node quad's stiffness matrix. Using fewer points (reduced integration) saves time and avoids locking, but it can let zero-energy hourglass modes appear.
| Integrand on −1 to 1 | Exact | 2-point Gauss | Exact? |
|---|---|---|---|
| 2 | 2 | Yes | |
| 0.667 | 0.667 | Yes | |
| 0 | 0 | Yes | |
| 0.400 | 0.222 | No |
Commercial solvers expose this choice directly. Ansys documents that its 8-node brick SOLID185 defaults to full integration with the B-bar method. It also offers uniform reduced integration with hourglass control, and an enhanced-strain option that adds internal degrees of freedom to handle shear locking. The 20-node SOLID186, which shows quadratic displacement behaviour, defaults to uniform reduced integration. Its documentation warns that hourglass modes can spread unless there are at least two element layers in each direction. Those options exist because of the shape functions underneath them.
How do element families differ? (Pascal's triangle)
Pascal's triangle shows which polynomial terms an element's shape functions contain. Triangles use complete rows: 3 terms for a linear triangle, 6 for a quadratic one. Quadrilaterals add the twist term . The 4-node quad uses 1, x, y and xy. The 8-node serendipity quad adds , , and , and the 9-node Lagrange quad also adds . One term is needed per node.
| Element | Nodes | Polynomial in each element | Strain inside the element |
|---|---|---|---|
| 2-node bar / truss | 2 | 1, x | Constant |
| 3-node bar | 3 | 1, x, x² | Linear |
| Linear triangle (T3, CST) | 3 | 1, x, y | Constant |
| Quadratic triangle (T6) | 6 | Complete quadratic | Linear |
| Bilinear quad (Q4) | 4 | 1, x, y, xy | Varies linearly in one direction only |
| Serendipity quad (Q8) | 8 | Quadratic + x²y, xy² | Linear, plus some quadratic terms |
Should I use linear or quadratic elements?
Use quadratic elements, such as 10-node tets or 20-node bricks, for stresses on curved CAD geometry and wherever bending matters. Use linear elements for very large models, contact-heavy or explicit crash and drop simulations, and quick stiffness checks. When you do use linear elements, refine the mesh and use the element technology (reduced or enhanced integration) your solver recommends.
- Bending with linear quads and bricks. A fully integrated Q4 cannot bend without picking up false shear strain, so it is too stiff (shear locking). That is why enhanced-strain and incompatible-mode formulations exist.
- Linear tetrahedra. A 4-node tet is a constant-strain element in 3D, so structural meshes of CAD geometry normally use 10-node tets (Ansys lists SOLID187 as the 10-node option).
- Explicit dynamics. Crash and drop models typically use cheap, reduced-integrated linear elements with hourglass control, because millions of time steps make every Gauss point expensive. See implicit vs explicit FEA for why.
Are shape functions used in CFD?
It depends on the method. Finite-element CFD solvers use them exactly as described here. Finite-volume codes such as OpenFOAM store one value per cell and instead use interpolation schemes to estimate values at cell faces. The OpenFOAM guide, for example, describes "linear" (second order, unbounded) and "upwind" (first order, bounded) schemes. These play the role shape functions play in FEM.
The same thinking carries over. A linear face interpolation is the 1D shape-function formula from earlier, applied between two cell centres. The accuracy-versus-boundedness trade-off you meet when choosing a CFD scheme mirrors the linear-versus-quadratic choice in FEA. If you are heading into CFD, our explainer on what CFD is walks through the finite-volume method.
How can you learn FEA properly?
Learn the theory on a 1D bar and a CST by hand, then reproduce those results in a solver and compare. Skill-Lync's Basics of FEA: Explicit and Implicit FEA (12 weeks) covers element formulation and solver practice. The 48-week Post Graduate Program in CAE takes you through meshing, implicit and explicit analysis and industry projects.
For CFD, the Post Graduate Program in CFD Solver Development builds solvers from the discretisation up. Based on 3,711 Skill-Lync placement records up to 7 Nov 2026 (data snapshot of 15 Nov 2026); this is a starting point and we will update it as new placements come in. Learners placed in CAE reported a median starting salary of ₹3.2 LPA (n = 456), and those in FEA/CAE engineer roles ₹3.3 LPA (n = 272). These figures are self-reported and mostly from 2021-23. For more detail, see our CAE and FEA engineer salary guide. Not sure where to start? Book a free call with a Skill-Lync counsellor.
Frequently asked questions
What is the difference between a shape function and an interpolation function?
In most FEA textbooks they mean the same thing. "Shape function" is the engineering name, and "interpolation function" or "basis function" are the mathematical ones. Some authors say "shape function" only for isoparametric elements, where the same functions also describe the element's geometry. The definition, , does not change.
Why is the sum of shape functions equal to one?
The sum must be one so that a constant field, such as a rigid-body translation or a uniform temperature, is reproduced exactly. If every node moves by the same amount c, then only when . Without this, a rigid shift would create false strain, and the mesh would fail the patch test.
Can a shape function be negative?
Yes. Higher-order shape functions go negative between nodes. The quadratic end-node function equals −0.125 at . Linear shape functions stay between 0 and 1. Negative values are mathematically fine, but they explain why naive lumped mass matrices for some quadratic elements can produce zero or negative corner masses.
What does a negative Jacobian mean in FEA?
A negative Jacobian means the mapping from the parent element to the real element has folded over: the element is inverted or badly concave. In our quad example, dragging one node inside made det J −1.875 at that corner. Solvers reject such elements or give wrong stiffness, so fix the mesh before solving.
How many shape functions does an element have?
An element has one shape function per node, for each field it interpolates. A 4-node quad has four shape functions. For 2D displacement it reuses the same four for both x and y, giving 8 degrees of freedom. A 20-node brick has twenty shape functions and 60 displacement degrees of freedom.
What is the difference between Lagrange and serendipity elements?
Lagrange elements place nodes on a full grid, so a quadratic quad has 9 nodes, including a centre node, and contains . Serendipity elements keep only boundary nodes: 8 for a quadratic quad. Serendipity elements need fewer nodes, which is why 8-node quads and 20-node bricks are so common. Lagrange elements carry the extra term, at more cost.
Sources and further reading
- TU Delft MUDE textbook, "Isoparametric mapping" (CC BY 4.0): bilinear quad shape functions in ξ, η; Jacobian definition; dx dy = det J dξ dη; 2-point Gauss rule at ±1/√3 with unit weights. Accessed 17 Nov 2026.
- Ansys Help 2026 R1, SOLID185 element description: 8 nodes, 3 DOF per node; KEYOPT(2) full integration with B-bar (default), uniform reduced integration with hourglass control, enhanced strain (internal DOFs for shear locking). Accessed 17 Nov 2026.
- Ansys Help 2026 R1, SOLID186 element description: 20 nodes, quadratic displacement behaviour, uniform reduced integration default, hourglass caution, degenerate prism/tet/pyramid shapes. Accessed 17 Nov 2026.
- MIT OpenCourseWare, K.-J. Bathe, Finite Element Procedures for Solids and Structures (RES.2-002): lecture 6 covers the formulation of isoparametric continuum elements. Accessed 17 Nov 2026.
- OpenFOAM User Guide v12 (CFD Direct), Numerical schemes: interpolation from cell centres to faces; linear (second order, unbounded) and upwind (first order, bounded). Accessed 17 Nov 2026.
- Skill-Lync placement records, snapshot of 15 Nov 2026 (records up to 7 Nov 2026): CAE domain n = 456, median ₹3.2 LPA; FEA/CAE engineer role n = 272, median ₹3.3 LPA.


