# 2.11 The Finite Element Method for Two-Dimensional Diffusion

## 2.11.3 Differentiation using the Reference Element

Measurable Outcome 2.17

To find the derivative of \(\tilde{T}\) with respect to \(x\) (or similarly \(y\)) within an element, we differentiate the three nodal basis functions within the element:

| \(\displaystyle \tilde{T}_ x\) | \(\displaystyle =\) | \(\displaystyle \frac{\partial }{\partial x}\left(\sum _{j=1}^{3} a_ j\phi _ j\right),\) |  | (2.271)
|  | \(\displaystyle =\) | \(\displaystyle \sum _{j=1}^{3} a_ j\frac{\partial \phi _ j}{\partial x}.\) |  | (2.272)

To find the \(x\)-derivatives of each of the \(\phi _ j\)'s, the chain rule is applied:

\[\frac{\partial \phi _ j}{\partial x} = \frac{\partial \phi _ j}{\partial \xi _1}\frac{\partial \xi _1}{\partial x} + \frac{\partial \phi _ j}{\partial \xi _2}\frac{\partial \xi _2}{\partial x}.\] | (2.273)

Similarly, to find the derivatives with respect to \(y\):

\[\frac{\partial \phi _ j}{\partial y} = \frac{\partial \phi _ j}{\partial \xi _1}\frac{\partial \xi _1}{\partial y} + \frac{\partial \phi _ j}{\partial \xi _2}\frac{\partial \xi _2}{\partial y}.\] | (2.274)

The calculation of the derivatives of \(\phi _ j\) with respect to the \(\xi\) variables gives:

| \(\displaystyle \frac{\partial \phi _1}{\partial \xi _1}\) | \(\displaystyle =\) | \(\displaystyle -1, \qquad \frac{\partial \phi _1}{\partial \xi _2} = -1,\) |  | (2.275)
| \(\displaystyle \frac{\partial \phi _2}{\partial \xi _1}\) | \(\displaystyle =\) | \(\displaystyle 1, \qquad \frac{\partial \phi _2}{\partial \xi _2} = 0,\) |  | (2.276)
| \(\displaystyle \frac{\partial \phi _3}{\partial \xi _1}\) | \(\displaystyle =\) | \(\displaystyle 0, \qquad \frac{\partial \phi _3}{\partial \xi _2} = 1.\) |  | (2.277)

The only remaining terms are the calculation of \(\frac{\partial \xi _1}{\partial x}\), \(\frac{\partial \xi _2}{\partial x}\), etc. which can be found by differentiating Equation (2.270),

| \(\displaystyle \frac{\partial \vec{\xi }}{\partial \vec{x}}\) | \(\displaystyle =\) | \(\displaystyle \left(\begin{array}{cc} x_2-x_1 & x_3-x_1 \\ y_2-y_1 & y_3-y_1\end{array}\right)^{-1},\) |  | (2.278)
|  | \(\displaystyle =\) | \(\displaystyle \frac{1}{J} \left(\begin{array}{cc} y_3-y_1 & -(x_3-x_1) \\ -(y_2-y_1) & x_2-x_1\end{array}\right),\) |  | (2.279)

where

\[J = (x_2-x_1)(y_3-y_1) - (x_3-x_1)(y_2-y_1).\] | (2.280)

Note that the Jacobian, \(J\), is equal to twice the area of the triangular element.