## 4 Computation of PDs of Surface-Wave Group Velocities
### Fully Analytical Method  
The first order derivative \(\partial c/\partial\omega\) in (8) also can be calculated by using the implicit function theory:  
\[\partial c/\partial\omega=-\frac{\partial F/\partial\omega}{\partial F/ \partial c}. \tag{9}\]  
Although the pseudo-code in Table 1 is for \(\partial F/\partial c\), it is apparently applicable to \(\partial F/\partial\omega\), provided that \(c\) is replaced by \(\omega\). Similarly, the PDs of group velocity with respect to certain generic physical parameter \(p\) of the objective layer \(t\) can be derived from (8) [30; 31; 32; 33; 36]: \begin{table}
\begin{tabular}{p{34.1 pt}} \hline \hline
**Pseudo-code 2** The computation of \(\partial F/\partial p_{t}\) \\ \hline
**Input:** angular frequency \(\omega\), phase velocity \(c\), earth model \(\mathbf{Q}_{\text{R}}\) or \(\mathbf{Q}_{\text{L}}\), and the sequence number \(t\) of the objective layer \\ \hline
1: Initialize one vector and one matrix: \(\mathbf{x}=\overline{\mathbf{X}}_{1}^{*}\), \(\mathbf{T}=\mathbf{0}\) \\
2: **if**\(t\) equals to \(n+1\)**then** \\
3: **for**\(m=1\)-\(n\)**do** \\
4: calculate \(\overline{\mathbf{T}}_{m}\): \(\mathbf{T}=\overline{\mathbf{T}}_{m}\) \\
5: update \(\mathbf{x}\): \(\mathbf{x}=\mathbf{x}\times\mathbf{T}\) \\
6: **end for** \\
7: Calculate \(\partial\overline{\mathbf{V}}_{n+1}/\partial p_{t+1}\) \\
8: **end for** \\
9: **for**\(m=1\)-\(n\)**do** \\
10: **if**\(m\) equals to \(t\)**then** \\
11: Calculate \(\partial\overline{\mathbf{T}}_{t}/\partial p_{t}\): \(\mathbf{T}=\partial\overline{\mathbf{T}}_{t}/\partial p_{t}\) \\
12: **else** \\
13: Calculate \(\overline{\mathbf{T}}_{m}\): \(\mathbf{T}=\overline{\mathbf{T}}_{m}\) \\
14: **end if** \\
15: update \(\mathbf{x}\): \(\mathbf{x}=\mathbf{x}\times\mathbf{T}\) \\
16: **end for** \\
17: compute \(\overline{\mathbf{V}}_{n+1}\) \\
**Output: \(\partial F/\partial p_{t}=\mathbf{x}\times\overline{\mathbf{V}}_{n+1}\)** \\
18: **end if** \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Pseudo-code for computation of \(\partial F/\partial p_{t}\). \[\frac{\partial U}{\partial p_{t}}=\frac{U}{c}\Big{(}2-\frac{U}{c}\Big{)}\frac{ \partial c}{\partial p_{t}}+\omega\frac{U^{2}}{c^{2}}\frac{\partial^{2}c}{ \partial\omega\partial p_{t}}. \tag{10}\]  
The second-order mixed partial derivative in (10) can be derived by further differentiating (4) with respect to \(\omega\)[31]:  
\[\frac{\partial^{2}c}{\partial\omega\partial p_{t}}=-\bigg{[}\frac{\partial^{ 2}F}{\partial\omega\partial p_{t}}+\frac{\partial^{2}F}{\partial\omega \partial c}\frac{\partial c}{\partial p_{t}}+\bigg{(}\frac{\partial^{2}F}{ \partial c\partial p_{t}}+\frac{\partial^{2}F}{\partial c^{2}}\frac{\partial c }{\partial p_{t}}\bigg{)}\frac{\partial c}{\partial\omega}\bigg{]}/\frac{ \partial F}{\partial c}. \tag{11}\]  
In the following, we take \(\frac{\partial^{2}F}{\partial c^{2}}\) as an example to illustrate how to calculate the second-order partial derivatives analytically. As for \(\frac{\partial^{2}F}{\partial\omega p_{t}}\frac{\partial^{2}F}{\partial\omega p _{t}}\), and \(\frac{\partial^{2}F}{\partial\omega kc}\), they can be calculated in the same way. The computational procedure for \(\partial F/\partial c\) (Table 1) can be performed in a recursive manner:  
\[ \begin{split}&\overline{\textbf{X}}_{m+1}=\overline{\textbf{X}}_{ m}\overline{\textbf{T}}_{m}^{*},\;m=1,2,\cdots,n;\\ &\overline{\textbf{Y}}_{m+1}=\overline{\textbf{Y}}_{m}^{*} \overline{\textbf{T}}_{m}^{*}+\overline{\textbf{X}}_{m}^{*}\frac{\partial \overline{\textbf{T}}_{m}^{*}}{\partial\overline{\textbf{c}}},\;m=1,2,\cdots, n;\\ &\partial F/\partial c=\overline{\textbf{Y}}_{n+1}\overline{ \textbf{V}}_{n+1}+\overline{\textbf{X}}_{n+1}\frac{\partial\overline{\textbf{ V}}_{n+1}}{\partial c}.\end{split}