# Constructing a function space to automatically satisfy BCs

Gold Member

## Main Question or Discussion Point

Suppose we have a piecewise function $$f(x) = \begin{cases} f_1(x) & \text{if } -1\leq x \leq \xi_1 \\ 0 & \text{if } -\xi_1\leq x \leq \xi_2 \\ f_2(x) & \text{if } -\xi_2 \leq x \leq 1 \end{cases}$$

where ##\xi_1,\xi_2## are known constants and ##f_1(x),f_2(x)## are unknown functions. ##f(x)## is subject to the following boundary conditions$$\int_{-1}^{\xi_1}f_1(x)\,dx + \int_{\xi_2}^{1}f_2(x)\,dx=0\\ f_1(\xi_1)=0\\ f_2(\xi_2)=0.$$

We assume ##f(x)## takes the following form: $$f_1(x) = \sum_{k=0}^N b_k P_k(x)\\ f_2(x) = \sum_{k=0}^N c_k P_k(x)$$
where ##P_k(x)## is the ##k##th Legendre polynomial. In order to satisfy the above boundary conditions for any ##\xi_1<\xi_2\in[-1,1]## I necessarily solve for 3 constants, a combination of ##b_k## and ##c_k##, right? My text reads "There are ##2(N+1)−3 = 2N−1## linearly independent coefficient vectors that solve [the boundary conditions]"; what does this mean? I thought it meant there are ##2N-1## undetermined coefficients.

See, ultimately I am trying to solve the system of ##j## algebraic equations $$-\lambda^2\sum_{i=1}^nM_{ij}a_i=\sum_{i=1}^nK_{ij}a_i$$ where ##K_{ij},M_{ij}## are differential operators, functions of only ##P_k(x),P_i(x)## and ##\lambda^2## is an eigenvalue to be determined. So am I understanding this correct, that we are using the system of equations to solve for the remaining ##2N-1## constants ##b_k,c_k##?