# Fokas method

The Fokas method, or unified transform, is an algorithmic procedure for analysing boundary value problems for linear partial differential equations and for an important class of nonlinear PDEs belonging to the so-called integrable systems. It is named after Greek mathematician Athanassios S. Fokas.
Traditionally, linear boundary value problems are analysed using either integral transforms and infinite series, or by employing appropriate fundamental solutions.

## Integral transforms and infinite series

For example, the Dirichlet problem of the heat equation on the half-line, i.e., the problem
| $u_{t}=u_{xx},\quad 0<x<\infty ,\quad t>0,$ | (Eq.1) |
| $u(x,0)=u_{0}(x),\quad 0<x<\infty ;\quad u(0,t)=g_{0}(t),\quad t>0,$ | (Eq.2) |
$u_{0}$ and $g_{0}$ given, can be solved via the sine-transform. The analogous problem on a finite interval can be solved via an infinite series. However, the solutions obtained via integral transforms and infinite series have several disadvantages:
1. The relevant representations are not uniformly convergent at the boundaries. For example, using the sine-transform, equations Eq.1 and Eq.2 imply
| $u(x,t)={\frac {2}{\pi }}\int _{0}^{\infty }\sin(\lambda x)e^{-\lambda ^{2}t}\left[\int _{0}^{\infty }\sin(\lambda y)u_{0}(y)\,dy+\lambda \int _{0}^{t}e^{\lambda ^{2}\tau }g_{0}(\tau )\,d\tau \right]\,d\lambda .$ | (Eq.3) |
For $g_{0}(t)\neq 0$, this representation cannot be uniformly convergent at $x=0$, otherwise one could compute $u(0,t)$ by inserting the limit $x\rightarrow 0$ inside the integral of the rhs of Eq.3 and this would yield zero instead of $g_{0}(t)$.
2. The above representations are unsuitable for numerical computations. This fact is a direct consequence of 1.
3. There exist traditional integral transforms and infinite series representations only for a very limited class of boundary value problems. For example, there does not exist the analogue of the sine-transform for solving the following simple problem:
| $u_{t}+u_{xxx}=0,\quad 0<x<\infty ,\quad t>0,$ | (Eq.4) |
supplemented with the initial and boundary conditions Eq.2.
For evolution PDEs, the Fokas method:
* Constructs representations which are always uniformly convergent at the boundaries.
* These representations can be used in a straightforward way, for example using MATLAB, for the numerical evaluation of the solution.
* Constructs representations for evolution PDEs with spatial derivatives of any order.
In addition, the Fokas method constructs representations which are always of the form of the Ehrenpreis fundamental principle.

## Fundamental solutions

For example, the solutions of the Laplace, modified Helmholtz and Helmholtz equations in the interior of the two-dimensional domain $\Omega$, can be expressed as integrals along the boundary of $\Omega$. However, these representations involve both the Dirichlet and the Neumann boundary values, thus since only one of these boundary values is known from the given data, the above representations are not effective. In order to obtain an effective representation, one needs to characterize the generalized Dirichlet to Neumann map; for example, for the Dirichlet problem one needs to obtain the Neumann boundary value in terms of the given Dirichlet datum.
For elliptic PDEs, the Fokas method:
* Provides an elegant formulation of the generalised Dirichlet to Neumann map by deriving an algebraic relation, called the global relation, which couples appropriate transforms of all boundary values.
* For simple domains and a variety of boundary conditions the global relation can be solved analytically. Furthermore, for the case that $\Omega$ is an arbitrary convex polygon, the global relation can be solved numerically in a straightforward way, for example using MATLAB. Also, for the case that $\Omega$ is a convex polygon, the Fokas method constructs an integral representation in the Fourier complex plane. By using this representation together with the global relation it is possible to compute the solution numerically inside the polygon in a straightforward semi-analytic manner.

## The forced heat equation on the half-line

Let $u(x,t)$ satisfy the forced heat equation
| $u_{t}-u_{xx}=f(x,t),\ 0<x<\infty ,t>0,$ | (Eq.5) |
supplemental with the initial and boundary conditions Eq.2, where $g(t),\ u_{0}(x),\ f(x,t)$ are given functions with sufficient smoothness, which decay as $x\rightarrow \infty$.
The unified transform involves the following three simple steps.
1. By employing the Fourier transform pair
    ${\widehat {f}}(\lambda )=\int _{0}^{\infty }e^{-i\lambda x}f(x)\,dx,\quad \operatorname {Im} \lambda \leq 0;$
| $f(x)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }e^{i\lambda x}{\hat {f}}(\lambda )\,d\lambda ,\quad 0<x<\infty ,$ | (Eq.6) |
obtain the global relation. For equation Eq.5, we find
| $e^{\lambda ^{2}t}{\hat {u}}(\lambda ,t)=Q(\lambda ,t)-{\tilde {g_{1}}}(\lambda ^{2},t)-i\lambda {\tilde {g_{0}}}(\lambda ^{2},t),\quad \operatorname {Im} \lambda \leq 0,$ | (Eq.7) |
where the functions ${\hat {u}},\ Q,\ {\tilde {g_{1}}}$ and ${\tilde {g_{0}}}$ are the following integral transforms:
    ${\widehat {u}}(\lambda ,t)=\int _{0}^{\infty }e^{-i\lambda x}u(x,t)\,dx,\ \operatorname {Im} \lambda \leq 0,$
    $Q(\lambda ,t)=\int _{0}^{\infty }e^{-i\lambda x}u_{0}(x)dx+\int _{0}^{t}\,d\tau \int _{0}^{\infty }dx\,e^{-i\lambda x+\lambda ^{2}\tau }f(x,\tau ),\quad \operatorname {Im} \lambda \leq 0,$
| ${\tilde {g_{1}}}(\lambda ^{2},t)=\int _{0}^{t}e^{\lambda ^{2}\tau }u_{x}(0,\tau )\,d\tau ,\quad {\tilde {g_{0}}}(\lambda ^{2},t)=\int _{0}^{t}e^{\lambda ^{2}\tau }u(0,\tau )\,d\tau ,\quad \lambda \in \mathbb {C} .$ | (Eq.8) |
This step is similar with the first step used for the traditional transforms. However, equation Eq.7 involves the t-transforms of both $u(0,t)$ and $u_{x}(0,t)$, whereas in the case of the sine-transform $u_{x}(0,t)$ does not appear in the analogous equation (similarly, in the case of the cosine-transform only $u_{x}(0,t)$ appears). On the other hand, equation Eq.7 is valid in the lower-half complex $\lambda$-plane, wheres the analogous equations for the sine and cosine transforms are valid only for $\lambda$ real. The Fokas method is based on the fact that equation Eq.7 has a large domain of validity.
2. By using the inverse Fourier transform, the global relation yields an integral representation on the real line. By deforming the real axis to a contour in the upper half $\lambda$-complex plane, it is possible to rewrite this expression as an integral along the contour $\partial D^{+}$, where $\partial D^{+}$ is the boundary of the domain $D^{+}$, which is the part of $D$ in the upper half complex $\lambda$ plane, with $D$ defined by
    $D:\{\lambda \in \mathbb {C} ,\ \Re \ \omega (\lambda )<0\},$ where $\omega (\lambda )$ is defined by the requirement that $e^{i\lambda x+\omega (\lambda )t}$ solves the given PDE. Figure 1: The curve $\partial D^{+}$ For equation Eq.5, equations Eq.6 and Eq.7 imply
| $u(x,t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }e^{i\lambda x-\lambda ^{2}t}Q(\lambda ,t)\,d\lambda -{\frac {1}{2\pi }}\int _{\partial D^{+}}e^{i\lambda x-\lambda ^{2}t}[{\tilde {g_{1}}}(\lambda ^{2},t)+i\lambda {\tilde {g_{0}}}(\lambda ^{2},t)]\,d\lambda ,$ | (Eq.9) |
where the contour $\partial D^{+}$ is depicted in figure 1.
In this case, $\omega (\lambda )=-\lambda ^{2}=-|\lambda |^{2}e^{2i\theta }$, where $\theta ={\rm {{arg}\lambda }}$. Thus, $\Re \ \omega (k)<0$ implies $\sin 2\theta >0$, i.e., $-{\frac {\pi }{4}}<\theta <{\frac {\pi }{4}}$ and ${\frac {3\pi }{4}}<\theta <{\frac {5\pi }{4}}$. The fact that the real axis can be deformed to $\partial D^{+}$ is a consequence of the fact that the relevant integral is an analytic function of $\lambda$ which decays in $D^{+}$ as $\lambda \rightarrow \infty$.
3. By using the global relation and by employing the transformations in the complex-$\lambda$ plane which leave $\omega (\lambda )$ invariant, it is possible to eliminate from the integral representation of $u(x,t)$ the transforms of the unknown boundary values. For equation Eq.5, $\omega (\lambda )=\lambda ^{2}$, thus the relevant transformation is $\lambda \rightarrow -\lambda$. Using this transformation, equation Eq.7 becomes
| $e^{\lambda ^{2}t}{\hat {u}}(-\lambda ,t)=Q(-\lambda ,t)-{\tilde {g_{1}}}(\lambda ^{2},t)+i\lambda {\tilde {g_{0}}}(\lambda ^{2},t),\quad \operatorname {Im} \lambda \geq 0.$ | (Eq.10) |
In the case of the Dirichlet problem, solving equation Eq.10 for ${\tilde {g_{1}}}$ and substituting the resulting expression in Eq.9 we find
| $u(x,t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }e^{i\lambda x-\lambda ^{2}t}Q(\lambda ,t)\,d\lambda -{\frac {1}{2\pi }}\int _{\partial D^{+}}e^{i\lambda x-\lambda ^{2}t}[2i\lambda {\tilde {g_{0}}}(\lambda ^{2},t)+Q(-\lambda ,t)]\,d\lambda .$ | (Eq.11) |
If is important to note that the unknown term ${\hat {u}}(-\lambda ,t)$ does not contribute to the solution $u$. Indeed, the relevant integral involves the term $e^{i\lambda x}{\hat {u}}(-\lambda ,t)$, which is analytic and decays as $\lambda \rightarrow \infty$ in $D^{-}$, thus Jordan's lemma implies that ${\hat {u}}(-\lambda ,t)$ yields a zero contribution. Equation Eq.11 can be rewritten in a form which is consistent with the Ehrenpreis fundamental principle: if the boundary condition is specified for $0<\tau <T$, where $T$ is a given positive constant, then using Cauchy's integral theorem, it follows that Eq.11 is equivalent with the following equation:
| $u(x,t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }e^{i\lambda x-\lambda ^{2}t}Q(\lambda )\,d\lambda -{\frac {1}{2\pi }}\int _{\partial D^{+}}e^{i\lambda x-\lambda ^{2}t}[Q(-\lambda )+2i\lambda {\tilde {g_{0}}}(\lambda ^{2})]\,d\lambda ,$ | (Eq.12) |
where
    $Q(\lambda )={\widehat {u}}_{0}(\lambda )+\int _{0}^{\infty }dx\int _{0}^{T}dt\,e^{-i\lambda x+\lambda ^{2}t}f(x,t),$
    ${\tilde {g_{0}}}(\lambda ^{2})=\int _{0}^{T}e^{\lambda ^{2}t}g_{0}(t)\,dt.$
Uniform convergence The unified transform constructs representations which are always uniformly convergent at the boundaries. For example, evaluating Eq.12 at $x=0$, and then letting $\lambda \rightarrow -\lambda$ in the first term of the second integral in the rhs of Eq.12, it follows that
    $u(0,t)=-{\frac {i}{\pi }}\int _{\partial D}e^{-\lambda ^{2}t}\lambda {\tilde {g_{0}}}(\lambda ^{2})\,d\lambda .$
The change of variables $\lambda =e^{\frac {i\pi }{4}}{\sqrt {k}}$, $k>0$, implies that $u(0,t)=g(t)$.
Numerical evaluation It is straightforward to compute the solution numerically using quadrature after the contour has been deformed to ensure exponential decay of the integrand. For simplicity we concentrate on the case that the relevant transforms can be computed analytically. For example,
    $f(x,t)=0,\ u_{0}(x)=e^{-a^{2}x},\ g_{0}(t)=\cos(bt),\ a,b,{\text{real constants}}.$
Then, equation Eq.11 becomes
| $2\pi u(x,t)=\int _{-\infty }^{\infty }{\frac {e^{i\lambda x-\lambda ^{2}t}}{i\lambda +a^{2}}}\,d\lambda -\int _{\partial D^{+}}e^{i\lambda x-\lambda ^{2}t}\left[{\frac {1}{-i\lambda +a^{2}}}+{\frac {i\lambda }{\lambda +ib}}{\bigle^{(\lambda ^{2}+ib)t}-1{\bigr )}+{\frac {i\lambda }{\lambda -ib}}{\bigle^{(\lambda ^{2}-ib)t}-1{\bigr )}\right]\,d\lambda .$ | (Eq.13) |
* Figure 2: The contour L
For $\lambda$ on $\partial D^{+}$, the term $e^{i\lambda x}$ decays exponentially as $|\lambda |\rightarrow \infty$. Also by deforming $\partial D^{+}$ to $L$ where $L$ is a contour between the real axis and $\partial D^{+}$, it follows that for $\lambda$ on $L$ the term $e^{-\lambda ^{2}t}$ also decays exponentially as $|\lambda |\rightarrow \infty$. Thus, equation Eq.13 becomes
$2\pi u(x,t)=\int _{L}\left\{e^{i\lambda x-\lambda ^{2}t}\left[{\frac {1}{i\lambda +a^{2}}}+{\frac {1}{i\lambda -a^{2}}}\right]+i\lambda e^{i\lambda x}\left[{\frac {e^{ibt}-e^{-\lambda ^{2}t}}{\lambda +ib}}+{\frac {e^{-ibt}-e^{-\lambda ^{2}t}}{\lambda -ib}}\right]\right\}\,d\lambda ,$
and the rhs of the above equation can be computed using MATLAB.
For the details of effective numerical quadrature using the unified transform, we refer the reader to, which solves the advection-dispersion equation on the half-line. There it was found that the solution lends itself to quadrature (Gauss-Laguerre quadrature for exponential decay of integrand or Gauss–Hermite quadrature for squared exponential decay of integrand) with exponential convergence.
An Evolution Equation with Spatial Derivatives of Arbitrary order. Suppose that $e^{i\lambda x+\omega (\lambda )t}$ is a solution of the given PDE. Then, $\partial D^{+}$ is the boundary of the domain $D^{+}$ defined earlier.
If the given PDE contain spatial derivatives of order $n$, then for $n$ even, the global relation involves ${\frac {n}{2}}$ unknowns, whereas for $n$ odd it involves $(n+1)/2$ or $(n-1)/2$ unknowns (depending on the coefficient of the highest derivative). However, using an appropriate number of transformations in the complex $\lambda$-plane which leave $\omega (\lambda )$ invariant, it is possible to obtain the needed number of equations, so that the transforms of the unknown boundary values can be obtained in terms of ${\hat {u}}$ and of the given boundary data in terms of the solution of a system of algebraic equations.

## A Numerical Collocation Method

The Fokas method gives rise to a novel spectral collocation method occurring in Fourier space. Recent work has extended the method and demonstrated a number of its advantages; it avoids the computation of singular integrals encountered in more traditional boundary based approaches, it is fast and easy to code up, it can be used for separable PDEs where no Green's function is known analytically and it can be made to converge exponentially with the correct choice of basis functions.

### Basic method in a convex bounded polygon

Suppose that $u$ and $v$ both satisfy Laplace's equation in the interior of a convex bounded polygon $\Omega$. It follows that
    $0=v(u_{xx}+u_{yy})-u(v_{xx}+v_{yy})={\frac {\partial }{\partial x}}{\bigvu_{x}-uv_{x}{\big )}+{\frac {\partial }{\partial y}}{\bigvu_{y}-uv_{y}{\big )}.$
Then Green's theorem implies the relation
| $\int _{\partial \Omega }\left[\left(vu_{x}-uv_{x}\right)dy-\left(vu_{y}-uv_{y}\right)dx\right]=0.$ | (Eq.14) |
In order to express the integrand of the above equation in terms of just the Dirichlet and Neumann boundary values, we parameterize $u(x,y)$ and $v(x,y)$ in terms of the arc length, $s$, of $\partial \Omega$. This leads to
| $u_{x}dy-u_{y}dx={\frac {\partial u}{\partial w}}ds,$ | (Eq.15) |
where ${\frac {\partial u}{\partial w}}$ denotes the normal derivative.
In order to further simplify the global relation, we introduce the complex variable $z=x+iy$, and its conjugate ${\bar {z}}=x-iy$. We then choose the test function $v=e^{-i\lambda z}$, leading to the global relation for Laplace's equation:
| $\int _{\partial \Omega }e^{-i\lambda z}\left[{\frac {\partial u}{\partial w}}+\lambda u{\frac {dz}{ds}}\right]ds=0,\qquad \lambda \in \mathbb {C} .$ | (Eq.16) |
A similar argument can also be used in the presence of a forcing term (giving a non-zero right-hand side). An identical argument works for the Helmholtz equation
    $u_{xx}+u_{yy}+4\beta ^{2}u=0$
and the modified Helmholtz equation
    $u_{xx}+u_{yy}-4\beta ^{2}u=0.$
Choosing respective test functions $v=e^{-i\beta (\lambda z+{\frac {\bar {z}}{\lambda }})}$ and $v=e^{-i\beta (\lambda z-{\frac {\bar {z}}{\lambda }})}$ lead to respective global relations
    $\int _{\partial \Omega }e^{-i\beta (\lambda z+{\frac {\bar {z}}{\lambda }})}\left[{\frac {\partial u}{\partial w}}+\beta \left(\lambda {\frac {dz}{ds}}-{\frac {1}{\lambda }}{\frac {d{\bar {z}}}{ds}}\right)u\right]ds=0,\qquad \lambda \in \mathbb {C} \backslash \{0\},$
and
    $\int _{\partial \Omega }e^{-i\beta (\lambda z-{\frac {\bar {z}}{\lambda }})}\left[{\frac {\partial u}{\partial w}}+\beta \left(\lambda {\frac {dz}{ds}}+{\frac {1}{\lambda }}{\frac {d{\bar {z}}}{ds}}\right)u\right]ds=0,\qquad \lambda \in \mathbb {C} \backslash \{0\}.$
These three cases deal with more general second order elliptic constant coefficient PDEs through a suitable linear change of variables.
The Dirichlet to Neumann map for a convex polygon Suppose that $\Omega$ is the interior of a bounded convex polygon specified by the corners $z_{1},z_{2},\dots \ z_{n}$. In this case, the global relation Eq.16 takes the form
| $\sum _{j=1}^{n}u_{j}(\lambda )=0,\ \lambda \in \mathbb {C} ,$ | (Eq.17) |
where
| $u_{j}(\lambda )={\frac {1}{2}}\int _{z_{j}}^{z_{j}+1}e^{-i\lambda z}(u_{x}-iu_{y})\,dz,$ | (Eq.18) |
or
| $u_{j}(\lambda )=\int _{z_{j}}^{z_{j}+1}e^{-i\lambda z}\left({\frac {\partial u}{\partial w}}+\lambda u{\frac {dz}{ds}}\right)\,ds.$ | (Eq.19) |
The side $S_{j}$, which is the side between $z_{j}$ and $z_{j+1}$, can be parametrized by
    $z(t)=m_{j}+th_{j},\ m_{j}={\frac {z_{j}+z_{j+1}}{2}},\ h_{j}={\frac {z_{j+1}-z_{j}}{2}},\ t\in [-1,1].$
Hence,
    $ds=|h_{j}|\,dt,\ dz=h_{j}\,dt.$
The functions $u$ and ${\frac {\partial u}{\partial w}}$ can be approximated in terms of Legendre polynomials:
| $u^{j}(t)\approx \sum _{\ell =0}^{N-1}a_{\ell }^{j}P_{\ell }(t),\quad {\frac {\partial u^{j}(t)}{\partial w}}\approx \sum _{\ell =0}^{N-1}b_{\ell }^{j}P_{\ell }(t),$ | (Eq.20) |
where for the cases of the Dirichlet, Neumann or Robin boundary value problems either $a_{\ell }^{j}$, $b_{\ell }^{j}$or a linear combination of $a_{\ell }^{j}$and $b_{\ell }^{j}$ is given.
Equation Eq.19 now becomes an approximate global relation, where
| $u_{j}(\lambda )=\sum _{\ell =0}^{N-1}e^{-im_{j}\lambda }(b_{\ell }^{j}|h_{j}|+\lambda a_{\ell }^{j}h_{j}){\widehat {P}}_{\ell }(\lambda h_{j}),\ \lambda \in \mathbb {C} ,$ | (Eq.21) |
with ${\hat {P}}_{\ell }(\lambda )$ denoting the Fourier transform of $P_{\ell }(t)$, i.e.,
| ${\widehat {P}}_{\ell }(\lambda )=\int _{-1}^{1}e^{-i\lambda t}P_{\ell }(t)\,dt,\quad \lambda \in \mathbb {C} .$ | (Eq.22) |
${\hat {P}}_{\ell }(\lambda )$ can be computed numerically via ${\hat {P}}_{\ell }(\lambda )={\frac {\sqrt {-2i\pi \lambda }}{-i\lambda }}I_{\ell +{\frac {1}{2}}}(-i\lambda ),$ where $I_{\ell }$ denotes the modified Bessel function of the first kind.
The global relation involves $N$ unknown constants (for the Dirichlet problem, these constants are $b_{\ell }^{j}$). By evaluating the global relation at a sufficiently large number of different values of $\lambda$, the unknown constants can be obtained via the solution of a system of algebraic equations.
It is convenient to choose the above values of $\lambda$ on the $n$ rays $-{\bar {h}}_{j}\rho ,\ \rho >0,\ j=1,\dots ,n.$ For this choice, as $|\lambda |\rightarrow \infty$, the relevant system is diagonally dominant, thus its condition number is very small.

### Dealing with non-convexity

Whilst the global relation is valid for non-convex domains $\Omega$, the above collocation method becomes numerically unstable. A heuristic explanation for this ill-conditioning in the case of the Laplace equation is as follows. The `test functions' $e^{-i\lambda z}$ grow/decay exponentially in certain directions of $\lambda$. When using a sufficiently large selection of complex $\lambda$-values, located in all directions from the origin, each side of a convex polygon will for many of these $\lambda$-values encounter larger test functions than do the remaining sides. This is exactly the same argument that motivates the `ray' choice of collocation points given by $-{\overline {h}}_{j}\rho$, which yield a diagonally dominant system. In contrast, for a non-convex polygon, boundary regions in indented regions will always be dominated by effects from other boundary parts, no matter the $\lambda$-value. This can easily be overcome by splitting up the domain into numerous convex regions (introducing fictitious boundaries) and matching the solution and normal derivative across these internal boundaries. Such splitting also allows the extension of the method to exterior/unbounded domains $\Omega$ (see below).

### Evaluating in the domain interior

Let $G=G(z,\zeta )$ be the associated fundamental solution of the PDE satisfied by $u$. In the case of straight edges, Green's representation theorem leads to
| ${\begin{aligned}u(x,y)&=\sum _{j=1}^{n}\int _{-1}^{1}{\BigG(z,\zeta (t)){\frac {\partial u}{\partial w}}|h_{j}|+iu{\Big{\frac {\partial G}{\partial \zeta (t)}}(z,\zeta (t))h_{j}-{\frac {\partial G}{\partial {\bar {\zeta }}(t)}}(z,\zeta (t)){\bar {h}}_{j}{\Big )}{\Big ]}dt\\&\approx \sum _{j=1}^{n}\sum _{l=0}^{N-1}\int _{-1}^{1}{\BigG(z,\zeta (t))b_{l}^{j}P_{l}(t)|h_{j}|+ia_{l}^{j}{\Big{\frac {\partial G}{\partial \zeta (t)}}(z,\zeta (t))h_{j}-{\frac {\partial G}{\partial {\bar {\zeta }}(t)}}(z,\zeta (t)){\bar {h}}_{j}{\Big )}P_{l}(t){\Big ]}dt.\end{aligned}}$ | (Eq.23) |
Due to the orthogonality of the Legendre polynomials, for a given $z=x+iy$, the integrals in the above representation are Legendre expansion coefficients of certain analytic functions (written in terms of $G$). Hence the integrals can be computed rapidly (all at once) by expanding the functions in a Chebyshev basis (using the FFT) and then converting to a Legendre basis. This can also be used to approximate the `smooth' part of the solution after adding global singular functions to take care of corner singularities.

### Extension to curved boundaries and separable PDEs

The method can be extended to variable coefficient PDEs and curved boundaries in the following manner (see). Suppose that $\alpha (x,y)\in \mathbb {C} ^{2\times 2}$ is a matrix valued function, $\beta (x,y)\in \mathbb {C} ^{2}$ a vector valued function and $\gamma$ a function (all sufficiently smooth) defined over $\Omega$. Consider the formal PDE in divergence form:
| $\nabla \cdot (\alpha \nabla u)+\nabla \cdot (\beta u)+\gamma u=0.$ | (Eq.24) |
Assume that the domain $\Omega$ is a bounded connected Lipschitz domain whose boundary consists of a finite number of vertices connected by $C^{1}$ arcs. Denote the corners of $\Omega$ in anticlockwise order as $\{z_{j}\}_{1}^{n}$ with the side $\Gamma _{j}$, joining $z_{j}$ to $z_{j+1}$. $\Gamma _{j}$ can be parametrised by
    $[-1,1]\ni t\rightarrow (x_{j}(t),y_{j}(t))\in \mathbb {R} ^{2},$
where we assume that the parametrisation is $C^{1}$.
The adjoint of equation Eq.24 is given by
| $\nabla \cdot (\alpha ^{T}\nabla v)-\beta \cdot \nabla v+\gamma v=0.$ | (Eq.25) |
The expression $v\times$Eq.24$-u\times$Eq.25 can be written in the form
| $\nabla \cdot [v(\alpha \nabla u)-u(\alpha ^{T}\nabla v)+\beta uv]=0.$ | (Eq.26) |
Integrating across the domain and applying the divergence theorem we recover the global relation ($n$ denotes the outward normal):
| $\int _{\partial \Omega }u{\big(n\cdot \beta )v-n\cdot (\alpha ^{T}\nabla v){\big ]}+v{\bign\cdot (\alpha \nabla u){\big ]}ds=0.$ | (Eq.27) |
Define $l_{j}(t)={\sqrt {{\dot {x}}_{j}(t)^{2}+{\dot {y}}_{j}(t)^{2}}}$ along the curve $\Gamma _{j}$ and assume that $l_{j}(t)>0$. Suppose that we have a one-parameter family of solutions of the adjoint equation, $v(x,y;\lambda )=v_{\lambda }$, for some $\lambda \in {\mathcal {C}}$, where ${\mathcal {C}}$ denotes the collocation set. Denoting the solution $u$ alongside $\Gamma _{j}$ by $u^{j}$, the unit outward normal by $n_{j}$ and analogously the oblique derivative by $n_{j}\cdot (\alpha \nabla u^{j})$, we define the following important transform:
| ${\hat {\mu }}_{j}(\lambda ):=\int _{-1}^{1}{\big \u^{j}{\big(n_{j}\cdot \beta )v_{\lambda }-n_{j}\cdot (\alpha ^{T}\nabla v_{\lambda }){\big ]}+v_{\lambda }{\bign_{j}\cdot (\alpha \nabla u^{j}){\big ]}{\big \}}l_{j}(t)dt.$ | (Eq.28) |
Using Eq.28 , the global relation Eq.27 becomes
| $\sum _{j=1}^{n}{\hat {\mu }}_{j}(\lambda )=0.$ | (Eq.29) |
For separable PDEs, a suitable one-parameter family of solutions $v_{\lambda }$ can be constructed. If we expand each $u^{j}$ and its derivative $n_{j}\cdot (\alpha \nabla u^{j})$ along the boundary $\Gamma _{j}$ in Legendre polynomials, then we cover a similar approximate global relation as before. To compute the integrals that form the approximate global relation, we can use the same trick as before - expanding the function integrated against Legendre polynomials in a Chebyshev series and then converting to a Legendre series. A major advantage of the method in this scenario is that it is a boundary-based method which does not need any knowledge of the corresponding Green's function. Hence, it is more applicable than boundary integral methods in the setting of variable coefficients.

### Singular functions and an exterior scattering problems

A major advantage of the above collocation method is that the basis choice (Legendre polynomials in the above discussion) can be flexibly chosen to capture local properties of the solution along each boundary. This is useful when the solution has different scalings in different regions of $\Omega$, but is particularly useful for capturing singular behavior, for example, near sharp corners of $\Omega$.
We consider the acoustic scattering problem solved in by the method. The solution $u$ satisfies Helmholtz equation in $\mathbb {R} ^{2}\backslash \{x\in [-1,1],y=0\}$ with frequency $k_{0}=2\beta$, along with the Sommerfeld radiation condition at infinity:
| $\lim _{r\rightarrow \infty }r^{1/2}\left({\frac {\partial }{\partial r}}-ik_{0}\right)u(x,y)=0,$ | (Eq.30) |
where $r={\sqrt {x^{2}+y^{2}}}$. The boundary condition along the plate is
| ${\frac {\partial u}{\partial y}}(x,0)=-{\frac {\partial u_{I}}{\partial y}}(x,0),\quad x\in [-1,1]$ | (Eq.31) |
for the incident field
| $u_{I}(x,y)=e^{-ik_{0}\cos \theta x-ik_{0}\sin \theta y}.$ | (Eq.32) |
By considering the domains $y>0$ and $y<0$ separately and matching the global relations, the global relation for this problem becomes
| ${\begin{aligned}&\int _{\mathbb {R} \backslash [-1,1]}e^{-i\beta x(\lambda +{\frac {1}{\lambda }})}u_{y}(x,0)dx\\&+\int _{[-1,1]}e^{-i\beta x(\lambda +{\frac {1}{\lambda }})}\left[u_{y}(x,0)+{\frac {\beta }{2}}\left(\lambda -{\frac {1}{\lambda }}\right)[u](x,0)\right]dx=0,\qquad \lambda \in \Lambda ,\end{aligned}}$ | (Eq.33) |
with $\Lambda =(-1,0)\cup (1,\infty )\cup \{e^{-i\theta }:0<\theta <\pi \}$ and where $[u](x,0)=u(x,0_{+})-u(x,0_{-})$ denotes the jump in $u$ across the plate. The complex collocation points are allowed precisely because of the radiation condition. To capture the endpoint singularities, we expand $[u](x,0)$ for $x\in [-1,1]$ in terms of weighted Chebyshev polynomials of the second kind:
| $C_{m}(x)={\sqrt {1-x^{2}}}U_{m}(x).$ | (Eq.34) |
These have the following Fourier transform:
| $\int _{-1}^{1}e^{i\lambda t}{\sqrt {1-t^{2}}}U_{m}(t)dt={\frac {(m+1)i^{m}\pi }{\lambda }}J_{m+1}(\lambda ),$ | (Eq.35) |
where $J_{\alpha }(\cdot )$ denotes the Bessel function of the first kind of order $\alpha$. For the derivative $u_{y}$ along $\mathbb {R} \backslash [-1,1]$, a suitable basis choice are Bessel functions of fractional order (to capture the singularity and algebraic decay at infinity).
We introduce the dimensionless frequency ${\tilde {k}}_{0}=k_{0}L^{-1}$, where $L$ is the length of the plate. The figure below shows the convergence of the method for various ${\tilde {k}}_{0}$. Here $N$ is the number of basis functions $C_{m}$ used to approximate the jump $[u]$ across the plate. The maximum relative absolute error is the maximum error of the computed solution divided by the maximum absolute value of the solution. The figure is for $\theta =\pi /3$ and shows the quadratic-exponential convergence of the method, namely the error decreases like ${\mathcal {O}}(\rho ^{N^{2}})$ for some positive $\rho <1$. More complicated geometries (including different angles of touching boundaries and infinite wedges) can also be dealt with in a similar fashion as well as more complicated boundary conditions such as those modeling elasticity.