Introduction

One of the best subjects in the numerical analysis is a finite-element method (FEM). We used (FEM) to solve problems in mathematical physics, integral equations, and engineering, such as electromagnetic potential, fluid flow, radiation heats transfer, laminar boundary-layer theory and mass transport, Abel integral equations, and problem of mechanics or physics [3,4,5, 7, 18, 20]. For approximating of singular or weakly singular integral equations, there are several numerical method’s existences. For example, Baratella and Orsi [8] were introduced weakly singular for Volterra, and discussed on operational matrix method with block-pulse functions by Babolian and Salimi [6]. Furthermore, some author works to be approximate to Abel integral equations, for example, Garza in [12] and Hall in [13] used the wavelet method, Legendre wavelets approximation by Yousefi in [19], Gauss–Jacobi quadrature rule by Fettis in [10], and Piessens and Verbaeten in [16, 17] with Chebyshev polynomials of the first kind.

In this paper, we use (FEM) and Bernstein polynomials to acquire an approximate solution for linear weakly singular mixed Volterra–Fredholm integral equation as follows:

$$\begin{aligned} u(x)=f(x)+\int _{a}^{x} \frac{W_{1}(x,t)}{(x-t)^\alpha }u(t){{\mathrm{d}}}t + \int _{a}^{b} \frac{W_{2}(x,t)}{(x-t)^{\beta }} u(t) {{\mathrm{d}}}t, \quad \quad 0<\alpha ,\, \beta <1 \end{aligned}$$
(1)

that f(x), \(W_{1}(x,t)\), and \(W_{2} (x,t)\) are known continuous functions, and u(x) is the unknown function.

Bernstein polynomials and their properties

On the interval [ab], the \(m+1\) Bernstein basis polynomials (BPs) of degree m are defined as [1]

$$\begin{aligned} B_{i,m} (t)=\left( \begin{array}{l} {m} \\ {i} \end{array}\right) \, \frac{(t-a)^{i} (b-t)^{m-i} }{(b-a)^{m} } ,\, \, \, \, \, i=0,\, 1,\, \ldots \, ,\, m. \end{aligned}$$
(2)

In addition, for \(i< 0\) or \(i>m\), we have

$$\begin{aligned} B_{i,m} (t)=0. \end{aligned}$$

The ten first Bernstein basis polynomials are

$$\begin{aligned} \begin{array}{llll} B_{0,0} (t)=1,&{}&{}&{}\\ B_{0,1} (t)=(1-t),&{}B_{1,1} (t)=t,&{}&{}\\ B_{0,2} (t)=(1-t)^2,&{}B_{1,2} (t)=2t(1-t),&{}B_{2,2} (t)=t^2,&{}\\ B_{0,3} (t)=(1-t)^3,&{}B_{1,3} (t)=3t(1-t)^2,&{}B_{2,3} (t)=3t^2(1-t),&{}B_{3,3} (t)=t^3.\\ \end{array} \end{aligned}$$

Therefore, we can be plotted this ten first Bernstein basis polynomials on the unit square as follows (Fig. 1):

Fig. 1
figure 1

Bernstein basis polynomials of degrees 1, 2, and 3

Implementation of the Bernstein–Galerkin method

In this section with using of Galerkin method, we find an approximate solution for Eq. (1). For this purpose, we obtain weak and variational form.

If \(\Omega =[a,b] \subset {\mathbb{R}}\) is an infinite dimensional space, and

$$\begin{aligned} \mathbb{V}= {H}^{0}(\Omega ) =L_2(\Omega ). \end{aligned}$$

We let \(B:{ \mathbb{V}}\times { \mathbb{V}} \rightarrow \mathbb{R}\) is a bilinear form and \({L}:{ \mathbb{V}} \rightarrow \mathbb{R}\) is a linear functional; then for all arbitrary functions \(v(x) \in {\mathbb{V}}\), we have \({B}(u,v) = {L}(v)\), where

$$\begin{aligned} {B}(u,v)&= \int _{\Omega }u(x) v(x) {{\mathrm{d}}}x - \int _{\Omega } v(x) \left( \int _{a}^{x} \dfrac{W_{1}(x,t)\,u(t)}{(x-t)^\alpha } {{\mathrm{d}}}t\right) {{\mathrm{d}}}x \\&\quad - \int _{\Omega } v(x) \left( \int _{a}^{b} \dfrac{W_{2}(x,t)\,u(t)}{(x-t)^{\beta }} {{\mathrm{d}}}t\right) {{\mathrm{d}}}x, \end{aligned}$$
(3)

and

$$\begin{aligned} {L}(v) = \int _{\Omega } f(x) v(x) {{\mathrm{d}}}x, \end{aligned}$$

thus

$$\begin{aligned} {B}(\lambda _{1} u +\lambda _{2} w, v)&= \int _{\Omega } (\lambda _{1} u(x)+\lambda _{2} w(x)) v(x) {{\mathrm{d}}}x \\&\quad - \int _{\Omega } v(x) \int _{a}^{x} \dfrac{W_{1}(x,t) (\lambda _{1} u(t)+\lambda _{2} w(t))}{(x-t)^\alpha } {{\mathrm{d}}}t {{\mathrm{d}}}x\\&\quad - \int _{\Omega } v(x) \int _{a}^{b} \dfrac{W_{2}(x,t) (\lambda _{1} u(t)+\lambda _{2} w(t))}{(x-t)^\beta } {{\mathrm{d}}}t {{\mathrm{d}}}x, \end{aligned}$$

then, B is a bilinear form:

$$\begin{aligned} {B}(\lambda _{1} u +\lambda _{2} w, v) =\lambda _{1} {B}(u,v)+ \lambda _{2} {B}(w,v). \end{aligned}$$

We consider

$$\begin{aligned} u_h (x) = \sum _{i=1}^{n} a_i \phi _i (x), \quad v_h (x) = \phi _j (x),\quad u_h(x), v_h(x)\in {\mathbb{V}}_{h} \end{aligned}$$
(4)

that \({V}_h = span \lbrace \phi _1,\phi _2,\ldots ,\phi _n\rbrace\) is a subspace of \({\mathbb{V}}\), and \(\{\phi _i\}_{i=1}^{n}\) are a set of Bernstein polynomial functions of degree at most m in each subinterval. Hence, by substituting (4) in variational formulation, we have

$$\begin{aligned}&\sum _{i=1}^{n} a_i \bigg \lbrace \int _{\Omega } {\phi _i} (x) {\phi _j} (x) {{\mathrm{d}}}x - \int _{\Omega } \phi _j (x) \bigg ( \int _{0}^{x} \dfrac{W_{1}(x,t) }{(x-t)^\alpha }\, \phi _i (t)\, {{\mathrm{d}}}t\bigg )\, {{\mathrm{d}}}x \\&\quad - \int _{\Omega } \phi _j (x) \bigg ( \int _{a}^{b} \dfrac{W_{2}(x,t) }{(x-t)^\beta }\, \phi _i (t)\, {{\mathrm{d}}}t\bigg )\, {{\mathrm{d}}}x\, \bigg \rbrace - \int _{\Omega } g(x) \phi _j (x) {{\mathrm{d}}}x\, =\,0. \end{aligned}$$
(5)

Now, for \(i,j=1,2,\ldots ,n,\) we define

$$\begin{aligned} C_{i,j}&= \int _{\Omega } \phi _i (x) \phi _j (x) {\mathrm{d}}x \\&\quad - \int _{\Omega } \phi _j (x) \int _{0}^{x} \dfrac{W_{1}(x,t)}{(x-t)^\alpha }\, \phi _i (t)\, {\mathrm{d}}t \, {\mathrm{d}}x \\&\quad - \int _{\Omega } \phi _j (x) \int _{a}^{b} \dfrac{W_{2}(x,t)}{(x-t)^\beta }\, \phi _i (t)\, {\mathrm{d}}t \, {\mathrm{d}}x, \end{aligned}$$
(6)

and

$$\begin{aligned} G_j = \int _{\Omega } g(x) \phi _j (x) {\mathrm{d}}x, \quad \quad j=1,2,\ldots ,n \end{aligned}$$
(7)

thus

$$\begin{aligned} \sum _{i=1}^{n} C_{ij} a_i = G_j, \quad \quad j=1,2,\ldots ,n. \end{aligned}$$
(8)

From system (8), we have

$$\begin{aligned} C^{T} \mathbf {A} =\mathbf {G} \end{aligned}$$
(9)

that

$$\begin{aligned}&\mathbf {A}=[a_1,a_2,\ldots ,a_n]^{T},\quad \mathbf {G}=[G_1,G_2,\ldots ,G_n]^{T},\quad C=[C_{ij}], \quad i,j=1,2,\ldots ,n. \end{aligned}$$

By solving of the system (9), we can obtain approximate solution of Eq. (1).

Error analysis

In this section, using the theorem, we get an upper bound for the error of our method, and we proved that the order of convergence is a \(O(h^{\zeta })\). For this purpose, suppose that \(\mathbb{V}\) and B are a Hilbert space and symmetric, respectively.

Definition 1

If B is a \({\mathbb{V}}\)-elliptic bilinear form, then an inner product energy is a \(( . , . ) : {\mathbb{V}} \times {\mathbb{V}} \rightarrow {\mathbb{R}}\) and the energy norm as

$$\begin{aligned} || u ||_{E}^{2} = (u,u)_B = {{B} (u,u)}. \end{aligned}$$

Definition 2

For operator \(\Pi : {\mathbb{V}} \rightarrow {\mathbb{V}}_h\), projection operators as

$$\begin{aligned}&\Pi u= \tilde{u}_h = \sum _{i=1}^{n} \tilde{a}_i \phi _i (x). \end{aligned}$$

Theorem 1

Let \(\alpha >0\), then bilinear form B, defined by (3) is a \({\mathbb{V}}\)-ellipticity and Eq. (1) has a unique solution, and order of convergence is a \(O(h^{\zeta })\).

Proof

From Eq. (3), we have

$$\begin{aligned} \big | {B}(u, v) \big |&= \bigg | \int _{\Omega } u(x) v(x) {\mathrm{d}}x - \int _{\Omega } v(x) \int _{a}^{x} \dfrac{W_{1}(x,t) u(t)}{(x-t)^\alpha } {\mathrm{d}}t {\mathrm{d}}x\\&\quad - \int _{\Omega } v(x) \int _{a}^{b} \dfrac{W_{2}(x,t) u(t)}{(x-t)^\beta } {\mathrm{d}}t {\mathrm{d}}x\bigg |, \end{aligned}$$

with using of the Cauchy–Schwarz inequality and \(L_2\)-norm, we have

$$\begin{aligned} \big | {B}(u,v)\big |&\le || u ||_{L_2(\Omega )} || v ||_{L_2 (\Omega )}+ W_{1} \bigg |\int _{a}^{b} v(x) \int _{a}^{x} \frac{u(t)}{(x-t)^\alpha } {\mathrm{d}}t {\mathrm{d}}x\bigg |\\&\quad + W_{2} \bigg |\int _{a}^{b} v(x) \int _{a}^{b} \frac{u(t)}{(x-t)^\beta } {\mathrm{d}}t {\mathrm{d}}x\bigg |\\&=|| u||_{L_2(\Omega )} || v ||_{L_2 (\Omega )}\\&\quad + W_{1}\bigg |\int _{a}^{b} v(x) u(\eta _x) \int _{a}^{x} \frac{1}{(x-t)^{\alpha }} {\mathrm{d}}t {\mathrm{d}}x\bigg | + W_{2}\bigg |\int _{a}^{b} v(x) u(\zeta _x) \int _{a}^{b} \frac{1}{(x-t)^{\beta }} {\mathrm{d}}t {\mathrm{d}}x\bigg |\\&\le || u||_{L_2(\Omega )} || v ||_{L_2 (\Omega )} + W_{1}\bigg |\int _{a}^{b} v(x) u(\eta _x) \frac{1}{1-\alpha } (x-t)^{1-\alpha } \mid _{t=a}^{t=x} {\mathrm{d}}x\bigg | \\&\quad + W_{2}\bigg |\int _{a}^{b} v(x) u(\zeta _x) \frac{1}{1-\beta } (x-t)^{1-\beta } \mid _{t=a}^{t=b} {\mathrm{d}}x\bigg |\\&\le || u||_{L_2(\Omega )} || v ||_{L_2 (\Omega )}\\&\quad + \frac{W_{1} (b-a)^{1-\alpha }}{1-\alpha } \bigg |\int _{a}^{b} v(x) u(\eta _x) {\mathrm{d}}x\bigg | + \frac{W_{2} (b-a)^{1-\beta }}{1-\beta } \bigg |\int _{a}^{b} v(x) u(\zeta _x) {\mathrm{d}}x\bigg |\\&\le \bigg (1+\frac{W_{1} (b-a)^{1-\alpha }}{1-\alpha } + \frac{W_{2} (b-a)^{1-\beta }}{1-\beta } \bigg ) ||u||_{L^2 (\Omega )} ||v||_{L^2 (\Omega )}, \end{aligned}$$

where

$$\begin{aligned}&W_{1} =\max |W_{1}(x,t)|,\quad x\in [a,b],\quad \hbox {and} \quad t\in [a,x], \\&W_{2} =\max |W_{2}(x,t)|,\quad x\in [a,b],\quad \hbox {and} \quad t\in [a,b], \end{aligned}$$
(10)

then B is a continuous. Furthermore, we proved V-ellipticity of B; for this purpose, we have

$$\begin{aligned} {B}(v,v)&= \int _{\Omega } v(x) v(x) {\mathrm{d}}x - \int _{\Omega } v(x) \int _{a}^{x}\dfrac{W_{1}(x,t) v(t)}{(x-t)^\alpha } {\mathrm{d}}t {\mathrm{d}}x \\&\quad - \int _{\Omega } v(x) \int _{a}^{b}\dfrac{W_{2}(x,t) v(t)}{(x-t)^\beta } {\mathrm{d}}t {\mathrm{d}}x \\&\ge ||v||^{2}_{L_2 (\Omega )} - W_{1} \bigg (\frac{(b-a)^{1-\alpha }}{1-\alpha } \bigg ) ||v||^2_{L_2} \\&\quad - W_{2} \bigg (\frac{(b-a)^{1-\beta }}{1-\beta } \bigg ) \Vert v\Vert ^2_{L_2} =(\eta )||v||^{2}_{L_2(\Omega )}, \end{aligned}$$
(11)

then

$$\begin{aligned} {B}(v,v) \ge (\eta ) || v ||^{2}_{L_2(\Omega )}, \end{aligned}$$
(12)

where

$$\begin{aligned} \eta = 1- W_{1} \bigg (\frac{(b-a)^{1-\alpha }}{1-\alpha }\bigg )- W_{2} \bigg (\frac{(b-a)^{1-\beta }}{1-\beta }\bigg ), \end{aligned}$$

thus B is a V-ellipticity; therefore, using of Lax–Milgram theorem and V-ellipticity of B, Eq. (1) has a unique solution. Suppose \(u_h\) is an approximate solution, so we have

$$\begin{aligned} {B}(u,v_h) = {L}(v_h), \quad \quad \forall v_h \in {V}_h , \end{aligned}$$
(13)

and

$$\begin{aligned} {B}(u_h , v_h) = {L} (v_h), \quad \forall v_h \in {V}_h. \end{aligned}$$
(14)

If \(e=u-u_h\) that u are an exact solution of Eq. (1), then

$$\begin{aligned} {B} (e, v_h) = 0, \,\quad \forall v_h \in {V}_h. \end{aligned}$$
(15)

By Schwartz’s inequality, and relation between energy norm and inner product, we have

$$\begin{aligned} | {B}(v ,w )| \le || v ||_{E} || w ||_{E}, \quad \quad \forall v,w \in {V}. \end{aligned}$$
(16)

Using (15), we have

$$\begin{aligned} (e, v_h )_{B} = {B} (e , v_h) = 0. \end{aligned}$$

Therefore, e is an orthogonal for any \(v_h\). Using

$$\begin{aligned} ||u-u_h ||_{E} = min \lbrace || u-v_h ||_{E} ;~ v_h \in {V}_h \rbrace , \end{aligned}$$

and Cea’s Lemma [9], for each particular \(\tilde{v}_h\) in \({V}_h\), we have

$$\begin{aligned} || u-v_h ||_{{V}} \le \frac{M}{\eta } \inf || u-v_h ||_{{V}}, \quad v_{h} \in V_{v}, \end{aligned}$$

where

$$\begin{aligned} M=\bigg (1+\frac{W_{1} (b-a)^{1-\alpha }}{1-\alpha } + \frac{W_{2} (b-a)^{1-\beta }}{1-\beta } \bigg ). \end{aligned}$$

Since

$$\begin{aligned} \inf || u-v_h ||_{{V}} \le ||u-\tilde{v}_h ||_{{V}}, \end{aligned}$$

if \(\tilde{v}_h\) is equal to \(\tilde{u}_h\), then

$$\begin{aligned} || u-u_h ||_{{V}} \le \frac{M}{\eta } ||u - \tilde{u}_h ||_{{V}}. \end{aligned}$$

If we get an upper bounded for the interpolation error, we have

$$\begin{aligned} ||u - \tilde{u}_h ||_{{V}}\le c h^{\zeta },\quad \zeta >0, \end{aligned}$$

that c is not dependent of h; therefore

$$\begin{aligned} ||u-u_h||_{{V}}&\le \frac{c M}{\eta } h^{\zeta }. \end{aligned}$$

Thus, \(h\rightarrow 0\), and the order of convergence is a \(O(h^{\zeta })\), \(\square\)

Numerical examples

Example 1

Consider the linear weakly singular Volterra–Fredholm integral equation:

$$\begin{aligned} u(x)-\int _{0}^{x} \dfrac{1}{{(x-t)}^{\frac{1}{4}}} u(t) {\mathrm{d}}t-\int _{0}^{1} \dfrac{1}{{(x-t)}^{\frac{1}{4}}} u(t) {\mathrm{d}}t=f(x) ,\quad \, 0<x\le 1 \end{aligned}$$

that

$$\begin{aligned} f(x)&= \frac{1}{1155}\big(-512 x^{3}-256 x^{2}+144x+112\big) \, (x-1)^{\frac{3}{4}}\\&\quad -x^{3}+x^{2}-\frac{256}{231} x^{\frac{11}{4}} + \frac{1024}{1155} x^{\frac{15}{4}}, \end{aligned}$$

and the exact solution is a \(u(x) = x^{2} (1-x)\).

With using Bernstein basis polynomials of degree 2, and \(M=5\), the results of obtained are presented in Table 1 and Fig. 2.

Table 1 Numerical results for Example 1
Fig. 2
figure 2

Diagrams of exact and numerical solutions and graph of error for Example 1

Example 2

In this example, we consider

$$\begin{aligned} u(x)-\int _{0}^{x} \dfrac{1}{{(x-t)}^{\frac{1}{3}}} u(t) {\mathrm{d}}t-\int _{0}^{1} \dfrac{1}{{(x-t)}^{\frac{1}{2}}} u(t) {\mathrm{d}}t=f(x) ,\quad \, 0<x\le 1 \end{aligned}$$

that

$$\begin{aligned} f(x)=x-\frac{9}{10} x^{\frac{5}{3}}-\frac{4}{3} x^{\frac{3}{2}} +\frac{2}{3} \sqrt{x-1} +\frac{4}{3} x \sqrt{x-1}. \end{aligned}$$

In addition, the exact solution is \(u(x) = x\).

With using of Bernstein basis polynomials of degree 2, and \(M=5\), the results of obtained are presented in Table 2 and Fig. 3.

Table 2 Numerical results for Example 2
Fig. 3
figure 3

Diagrams of exact and numerical solutions and graph of error for Example 2

Example 3

Consider the equation:

$$\begin{aligned} u(x)-\int _{0}^{x} \dfrac{1}{{(x-t)}^{\frac{1}{2}}} u(t) {\mathrm{d}}t-\int _{0}^{1} \dfrac{1}{{(x-t)}^{\frac{1}{2}}} u(t) {\mathrm{d}}t=f(x) ,\quad \, 0<x\le 1, \end{aligned}$$

that

$$\begin{aligned} f(x)=\exp (x)\bigg (\hbox {erf}(\sqrt{x-1})\sqrt{\pi }-2 \hbox {erf}(\sqrt{x})\sqrt{\pi }+1\bigg ), \end{aligned}$$

and the exact solution is \(u(x)=\exp (x).\)

With using of Bernstein basis polynomials of degree 2, and \(M=5\), the results of obtained are presented in Table 3 and Fig. 4.

Table 3 Numerical results for Example 3
Fig. 4
figure 4

Diagrams of exact and numerical solutions and graph of error for Example 3

Conclusions

In this paper, we used of Galerkin method and Bernstein polynomials to solving one of the most important linear weakly singular Volterra–Fredholm integral equation, with using of Bernstein basis polynomials. We now begin the theoretical study with acquire of the variational form of Eq. (1), and with using of the system (9), we can obtain approximate solution. In section error analysis, we proved that B is a \(\mathbb{V}\)-ellipticity and Eq. (1) has a unique solution, and order of convergence is a \(O(h^{\zeta })\). In section Numerical Examples, we have solved three problems considered, the results obtained are presented in Tables 1, 2, and 3, and Figs. 2, 3, and 4, the comparison of results confirms the better accuracy with this method.