## 3 Complex-Step Approximation and Finite Difference Method  
The complex-step (CS) derivative method [46] was introduced by [PERSON] and [PERSON] [47] and has been proven to be more efficient for the first-order derivative calculation than the conventional finite difference method [48]. In the CS derivative approximation, an imaginary number multiplied by the step size \(h\) is utilized. The first derivative is approximated by a single function evaluation with it. To derive the CS derivative and identify its associated errors, consider the differentiable function \(f(\cdot)\) and the point \(y\) on the real axis (\(y\ \in\ \mathbb{R}\)). The Taylor series expansion of \(f(y+\mathrm{i}h)\) gives  
\[f(y+\mathrm{i}h)\approx f(y)+ihf^{\prime}(y)-\tfrac{h^{2}}{2^{2}}f^{(2)}(y)-i \tfrac{h^{3}}{3!}f^{(3)}(y)+\tfrac{h^{4}}{4!}f^{(4)}(y)+\ldots \tag{12}\]  
where \(\mathrm{i}\) is the imaginary unit. Rearranging Equation (12) and taking the imaginary part of both sides yield  
\[f^{\prime}(y)\approx\tfrac{\Im[f(y+\mathrm{i}h)]}{h}+O\big{(}h^{2}\big{)} \tag{13}\]  
where \(\Im[\cdot]\) denotes the imaginary part of the function \(f\). When a small \(h\) is selected, terms with the order \(h^{2}\) and higher can be truncated. Evaluating the function \(f\) at the imaginary argument \(y+\mathrm{i}h\), and dividing it by \(h\) gives an approximation to the first derivative. The CS approximation in Equation (13) does not cause subtractive cancellation and results in calculations without the associated round-off error. Note that the real part of Equation (13) multiplied by \(h\) is equal to \(f(y)\). Therefore, the first derivative approximation and function value can be computed simultaneously, which will result in increased computational efficiency for analysis and optimization. The level of accuracy in the first derivative using the conventional finite difference method can vary with a change in the step size, which is generally selected arbitrarily. This level indicates that the actual effect of the step size in the finite difference method on the result makes it difficult to predict prior to actual calculation. It is noteworthy that sensitivity analysis using the CS approximation simply requires the evaluation of the function with a complex variable without analytical derivations of gradients. Therefore, the CS approximation allows for sensitive analysis in situations when the analytic derivative of gradients cannot be explicitly expressed or when each analysis becomes computationally expensive.  
More accurate finite difference approximations for the first derivative can be derived by combining different Taylor series expansions. For instance, subtracting the two expansions at the points \(f(x-h)\) and \(f(x+h)\) gives  
\[f^{\prime}(x)=\frac{f(x+h)-f(x-h)}{2h}+O\big{(}h^{2}\big{)} \tag{14}\]  
An error from Equation (14), which is referred to as the second-order central difference method, is proportional to \(h^{2}\). Similarly, second-order forward difference (FDM\({}^{2}\)) and fourth-order central difference methods method (CDM\({}^{4}\)) for approximating the first derivative are  
\[f^{\prime}(x)=\left\{\begin{array}{ll}\text{FDM}^{2}:&\frac{-3f(x)+4f(x+h)-f( x+2h)}{2h}+O\big{(}h^{2}\big{)}\\ \text{CDM}^{4}:&\frac{-f(x+2h)+8f(x+h)-8f(x-h)+f(x-2h)}{12h}+O\big{(}h^{4} \big{)}\end{array}\right. \tag{15}\]  
Although the high-order finite difference method leads to less truncation error, which can also be minimized by taking a relatively small \(h\), subtractive cancellations involved in formulas may lead to significant round-off errors, unlike the CS approximation.