In this section we investigate properties of a generalized Green’s function that are similar to corresponding properties of ordinary Green’s function given in Section 4.
Lemma 3
A generalized Green’s function
\(G^{g}\)
is the minimum norm least squares solution of the following discrete problem:
$$ \begin{aligned} &\mathcal{L}_{i \cdot}G_{\cdot j}^{g}= \delta_{ij},\quad i\in X_{n}, \\ & \bigl\langle L_{k},G_{\cdot j}^{g} \bigr\rangle =0, \quad k=1,2, \end{aligned} $$
(29)
for every fixed
\(j\in X_{n-2}\).
Proof
The minimum norm least squares solution of the problem (5)-(6) is described by (28). Let us choose \(j\in X_{n-2}\) and values of the right side \({\mathbf{f}}=(\delta_{0j},\delta_{1j},\ldots,\delta_{n-2,j})^{T}\), and \(g_{1}=g_{2}=0\). Then for a fixed \(j\in X_{n-2}\), the form of the minimum norm least squares solution (28) simplifies as follows:
$$u^{o}_{i}=\sum_{l=0}^{n-2}G_{il}^{g}f_{l}= \sum_{l=0}^{n-2}G_{il}^{g} \delta_{lj}=G_{ij}^{g}, \quad i\in X_{n}. $$
So, for each fixed \(j\in X_{n-2}\) generalized Green’s function \(G_{\cdot j}^{g}\) is the minimum norm least squares solution of the problem (29). □
Lemma 4
Discrete functions
\(v^{g,1}\)
and
\(v^{g,2}\)
are minimum norm least squares solutions of corresponding discrete problems
$$ \textstyle\begin{array}{c} \mathcal{L}v^{g,1}=0,\\ \bigl\langle L_{1},v^{g,1} \bigr\rangle =1,\qquad \bigl\langle L_{2},v^{g,1} \bigr\rangle =0, \end{array}\displaystyle \qquad \textstyle\begin{array}{c} \mathcal{L}v^{g,2}=0,\\ \bigl\langle L_{1},v^{g,2} \bigr\rangle =0,\qquad \bigl\langle L_{2},v^{g,2} \bigr\rangle =1. \end{array} $$
(30)
Proof
The minimum norm least squares solution of the problem (5)-(6) is described by formula (24). For this problem, let us choose \({\mathbf{f}}={\mathbf{0}}\) and \(g_{1}=1\), \(g_{2}=0\). Then from (24) follows that \({\mathbf{v}}^{g,1}\) is the minimum norm least squares solution of the first problem (30). Afterwards choosing \({\mathbf{f}}={\mathbf{0}}\) and \(g_{1}=0\), \(g_{2}=1\), we obtain similarly that \({\mathbf{v}}^{g,2}\) is the minimum norm least squares solution of the other problem (30). □
Let us now investigate two discrete problems (18), where \(D(\boldsymbol {l})[\boldsymbol {u}]\neq0\) and the other determinant \(D(\boldsymbol {L})[\boldsymbol {u}]\) can obtain any value. Thus, for the first problem (18), there exist a unique solution u and the ordinary Green’s function G.
Theorem 2
If the first discrete problem (18) has the unique exact solution
u, then the minimum norm least squares solution of the other problem (18) is given by
$$ v=u-{P}_{N(A)}u +{v}^{g,1} \bigl(g_{1}-\langle L_{1},u\rangle \bigr)+{v}^{g,2} \bigl(g_{2}- \langle L_{2},u\rangle \bigr). $$
Proof
Let u be the unique exact solution of the first problem (18). On the other hand, the second discrete problem (18) always has the minimum norm least squares solution v. Since u is the exact solution, the difference \(w=v-u\) satisfies equalities
$$ \begin{aligned} &\mathcal{L}w=\mathcal{L}v-\mathcal{L}u=\mathcal{L}v-f, \\ &\langle L_{k},w\rangle=\langle L_{k},v\rangle-\langle L_{k},u\rangle,\quad k=1,2. \end{aligned} $$
We will show that w is a least squares solution of the following discrete problem:
$$\mathcal{L}w=0,\qquad \langle L_{k},w\rangle=g_{k}-\langle L_{k},u\rangle, \quad k=1,2. $$
This problem can also be written in the unexpanded matrix form \(\mathbf {A}{\mathbf{w}}=\widetilde{\mathbf{g}}\) with the right side \(\widetilde{\mathbf{g}}=(0,0,\ldots,0,g_{1}-\mathbf {L}_{1}\mathbf{u},g_{2}- \mathbf{L}_{2}\mathbf{u})^{T}\). Since v is the minimum norm least squares solution of the linear system (9) with \(\widetilde{\mathbf{f}}=(f_{0},f_{1},\ldots,f_{n-2},g_{1},g_{2})^{T}\), the inequality (21) is always valid, i.e.
$$ \|\mathbf{A} {\mathbf{v}}-\widetilde{\mathbf{f}}\|\leq\| \mathbf{A} {\mathbf {x}}-\widetilde{\mathbf{f}}\| $$
(31)
for every \(\mathbf{x}\in\mathbb{C}^{(n+1)\times1}\). Now we rewrite the Euclidean norm as follows:
$$\begin{aligned} \|\mathbf{A} {\mathbf{x}}-\widetilde{\mathbf{f}}\|^{2}&=\|{ \mathbf{Lx}-\mathbf {f}}\|^{2}+|\mathbf{L}_{1} \mathbf{x}-g_{1}|^{2} +| \mathbf{L}_{2} \mathbf{x}-g_{2}|^{2} \\ &=\|{\mathbf{Lx-\mathcal{L}u}}\|^{2} +\sum _{j=1}^{2}|\mathbf{L}_{j}\mathbf{x}- \mathbf{L}_{j}\mathbf{u}+ \mathbf{L}_{j} \mathbf{u}-g_{j}|^{2} \\ &=\bigl\| \mathbf{L(x-u)}\bigr\| ^{2}+\sum_{j=1}^{2}\bigl| \mathbf{L}_{j}(\mathbf {x}-\mathbf{u})-(g_{j}- \mathbf{L}_{j}\mathbf{u})\bigr|^{2} \\ &=\bigl\| \mathbf{A} {\mathbf{(x-u)}}-\widetilde{\mathbf{g}}\bigr\| ^{2}, \end{aligned}$$
which becomes \(\|\mathbf{A}{\mathbf{v}}-\widetilde{\mathbf{f}}\|=\|\mathbf{A}{\mathbf {w}}-\widetilde{\mathbf{g}}\|\) for the vector v, since \({\mathbf{w}}={\mathbf{v}}-{\mathbf{u}}\). Then the inequality (31) can be rewritten as
$$\|\mathbf{A} {\mathbf{w}}-\widetilde{\mathbf{g}}\|\leq\bigl\| \mathbf{A}({\mathbf {x-u}})-\widetilde{\mathbf{g}}\bigr\| ,\quad \forall{\mathbf{x}}\in \mathbb{C}^{(n+1)\times1}. $$
Denoting \({\mathbf{y}}={\mathbf{x}}-{\mathbf{u}}\), the last inequality becomes
$$\|\mathbf{A} {\mathbf{w}}-\widetilde{\mathbf{g}}\|\leq\|\mathbf{A} {\mathbf {y}}-\widetilde{\mathbf{g}}\|,\quad \forall{\mathbf{y}}\in\mathbb{C}^{(n+1)\times1}. $$
So, w is a least squares solution of the problem \(\mathbf {A}{\mathbf{w}}=\widetilde{\mathbf{g}}\) and has a particular form (20). Precisely, there exists such \({\mathbf{c}}^{o}\in \mathbb{C}^{(n+1)\times1}\) that
$$ {\mathbf{w}}={\mathbf{A}}^{\dagger}\widetilde{\mathbf{g}}+{ \mathbf{P}}_{N({\mathbf {A}})}{\mathbf{c}}^{o} =(g_{1}- \mathbf{L}_{1}\mathbf{u}){\mathbf{v}}^{g,1}+(g_{2}- \mathbf {L}_{2}\mathbf{u}){\mathbf{v}}^{g,2}+{ \mathbf{P}}_{N(\mathbf{A})}{\mathbf{c}}^{o}. $$
Now we recall the equality \({\mathbf{w}}={\mathbf{v}}-{\mathbf{u}}\) and obtain
$$ {\mathbf{v}}={\mathbf{u}}+(g_{1}-\mathbf{L}_{1} \mathbf{u}){\mathbf{v}}^{g,1} +(g_{2}-\mathbf{L}_{2} \mathbf{u}){\mathbf{v}}^{g,2}+{\mathbf{P}}_{N(\mathbf {A})}{ \mathbf{c}}^{o}. $$
(32)
Moreover, from Lemma 2 and the properties of every finite matrix [26] it follows that
-
(1)
\(\mathbf{P}_{N(\mathbf{A})}{\mathbf{c}}^{o}\in N(\mathbf{A})\),
-
(2)
\((g_{1}- \mathbf{L}_{1}\mathbf{u}){\mathbf{v}}^{g,1} +(g_{2}- \mathbf{L}_{2}\mathbf{u}){\mathbf{v}}^{g,2}={\mathbf{A}}^{\dagger }\widetilde{\mathbf{g}} \in R(\mathbf{A}^{\dagger})=R(\mathbf{A}^{*})=N(\mathbf{A})^{\bot}\),
-
(3)
\({\mathbf{v}}={\mathbf{G}}^{g}{\mathbf{f}}= \mathbf{A}^{\dagger}\widetilde{\mathbf {f}}\in R(\mathbf{A}^{\dagger}) =N(\mathbf{A})^{\bot}\) for \(\widetilde{\mathbf{f}}= (f_{0},f_{1},\ldots,f_{n-2},0,0)^{T}\).
Furthermore, for every \(\mathbf{u}\in\mathbb{C}^{(n+1)\times1}\) the notation
$${\mathbf{u}}=({\mathbf{I}}-{\mathbf{P}}_{N(\mathbf{A})}) {\mathbf{u}}+{ \mathbf{P}}_{N(\mathbf {A})}{\mathbf{u}} ={\mathbf{P}}_{{N(\mathbf{A})}^{\bot}}{\mathbf{u}} +{ \mathbf{P}}_{N(\mathbf{A})}{\mathbf{u}} $$
is valid. Then (32) becomes
$$ {\mathbf{v}}={\mathbf{P}}_{N({\mathbf{A)}^{\bot}}}{\mathbf{u}}+(g_{1}- \mathbf {L}_{1}\mathbf{u}){\mathbf{v}}^{g,1} +(g_{2}- \mathbf{L}_{2}\mathbf{u}){\mathbf{v}}^{g,2}+{ \mathbf{P}}_{N({\mathbf {A}})} \bigl({\mathbf{c}}^{o}+{\mathbf{u}} \bigr), $$
where only the last component \({\mathbf{P}}_{N(\mathbf{A})}({\mathbf {c}}^{o}+{\mathbf{u}})\in N(\mathbf{A})\), but all the other components and the vector v belong to \(N(\mathbf{A})^{\bot}\), the orthogonal complement of \(N(\mathbf{A})\). Since the left side of the last equality belongs to the orthogonal complement \(N(\mathbf{A})^{\bot}\), the right side also belongs to \(N(\mathbf{A})^{\bot}\) because of the equality. Thus, it follows that the component \({\mathbf{P}}_{N(\mathbf{A})}({\mathbf {c}}^{o}+{\mathbf{u}})=0\), and the statement of this theorem is valid. □
The Green’s functions of these problems are also related.
Theorem 3
If there exists an ordinary Green’s function
G
for the first problem (18), then the generalized Green’s function
\(G^{g}\)
of the second problem is given by
$$ G^{g}_{ij}=G_{ij}-({P_{N(A)}})_{i \cdot}G_{\cdot j} -v^{g,1}_{i}\langle L_{1},G_{\cdot j}\rangle -v^{g,2}_{i}\langle L_{2},G_{\cdot j}\rangle, \quad i\in X_{n}, j\in X_{n-2}. $$
Proof
For every fixed \(j\in X_{n-2}\), let us investigate the discrete problems (14) and (29). Their solutions are \(u=G_{\cdot j}\) and \(v=G_{\cdot j}^{g}\), respectively. Then according to Theorem 2, they are related by
$$G^{g}_{\cdot j}=G_{\cdot j}-({P_{N(A)}})G_{\cdot j} -v^{g,1}\langle L_{1},G_{\cdot j}\rangle -v^{g,2}\langle L_{2},G_{\cdot j}\rangle v,\quad j\in X_{n-2}. $$
□
Corollary 3
A generalized Green’s function for the problem (5)-(6) is given by
$$ G^{g}_{ij}=G^{c}_{ij}-({P_{N(A)}})_{i \cdot}G^{c}_{\cdot j} -v^{g,1}_{i} \bigl\langle L_{1},G^{c}_{\cdot j} \bigr\rangle -v^{g,2}_{i} \bigl\langle L_{2},G^{c}_{\cdot j} \bigr\rangle , $$
(33)
where
\(i\in X_{n}\), \(j\in X_{n-2}\), and
\(G^{c}\)
is an ordinary Green’s function of the corresponding initial problem (5)-(6).
Proof
Since every second order discrete initial problem (5)-(6) has an ordinary Green’s function [21], the statement of this corollary follows from Theorem 3 with \(G=G^{c}\). □
Let us investigate the discrete problem (5) with nonlocal boundary conditions (19). Recall that this problem becomes a classical problem if parameters \(\gamma_{1},\gamma_{2}=0\).
Corollary 4
If there exists an ordinary Green’s function
\(G^{cl}\)
of the classical problem (5), (19) (\(\gamma_{1},\gamma_{2}=0\)), then the generalized Green’s function of the problem with nonlocal boundary conditions (5), (19) is given by
$$ G^{g}_{ij}=G_{ij}^{cl}-(P_{N(A)})_{i\cdot}G^{cl}_{\cdot j} +\gamma_{1}v^{g,1}_{i} \bigl\langle \varkappa_{1},G_{\cdot j}^{cl} \bigr\rangle + \gamma_{2}v^{g,2}_{i} \bigl\langle \varkappa_{2},G_{\cdot j}^{cl} \bigr\rangle , $$
(34)
where
\(i\in X_{n}\), \(j\in X_{n-2}\).
Proof
Let us say that there exists an ordinary Green’s function \(G^{cl}\) of classical problem (with \(\gamma_{k}=0\), \(k=1,2\)). Then, according to (14), an ordinary Green’s function satisfies homogeneous classical boundary conditions \(\langle\kappa_{k},G_{\cdot j}^{cl}\rangle=0\), \(k=1,2\), \(j\in X_{n-2}\). Since \(L_{k}=\kappa_{k}-\gamma_{k}\varkappa_{k}\), from Theorem 3 with \(G=G^{cl}\) it follows that
$$\begin{aligned} G_{ij}^{g}&=G_{ij}^{cl}-(P_{N(A)})_{i\cdot}G_{\cdot j}^{cl} -v^{g,1}_{i} \bigl\langle L_{1},G_{\cdot j}^{cl} \bigr\rangle -v^{g,2}_{i} \bigl\langle L_{2},G_{\cdot j}^{cl} \bigr\rangle \\ &=G_{ij}^{cl}-(P_{N(A)})_{i\cdot}G_{\cdot j}^{cl} +\gamma_{1} \bigl\langle \varkappa_{1},G_{\cdot j}^{cl} \bigr\rangle v^{g,1}_{i} +\gamma_{2} \bigl\langle \varkappa_{2},G_{\cdot j}^{cl} \bigr\rangle v^{g,2}_{i}. \end{aligned}$$
□
Remark 1
Since the condition (7) is equivalent to \(\det\mathbf{A}\neq 0\), the discrete problem (9) has a nonsingular matrix and the orthogonal projector \(\mathbf{P}_{N(\mathbf{A})}=\mathbf{O}\) is the zero matrix. So, we note that all statements, proved in this section for a generalized Green’s function \(G^{g}\), a generalized system of vectors \(v^{g,1}\), \(v^{g,2}\), and the minimum norm least squares solution \(u^{o}\), are coincident with the corresponding statements that are formulated in Section 4 for an ordinary Green’s function G, a biorthogonal fundamental system \(v^{1}\), \(v^{2}\), and the unique exact solution u if the condition (7) is satisfied.
Corollary 5
Let
\(D(\boldsymbol {l})[\boldsymbol {u}]\neq0\). Then the biorthogonal fundamental system
\(v^{1}\), \(v^{2}\)
of the first problem (18) and a generalized fundamental system
\(v^{g,1}\), \(v^{g,2}\)
of the second problem (18) are related as follows:
$$ \begin{pmatrix} \langle L_{1},v^{1}\rangle& \langle L_{2}, v^{1}\rangle\\ \langle L_{1},v^{2}\rangle& \langle L_{2}, v^{2}\rangle \end{pmatrix} \begin{pmatrix} v^{g,1}_{i}\\ v^{g,2}_{i} \end{pmatrix} = \begin{pmatrix} v^{1}_{i}\\ v^{2}_{i} \end{pmatrix} - \begin{pmatrix} (P_{N(A)}v^{1})_{i}\\ (P_{N(A)}v^{2})_{i} \end{pmatrix},\quad i\in X_{n}. $$
Proof
First, let us take values \(f=0\), \(\widetilde{g}_{1}=g_{1}=1\) and \(\widetilde {g}_{2}=g_{2}=0\) for the problems (18). According to Theorem 2, their solutions are \(v^{1}\) and \(v^{g,1}\), respectively, and are linked with the equality
$$ v^{g,1}=v^{1}-P_{N(A)}v^{1}+ \bigl(1- \bigl\langle L_{1},v^{1} \bigr\rangle \bigr)v^{g,1}- \bigl\langle L_{2},v^{1} \bigr\rangle v^{g,2}, $$
which can be rewritten as follows:
$$ \bigl\langle L_{1},v^{1} \bigr\rangle v^{g,1}+ \bigl\langle L_{2},v^{1} \bigr\rangle v^{g,2}=v^{1}-P_{N(A)}v^{1}. $$
Afterwards taking \(f=0\), \(\widetilde{g}_{1}=g_{1}=0\), and \(\widetilde {g}_{2}=g_{2}=1\) for the problems (18), we obtain other equality
$$ \bigl\langle L_{1},v^{2} \bigr\rangle v^{g,1}+ \bigl\langle L_{2},v^{2} \bigr\rangle v^{g,2}=v^{2}-P_{N(A)}v^{2}. $$
Together they confirm the statement of this corollary. □
Corollary 6
Let
\(D(\boldsymbol {l})[\boldsymbol {u}]\neq0\)
and
\(D(\boldsymbol {L}) [\boldsymbol {u}]\neq0\)
for the problems (18). Then their biorthogonal fundamental systems
\(v^{1}\), \(v^{2}\)
and
\(w^{1}\), \(w^{2}\), respectively, are related by the equality
$$ \begin{pmatrix} \langle L_{1},v^{1}\rangle& \langle L_{2}, v^{1}\rangle\\ \langle L_{1},v^{2}\rangle& \langle L_{2}, v^{2}\rangle \end{pmatrix} \begin{pmatrix} w^{1}_{i}\\ w^{2}_{i} \end{pmatrix} = \begin{pmatrix} v^{1}_{i}\\ v^{2}_{i} \end{pmatrix}, \quad i \in X_{n}, $$
with the nonsingular matrix.
Proof
Since \(v^{1}\) and \(v^{2}\) are the fundamental system of the operator \(\mathcal{L}\), we have \(D(\boldsymbol {L})[\boldsymbol {v}]\neq0\) and the matrix
$$ \begin{pmatrix} \langle L_{1},v^{1}\rangle& \langle L_{2},v^{1}\rangle\\ \langle L_{1},v^{2}\rangle& \langle L_{2},v^{2}\rangle \end{pmatrix} $$
is nonsingular. As noted in Remark 1, \(\mathbf{P}_{N(\mathbf {A})}=\mathbf{O}\) and functions \(v^{g,1}\), \(v^{g,2}\) coincide with the (usual) biorthogonal fundamental system \(w^{1}\), \(w^{2}\) of the second problem (18). Applying Corollary 5, we conclude the proof. □
Theorem 4
For a real problem (5)-(6), the following statements are always valid:
-
(1)
\(G^{g}_{i\cdot}\in{N(\mathcal{L}^{*})}^{\perp}= R(\mathcal{L})\)
for all
\(i\in X_{n}\);
-
(2)
\(G^{g}_{\cdot j}\in N({\mathbf{A}})^{\perp}= R({\mathbf{A}}^{*})\)
for all
\(j\in X_{n-2}\);
-
(3)
\(v^{g,1}, v^{g,2}\in N({\mathbf{A}})^{\perp}=R({\mathbf{A}}^{*})\).
Proof
First of all, we have \(\mathbf{A}^{*}= (\mathbf{L}^{*} \mathbf {L}_{1}^{*} \mathbf{L}_{2}^{*} )\). For every \(\mathbf{f}=(f_{1}, f_{2},\ldots,f_{n-2})^{T}\in N(\mathbf {L}^{*})\), we have
$$\mathbf{0}=\mathbf{L}^{*}\mathbf{f}+0\cdot\mathbf{L_{1}^{*}}+0 \cdot \mathbf{L_{2}^{*}}=\mathbf{A}^{*} \widetilde{ \mathbf{f}}, $$
where \(\widetilde{\mathbf{f}}=(f_{0},f_{1},\ldots,f_{n-2},0,0)^{T}\). So, \(\mathbf{f}\in N(\mathbf{L}^{*}) \Leftrightarrow \widetilde{\mathbf{f}}\in N(\mathbf{A}^{*})\). According to Lemma 2, \(N(\mathbf{A}^{*})=N(\mathbf{A}^{\dagger })\). Thus, \(\widetilde{\mathbf{f}}\in N(\mathbf{A}^{\dagger})\) and \(\mathbf{0}=\mathbf{A}^{\dagger}\widetilde{\mathbf{f}}=\mathbf {G}^{g}\mathbf{f}\) or equivalently
$$\sum_{j=0}^{n-2}G^{g}_{ij}f_{j}=0, \quad \forall i\in X_{n}, $$
i.e. statement (1) is valid since \(N(\mathcal{L}^{*})\simeq N(\mathbf{L}^{*})\).
According to Lemma 3, the generalized Green’s function \(\mathbf{G}^{g}_{\cdot j}\) is the minimum norm least squares solution to the problem (29) for every fixed \(j\in X_{n-2}\). Thus, it can be written as (23), i.e.
\(\mathbf{A}^{\dagger}\widetilde{\mathbf{f}}\) for some \(\widetilde{\mathbf{f}}\). Now by Lemma 2, \(\mathbf{G}^{g}_{\cdot j}=\mathbf{A}^{\dagger}\widetilde{\mathbf{f}}\in R(\mathbf{A}^{\dagger})=R(\mathbf{A}^{*})= N(\mathbf{A})^{\bot}\) and statement (2) follows. The last statement is proved using Lemma 4 in an analogous way. □
6.1 Example 1
Let us investigate a second order differential problem with one nonlocal Bitsadze-Samarskii condition,
$$\begin{aligned} &{-}u^{\prime\prime}=f(x), \quad x\in(0,1),\\ &u(0)=0, \qquad u(1)=\gamma u(\xi), \quad 0< \xi< 1, \end{aligned}$$
where f is a real function and \(\gamma\in\mathbb{R}\). We introduce the mesh \({\overline{\omega}}^{h}=\{x_{i}=ih\colon i\in X_{n}, nh=1\}\) and suppose ξ is coincident with a mesh point, i.e., \(\xi=sh\), \(s\in X_{n}\). Denoting \(f_{i}=h^{2} f(x_{i+1})\), \(i\in X_{n-2}\), we obtain the discrete problem
$$\begin{aligned} & \mathcal{L}u:= u_{i+2}-2u_{i+1}+u_{i}=f_{i}, \quad i\in X_{n-2}, \\ &\langle L_{1},u\rangle:=u_{0}=0, \qquad\langle L_{2},u\rangle :=u_{n}-\gamma u_{s}=0. \end{aligned}$$
From (7) follows that this discrete problem has the unique exact solution and an ordinary Green’s function if and only if \(\gamma\neq1/\xi\). Let us take the values of the parameters \(\gamma= 1/\xi\), i.e.
\(\gamma=4\), \(\xi=1/4\), \(n=4\), \(h=1/4\), \(s=1\). This problem is described by the linear system \({\mathbf{A}}{\mathbf{u}}=\widetilde{\mathbf{f}}\), which can be written in the expanded matrix form
$$ \begin{pmatrix} -1 & 2 & -1 & 0 & 0\\ 0 & -1 & 2 & -1 &0\\ 0 & 0 & -1 & 2 & -1\\ 1 & 0 & 0 & 0 & 0 \\ 0 & -4 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} u_{0}\\ u_{1}\\ u_{2}\\ u_{3}\\ u_{4} \end{pmatrix} = \begin{pmatrix} f_{0}\\ f_{1}\\ f_{2}\\ 0\\ 0 \end{pmatrix} $$
with the singular matrix A and the nullity \(\dim N(\mathbf {A})=1\) [24]. Now we find bases of null spaces \(\mathbf{w}=(0,1,2,3,4)^{T}\in N(\mathbf {A})\) and \(\mathbf{v}=(3,2,1,3,1)^{T}\in N(\mathbf{A}^{T})\). According to [24], we calculate the Moore-Penrose inverse as follows:
$$\begin{aligned} \mathbf{A}^{\dagger}&= \bigl(\mathbf{A}+\mathbf{vw}^{T} \bigr)^{-1}-\frac {1}{\|\mathbf{w}\|^{2}\cdot\|\mathbf{v}\|^{2}}\mathbf{wv}^{T} \\ &=\frac{1}{720} \begin{pmatrix} -270 & -180 & -90 & 450 & -90 \\ 42 & -28 & -50 & 42 & -146\\ -96 & 304 & 80 & -96 & -112\\ -54 & 36 & 270 & -54 & -18\\ 78 & -172 & -230 & 78 & 106 \end{pmatrix}. \end{aligned}$$
So, the generalized Green’s function and a generalized fundamental system are
$$\begin{aligned} &{\mathbf{G}}^{g}=\frac{1}{720} \begin{pmatrix} -270 & -180 & -90 \\ 42 & -28 & -50 \\ -96 & 304 & 80 \\ -54 & 36 & 270 \\ 78 & -172 & -230 \end{pmatrix}, \\ &{\mathbf{v}}^{g,1}= \frac{1}{720} \begin{pmatrix} 450\\ 42\\ -96\\ -54\\ 78 \end{pmatrix},\qquad {\mathbf{v}}^{g,2}= \frac{1}{720} \begin{pmatrix} -90\\ -146\\ -112\\ -18\\ 106 \end{pmatrix}. \end{aligned}$$
Further we calculate the orthogonal projector
$${\mathbf{P}}_{N(\mathbf{A})}=\frac{1}{30} \begin{pmatrix} 0 & 0 & 0 & 0 & 0\\ 0 & 1 & 2 & 3 & 4\\ 0 & 2 & 4 & 6 & 8\\ 0 & 3 & 6 & 9 & 12\\ 0 & 4 & 8 & 12 & 16 \end{pmatrix}. $$
We know that the ordinary Green’s function \({\mathbf{G}}^{c}\) of the operator \(\mathcal{L}\) with initial conditions \(u_{0}=0\), \(u_{1}=0\) exists and is given by (17), which can also be written in the extended form
$${\mathbf{G}}^{c}= \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0\\ -1 & 0 & 0\\ -2 & -1 & 0\\ -3 & -2 & -1 \end{pmatrix}. $$
Let us now calculate the generalized Green’s function \({\mathbf{G}}^{g}\) using Corollary 3. Precisely, we apply (33), written in matrix form,
$$ {\mathbf{G}}^{g}=({\mathbf{I}}-{\mathbf{P}}_{N(\mathbf{A})}){ \mathbf{G}}^{c} -{\mathbf{v}}^{g,1} \mathbf{L}_{1}{ \mathbf{G}}^{c} -{\mathbf{v}}^{g,2} \mathbf{L}_{2}{ \mathbf{G}}^{c}. $$
(35)
First of all, we calculate
$$\begin{aligned} ({\mathbf{I}}-{\mathbf{P}}_{N(\mathbf{A})}){\mathbf{G}}^{c}&= \frac{1}{30} \begin{pmatrix} 30 & 0 & 0 & 0 & 0\\ 0 & 29 & -2 & -3 & -4\\ 0 & -2 & 26 & -6 & -8\\ 0 & -3 & -6 & 21 & -12\\ 0 & -4 & -8 & -12 & 14 \end{pmatrix} \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0\\ -1 & 0 & 0\\ -2 & -1 & 0\\ -3 & -2 & -1 \end{pmatrix} \\ &=\frac{1}{30} \begin{pmatrix} 0 & 0 & 0\\ 20 & 11 & 4\\ 10 & 22 & 8\\ 0 & 3 & 12\\ -10 & -16 & -14 \end{pmatrix}. \end{aligned}$$
Moreover, \({\mathbf{v}}^{g,1} \mathbf{L}_{1}{\mathbf{G}}^{c} ={\mathbf{v}}^{g,1}{\mathbf {G}}^{c}_{0\cdot} ={\mathbf{v}}^{g,1}(0\ 0\ 0)={\mathbf{O}}\) is the zero matrix. Further, we have \(\mathbf{L}_{2}{\mathbf{G}}^{c}={\mathbf{G}}^{c}_{4\cdot}-4{\mathbf{G}}^{c}_{1\cdot }={\mathbf{G}}^{c}_{4\cdot}=(-3\ -2\ -1)\). Thus,
$${\mathbf{v}}^{g,2}\mathbf{L}_{2}{\mathbf{G}}^{c}= \frac{1}{720} \begin{pmatrix} -90\\ -146\\ -112\\ -18\\ 106 \end{pmatrix} (-3\quad {-}2\quad {-}1)= \frac{1}{720} \begin{pmatrix} 270 & 180 & 90\\ 438 & 292 & 146\\ 336 & 224 & 112\\ 54 & 36 & 18\\ -318 & -212 & -106 \end{pmatrix}. $$
Now we put the expressions obtained into the right side of (35) and again get the generalized Green’s function,
$$\begin{aligned} {\mathbf{G}}^{g} &= \frac{1}{30} \begin{pmatrix} 0 & 0 & 0\\ 20 & 11 & 4\\ 10 & 22 & 8\\ 0 & 3 & 12\\ -10 & -16 & -14 \end{pmatrix} - \frac{1}{720} \begin{pmatrix} 270 & 180 & 90\\ 438 & 292 & 146\\ 336 & 224 & 112\\ 54 & 36 & 18\\ -318 & -212 & -106 \end{pmatrix} \\ &= \frac{1}{720} \begin{pmatrix} -270 & -180 & -90 \\ 42 & -28 & -50 \\ -96 & 304 & 80 \\ -54 & 36 & 270 \\ 78 & -172 & -230 \end{pmatrix}. \end{aligned}$$
Thus, the equality (35) is valid.
6.2 Example 2
Let now us investigate another differential problem with two nonlocal boundary conditions,
$$\begin{aligned} &{-}u^{\prime\prime}=f(x),\quad x\in(0,1), \\ &u^{\prime}(0)=\gamma_{1} u^{\prime}(\xi), \qquad u(1)= \gamma_{2} \int_{0}^{1}(1-x)u(x)\,dx, \quad 0< \xi< 1, \end{aligned}$$
where \(\gamma_{1},\gamma_{2}\in\mathbb{R}\). We suppose ξ is coincident with a mesh point, i.e., \(\xi=sh\). Applying the trapezoid rule to the integral condition, we consider the discrete problem
$$\begin{aligned} &\mathcal{L}u:= u_{i+2}-2u_{i+1}+u_{i}=f_{i}, \quad i\in X_{n-2}, \\ &u_{0}=u_{1}- \gamma_{1}(u_{s+1}- u_{s}),\qquad u_{n}=\gamma_{2} h \Biggl( \frac {u_{0}}{2}+\sum_{j=1}^{n-1}(1-x_{j})u_{j} \Biggr). \end{aligned}$$
Let us take the values of parameters as \(\gamma_{1}=1\), \(\gamma_{2}=16\), \(\xi =1/2\), \(n=4\). So, \(h=1/4\) and \(s=1\). Then the nonlocal conditions simplify to
$$\langle L_{1},u\rangle:=u_{0}-2u_{1}+u_{2}=0, \qquad \langle L_{2},u\rangle :=u_{4}-2u_{0}-3u_{1}-2u_{2}-u_{3}=0, $$
and the discrete problem is described by the linear system \(\mathbf {Au}=\mathbf{\widetilde{f}}\) as follows:
$$ \begin{pmatrix} -1 & 2 & -1 & 0 & 0\\ 0 & -1 & 2 & -1 &0\\ 0 & 0 & -1 & 2 & -1\\ 1 & -2 & 1 & 0 & 0 \\ -2 & -3 & -2 & -1 & 1 \end{pmatrix} \begin{pmatrix} u_{0}\\ u_{1}\\ u_{2}\\ u_{3}\\ u_{4} \end{pmatrix} = \begin{pmatrix} f_{0}\\ f_{1}\\ f_{2}\\ 0\\ 0 \end{pmatrix}. $$
Since the first and fourth rows of matrix A are linearly independent, this linear system has the singular matrix A. According to [24], we find the nullity \(\dim N(\mathbf{A})=1\) and afterwards the bases of null spaces \(\mathbf{w}=(-6,1,8,15,22)^{T}\in N(\mathbf{A})\) and \(\mathbf {v}=(1,0,0,1,0)^{T}\in N(\mathbf{A}^{T})\). Then we calculate the Moore-Penrose inverse,
$$\begin{aligned} \mathbf{A}^{\dagger} &= \bigl(\mathbf{A}+\mathbf{vw}^{T} \bigr)^{-1}-\frac{1}{\|\mathbf{w}\| ^{2}\cdot\|\mathbf{v}\|^{2}}\mathbf{wv}^{T} \\ &=\frac{1}{810} \begin{pmatrix} -237 & -504 & -282 & 237 & -150\\ 107 & -51 & -88 & -107 & -110\\ 46 & 402 & 106 & -46 & -70\\ -15 & 45 & 300 & 15 & -30\\ -76 & -312 & -316 & 76 & 10 \end{pmatrix} , \end{aligned}$$
and we obtain the generalized Green’s function and the generalized fundamental system,
$$ \mathbf{G}^{g}=\frac{1}{810} \begin{pmatrix} -237 & -504 & -282 \\ 107 & -51 & -88 \\ 46 & 402 &106 \\ -15 & 45 & 300 \\ -76 & -312 & -316 \end{pmatrix} ,\quad {\mathbf{v}^{g,1}}=\frac{1}{810} \begin{pmatrix} 237 \\ -107 \\ -46 \\ 15 \\ 76 \end{pmatrix} ,\quad {\mathbf{v}^{g,2}}= \frac{1}{810} \begin{pmatrix} -150\\ -110\\ -70\\ -30\\ 10 \end{pmatrix} . $$
The orthogonal projector is given by
$$ {\mathbf{P}}_{N(\mathbf{A})}=\frac{1}{\|\mathbf{w}\|^{2}}\mathbf{ww}^{T}= \frac{1}{810} \begin{pmatrix} 36 & -6 & -48 & -90 & -132\\ -6 & 1 & 8 & 15 & 22\\ -48 & 8 & 64 & 120 & 176\\ -90 & 15 & 120 & 225 & 330\\ -132 & 22 & 176 & 330 & 484 \end{pmatrix}. $$
Let us verify (35) as regards investigating the discrete problem once more. As in the previous example we calculate
$$ ({\mathbf{I}}-{\mathbf{P}}_{N(\mathbf{A})}){\mathbf{G}}^{c}= \frac{1}{810} \begin{pmatrix} -624 & -354 & -132\\ 104 & 59 & 22\\ 22 & 472 & 176\\ -60 & 75 & 330\\ -142 & -322 & -326 \end{pmatrix}. $$
Now we have \(\mathbf{L}_{1}{\mathbf{G}}^{c} ={\mathbf{G}}^{c}_{0\cdot}-2{\mathbf{G}}^{c}_{1\cdot}+{\mathbf{G}}^{c}_{2\cdot} =(-1\ 0\ 0)\) and afterwards obtain
$${\mathbf{v}}^{g,1} \mathbf{L}_{1}{\mathbf{G}}^{c}= \frac{1}{810} \begin{pmatrix} 237 \\ -107 \\ -46 \\ 15 \\ 76 \end{pmatrix} (-1\quad 0\quad 0)= \frac{1}{810} \begin{pmatrix} -237 & 0 & 0\\ 107 & 0 & 0\\ 46 & 0 & 0\\ -15 & 0 & 0\\ -76 & 0 & 0 \end{pmatrix}. $$
Similarly, we get \(\mathbf{L}_{2}{\mathbf{G}}^{c}= {\mathbf{G}}^{c}_{4\cdot}-2{\mathbf{G}}^{c}_{0\cdot}-3{\mathbf{G}}^{c}_{1\cdot }-2{\mathbf{G}}^{c}_{2\cdot}-{\mathbf{G}}^{c}_{3\cdot} =(1\ -1\ -1)\). Thus,
$${\mathbf{v}}^{g,2} \mathbf{L}_{2}{\mathbf{G}}^{c}= \frac{1}{810} \begin{pmatrix} -150\\ -110\\ -70\\ -30\\ 10 \end{pmatrix} (1\quad {-}1\quad {-}1)= \frac{1}{810} \begin{pmatrix} -150 & 150 & 150\\ -110 & 110 & 110\\ -70 & 70 & 70\\ -30 & 30 & 30\\ 10 & -10 & -10 \end{pmatrix}. $$
Now we put the obtained expressions into (35) and find the generalized Green’s function,
$$\begin{aligned} {\mathbf{G}}^{g}={}& \frac{1}{810} \begin{pmatrix} -624 & -354 & -132\\ 104 & 59 & 22\\ 22 & 472 & 176\\ -60 & 75 & 330\\ -142 & -322 & -326 \end{pmatrix} - \frac{1}{810} \begin{pmatrix} -237 & 0 & 0\\ 107 & 0 & 0\\ 46 & 0 & 0\\ -15 & 0 & 0\\ -76 & 0 & 0 \end{pmatrix} \\ &{}- \frac{1}{810} \begin{pmatrix} -150 & 150 & 150\\ -110 & 110 & 110\\ -70 & 70 & 70\\ -30 & 30 & 30\\ 10 & -10 & -10 \end{pmatrix} = \frac{1}{810} \begin{pmatrix} -237 & -504 & -282 \\ 107 & -51 & -88 \\ 46 & 402 & 106 \\ -15 & 45 & 300 \\ -76 & -312 & -316 \end{pmatrix} \end{aligned}$$
again. This identity confirms that (35) is valid as well.