1 Introduction

Different finite-difference problems as approximations of the nonlocal problems with integral boundary condition have been studied by many authors (see [1,2,3,4,5] and references given therein). They all were basically focusing on the following difficulties related to the existence of a quadrature approximation of the integral condition on the side of the domain where nonlocal condition was given: (i) finding an approximate solution by solving the obtained system of equations which are non-band matrices, (ii) determining the rate of convergence of the approximate solution by appropriate smoothness conditions on the given data. In [1], a system of finite difference equations for the Poisson problem has been studied for the spectrum of the matrix to apply an iterative method. Moreover, the author obtained some conditions, under which this system has a unique solution. In [2] and [3], for the error of approximate solution, the order of estimation of \(O(h^{2})\) in the difference \(W_{2}^{1}\) metric is obtained, where h is the mesh step. In [4], the radial basis function collocation technique is used to find an approximate solution of an elliptic equation with nonlocal integral boundary condition. In [5], a finite-difference approximation for the problem with integral boundary conditions is constructed by reducing the given problem to the problem with nonlocal conditions containing derivatives. The authors proved that when the fourth-order partial derivatives of the exact solution are continuous on the closed solution domain, the uniform estimate of order \(O(h^{2} \vert \ln h \vert )\) is obtained for the error of the approximate solution.

In this paper, we propose and justify a new constructive method to solve a system of nonlocal 9-point finite-difference problem for the Laplace equation with the integral boundary condition. The solution of this nonlocal difference problem is defined as a solution of the 9-point Dirichlet problem by constructing approximate values of the solution on the side where the integral condition was given. Therefore, the approximate solution is obtained by solving a system with 9 diagonal matrices, for the realization of which many fast algorithms have been proposed (see [6, 7]). Moreover, the uniform estimate of the error of approximate solution is of order \(O(h^{4})\) when the given boundary functions on the sides belong to the Hölder classes \(C^{4,\lambda }\), \(0<\lambda <1\). Finally, numerical experiments are demonstrated to support the theoretical results.

The proposed method with the 5-point scheme was announced in [8].

Other nonlocal boundary value problems are stated and developed in numerous papers (see [9,10,11,12,13,14,15,16,17,18,19,20] and references therein).

2 Nonlocal boundary value problem

Let

$$\begin{aligned} R= \bigl\{ ( x,y ) :0< x< a, 0< y< b \bigr\} \end{aligned}$$

be an open rectangle, \(\gamma ^{m}\), \(m=1,2,3,4\), be its sides including the endpoints, numbered in the clockwise direction, beginning with the side lying on the y-axis, and let \(\gamma =\bigcup_{m=1}^{4}\gamma ^{m}\) be the boundary of R and \(\overline{R}=R\cup \gamma \). Let \(C^{0}\) denote the linear space of continuous functions of one variable x on the interval \([ 0,a ] \) of the x-axis, and vanishing at the points \(x=0\) and \(x=a\). For a function \(f\in C^{0}\), we define the norm

$$\begin{aligned} \Vert f \Vert _{C^{0}}=\max_{0\leq x\leq a} \bigl\vert f(x) \bigr\vert . \end{aligned}$$

It is clear that the space \(C^{0}\) with this norm is complete.

Consider the following nonlocal boundary value problem:

$$\begin{aligned}& \triangle u = 0 \quad \text{on } R, \quad\quad u=0\quad \text{on }\gamma ^{1} \cup \gamma ^{3}, \quad\quad u=\tau \quad \text{on } \gamma ^{2}, \end{aligned}$$
(1)
$$\begin{aligned}& u(x,0) = \alpha \int _{\xi }^{b}u(x,y)\,dy+\mu (x), \quad 0< x< a, 0< \xi < b, \end{aligned}$$
(2)

where \(\Delta \equiv \partial ^{2}/\partial x^{2}+\partial ^{2}/\partial x^{2}\) is the Laplacian, \(\tau =\tau (x)\) and \(\mu =\mu (x)\) are given functions which belong to \(C^{0}\), and α is a given constant which satisfies the following inequality:

$$\begin{aligned} \vert \alpha \vert < \frac{1}{b-\xi } . \end{aligned}$$
(3)

3 Nonlocal finite-difference problem and its reduction to the Dirichlet problem

We define a square mesh with size \(h=\frac{a}{N}=\frac{b}{ M^{\ast }}\), where \(N,M^{\ast }>2\) are integers, constructed with the lines \(x,y=h,2h,\ldots \) . Let \(D_{h}\) be the set of nodes of this square grid and let \(R_{h}=R\cap D_{h}\), \(\overline{R}_{h}=\overline{R}\cap D_{h}\). We put \(\gamma _{h}^{m}=\gamma ^{m}\cap D_{h}\), \(m=1,2,3,4\), and \(\gamma _{h}=\bigcup_{m=1}^{4}\gamma _{h}^{m}\).

Let

$$\begin{aligned}{} [ 0,a ] _{h}= \biggl\{ x=x_{i},x_{i}=ih, i=0,1,\ldots,N, h=\frac{a}{N} \biggr\} \end{aligned}$$

be the set of points divided by the step size h on \([ 0,a ]\).

Let \(C_{h}^{0}\) be the linear space of grid functions defined on \([0,a]_{h}\) that vanish at \(x=0\) and \(x=a\). The norm of a function \(f_{h}\in C_{h}^{0}\) is defined as

$$\begin{aligned} \Vert f_{h} \Vert _{C_{h}^{0}}= \max_{x\in [ 0,a ] _{h}} \vert f_{h} \vert . \end{aligned}$$

We introduce the operator \(B_{h}\) by

$$\begin{aligned} Bu_{h}(x,y) \equiv & \bigl( u(x+h,y)+u(x-h,y)+u(x,y+h)+u(x,y-h) \bigr) /5 \\ & {} + \bigl(u(x+h,y+h)+u(x+h,y-h)+ \\ & {} +u(x-h,y+h)+u(x-h,y-h) \bigr)/20. \end{aligned}$$

For the approximate solution of the nonlocal problem (1)–(2), we consider a solution of the following system of difference equations (see [1]):

$$\begin{aligned}& u_{h} =Bu_{h}\quad \text{on }R_{h},\quad \quad u_{h}=0\quad \text{on } \gamma _{h}^{1} \cup \gamma _{h}^{3}, \quad\quad u_{h}= \tau_{h}\quad \text{on }\gamma _{h}^{2}, \end{aligned}$$
(4)
$$\begin{aligned}& u_{h}(x,0) =\alpha \sum_{k=1}^{M} \rho _{k}u_{h}(x, \eta _{k})+\mu _{h}\quad \text{on }\gamma _{h}^{4}, \end{aligned}$$
(5)

where equation (5) is obtained by approximating the integral in (2) and using Simpson’s rule with \(\rho _{1}=\rho _{M}= \frac{h}{3}\), \(\rho _{j}=\frac{h}{3} ( 3+ ( -1 ) ^{j} ) \) for \(j=2,3,\ldots,M-1\), \(\eta _{j}=\xi +(j-1)h\), \(j=1,2,\ldots,M\), \(h=\frac{a}{N}\), \((M-1)h+\xi =b\), \(\mu _{h}\) is the trace of μ on \(\gamma _{h}^{4}\), and \(\frac{\xi }{h}\) is an integer.

We reduce a solution of the nonlocal differential problem to the solution of the local Dirichlet problem.

Let \(v_{h}\) be the solution of the finite-difference Dirichlet problem

$$\begin{aligned}& v_{h}=Bv_{h}\quad \text{on }R_{h}, \quad \quad v_{h}=\tau _{h} \quad \text{on } \gamma _{h}^{2}, \quad\quad v_{h}=0\quad \text{on } \gamma _{h}/\gamma _{h}^{2}, \end{aligned}$$
(6)

and we put

$$\begin{aligned}& \widetilde{\varphi }_{i,h}(x)=v_{h}(x,\eta _{i}),\quad i=1,2,\ldots,M, \end{aligned}$$
(7)

where \(\tau _{h}\) is the trace of τ on \(\gamma _{h}^{2}\).

Let \(w_{h}\) be a solution of the following finite difference Dirichlet problem:

$$\begin{aligned} w_{h}=Bw_{h}\quad \text{on }R_{h}, \quad \quad w_{h}=0\quad \text{on } \gamma _{h}/\gamma _{h}^{4}, \quad\quad w_{h}= \widetilde{f}_{h}\quad \text{on }\gamma _{h}^{4}, \end{aligned}$$
(8)

where \(\widetilde{f}_{h}\in C_{h}^{0}\), is an arbitrary function.

We define a linear operator \(B_{i}^{h}\) from \(C_{h}^{0}\) to \(C_{h}^{0}\) as follows:

$$\begin{aligned} B_{i}^{h}\widetilde{f}_{h}(x)=w_{h} ( x,\eta _{i} ) , \quad i=1,2,\ldots,M, \end{aligned}$$
(9)

where \(w_{h}\) is the solution of problem (8).

Let

$$\begin{aligned} w_{h}^{\ast }(x,y)=\frac{1}{b} \Vert \widetilde{f}_{h} \Vert _{C_{h}^{0}} ( b-y ) \quad \text{on } \overline{R} _{h}. \end{aligned}$$

We have

$$\begin{aligned} \bigl\vert w_{h} ( x,y ) \bigr\vert \leq w_{h}^{\ast }(x,y), \quad (x,y)\in \gamma _{h}. \end{aligned}$$
(10)

Since \(w_{h}^{\ast }=Bw_{h}^{\ast }\) on \(R_{h}\), from (9)–(10) and by a comparison theorem (see [21, Chap. 4]), we have

$$\begin{aligned} \bigl\Vert B_{i}^{h}\widetilde{f}_{h} \bigr\Vert _{C_{h}^{0}}\leq \Vert \widetilde{f}_{h} \Vert _{C_{h}^{0}} \biggl( 1-\frac{ {\xi +(i-1)h}}{b} \biggr) ,\quad i=1,2,\ldots,M, \end{aligned}$$
(11)

and then for the norm of operator \(B_{i}^{h}\), we get

$$\begin{aligned} \bigl\vert B_{i}^{h} \bigr\vert < 1,\quad i=1,2, \ldots,M. \end{aligned}$$
(12)

Let

$$\begin{aligned} \widetilde{\varphi }_{h}=\alpha \sum_{k=1}^{M} \rho _{k}\widetilde{ \varphi }_{k,h}(x), \quad x\in [ 0,a ] _{h}, \end{aligned}$$
(13)

where \(\widetilde{\varphi }_{k,h}(x)\) is the function from (7).

In the view of inequality (3), we have

$$\begin{aligned} \vert \alpha \vert \sum_{k=1}^{M} \rho _{k}=q_{0}< 1. \end{aligned}$$
(14)

Inequalities (12) and (14) yield

$$\begin{aligned} q_{0} \bigl\vert B_{1}^{h} \bigr\vert =q< 1. \end{aligned}$$
(15)

Lemma 1

A solution of the finite difference problem (4)(5) can be represented as

$$ u_{h}=v_{h}+w_{h}, $$
(16)

where \(v_{h}\) is the solution of problem (6) and \(w_{h}\) is the solution of problem (8) with \(\widetilde{f}_{h}\) being a solution of the following nonlinear equation:

$$ \widetilde{f}_{h}=\widetilde{\varphi }_{h}+\mu _{h}+\alpha \sum_{k=1}^{M} \rho _{k}B_{k}^{h}\widetilde{f}_{h} \quad \textit{on } \gamma _{h}^{4}. $$
(17)

Proof

According to (4), (6), and (8), relation (16) holds on \(R_{h}\) and the boundary sides \(\gamma _{h}^{m}\), \(m=1,2,3\).

From (13) and (17), it follows that

$$\begin{aligned} \widetilde{f}_{h}=\mu _{h}+\alpha \sum _{k=1}^{M}\rho _{k} \bigl[ \widetilde{\varphi }_{k,h}(x)+B_{k}^{h} \widetilde{f}_{h} \bigr] \quad \text{on }\gamma _{h}^{4}. \end{aligned}$$

Relying on (7) and (9), we have

$$\begin{aligned} \widetilde{f}_{h}=\mu _{h}+\alpha \sum _{k=1}^{M}\rho _{k} \bigl[ v_{h}(x,\eta _{i})+w_{h} ( x,\eta _{i} ) \bigr] \quad \text{on } \gamma _{h}^{4}. \end{aligned}$$

By virtue of (6) and (8), we obtain

$$\begin{aligned} v_{h}(x,0)+w_{h} ( x,0 ) =\mu _{h}+\alpha \sum_{k=1} ^{M}\rho _{k} \bigl[ v_{h}(x,\eta _{i})+w_{h} ( x,\eta _{i} ) \bigr] \quad \text{on }\gamma _{h}^{4}. \end{aligned}$$

Due to (5), this shows that relation (16) is also satisfied on \(\gamma _{h}^{4}\). □

Thus, the unknown function on \(\gamma _{h}^{4}\) in problem (8) is a solution of the nonlinear equation (17).

Theorem 2

There exists a unique solution \(\widetilde{f}_{h}\) of the nonlinear equation (17).

Proof

Consider the following sequences in \(C_{h}^{0}\):

$$\begin{aligned}& \widetilde{\psi }_{i,h}^{0} =0, \quad\quad \widetilde{ \psi }_{i,h} ^{n}=B_{i}^{h} \Biggl( \widetilde{\varphi }_{h}+\mu _{h}+\alpha \sum _{k=1}^{M}\rho _{k} \widetilde{\psi }_{k,h}^{n-1} \Biggr) , \\& \quad i=1,2,\ldots,M;n=1,2,\ldots. \end{aligned}$$
(18)

From this, for the positive integers m and n with \(m>n\), we get

$$\begin{aligned} \widetilde{\psi }_{i,h}^{m}-\widetilde{\psi }_{i,h}^{n}=B_{i}^{h} \Biggl( \alpha \sum_{k=1}^{M}\rho _{k} \bigl( \widetilde{\psi } _{k,h}^{m-1}- \widetilde{\psi }_{k,h}^{n-1} \bigr) \Biggr) ,\quad i=1,2, \ldots,M. \end{aligned}$$

Applying inequality (11), we reach

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{m}-\widetilde{\psi }_{i,h}^{n} \bigr\Vert _{C_{h}^{0}}\leq q \bigl\Vert \widetilde{\psi }_{i,h}^{m-1}-\widetilde{ \psi }_{i,h}^{n-1} \bigr\Vert _{C_{h}^{0}}, \end{aligned}$$
(19)

where q is defined by (15). In a similar way, from (19) we obtain

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{m}-\widetilde{\psi }_{i,h}^{n} \bigr\Vert _{C_{h}^{0}}\leq q^{n+1}\frac{1-q^{m-n}}{1-q} \bigl( \Vert \widetilde{\varphi } _{h} \Vert _{C_{h}^{0}}+ \Vert \mu _{h} \Vert _{C_{h} ^{0}} \bigr), \end{aligned}$$

which shows that sequences (18) are Cauchy. Since \(C_{h}^{0}\) is complete, there are limits

$$\begin{aligned} \lim_{n\rightarrow \infty }\widetilde{\psi }_{i,h}^{n}= \widetilde{\psi }_{i,h}\in C_{h}^{0},\quad i=1,2,\ldots,M. \end{aligned}$$

By using (11) and (15),

$$\begin{aligned} \lim_{n\rightarrow \infty }B_{k}^{h}\widetilde{\psi }_{i,h}^{n}=B_{k} ^{h} \widetilde{\psi }_{i,h}\in C_{h}^{0},\quad i,k=1,2,\ldots,M. \end{aligned}$$
(20)

Using (20) and taking the limit of (18) as \(n\rightarrow \infty \), we have

$$\begin{aligned} \widetilde{\psi }_{i,h}=B_{i}^{h} \Biggl( \widetilde{\varphi }_{h}+\mu _{h}+ \alpha \sum _{k=1}^{M}\rho _{k}\widetilde{\psi }_{k,h} \Biggr) , \quad i=1,2,\ldots,M. \end{aligned}$$
(21)

We multiply both sides of equation (21) by \(\alpha \rho _{i}\) and sum over \(i=1,2,\ldots,M\) to get

$$\begin{aligned} \widetilde{\varphi }_{h}+\mu _{h}+\alpha \sum _{i=1}^{M}\rho _{i} \widetilde{\psi }_{i,h}=\widetilde{\varphi }_{h}+\mu _{h}+ \alpha \sum_{i=1}^{M}\rho _{i}B_{i}^{h} \Biggl( \widetilde{\varphi } _{h}+\mu _{h}+\alpha \sum_{k=1}^{M} \rho _{k}\widetilde{\psi } _{k,h} \Biggr) . \end{aligned}$$
(22)

In view of relations (17) and (22), we obtain a solution of the nonlinear equation (17) as

$$\begin{aligned} \widetilde{f}_{h}=\widetilde{\varphi }_{h}+\mu _{h}+\alpha \sum_{k=1}^{M} \rho _{k}\widetilde{\psi }_{k,h}. \end{aligned}$$

To show the uniqueness, let \(\widetilde{f}_{h,p}\in C_{h}^{0}\), \(p=1,2\), be two functions satisfying relation (17). Then, we obtain the following inequality:

$$\begin{aligned} \Vert \widetilde{f}_{h,1}-\widetilde{f}_{h,2} \Vert _{C _{h}^{0}}= \Biggl\Vert \alpha \sum_{k=1}^{m} \rho _{k}B_{k}^{h} ( \widetilde{f}_{h,1}- \widetilde{f}_{h,2} ) \Biggr\Vert _{C_{h}^{0}}\leq q \Vert \widetilde{f}_{h,1}-\widetilde{f}_{h,2} \Vert _{C_{h}^{0}}, \end{aligned}$$

where \(0< q<1\) is defined by (15). Hence \(\widetilde{f}_{h,1}= \widetilde{f}_{h,2}\). □

4 Convergence of the finite-difference problem

We say that \(F\in C^{k,\lambda }(E)\), if F has kth derivatives on E satisfying Hölder condition with exponent λ. We assume that \(\tau (x)\) and \(\mu (x)\) in (1) and (2) are from \(C^{4,\lambda }\), \(0<\lambda <1\), on \(\gamma ^{2}\) and \(\gamma ^{4}\), respectively, and \(\tau ^{ ( 2m ) } ( 0 ) = \tau ^{ ( 2m ) } ( a ) =0\), \(\mu ^{ ( 2m ) } ( 0 ) =\mu ^{ ( 2m ) } ( a ) =0\), \(m=0,1,2\). By using the nth iteration \(\widetilde{\psi }_{i,h}^{n}\), \(n\geq 1\) of (18), we define the function

$$\begin{aligned} \widetilde{f}_{h}^{n}=\widetilde{\varphi }_{h}+\mu _{h}+\alpha \sum _{k=1}^{M}\rho _{k}\widetilde{\psi }_{k,h}^{n} . \end{aligned}$$
(23)

Hence, for the approximate solution of the nonlocal problem (1)–(2), we define the following difference problem:

$$\begin{aligned}& \widetilde{u}_{h}^{n} =B_{h} \widetilde{u}_{h}^{n}\quad \text{on }R _{h}, \quad\quad \widetilde{u}_{h}^{n}= \tau _{h} \quad \text{on }\gamma _{h}^{2}, \quad\quad \widetilde{u}_{h}^{n}=0 \quad \text{on } \gamma _{h}^{1}\cup \gamma _{h}^{3}, \end{aligned}$$
(24)
$$\begin{aligned}& \widetilde{u}_{h}^{n} =\widetilde{f}_{h}^{n} \quad \text{on }\gamma _{h}^{4}. \end{aligned}$$
(25)

Theorem 3

The following estimate holds:

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \bigl\vert \widetilde{u}_{h}^{n}-u \bigr\vert \leq c_{1}h^{4}+q_{0} \frac{{q_{1}^{n+1}}}{1-q_{1}}c^{\ast }, \end{aligned}$$
(26)

where \(\widetilde{u}_{h}^{n}\) is a solution of problem (24)(25), u is the exact solution of nonlocal boundary value problem (1)(2), \(c_{1}\) and \(c^{\ast }\) are constants independent of h, \(q_{0}\) is defined by (14), and \(q_{1}=1-\frac{\xi }{b}\).

Proof

Let U be the exact solution of the system of the following problem:

$$\begin{aligned}& \triangle U =0\quad \text{on }R, \quad\quad U=\tau \quad \text{on }\gamma ^{2}, \quad\quad U=0\quad \text{on }\gamma ^{1}\cup \gamma ^{3}, \end{aligned}$$
(27)
$$\begin{aligned}& U(x,0) =\alpha \sum_{k=1}^{M}\rho _{k}U(x,\eta _{k})+\mu (x) , \quad 0\leq x\leq a. \end{aligned}$$
(28)

Let V be a solution of the Dirichlet problem

$$\begin{aligned} \triangle V=0\quad \text{on }R, \quad\quad V=\tau \quad \text{on }\gamma ^{2}, \quad\quad V=0\quad \text{on }\gamma /\gamma ^{2}, \end{aligned}$$
(29)

and denote by

$$\begin{aligned} \varphi _{k}(x)=V(x,\eta _{k})\quad \text{for }k=1,2, \ldots,M, \end{aligned}$$
(30)

where \(\eta _{k}=\xi +(k-1)h\), \(k=1,2,\ldots,M\). We define the function

$$\begin{aligned} \varphi =\alpha \sum_{k=1}^{M}\rho _{k}\varphi _{k}. \end{aligned}$$
(31)

Consider the Dirichlet problem

$$\begin{aligned} \triangle W=0\quad \text{on }R,\quad\quad W=0\quad \text{on }\gamma /\gamma ^{4}, \quad\quad W=f\quad \text{on }\gamma ^{4}, \end{aligned}$$
(32)

where f is an unknown function from \(C^{0}\). The linear operator \(B_{i}:C^{0}\rightarrow C^{0}\) is defined as

$$\begin{aligned} B_{i}f(x)=W(x,\eta _{i})\in C^{0},\quad i=1,2,\ldots,M. \end{aligned}$$

Then following inequality holds for the norm \(\vert B_{i} \vert \):

$$\begin{aligned} \vert B_{i} \vert < \biggl( 1-\frac{{\xi +(i-1)h}}{b} \biggr) , \quad i=1,2,\ldots,M. \end{aligned}$$

By analogy with the results in [18], it is shown that a solution U of problem (27)–(28) can be represented as \(U=V+W\) where V and W are the solutions of problem (29) and (32), respectively, when f is defined by

$$\begin{aligned} f=\varphi +\mu +\alpha \sum_{k=1}^{M} \rho _{k}\psi _{k}. \end{aligned}$$
(33)

Here the functions \(\psi _{1},\psi _{2},\ldots,\psi _{M}\) are from \(C^{0}\), and are defined as the solutions of the nonlinear equations

$$\begin{aligned} \psi _{i}=B_{i} \Biggl( \varphi +\mu +\alpha \sum _{k=1}^{M}\rho _{k} \psi _{k} \Biggr) ,\quad i=1,2,\ldots,M. \end{aligned}$$
(34)

Therefore, the nonlocal problem (27)–(28) is reduced to the following Dirichlet problem:

$$\begin{aligned}& \triangle U=0\quad \text{on }R, \quad\quad U=\tau \quad \text{on }\gamma ^{2}, \quad\quad U=0\quad \text{on }\gamma ^{1}\cup \gamma ^{3}, \end{aligned}$$
(35)
$$\begin{aligned}& U(x,0)=f, \quad 0\leq x\leq a, \end{aligned}$$
(36)

where f is defined by (33). The solution \(\psi _{i}\), \(i=1,2,\ldots,M\), of system (34) is found as a limit of the infinite sequence of functions \(\{ \psi _{i}^{n} \} _{n _{=0}}^{\infty }\) in \(C^{0}\) defined by

$$\begin{aligned}& \psi _{i}^{0} =0, \quad\quad \psi _{i}^{n}=B_{i} \Biggl( \varphi +\mu + \alpha \sum_{k=1}^{M} \rho _{k}\psi _{k}^{n-1} \Biggr) , \\& \quad i=1,2,\ldots,M; n=1,2,\ldots . \end{aligned}$$
(37)

Since \(\tau (x)\) in (29) belongs to \(C^{4,\lambda } ( \gamma ^{2} ) \) and \(\tau ^{ ( 2m ) } ( 0 ) =\tau ^{ ( 2m ) } ( a ) =0\), \(m=0,1,2\), it follows from [22] that

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \vert v_{h}-V_{h} \vert \leq c_{2}h^{4}, \end{aligned}$$
(38)

where \(v_{h}\) is a solution of problem (6), \(V_{h}\) is the trace of the solution of (29) on \(\overline{R}_{h}\) and \(c_{2}\) is a constant independent of h. Let \(\varphi _{h}\), \(\psi _{i,h}\), and \(\psi _{i,h}^{n}\) be the trace of φ, \(\psi _{i}\), and \(\psi _{i}^{n}\) on \([ 0,a ] _{h}\), respectively, and let \(( B_{i} ( F ) ) _{h}\) be the trace of \(B_{i} ( F ) \) on \([ 0,a ] _{h}\) for any function \(F\in C^{4,\lambda } [ 0,a ] \). By (7), (13), (30), (31), and (38), we obtain

$$\begin{aligned} \Vert \widetilde{\varphi }_{h}-\varphi _{h} \Vert _{C_{h} ^{0}}\leq c_{3}h^{4}, \end{aligned}$$
(39)

where \(c_{3}\) is a constant independent of h. By using (18) and (37), we have, for all \(i=1,2,\ldots,M\),

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{1}-\psi _{i,h}^{1} \bigr\Vert _{C_{h}^{0}} \leq & \bigl\Vert B_{i}^{h} ( \widetilde{\varphi } _{h}-\varphi _{h} ) \bigr\Vert _{C_{h}^{0}} \\ &{}+ \bigl\Vert B_{i}^{h} ( \varphi _{h}+\mu _{h} ) - \bigl( B _{i} ( \varphi +\mu ) \bigr) _{h} \bigr\Vert _{C_{h} ^{0}}. \end{aligned}$$
(40)

Applying (11) and (39), it follows that

$$\begin{aligned} \bigl\Vert B_{i}^{h} ( \widetilde{\varphi }_{h}-\varphi _{h} ) \bigr\Vert _{C_{h}^{0}} \leq c_{4}h^{4},\quad i=1,2,\ldots,M, \end{aligned}$$
(41)

where \(c_{4}\) is a constant independent of h. Similar to inequality (38), we have

$$\begin{aligned} \bigl\Vert B_{i}^{h} ( \varphi _{h}+\mu _{h} ) - \bigl( B _{i} ( \varphi +\mu ) \bigr) _{h} \bigr\Vert _{C_{h} ^{0}}\leq c_{5}h^{4}, \end{aligned}$$
(42)

where \(c_{5}\) is a constant independent of h. From the relations (40)–(42), we have

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{1}-\psi _{i,h}^{1} \bigr\Vert _{C_{h}^{0}}\leq c_{6}h^{4}, \end{aligned}$$
(43)

where \(c_{6}\) is a constant independent of h. For \(n\geq 2\), we have

$$\begin{aligned} \begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{n}-\psi _{i,h}^{n} \bigr\Vert _{C_{h}^{0}} &=\Biggl\Vert B_{i}^{h} \Biggl( \widetilde{\varphi }_{h}+ \mu _{h}+\alpha \sum _{k=1}^{M}\rho _{k}\widetilde{\psi }_{k,h} ^{n-1} \Biggr) \\ &\quad {} - \Biggl( B_{i} \Biggl( \varphi +\mu +\alpha \sum _{k=1} ^{M}\rho _{k}\psi _{k}^{n-1} \Biggr) \Biggr) _{h}\Biggr\Vert _{C_{h} ^{0}}. \end{aligned} \end{aligned}$$

Then,

$$\begin{aligned}& \begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{n}- \psi _{i,h}^{n} \bigr\Vert _{C_{h}^{0}} &\leq \bigl\Vert B_{i}^{h} ( \widetilde{\varphi } _{h}+\mu _{h} ) - \bigl( B_{i} ( \varphi + \mu ) \bigr) _{h} \bigr\Vert _{C_{h}^{0}} \\ &\quad {}+ \Biggl\Vert B_{i}^{h} \Biggl( \alpha \sum _{k=1}^{M}\rho _{k} \widetilde{\psi }_{k,h}^{n-1}-\alpha \sum _{k=1}^{M}\rho _{k}\psi _{k} ^{n-1} \Biggr) \Biggr\Vert _{C_{h}^{0}} \\ &\quad {}+ \Biggl\Vert B_{i}^{h} \Biggl( \alpha \sum _{k=1}^{M}\rho _{k} \psi _{k}^{n-1} \Biggr) - \Biggl( B_{i} \Biggl( \alpha \sum_{k=1} ^{M}\rho _{k}\psi _{k}^{n-1} \Biggr) \Biggr) _{h} \Biggr\Vert _{C_{h} ^{0}}, \end{aligned} \\& \quad i=1,2,\ldots,M. \end{aligned}$$
(44)

By analogy with (54) in [20], it follows that

$$\begin{aligned} \max_{1\leq k\leq M} \bigl\Vert B_{i}^{h} \psi _{k}^{n-1}- \bigl( B_{i} \psi _{k}^{n-1} \bigr) _{h} \bigr\Vert _{C_{h}^{0}}\leq c_{7}h^{4}, \end{aligned}$$
(45)

where \(c_{7}\) is a constant independent of h. From (45), we find that

$$\begin{aligned}& \Biggl\Vert B_{i}^{h} \Biggl( \alpha \sum _{k=1}^{M}\rho _{k} \psi _{k}^{n-1} \Biggr) - \Biggl( B_{i} \Biggl( \alpha \sum_{k=1} ^{M}\rho _{k}\psi _{k}^{n-1} \Biggr) \Biggr) _{h} \Biggr\Vert _{C_{h} ^{0}} \\& \quad \leq \sum_{k=1}^{M} \vert \alpha \rho _{k} \vert \bigl\Vert B_{i}^{h} \psi _{k}^{n-1}- \bigl( B_{i}\psi _{k}^{n-1} \bigr) _{h} \bigr\Vert _{C_{h}^{0}} \\& \quad \leq c_{8}h^{4}, \end{aligned}$$
(46)

where \(c_{8}= \vert \alpha \vert ( b-\xi ) c _{7}\). In the view of (11), (14), (42), (44), and (46), we have

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{n}-\psi _{i,h}^{n} \bigr\Vert _{C_{h}^{0}}\leq c_{9}h^{4}+q_{0} \bigl\Vert \widetilde{ \psi }_{i,h} ^{n-1}-\psi _{i,h}^{n-1} \bigr\Vert _{C_{h}^{0}}, \end{aligned}$$
(47)

where \(q_{0}\) is defined by (14) and \(c_{9}\) is a constant independent of h. By virtue of (43) and (47), we obtain

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{n}-\psi _{i,h}^{n} \bigr\Vert _{C_{h}^{0}}\leq c_{10}h^{4} \bigl( 1+q_{0}+q_{0}^{2}+ \cdots +q_{0} ^{n-1} \bigr) \leq c_{11}h^{4}, \end{aligned}$$
(48)

where \(c_{10}\) and \(c_{11}\) are constants independent of h. According to (37), it follows that

$$\begin{aligned}& \bigl\Vert \psi _{i}^{1} \bigr\Vert _{C^{0}}\leq \biggl( 1-\frac{ \xi }{b} \biggr) \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) , \end{aligned}$$
(49)
$$\begin{aligned}& \bigl\Vert \psi _{i}^{n}-\psi _{i}^{n-1} \bigr\Vert _{C^{0}}\leq \vert B_{i} \vert \vert \alpha \vert \sum_{k=1}^{M} \vert \rho _{k} \vert \bigl\Vert \psi _{i} ^{n-1}-\psi _{i}^{n-2} \bigr\Vert _{C^{0}},\quad i=1,2,\ldots,M, \end{aligned}$$
(50)

where φ is defined by (31). From (49) and (50), we have

$$\begin{aligned} \bigl\Vert \psi _{i}^{n}-\psi _{i}^{n-1} \bigr\Vert _{C^{0}}\leq q _{1}^{{n}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) ,\quad i=1,2,\ldots,M, \end{aligned}$$

where \(q_{1}=1-\frac{\xi }{b}\). Moreover, for any \(m=1,2,\ldots \) , we obtain

$$\begin{aligned} \bigl\Vert \psi _{i}^{n+m}-\psi _{i}^{n} \bigr\Vert _{C^{0}}\leq q _{1}^{{n+1}} \biggl( \frac{1-{q_{1}^{{m}}}}{1-q_{1}} \biggr) \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) ,\quad i=1,2,\ldots,M. \end{aligned}$$
(51)

Since

$$\begin{aligned} \bigl\Vert \psi _{i}^{n}-\psi _{i} \bigr\Vert _{C^{0}}\leq \bigl\Vert \psi _{i} ^{n+m}-\psi _{i}^{n} \bigr\Vert _{C^{0}}+ \bigl\Vert \psi _{i}^{n+m}- \psi _{i} \bigr\Vert _{C^{0}},\quad i=1,2,\ldots,M, \end{aligned}$$
(52)

by taking the limit as \(m\rightarrow \infty \), from (51) and (52), it follows that

$$\begin{aligned} \bigl\Vert \psi _{i}^{n}-\psi _{i} \bigr\Vert _{C^{0}}\leq \frac{ {q_{1}^{{n+1}}}}{1-q_{1}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) ,\quad i=1,2,\ldots,M. \end{aligned}$$
(53)

From (48) and (53), we have

$$\begin{aligned} \bigl\Vert \widetilde{\psi }_{i,h}^{n}-\psi _{i,h} \bigr\Vert _{C _{h}^{0}}\leq c_{11}h^{4}+ \frac{{q_{1}^{{n+1}}}}{1-q_{1}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) ,\quad i=1,2,\ldots,M. \end{aligned}$$
(54)

Let \(U_{h}(x,y)\) be the solution of the system of grid equations

$$\begin{aligned}& U_{h} =B_{h}U_{h}\quad \text{on }R_{h},\quad\quad U_{h}=\tau \quad \text{on }\gamma _{h}^{2}, \quad\quad U_{h}=0\quad \text{on }\gamma _{h} ^{1}\cup \gamma _{h}^{3}, \end{aligned}$$
(55)
$$\begin{aligned}& U_{h} =f_{h}\quad \text{on }\gamma _{h}^{4}, \end{aligned}$$
(56)

which approximates problem (35)–(36) when \(f_{h}\) is the trace of f on \([ 0,a ] _{h}\). Since τ, μ, φ, and \(\psi _{i}\), \(i=1,2,\ldots,M\), belong to \(C^{4,\lambda }\), \(0< \lambda <1\), on the interval \(0\leq x\leq 1\), and the \((2m)\)th order derivatives vanish at the endpoints for \(m=0,1,2\) (see [20]), by [22], we have

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \vert U_{h}-U \vert \leq c_{12}h^{4}, \end{aligned}$$
(57)

where U is the solution of problem (35)–(36) and \(c_{12}\) is a constant independent of h. In view of inequalities (39) and (54), we obtain

$$\begin{aligned} \bigl\Vert \widetilde{f}_{h}^{n}-f_{h} \bigr\Vert _{C_{h}^{0}} \leq c_{13}h^{4}+q_{0} \frac{{q_{1}^{{n+1}}}}{1-q_{1}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) , \end{aligned}$$
(58)

where \(q_{0}\) is defined by (14) and \(c_{13}\) is a constant independent of h. By the grid maximum principle and from (58), we have

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \bigl\vert \widetilde{u}_{h}^{n}-U _{h} \bigr\vert \leq c_{13}h^{4}+q_{0} \frac{{q_{1}^{{n+1}}}}{1-q _{1}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) , \end{aligned}$$
(59)

where \(\widetilde{u}_{h}^{n}\) is the solution of problem (24)–(25) and \(U_{h}\) is the solution of problem (55)–(56). According to estimates (57) and (59), the following inequality holds:

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \bigl\vert \widetilde{u}_{h}^{n}-U \bigr\vert \leq c_{14}h^{4}+q_{0} \frac{{q_{1}^{{n+1}}}}{1-q_{1}} \bigl( \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}} \bigr) , \end{aligned}$$
(60)

where U is the solution of problem (35)–(36) and \(c_{14}\) is a constant independent of h.

Using the estimate (60) and by the maximum principle for the Laplace equation with the truncation error of Simpson’s rule, which is order of \(O(h^{4})\), we obtain the final estimate

$$\begin{aligned} \max_{(x,y)\in \overline{R}_{h}} \bigl\vert \widetilde{u}_{h}^{n}-u \bigr\vert \leq &\max_{(x,y)\in \overline{R}_{h}} \bigl\vert \widetilde{u}_{h} ^{n}-U \bigr\vert +\max _{(x,y)\in \overline{R}_{h}} \vert U-u \vert \\ \leq &c_{1}h^{4}+q_{0}\frac{{q_{1}^{{n+1}}}}{1-q_{1}}c^{\ast } , \end{aligned}$$
(61)

where u is the solution of problem (1)–(2), \(c_{1}\) is a constant independent of h, and \(c^{\ast }= \Vert \varphi \Vert _{C^{0}}+ \Vert \mu \Vert _{C^{0}}\). □

Remark 4

In (61), the right-hand side is of order \(O (h^{4} )\), when

$$\begin{aligned} \frac{q_{1}^{n+1}}{1-q_{1}}\thickapprox h^{4}. \end{aligned}$$
(62)

From (62) it follows that

$$\begin{aligned} n=\max \biggl\{ \biggl[ \frac{\ln h^{4}(1-q_{1})}{\ln q_{1}} \biggr] ,1 \biggr\} , \end{aligned}$$

where \([ a ] \) is the integer part of a.

5 Numerical experiments

Let

$$\begin{aligned} R= \bigl\{ (x,y):0< x< 1, 0< y< 2 \bigr\} . \end{aligned}$$

Problem 1

$$\begin{aligned}& \triangle u = 0\quad \text{on }R, \quad\quad u(0,y)=u(1,y)=0, \quad 0\leq y\leq 2, \\& u(x,2) = 100e^{-\pi }\sin \pi x, \quad 0\leq x\leq 1, \\& u(x,0) = \frac{1}{400} \int _{\frac{1}{8}}^{2}u(x,y)\,dy, \quad 0< x< 1. \end{aligned}$$

Problem 2

$$\begin{aligned}& \triangle u = 0\quad \text{on }R, \quad\quad u(0,y)=u(1,y)=0,\quad 0\leq y\leq 2, \\& u(x,2) = x^{\frac{121}{30}} \biggl( \tan ^{-1}x- \frac{\pi }{4} \biggr), \quad 0\leq x\leq 1, \\& u(x,0) = \frac{1}{250} \int _{\frac{1}{4}}^{2}u(x,y)\,dy, \quad 0< x< 1. \end{aligned}$$

The exact solutions of Problems 1 and 2 are unknown. The approximate values of Problems 1 and 2 on the line \(y=0\) obtained by the proposed method are given in Tables 1 and 2, respectively. According to repeated digits, for the decreasing mesh steps \(h=\frac{1}{16},\frac{1}{32}, \frac{1}{64},\frac{1}{128} \), it follows that the maximum error on this line decreases as \(O ( h^{4} ) \). To obtain these results, 14 iterations are run for the construction of \(\widetilde{f}_{h}^{n}\) with the successive error which is less than 10−16.

Table 1 Solutions on the line \(y=0\) of Problem 1
Table 2 Solutions on the line \(y=0\) of Problem 2

Problem 3

$$\begin{aligned}& \triangle u = 0\quad \text{on }R, \quad\quad u(0,y)=u(1,y)=0, \quad 0\leq y\leq 2, \\& u(x,2) = e^{2\pi }\sin \pi x, \quad 0\leq x\leq 1, \\& u(x,0) = \frac{1}{100} \int _{\frac{1}{16}}^{2}u(x,y)\,dy+\mu (x),\quad 0< x< 1, \end{aligned}$$

where \(u=e^{\pi y}\sin \pi x\) is the exact solution, \(\mu (x)= [ 1+\frac{\alpha }{\pi } ( 1-e^{2\pi } ) ] \sin \pi x\).

In Table 3 for Problem 3, the maximum error for each step \(h= \frac{1}{2^{k}}\), \(k=4,5,6,7\) and the reduction orders are given. From the third column it follows that the convergence order is \(O ( h ^{4} ) \).

Table 3 Maximum errors for the solution of Problem 3

In Tables 4, 5, and 6, the results of the CPU times (in seconds), when solving Problems 1, 2, and 3, respectively, are given. In columns 2 and 3, the CPU times for the realization of the proposed approaches by the discrete Fourier method and by the Gauss–Seidel method are given. For the construction of the local function \(\widetilde{f}_{h}^{n}\) for Problems 1 and 2, just 14 iterations are used. Problem 3 needs 11 iterations. In column 4, the Gauss–Seidel method is used to solve the given problems without reducing to the Dirichlet problem. From these results it follows that the discrete Fourier method, which cannot be used on the problem without reducing to the Dirichlet problem, is faster than others. The third and fourth columns show that for the method which is applicable for both approaches (as Gauss–Seidel), the CPU times with reducing are less than the CPU times without reducing to the Dirichlet problem.

Table 4 CPU times (in seconds) for Problem 1
Table 5 CPU times (in seconds) for Problem 2
Table 6 CPU times (in seconds) for Problem 3

As it follows from Tables 46, the CPU times for Problems 1 and 3 in Tables 4 and 6 are less than those for Problem 2 in Table 5. This takes place because of low smoothness of the boundary function in Problem 2.

6 Conclusion

A new constructive method for the approximate solution of the nonlocal boundary value for Laplace’s equation with integral boundary condition is given. In the proposed method, the system of finite-difference equations is defined as the 9-point solution of the Dirichlet problem by constructing the function on the side of the rectangle where the nonlocal boundary condition was given. This function is defined by using the nth term of the convergent simplest fixed point iteration (18) for the solution of the nonlinear system of (21). A uniform estimate for the error of the approximate solution of the nonlocal problem by using the nth term for \(n=\max \{ [ ( \ln h^{4}(1-q_{1}) ) /\ln q_{1} ] ,1 \} \) is of order \(O ( h^{4} ) \), where h is the step size.

The proposed method gives an opportunity to solve nonlocal problems by using different fast algorithms constructed for the local Dirichlet problem by many authors (see [6] and the references therein).