# Ordinary and generalized Green’s functions for the second order discrete nonlocal problems

## Abstract

In this paper, we investigate the properties of a generalized Green’s function describing the minimum norm least squares solution for a second order discrete problem with two nonlocal conditions. The properties obtained of a generalized Green’s function resemble analogous properties of an ordinary Green’s function that describes the unique exact solution if it exists. Several features are illustrated by examples.

## 1 Introduction

The concept of a Green’s function originated in the 19th century while studying the classical problems of mathematical physics [1, 2] and is fundamental in the theory of differential equations . Indeed, physics, mechanics, and other natural sciences have been developed greatly during the last 50 years, and today they investigate such processes and phenomena that those mathematical models do not fit into the frames of the classical differential problem. For instance, we have the thermostat problems , heat conduction  and bioreaction engineering  problems, and problems arising in electrochemistry , microelectronics , biology , and other fields.

Nowadays the methods of a Green’s function are generalized for nonclassical solutions to classical differential problems as well as nonlocal problems . In 2011, the Special Issue for Nonlocal Boundary Conditions (27 articles) was published in the journal Boundary Value Problems . We mention work of Cabada , of Štikonas , and of Webb and Infante .

Merely for the second order stationary differential equation, there is often formulated a nonclassical problem:

\begin{aligned} &\mathcal{L}u:=a(x)u^{\prime\prime}(x)+b(x)u^{\prime }(x)+c(x)u(x)=f(x), \quad x\in[0,1], \end{aligned}
(1)
\begin{aligned} &\langle L_{j},u\rangle=g_{j}, \quad j=1,2, \end{aligned}
(2)

where $$L_{j}$$, $$j=1,2$$, can be any possible functionals that describe two additional conditions. Indeed, $$L_{j}$$, $$j=1,2$$, vary from local differential operators, i.e. given at a single point of the interval $$[0,1]$$, to any other possible operators as

$$\langle L_{1},u\rangle:=u(0)-\gamma_{0} u^{\prime}( \xi),\qquad \langle L_{2},u\rangle:=u(1)-\gamma_{1} \int _{0}^{1}\alpha(x)u(x)\,dx,$$

where $$\xi\in[0,1]$$, $$\gamma_{0},\gamma_{1}\in\mathbb{R}$$, and $$\alpha\in L_{1}(0,1)$$. If $$\gamma_{0}=\gamma_{1}=0$$, the conditions become classical. Otherwise, conditions (2) are called nonlocal conditions and the differential problem (1)-(2) the nonlocal problem.

In general, an explicit solution or some optimization solution of the nonlocal problem (1)-(2) cannot always be found analytically. Since computer-programming science nowadays is widely developed, various numerical methods have been investigated and applied to differential problems [11, 17]. Then the nonlocal problem (1)-(2) is replaced by some discrete problem that merely is described by the linear system of equations

$$\mathbf{A}\mathbf{u}=\mathbf{f}\quad \bigl(\mathbf{A}\in \mathbb{C}^{m\times n}, \mathbf{x}\in\mathbb {C}^{n\times1}, \mathbf{f}\in \mathbb{C}^{m\times1} \bigr).$$
(3)

Since every linear transformation from one finite-dimensional vector space to another can be represented by a matrix (uniquely described by the linear transformation and the fixed bases for the vector spaces), there is a one to one correspondence between the $$m\times n$$ complex matrices $$\mathbb {C}^{m\times n}$$ and $$\mathcal{L}(\mathbb{C}^{n},\mathbb{C}^{m})$$, the space of linear transformations mapping $$\mathbb{C}^{n}$$ into $$\mathbb{C}^{m}$$. Hence, we use the same symbol A to denote both the linear transformation $$A\in\mathcal{L}(\mathbb{C}^{n},\mathbb{C}^{m})$$ and its matrix representation $$\mathbf{A}\in\mathbb{C}^{m\times n}$$. Then the discrete representation (3) of the differential problem (1)-(2) is equivalent to the statement that the linear transformation A maps x into y.

Both the differential problem (1)-(2)  and its discrete analog (3) [19, 20] were investigated by Roman. These results constitute the part of her doctoral dissertation . She formulated the necessary and sufficient existence condition of a Green’s function that describes the unique exact solution of the differential problem as well as the discrete problem. For the discrete problem (3), this condition is also equivalent to the inequality $$\det\mathbf{A}\neq0$$. On the other hand, if a matrix A is singular, then the unique solution does not exist and the Green’s function cannot be constructed using the ordinary inverse $$\mathbf{A}^{-1}$$ .

However, in 1955 Penrose  showed that, for every finite matrix $$\mathbf{A}\in\mathbb{C}^{k\times m}$$, there always exists a unique matrix $$\mathbf{X}\in\mathbb{C}^{m\times k}$$ satisfying all four Penrose equations,

$$\mathbf{AXA}=\mathbf{A},\qquad \mathbf{XAX}=\mathbf{X},\qquad ( \mathbf {AX})^{*}=\mathbf{AX},\qquad (\mathbf{XA})^{*}= \mathbf{XA},$$
(4)

where $$\mathbf{A}^{*}$$ denotes the adjoint matrix of A. This matrix X is often called the Moore-Penrose inverse and is denoted by $$\mathbf{A}^{\dagger}$$.

Thus, there always exists a generalized Green’s function defined by the Moore-Penrose inverse $$\mathbf{A}^{\dagger}$$ in an analogous way to an ordinary Green’s function, which is defined using the ordinary inverse $$\mathbf{A}^{-1}$$. Such a generalized Green’s function for the problem (3) with two discrete nonlocal conditions (2) was investigated in [23, 24]. In this paper, we analyze the properties of a generalized Green’s function considering the very analogous properties of an ordinary Green’s function .

The structure of the paper is as follows. First, we define some notation. Then, according to , a definition and properties of the ordinary Green’s function are given. Later, we formulate the definition of a generalized Green’s function. Finally, the properties of a generalized Green’s function are investigated. Several examples are also presented.

## 2 Notation

Let $$F(X_{n}):=\{u\mid u\colon X_{n}\to\mathbb{C}\}$$ denote the space of complex linear functions with the basis $$\{\delta^{i}\colon\delta^{i}(j)=\delta_{j}^{i}\}$$, where $$X_{n}:=\{ 0,1,2,\ldots,n\}$$, $$n\geq2$$, and $$\delta_{j}^{i}$$ is the Kronecker delta. So, $$F(X_{n})\cong\mathbb{C}^{n+1}$$. Then, for every $$u\in F(X_{n})$$, there exists a unique vector $${\mathbf{u}}=(u_{0},u_{1},\ldots,u_{n})^{T}\in\mathbb{C}^{(n+1)\times 1}$$ such that $$u=\sum_{i=0}^{n}u_{i}\delta^{i}$$. Further we consider the space $$F^{*}(X_{n})$$ of complex linear functionals in the space $$F(X_{n})$$ and use the notation $$\langle f,u\rangle$$ for the functional f value at the function u.

In analogous way, spaces $$F(X_{n}\times X_{m})$$ and $$F^{*}(X_{n}\times X_{m})$$ are defined . We note that their elements are uniquely described by matrices of the corresponding dimensions $$\mathbb {C}^{(n+1)\times(m+1)}$$ and $$\mathbb{C}^{(m+1)\times(n+1)}$$, respectively. We also remark that a discrete function u and its matrix representation u are always equivalent notations for the same function. Thus, the identity function $$I=id\in F(X_{n}\times X_{n})$$ is equivalent to the identity matrix $$\mathbf{I}=\mathbf{I}_{n+1}$$ of order $$n+1$$. We use the notation $$\delta_{ij}$$ for the Kronecker delta as well.

## 3 Ordinary discrete Green’s function

Let us investigate a second order linear discrete problem

\begin{aligned} &(\mathcal{L}u)_{i}:= a_{i}^{2}u_{i+2}+a_{i}^{1}u_{i+1}+a_{i}^{0}u_{i}=f_{i}, \quad i\in X_{n-2}, \end{aligned}
(5)
\begin{aligned} &\langle L_{k},u\rangle:=\sum _{j=0}^{n}L_{k}^{j}u_{j}=g_{k}, \quad k=1,2, \end{aligned}
(6)

where $$a_{i}^{0},a_{i}^{2}\neq0$$, $$f_{i} \in\mathbb{C}$$, $$i\in X_{n-2}$$. Here $$\mathcal{L}:F(X_{n})\to\mathbb{C}^{(n-1)\times1}$$ is a second order discrete linear operator and $$L_{1}, L_{2}\in F^{*}(X_{n})$$ are discrete linear functionals that describe nonlocal conditions. According to [19, 21], the problem (5)-(6) has a unique exact solution if and only if the condition

$$D(\boldsymbol {L})[\boldsymbol {u}]:= \begin{vmatrix} \langle L_{1},u^{1} \rangle& \langle L_{2},u^{1} \rangle \\ \langle L_{1},u^{2} \rangle& \langle L_{2},u^{2} \rangle \end{vmatrix} \neq0$$
(7)

is valid for every fundamental system $$\boldsymbol {u} =(u^{1},u^{2})$$ of the homogeneous equation (5). Here we denoted $$\boldsymbol {L}=(L_{1},L_{2})$$. Moreover, the unique exact solution for the problem (5)-(6) can be given by

$$u_{i}=\sum_{j=0}^{n-2}G_{ij}f_{j}+g_{1}v^{1}_{i}+g_{2}v^{2}_{i}, \quad i\in X_{n},$$
(8)

where $$G\in F(X_{n}\times X_{n-2})$$ is called an ordinary discrete Green’s function and $$v^{1},v^{2}\in F(X_{n})$$ are the biorthogonal fundamental system of the problem (5)-(6) [19, 21]. Further we also call an ordinary discrete Green’s function simply an ordinary Green’s function. Let us note  that the inequality (7) describes the existence condition of an ordinary Green’s function as well as the unique solution (8).

On the other hand, the problem (5)-(6) is also equivalent to the linear system of equations

$$\begin{pmatrix} a_{0}^{0} & a_{0}^{1} & a_{0}^{2} &0 &\ldots&0&0&0\\ 0& a_{1}^{0} & a_{1}^{1} & a_{1}^{2} &\ldots&0&0&0\\ & & & &\ddots& & & \\ 0 & 0 & 0 &0 &\ldots&a_{n-2}^{0}&a_{n-2}^{1}&a_{n-2}^{2}\\ L_{1}^{0} & L_{1}^{1} & L_{1}^{2} &L_{1}^{3}&\ldots &L_{1}^{n-2}&L_{1}^{n-1}&L_{1}^{n}\\ L_{2}^{0} & L_{2}^{1} & L_{2}^{2} &L_{2}^{3}&\ldots &L_{2}^{n-2}&L_{2}^{n-1}&L_{2}^{n} \end{pmatrix} \begin{pmatrix} u_{0}\\ u_{1}\\ \vdots\\ u_{n-3}\\ u_{n-2}\\ u_{n-1}\\ u_{n} \end{pmatrix} = \begin{pmatrix} f_{0}\\ f_{1}\\ \vdots\\ f_{n-3}\\ f_{n-2}\\ g_{1}\\ g_{2} \end{pmatrix},$$

where the first $$n-1$$ rows of this matrix describe the discrete operator $$\mathcal{L}$$, given by (5). Thus, we sometimes use the equivalent notation $$\mathbf{L}=(\mathcal{L}_{ij})$$ for operator $$\mathcal{L}$$ if we want to emphasize its matrix structure. Moreover, the last two rows $$\mathbf{L}_{k}$$, $$k=1,2$$, of previous matrix represent discrete functionals (6). Thus, the notation $$\langle L_{k},u\rangle$$ can be used for a multiplication of vectors $$\mathbf{L}_{k}\mathbf{u}$$. The current matrix representation of the discrete problem (5)-(6) can also be given in the unexpanded form

$$\mathbf{A}\mathbf{u}=\widetilde{\mathbf{f}},\qquad \mathbf{A}= \begin{pmatrix} \mathbf{L}\\ \mathbf{L}_{1} \\ \mathbf{L}_{2} \end{pmatrix}.$$
(9)

Therefore, the existence condition (7) of the unique solution (8) is equivalent to the inequality $$\det\mathbf{A}\neq0$$ because the unique exact solution of linear system (9) is given by $$\mathbf{u}=\mathbf{A}^{-1}\widetilde{\mathbf{f}}$$. Considering the special form of $$\widetilde{\mathbf{f}}=(f_{0},f_{1},\ldots , f_{n-2},g_{1},g_{2})^{T}$$ for every $$\mathbf{f}=(f_{1},f_{2},\ldots, f_{n-2})^{T}$$ and $$g_{1}$$, $$g_{2}$$, this unique vector solution can be written in the extended form

$$\mathbf{u}=\mathbf{G}\mathbf{f}+g_{1} \mathbf{v}^{1}+g_{2}\mathbf{v}^{2}.$$
(10)

Since (8) and (10) describe the same solution , the ordinary Green’s function and a biorthogonal fundamental system can also be calculated using the ordinary inverse $$\mathbf{B}=\mathbf{A}^{-1}$$ as follows:

\begin{aligned} &G_{ij}=B_{ij},\quad i\in X_{n}, j \in X_{n-2}, \end{aligned}
(11)
\begin{aligned} &v^{1}_{i}=B_{i,n-1},\quad i\in X_{n}, \end{aligned}
(12)
\begin{aligned} &v^{2}_{i}=B_{in}, \quad i\in X_{n}. \end{aligned}
(13)

## 4 Properties of ordinary Green’s functions

Roman investigated ordinary Green’s functions and their properties in . First of all, an ordinary Green’s function G is the unique exact solution of the discrete problem

\begin{aligned} &\mathcal{L}_{i \cdot}G_{\cdot j}= \delta_{ij},\quad i\in X_{n}, \\ &\langle L_{k},G_{\cdot j}\rangle=0, \quad k=1,2, \end{aligned}
(14)

for every fixed $$j\in X_{n-2}$$. On the other hand, unique solutions $$v^{1}$$ and $$v^{2}$$ of the discrete problems

$$\textstyle\begin{array}{c} \mathcal{L}v^{1}=0,\\ \bigl\langle L_{1},v^{1} \bigr\rangle =1,\qquad \bigl\langle L_{2},v^{1} \bigr\rangle =0, \end{array}\displaystyle \qquad \textstyle\begin{array}{c} \mathcal{L}v^{2}=0,\\ \bigl\langle L_{1},v^{2} \bigr\rangle =0,\qquad \bigl\langle L_{2},v^{2} \bigr\rangle =1, \end{array}$$
(15)

form the fundamental system (null space) of the operator $$\mathcal{L}$$. This system is biorthogonal with respect to the functionals $$L_{k}$$, $$k=1,2$$. According to , if the condition (7) is satisfied, then the biorthogonal fundamental system exists and is given by

$$v^{1}_{i}:=\frac{D(\delta_{i},L_{2})[\boldsymbol {u}]}{ D(\boldsymbol {L})[\boldsymbol {u}]},\qquad v^{2}_{i}:=\frac{D(L_{1},\delta_{i})[\boldsymbol {u}]}{ D(\boldsymbol {L})[\boldsymbol {u}]},\quad i\in X_{n}.$$
(16)

Moreover, Roman  presented the way to calculate the ordinary Green’s function as well.

### Lemma 1

(Roman )

If the condition (7) is satisfied, then the ordinary Green’s function for the problem (5)-(6) is given by

$$G_{ij}=G_{ij}^{c}-v^{1}_{i} \bigl\langle L_{1},G_{\cdot j}^{c} \bigr\rangle -v^{2}_{i} \bigl\langle L_{2},G_{\cdot j}^{c} \bigr\rangle ,\quad i\in X_{n}, j\in X_{n-2}.$$

Here $$G_{ij}^{c}$$, $$i\in X_{n}$$, $$j\in X_{n-2}$$, is an ordinary Green’s function of the operator $$\mathcal{L}$$ with initial conditions $$u_{0}=0$$, $$u_{1}=0$$.

A discrete problem that is described by the operator $$\mathcal{L}$$ and initial conditions $$u_{0}=0$$, $$u_{1}=0$$ is called the initial discrete problem. The ordinary Green’s function $$G_{ij}^{c}$$, $$i\in X_{n}$$, $$j\in X_{n-2}$$, of the initial second order discrete problem always exists . For example, the Green’s function of the discrete operator

$$\mathcal{L}u:=-u_{i+2}+2u_{i+1}-u_{i},\quad i\in X_{n},$$

with initial conditions $$u_{0}=0$$, $$u_{1}=0$$ is of the form

$$G_{ij}^{c}=H_{i-j}(j-i+1), \quad i \in X_{n}, j\in X_{n-2},$$
(17)

where

$$H_{i}:=\left \{ \textstyle\begin{array}{@{}l@{\quad}l} 1,& i>0,\\ 0,& i\leq0, \end{array}\displaystyle \right .$$

is the discrete Heaviside function.

Roman showed  that the unique solutions of two relative discrete problems

$$\textstyle\begin{array}{c} \mathcal{L}u=f,\\ \langle l_{k},u\rangle=\widetilde{g}_{k},\quad k=1,2, \end{array}\displaystyle \qquad \textstyle\begin{array}{c} \mathcal{L}v=f,\\ \langle L_{k},v\rangle=g_{k},\quad k=1,2, \end{array}$$
(18)

where the functionals $$l_{k}$$ and $$L_{k}$$ may be different, are related as well. Precisely, if conditions $$D(\boldsymbol {l})[\boldsymbol {u}]\neq0$$ and $$D(\boldsymbol {L})[\boldsymbol {u}]\neq0$$ are valid, then the biorthogonal fundamental system (16) exists and solutions of the problems (18) are related as follows.

### Corollary 1

(Roman )

For unique solutions of the problems (18), the following equality is always satisfied:

$$v=u+ \bigl(g_{1}-\langle L_{1},u\rangle \bigr)v^{1}+ \bigl(g_{2}-\langle L_{2},u\rangle \bigr)v^{2}.$$

Moreover, ordinary Green’s functions of these problems are related as well.

### Theorem 1

(Roman )

Ordinary Green’s functions $$G^{u}$$ and $$G^{v}$$ of problems (18), respectively, are linked with the equality

$$G_{ij}^{v}=G^{u}_{ij}-v^{1}_{i} \bigl\langle L_{1},G^{u}_{\cdot j} \bigr\rangle -v^{2}_{i} \bigl\langle L_{2},G^{u}_{\cdot j} \bigr\rangle ,\quad i\in X_{n}, j\in X_{n-2}.$$

Roman applied this theorem to the problem (5)-(6) with nonlocal boundary conditions,

$$\langle L_{k},u\rangle:=\langle\kappa_{k},u \rangle-\gamma_{k}\langle \varkappa_{k},u \rangle=g_{k},\quad k=1,2,$$
(19)

where $$D(\boldsymbol {L})[\boldsymbol {u}]\neq0$$. Precisely, if an ordinary Green’s function $$G_{ij}^{cl}$$, $$i\in X_{n}$$, $$j\in X_{n-2}$$, exists for the classical problem (with $$\gamma_{1}=\gamma_{2}=0$$), then the ordinary Green’s function for problem with nonlocal boundary conditions (19) is of the form

$$G_{ij}=G^{cl}_{ij}+\gamma_{1}v^{1}_{i} \bigl\langle \varkappa _{1},G^{cl}_{\cdot j} \bigr\rangle + \gamma_{2}v^{2}_{i} \bigl\langle \varkappa_{2},G^{cl}_{\cdot j} \bigr\rangle ,\quad i\in X_{n}, j\in X_{n-2}.$$

## 5 Generalized Green’s function

If the condition (7) or equivalent condition $$\det\mathbf {A}=0$$ is satisfied, then the discrete problem (9) does not have the unique solution . In this case, the problem (9) has a singular matrix A, the unique exact solution, and an ordinary Green’s function cannot be calculated using the ordinary inverse, because (11)-(13) and $$\mathbf{u}=\mathbf{A}^{-1}\widetilde{\mathbf{f}}$$ are not valid.

However, according to Penrose , a matrix A of the discrete problem always has the Moore-Penrose inverse $$\mathbf{A}^{\dagger}$$, which satisfies all four Penrose equations (4) and also has the following properties.

### Lemma 2

(Penrose , Moore and Barnard , Ben-Israel and Greville )

For every finite matrix $${\mathbf{A}}\in\mathbb{C}^{k\times m}$$, the following conditions are valid:

1. (1)

$${\mathbf{A}}^{\dagger}={\mathbf{A}}^{-1}$$ if $$\det{\mathbf{A}}\neq0$$;

2. (2)

$$({\mathbf{A}}^{\dagger})^{\dagger}={\mathbf{A}}$$;

3. (3)

$$({\mathbf{A}}^{*})^{\dagger}=({\mathbf{A}}^{\dagger})^{*}$$;

4. (4)

$$\operatorname{rank}{\mathbf{A}}=\operatorname{rank}{\mathbf{A}}^{\dagger}=\operatorname{rank}{\mathbf{A}}^{*}$$;

5. (5)

$$N( {\mathbf{A}}^{\dagger})=N ({\mathbf{A}}^{*})$$;

6. (6)

$$R ({\mathbf{A}}^{\dagger})=R( {\mathbf{A}}^{*})$$.

Here $$N(\mathbf{A})$$ and $$R(\mathbf{A})$$ denote the null space and range of matrix A, respectively.

Moreover, the general least squares solution $$\mathbf{u}^{g}$$ for the problem (9) that minimizes the Euclidean norm of the residual vector,

$$\bigl\| \mathbf{A}\mathbf{u}^{g}-\widetilde{\mathbf{f}}\bigr\| \leq\|\mathbf {A} \mathbf{u}-\widetilde{\mathbf{f}}\|,\quad \forall {\mathbf{u}}\in \mathbb{C}^{(n+1)\times1},$$

always exists and can be described by the Moore-Penrose inverse [22, 26, 27] as follows:

$$\mathbf{u}^{g}={\mathbf{A}}^{\dagger}\widetilde{ \mathbf{f}}+\mathbf {P}_{N(\mathbf{A})}\mathbf{c},\quad \forall\mathbf{c}\in \mathbb{C}^{(n+1)\times1},$$
(20)

where $$\mathbf{P}_{N(\mathbf{A})}$$ denotes the orthogonal projector onto $$N(\mathbf{A})$$. Among all least squares solutions (20), there always exists the one solution of minimum norm. According to [26, 27], such a minimum norm least squares solution $$\mathbf{u}^{o}$$ is characterized by the following two inequalities:

\begin{aligned} &\bigl\| \mathbf{A}\mathbf{u}^{o}-\widetilde{\mathbf{f}}\bigr\| \leq\|\mathbf {A}\mathbf{u}-\widetilde{\mathbf{f}}\|,\quad \forall {\mathbf{u}}\in \mathbb{C}^{n+1}, \end{aligned}
(21)
\begin{aligned} & \bigl\| \mathbf{u}^{o}\bigr\| < \bigl\| \mathbf{u}^{g}\bigr\| , \quad\forall \mathbf{u}^{g}\neq\mathbf{u}^{o}, \end{aligned}
(22)

and it is of the form

$$\mathbf{u}^{o}={\mathbf{A}}^{\dagger}\widetilde{ \mathbf{f}}.$$
(23)

We apply this formula to (9), which is equivalent to the discrete problem (5)-(6). Considering the form of $$\widetilde{\mathbf{f}}=(f_{0},f_{1},\ldots, f_{n-2},g_{1},g_{2})^{T}$$ for every $$\mathbf{f}=(f_{1},f_{2},\ldots,f_{n-2})^{T}$$, and $$g_{1}$$, $$g_{2}$$, this minimum norm least squares solution can be written in the extended form

$$\mathbf{u}^{o}=\mathbf{G}^{g} \mathbf{f}+g_{1}\mathbf{v}^{g,1}+g_{2} \mathbf{v}^{g,2},$$
(24)

where matrix $$\mathbf{G}^{g}$$ and vectors $$\mathbf{v}^{g,1}$$, $$\mathbf {v}^{g,2}$$ are described by the Moore-Penrose inverse $$\mathbf{B}=\mathbf{A}^{\dagger}$$ as follows:

\begin{aligned} &G^{g}_{ij}=B_{ij},\quad i\in X_{n}, j\in X_{n-2}, \end{aligned}
(25)
\begin{aligned} & v^{g,1}_{i}=B_{i,n-1},\quad i\in X_{n}, \end{aligned}
(26)
\begin{aligned} & v^{g,2}_{i}=B_{in}, \quad i\in X_{n}. \end{aligned}
(27)

Further we call the generalized Green’s function of the discrete problem (5)-(6) simply a generalized Green’s function and denote it by $$G^{g}$$. For functions $$v^{g,1}$$ and $$v^{g,2}$$, we do this as well.

### Corollary 2

A generalized Green’s function $$G^{g}$$, functions $$v^{g,1}$$ and $$v^{g,2}$$ always exist and are unique.

### Proof

This statement is valid since (25)-(27) are described by the Moore-Penrose inverse, which always exists and is unique. □

The minimum norm least squares solution (24) can also be written in the discrete form

$$u^{o}_{i}=\sum _{j=0}^{n-2}G_{ij}^{g}f_{j}+g_{1}v^{g,1}_{i}+g_{2}v^{g,2}_{i}, \quad i\in X_{n}.$$
(28)

According to (10)-(13), we call the discrete function $$G^{g}$$ a generalized discrete Green’s function and the system of functions $$v^{g,1}$$, $$v^{g,2}$$ a generalized fundamental system for the problem (5)-(6). Obviously, if $$\mathbf{A}^{-1}=\mathbf{A}^{\dagger}$$, then the unique exact solution (10) and the minimum norm least squares solution (28) are coincident. In this case, ordinary and generalized Green’s functions are coincident (see (11) and (25)), and the biorthogonal fundamental system and the generalized fundamental system, defined by (12)-(13) and (26)-(27), respectively, are coincident as well.

## 6 Properties of a generalized Green’s functions

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  it follows that

1. (1)

$$\mathbf{P}_{N(\mathbf{A})}{\mathbf{c}}^{o}\in N(\mathbf{A})$$,

2. (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. (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 , 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. (1)

$$G^{g}_{i\cdot}\in{N(\mathcal{L}^{*})}^{\perp}= R(\mathcal{L})$$ for all $$i\in X_{n}$$;

2. (2)

$$G^{g}_{\cdot j}\in N({\mathbf{A}})^{\perp}= R({\mathbf{A}}^{*})$$ for all $$j\in X_{n-2}$$;

3. (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$$ . 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 , 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 , 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.

## 7 Conclusions

We formulate the basic conclusions of this paper as follows:

• A generalized Green’s function and a generalized fundamental system, defined by the Moore-Penrose inverse, always exist and are unique.

• A generalized Green’s function is the unique minimum norm least squares solution of the problem where the unique exact solution is an ordinary Green’s function if it exists.

• Each function of a generalized fundamental system is the unique minimum norm least squares solution of the same problem where the unique exact solution is the corresponding function of the biorthogonal fundamental system if this system exists.

• The minimum norm least squares solution can be described by the unique exact solution of the other discrete problem.

• A generalized Green’s function can be represented by ordinary Green’s function of the other discrete problem.

• A generalized Green’s function is described by the generalized fundamental system.

The very analogous properties of a generalized Green’s function and a biorthogonal fundamental system can be obtained for mth order discrete boundary value problems with m nonlocal conditions as well.

## References

1. Green, G: An Essay on the Application of Mathematical Analysis to the Theories of Elasticity and Magnetism. Nottingham (1828)

2. Riemann, B: Ueber die Fortpflanzung ebener Luftwelen von endlicher Schwingungsweite. Abhandlungen der Königlichen Gesellschaft der Wissenschaften zu Göttingen 8 (1860)

3. Stakgold, I, Holst, M: Green’s Functions and Boundary Value Problems, 3rd edn. Wiley, Hoboken (2011). doi:10.1002/9780470906538

4. Kalna, G, McKee, S: The thermostat problem with a nonlocal nonlinear boundary conditions. IMA J. Appl. Math. 69, 437-462 (2004). doi:10.1093/imamat/69.5.437

5. Kamynin, LI: A boundary value problem in the theory of heat conduction with nonclassical boundary conditions. Comput. Math. Math. Phys. 6(4), 1006-1024 (1964). doi:10.1016/0041-5553(64)90080-1 (in Russian)

6. Schuegerl, K: Bioreaction Engineering, Fundamentals, Thermodinamics, Formal Kinetics, Idealized Reactor Types and Operation Modes. Vol. I. Wiley, Chichester (1987)

7. Choi, YS, Chan, KY: A parabolic equation with nonlocal boundary conditions arising from electrochemistry. Nonlinear Anal., Theory Methods Appl. 18(4), 317-331 (1992). doi:10.1016/0362-546X(92)90148-8

8. Būda, V, Sapagovas, M, Čiegis, R: Two-dimensional model of nonlinear diffusion. Matem, i Mshinn. Metody v Mikroelektronike, 36-43 (1985) (in Russian)

9. Nakhushev, AM: The Equations of Mathematical Biology. Vysshaya Shkola, Moscow (1995) (in Russian)

10. Estep, D, Holst, M, Larson, M: Generalized Green’s functions and the effective domain of Influence. SIAM J. Sci. Comput. 26, 1314-1339 (2002). doi:10.1137/S1064827502416319

11. Hernandez-Martinez, E, Valdes-Parada, FJ, Alvarez-Ramirez, J: A Green’s function formulation of nonlocal finite-difference schemes for reaction-diffusion equations. J. Comput. Appl. Math. 235(9), 3096-3103 (2011). doi:10.1016/j.cam.2010.10.015

12. Locker, J: The generalized Green’s function for an nth order linear differential operator. Trans. Am. Math. Soc. 228, 243-268 (1977)

13. Franco, D, Infante, G, Minhós, FM: Nonlocal boundary value problems. Bound. Value Probl. 2012, Article ID 23 (2012). doi:10.1186/1687-2770-2012-23

14. Cabada, A: Green’s Functions in the Theory of Ordinary Differential Equations. Springer, New York (2014). doi:10.1007/978-1-4614-9506-2

15. Štikonas, A: A survey on stationary problems, Green’s functions and spectrum of Sturm-Liouville problem with nonlocal boundary conditions. Nonlinear Anal., Model. Control 19(3), 301-334 (2014). doi:10.15388/NA.2014.3.1

16. Webb, JRL, Infante, G: Positive solutions of nonlocal boundary value problems: a unified approach. J. Lond. Math. Soc. 74, 673-693 (2006). doi:10.1112/S0024610706023179

17. Il’in, VA, Moiseev, EI: Nonlocal boundary value problem of the first kind for a Sturm-Liouville operator in its differential and finite difference aspects. Differ. Uravn. 23(7), 803-810 (1987)

18. Štikonas, A, Roman, S: Stationary problems with two additional conditions and formulae for Green’s functions. Numer. Funct. Anal. Optim. 30(9), 1125-1144 (2009). doi:10.1080/01630560903420932

19. Roman, S, Štikonas, A: Green’s functions for discrete second-order problems with nonlocal boundary conditions. Bound. Value Probl. 2011, Article ID 767024 (2011). doi:10.1155/2011/767024

20. Štikonas, A, Roman, S: Green’s functions for discrete mth-order problems. Lith. Math. J. 52(3), 334-351 (2012). doi:10.1007/s10986-012-9177-1

21. Roman, S: Green’s functions for boundary-value problems with nonlocal boundary conditions. Doctoral dissertation, Vilnius University (2011). http://www.mii.lt/files/s_roman_mii_santrauka.pdf

22. Penrose, R: A generalized inverse for matrices. Proc. Camb. Philos. Soc. 51, 406-413 (1955)

23. Paukštaitė, G, Štikonas, A: Generalized Green’s functions for second-order discrete boundary-value problems with nonlocal boundary conditions. Liet. Mat. Rink. 53, 96-101 (2012)

24. Paukštaitė, G, Štikonas, A: Generalized Green’s functions for the second-order discrete problems with nonlocal conditions. Lith. Math. J. 54(2), 203-219 (2014). doi:10.1007/s10986-014-9238-8

25. Moore, EH, Barnard, RW: General Analysis. Memoirs of the American Philosophical Society, vol. I, Am. Philos. Soc., Philadelphia (1935)

26. Ben-Israel, A, Greville, TNE: Generalized Inverses: Theory and Applications. Springer, New York (2003)

27. Meyer, CD: Matrix Analysis and Applied Linear Algebra (2004)

## Acknowledgements

The research was partially supported by the Research Council of Lithuania (grant No. MIP-047/2014).

## Author information

Authors

### Corresponding author

Correspondence to Gailė Paukštaitė.

### Competing interests

The authors declare that they have no competing interests.

### Authors’ contributions

All authors contributed equally to the writing of this paper. All authors read and approved the final manuscript.

## Rights and permissions 