# A Ritz-Galerkin approximation to the solution of parabolic equation with moving boundaries

## Abstract

The present paper is devoted to the investigation of a parabolic equation with moving boundaries arising in ductal carcinoma in situ (DCIS) model. Approximation solution of this problem is implemented by Ritz-Galerkin, which is a first attempt at tackling such problem. In process of dealing with this moving boundary condition, we use a trick of introducing two transformations to convert moving boundary to nonclassical boundary that can be handled with Ritz-Galerkin method. Also, existence and uniqueness are proved. Illustrative examples are included to demonstrate the validity and applicability of the technique in this paper.

## 1 Introduction

Ductal carcinoma in situ (DCIS) is isolated within the breast duct and has not spread to other parts of the breast. According to the appearance of the tumor cells proliferating within the duct, DCIS was classified into two types, comedo and noncomedo. The noncomedo-type DCIS tends to be less aggressive than the comedo types of DCIS. There are three common noncomedo types of DCIS: (1) Solid DCIS: cancer cells completely fill the affected ducts. (2) Cribiform DCIS: cancer cells do not completely fill the affected breast ducts; there are gaps between the cells. (3) Papillary DCIS: the cancer cells arrange themselves in a fern-like pattern within the affected breast ducts. The model for the growth of a tumor consisting of live cells was first proposed by Byrne and Chaplain [1, 2] (also see Friedman and Reitich [3]), which is in the form of a free boundary problem. After that, much research was developed (for more information, see [414]). In this paper, we describe the solid type of DCIS by an one-dimensional model. Assume the tumor to be within the interval $$[\varphi_{1}(t),\varphi_{2}(t)]$$ at each time t; the growing boundaries of the tumor are given by $$x=\varphi_{1}(t)$$ and $$x=\varphi_{2}(t)$$. Since tumor growth strongly depends upon the availability of nutrients, its diffusion through the growing material is introduced in the description of model. We model tumor growth by using the dimensionless nutrient concentration $$u(x,t)$$ that satisfies a reaction-diffusion equation. In this case, the model is simplified to the following parabolic equation:

$$\frac{\partial u}{\partial t} = \frac{\partial^{2}u}{\partial x^{2}}-\lambda(x)u(x,t), \quad \varphi_{1}(t)< x< \varphi_{2}(t), 0< t< 1,$$
(1.1)

with initial condition

$$u(x,0)=f(x), \quad\varphi_{1}(0)< x< \varphi_{2}(0),$$
(1.2)

boundary conditions

\begin{aligned}& u\bigl(\varphi_{1}(t),t\bigr)=g_{1}(t),\quad 0< t< 1, \end{aligned}
(1.3)
\begin{aligned}& u\bigl(\varphi_{2}(t),t\bigr)=g_{2}(t),\quad 0< t< 1, \end{aligned}
(1.4)

and compatibility conditions

\begin{aligned}& g_{1}(0)=f\bigl(\varphi_{1}(0)\bigr), \end{aligned}
(1.5)
\begin{aligned}& g_{2}(0)=f\bigl(\varphi_{2}(0)\bigr). \end{aligned}
(1.6)

Here $$\lambda(x)u(x,t)$$ denotes the nutrient consumption rate at the location x at time t. The problem is to determine $$u(x,t)$$ for given $$\lambda(x)$$, $$f(x)$$, $$\varphi_{1}(t)$$, $$\varphi_{2}(t)$$, $$g_{1}(t)$$, and $$g_{2}(t)$$.

So far, there are many publications about parabolic equations with fixed value boundary condition [15, 16], but to the best knowledge of the authors, this is the first time that Ritz-Galerkin method is used for moving boundary value problem presented here. Therefore, it is also significant mathematically.

The Ritz-Galerkin method in Bernstein polynomials basis is the method to convert a continuous operator problem to a discrete problem, which essentially converts the equation to a weak formulation, and then apply some constraints on the function space to characterize the space with a finite set of basis functions. It has been widely used in many areas of mathematics, especially in the field of numerical analysis [1721].

In this paper, we obtain the existence and uniqueness of the one-dimensional nutrient concentration DCIS model (1.1)-(1.6). Furthermore, this is the first time the Ritz-Galerkin method in Bernstein polynomials basis is employed to give an approximate solution of the parabolic equation with moving boundaries. Illustrative examples are included to demonstrate the validity and applicability of our technique.

The paper is divided as follows. In Section 2, we present an equivalent form of original problem. Section 3 is devoted to the existence and uniqueness of a solution. The properties of Bernstein polynomials are presented in Section 4. The numerical schemes for the solution of equations (5.1)-(5.6) are described in Section 5. Section 6 presents two test examples to support the new method. Finally, conclusions are made in Section 7.

## 2 Equivalent problems

In this section, we introduce two transformations to convert our problem (1.1)-(1.6) to two equivalent forms. Therefore, we may apply the Ritz-Gelerkin method to the second equivalent form to get approximation solution of problem.

Introduce the first transformation:

$$\xi=\frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi_{1}(t)}.$$
(2.1)

Then the variable $$x\in[\varphi_{1}(t),\varphi_{2}(t)]$$ makes $$\xi\in[0,1]$$.

Let

$$v(x,t)=u\bigl(\bigl(\varphi_{2}(t)-\varphi_{1}(t) \bigr)x+\varphi_{1}(t),t\bigr),\quad 0\leq x\leq1, t\geq0.$$
(2.2)

Then

\begin{aligned}& u(x,t)=v \biggl(\frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi_{1}(t)},t \biggr)=v(\xi,t), \end{aligned}
(2.3)
\begin{aligned}& \frac{\partial u}{\partial x}=\frac{\partial v}{\partial \xi}\cdot\frac{1}{\varphi_{2}(t)-\varphi_{1}(t)}, \end{aligned}
(2.4)
\begin{aligned}& \frac{\partial^{2} u}{\partial x^{2}}=\frac{\partial^{2} v}{\partial \xi^{2}}\cdot\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}, \end{aligned}
(2.5)
\begin{aligned}& \frac{\partial u}{\partial t}=\frac{\partial v}{\partial t}-\frac{\partial v}{\partial\xi}\cdot B(x,t), \end{aligned}
(2.6)

where

$$B(x,t)=\frac{\varphi_{1}^{\prime}(t)(\varphi_{2}(t)-\varphi_{1}(t))+ (x-\varphi_{1}(t))[\varphi_{2}^{\prime}(t)-\varphi_{1}^{\prime }(t)]}{(\varphi_{2}(t)-\varphi_{1}(t))^{2}}.$$
(2.7)

Under the first transformations (2.1), problem (1.1)-(1.6) becomes the first equivalent form as follows:

$$\frac{\partial v}{\partial t} =\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}\cdot \frac{\partial^{2}v}{\partial x^{2}}+ \widetilde{B}(x,t)\frac{\partial v}{\partial x}-\widetilde{\lambda}(x,t)v(x,t),\quad 0< x< 1, 0< t< 1,$$
(2.8)

with initial condition

$$v(x,0)=\widetilde{f}(x),\quad 0< x< 1,$$
(2.9)

boundary conditions

\begin{aligned}& v(0,t)= g(t), \quad 0< t< 1, \end{aligned}
(2.10)
\begin{aligned}& \int_{0}^{1}v(x,t)\,dx=\frac{E(t)}{\varphi_{2}(t)-\varphi_{1}(t)},\quad 0< t< 1, \end{aligned}
(2.11)

and compatibility conditions

\begin{aligned}& g(0)=f\bigl(\varphi_{1}(0)\bigr)=\widetilde{f}(0), \end{aligned}
(2.12)
\begin{aligned}& \int_{0}^{1}\widetilde{f}(x)\,dx= \frac{E(0)}{\varphi_{2}(0)-\varphi_{1}(0)}, \end{aligned}
(2.13)

where

\begin{aligned}& \widetilde{B}(x,t)=B\bigl(\varphi_{1}(t)+\bigl(\varphi_{2}(t)- \varphi_{1}(t)\bigr)x,t\bigr)= \frac{\varphi_{1}^{\prime}(t)+[\varphi_{2}^{\prime}(t)-\varphi _{1}^{\prime}(t)]x}{\varphi_{2}(t)-\varphi_{1}(t)}, \end{aligned}
(2.14)
\begin{aligned}& \widetilde{\lambda}(x,t)=\lambda\bigl(\varphi_{1}(t)+\bigl( \varphi_{2}(t)-\varphi _{1}(t)\bigr)x\bigr), \end{aligned}
(2.15)
\begin{aligned}& \widetilde{f}(x)=f\bigl(\bigl(\varphi_{2}(0)-\varphi_{1}(0) \bigr)x+\varphi_{1}(0)\bigr). \end{aligned}
(2.16)

In order to facilitate the application of the Ritz-Galerkin method, we introduce the second transformation:

$$H(x,t)=v(x,t)-(1-x)g_{1}(t)-x g_{2}(t).$$
(2.17)

Then

\begin{aligned}& \frac{\partial H}{\partial t}=\frac{\partial v}{\partial t}-(1-x)\frac{d (g_{1}(t))}{\partial t}-x \frac{d( g_{2}(t))}{\partial t}, \end{aligned}
(2.18)
\begin{aligned}& \frac{\partial H}{\partial x}=\frac{\partial v}{\partial x}+g_{1}(t)-g_{2}(t), \end{aligned}
(2.19)
\begin{aligned}& \frac{\partial^{2} H}{\partial x^{2}}=\frac{\partial^{2} v}{\partial x^{2}}. \end{aligned}
(2.20)

According to transformation (2.17) and equations (2.18)-(2.20), we have

\begin{aligned} &\frac{\partial H}{\partial t} =\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}\cdot \frac{\partial^{2}H}{\partial x^{2}}+ \widetilde{B}(x,t)\frac{\partial H}{\partial x}-\widetilde{\lambda}(x,t)H(x,t)+K(x,t), \\ &\quad 0< x< 1, 0< t< 1, \end{aligned}
(2.21)

with initial condition

$$H(x,0)=\widetilde{f}(x)-(1-x)g_{1}(0)-x g_{2}(0),\quad 0< x< 1,$$
(2.22)

boundary conditions

\begin{aligned}& H(0,t)= 0, \quad 0< t< 1, \end{aligned}
(2.23)
\begin{aligned}& H(1,t)=0,\quad 0< t< 1, \end{aligned}
(2.24)

and compatibility conditions

\begin{aligned}& H(0,0)= 0, \end{aligned}
(2.25)
\begin{aligned}& H(1,0)= 0, \end{aligned}
(2.26)

where

\begin{aligned} K(x,t)={}&\widetilde{B}(x,t) \bigl(g_{2}(t)-g_{1}(t) \bigr)-\widetilde{\lambda}(x,t) \bigl((1-x)g_{1}(t)+xg_{2}(t) \bigr) \\ &{}-(1-x)\frac{d( g_{1}(t))}{d t}-x\frac{d( g_{2}(t))}{d t}. \end{aligned}
(2.27)

From (2.2), (2.3), and (2.17) we obtain

$$H(x,t)=u\bigl(\bigl(\varphi_{2}(t)-\varphi_{1}(t) \bigr)x+\varphi _{1}(t),t\bigr)-(1-x)g_{1}(t)-xg_{2}(t)$$
(2.28)

and

$$u(x,t)=H \biggl(\frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi _{1}(t)},t \biggr)+ \biggl(1- \frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi _{1}(t)} \biggr)g_{1}(t)+ \frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi_{1}(t)}g_{2}(t).$$
(2.29)

## 3 Existence and uniqueness

In this section, the existence and uniqueness of a solution of problem (1.1)-(1.6) are discussed.

In order to facilitate the deduction of the problem, we need to make another transformation. Let

$$\eta= \int_{0}^{t}\bigl[\varphi_{2}(\tau)- \varphi_{1}(\tau)\bigr]^{-2}\,d\tau:=A(t)$$
(3.1)

and

$$t=\psi(\eta),$$
(3.2)

where ψ is the inverse of the mapping $$\eta=A(t)$$.

Setting

$$v(x,t)=w(x,\eta),$$
(3.3)

it follows from the chain rule that

\begin{aligned}& \frac{\partial v}{\partial t}=\frac{\partial w}{\partial \eta}\cdot\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}, \end{aligned}
(3.4)
\begin{aligned}& \frac{\partial v}{\partial x}=\frac{\partial w}{\partial x}, \end{aligned}
(3.5)
\begin{aligned}& \frac{\partial^{2} v}{\partial x^{2}}=\frac{\partial^{2} w}{\partial x^{2}}. \end{aligned}
(3.6)

Thus, problem (2.8)-(2.13) can be reduced to the following form:

$$\frac{\partial w(x,\eta)}{\partial\eta} =\frac{\partial^{2}w(x,\eta)}{\partial x^{2}}+\hat{B}(x,\eta) \frac{\partial w(x,\eta)}{\partial x}-\hat{\lambda}(x,\eta)w(x,\eta),\quad 0< x< 1, 0< t< T,$$
(3.7)

with initial condition

$$w(x,0)=\widetilde{f}(x),\quad 0< x< 1,$$
(3.8)

boundary conditions

\begin{aligned}& w(0,\eta)= g_{1}\bigl(\psi(\eta)\bigr), \quad 0< \eta< T, \end{aligned}
(3.9)
\begin{aligned}& w(1,\eta)=g_{2}\bigl(\psi(\eta)\bigr),\quad 0< \eta< T, \end{aligned}
(3.10)

and compatibility conditions

\begin{aligned}& w(0,0)=g_{1}(0)=\widetilde{f}(0)=f\bigl(\varphi_{1}(0) \bigr), \end{aligned}
(3.11)
\begin{aligned}& w(1,0)=g_{2}(0)=\widetilde{f}(1)=f\bigl(\varphi_{2}(0) \bigr), \end{aligned}
(3.12)

where

\begin{aligned}& \hat{B}(x,\eta)=\bigl[\varphi_{2}\bigl(\psi(\eta)\bigr)- \varphi_{1}\bigl(\psi(\eta )\bigr)\bigr]^{2}\tilde{B}\bigl(x, \psi(\eta)\bigr), \end{aligned}
(3.13)
\begin{aligned}& \hat{\lambda}(x,\eta)=\bigl[\varphi_{2}\bigl(\psi(\eta)\bigr)- \varphi_{1}\bigl(\psi(\eta )\bigr)\bigr]^{2}\tilde{\lambda} \bigl(x,\psi(\eta)\bigr), \end{aligned}
(3.14)
\begin{aligned}& T= \int_{0}^{1}\bigl[\varphi_{2}(\tau)- \varphi_{1}(\tau)\bigr]^{-2}\,d\tau. \end{aligned}
(3.15)

### Assumption

For the function $$F(x,\eta,w,p)$$, we shall assume the following:

1. (a)

The function $$F(x,\eta,w,p)$$ is defined and continuous on the set

$$\Omega=\bigl\{ (x,\eta,w,p)| (x,\eta)\in[0,1]\times[0,1],-\infty< w< \infty, - \infty< p< \infty\bigr\} ;$$
2. (b)

For each $$C>0$$ and for $$|w|,|p|< C$$, the function $$F(x,\eta,w,p)$$ is uniformly Hölder continuous in x and η for each compact subset of $$D_{T}=\{(x,\eta)| (x,\eta)\in(0,1)\times(0,1]\}$$;

3. (c)

There exists a constant $$C_{F}$$ such that

$$\bigl|F(x,\eta,w_{1},p_{1})\bigr|-\bigl|F(x,\eta,w_{2},p_{2})\bigr| \leq C_{F}\bigl[|w_{1}-w_{2}|+|p_{1}-p_{2}|\bigr]$$

for all $$(w_{i},p_{i})$$, $$i=1,2$$.

Applying the results of Cannon [22], p.351, Thm. 20.3.3, to the initial boundary value problem given by equations (3.7)-(3.12), we have the following theorem, which gives the existence and uniqueness of its solution.

### Theorem 1

Suppose that the function

$$F(x,\eta,w,p)=\hat{B}(x,\eta)p-\hat{\lambda}(x,\eta)w$$
(3.16)

satisfies the above assumption, $$\widetilde{f}(x)$$ is continuously differentiable, $$\widetilde{f}(x)$$ and $$\widetilde{f}'(x)$$ are bounded, $$g_{1}(\psi(\eta))$$ is continuously differentiable, and $$g_{2}(\psi(\eta))$$ is continuously differentiable. Then there exists a unique bounded solution $$w=w(x,\eta)$$ of initial boundary value problem (3.7)-(3.12). Moreover, this unique solution has a bounded continuous derivative with respect to x.

According to the relationship of functions $$u(x,t)$$, $$v(x,t)$$, and $$w(x,\eta)$$, we can easily get the following theorem.

### Theorem 2

Assume that

$$\lambda(x)\in C[0,1],\quad f(x)\in C^{1}\bigl[ \varphi_{1}(0),\varphi_{2}(0)\bigr],\quad g_{1}(t), g_{2}(t), \varphi _{1}(t), \varphi_{2}(t)\in C^{1}[0,1].$$
(3.17)

Then there exists a unique bounded solution $$u=u(x,t)$$ of initial boundary value problem (1.1)-(1.6). Moreover, this unique solution has a bounded continuous derivative with respect to x.

## 4 Bernstein polynomials and their properties

The general form of the Bernstein polynomials of mth degree proposed by Bhatti and Bracken [23] is defined on the interval $$[0,1]$$ as

$$B_{i,m}(x)=\frac{m!}{i!(m-i)!}x^{i}(1-x)^{m-i}, \quad 0\leq i\leq m.$$
(4.1)

It can easily be shown that all Bernstein polynomials are positive and that the sum of all Bernstein polynomials is unity for all real $$x\in[0,1]$$, that is,

$$\sum_{i=0}^{m}B_{i,m}(x)=1, \quad x\in[0,1].$$
(4.2)

Moreover, the Bernstein polynomials have the following properties:

\begin{aligned}& B_{i,m}(x)=(1-x)B_{i,m-1}(x)+x B_{i-1,m-1}(x), \end{aligned}
(4.3)
\begin{aligned}& B_{i,m-1}(x)=\frac{m-i}{m}B_{i,m}(x)+\frac{i+1}{m}B_{i+1,m}(x), \end{aligned}
(4.4)
\begin{aligned}& B^{\prime}_{i,m}(x)=m\bigl(B_{i-1,m-1}(x)- B_{i,m-1}(x)\bigr), \end{aligned}
(4.5)
\begin{aligned}& \int_{0}^{1}B_{i,m}(x)\,dx= \frac{1}{m+1}, \quad i=0,1,\ldots,m. \end{aligned}
(4.6)

Each kth-degree Bernstein basis function can be expressed in the mth-degree Bernstein basis functions (see [24]):

$$B_{i,k}(x)=\sum_{j=i}^{m-k+i} \frac {k!(m-k)!j!(m-j)!}{i!(k-i)!(j-i)!(m-k-j+i)!m!}B_{j,m}(x) \quad( i=0,1,\ldots ,k) \mbox{ for } k\leq m.$$
(4.7)

The set of Legendre polynomials, denoted by $$\{L_{k}(x),k=0,1,\dots\}$$ is orthogonal with respect to the weighting function $$\omega(x)=1$$ over the interval $$[0,1]$$. These polynomials satisfy the recurrence relation [25]

$$(k+1)L_{k+1}(x)=(2k+1) (2x-1)L_{k}(x)-k L_{k-1}(x),\quad k=1,2,\ldots,$$
(4.8)

with

$$L_{0}(x)=1,\qquad L_{1}(x)=2x-1.$$
(4.9)

It can be shown [26] that the Legendre polynomial $$L_{m}(x)$$ can be expressed in the mth-degree Bernstein basis $$B_{0,m}(x),B_{1,m}(x),\ldots,B_{m,m}(x)$$ as follows:

$$L_{m}(x)=\sum_{i=0}^{m}(-1)^{m+i} \frac{m!}{i!(m-i)!}B_{i,m}(x).$$
(4.10)

Thus, from (4.7) and (4.10) we can obtain that any given polynomial $$P_{m}(x)$$ of degree m can be expanded in the mth-degree Legendre and Bernstein base on $$x\in[0,1]$$:

$$P_{m}(x)=\sum_{k=0}^{m}l_{k}L_{k}(x)= \sum_{i=0}^{m}c_{i}B_{i,m}(x).$$
(4.11)

Let $$V=L^{2}[0,1]$$ be the vector space of real square-integrable functions on $$[0,1]$$ with inner product

$$\langle f,g\rangle= \int_{0}^{1}f(x)g(x)\,dx.$$
(4.12)

### Remarks

1. (1)

Space $$\operatorname{Span}\{L_{0}(x),L_{1}(x),\ldots,L_{m}(x)\} = \operatorname{Span}\{B_{0,m}(x),B_{1,m}(x),\ldots,B_{m,m}(x)\}:=Y \subset V$$ and $$B_{1,m}(x),B_{2,m}(x),\ldots,B_{m,m}(x)$$ are bases of the subspace Y of V.

2. (2)

Let $$f(x)\in V=L^{2}[0,1]$$. Then there exists a unique best approximation to $$f(x)$$ out of Y such that $$y_{0}(x)\in Y$$; that is, if $$y(x)\in Y$$, then

$$\bigl\| y_{0}(x)-f(x)\bigr\| \leq \bigl\| y(x)-f(x)\bigr\| ;$$
(4.13)

moreover,

$$y_{0}(x)=\sum_{k=0}^{m}c_{k}B_{k,m}=(c_{0},c_{1}, \ldots ,c_{m}) \bigl(B_{0,m}(x),B_{1,m}(x), \ldots,B_{m,m}(x)\bigr)^{T}:=C^{T}\phi,$$
(4.14)

where the coefficient matrix $$C^{T}$$ can be obtained by

$$C^{T}=\bigl\langle f,\phi^{T}\bigr\rangle \bigl\langle \phi,\phi^{T}\bigr\rangle ^{-1}.$$
(4.15)

## 5 Bernstein Ritz-Galerkin method

In this section, we apply the Ritz-Galerkin method to the second equivalent problem (2.21)-(2.26) in Section 2. Then an approximate solution of the original problem can be easily obtained by (2.29).

Consider the parabolic equation

\begin{aligned} &\frac{\partial H}{\partial t} =\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}\cdot \frac{\partial^{2}H}{\partial x^{2}}+ \widetilde{B}(x,t)\frac{\partial H}{\partial x}-\widetilde{\lambda}(x,t)H(x,t)+K(x,t), \\ &\quad 0< x< 1, 0< t< 1, \end{aligned}
(5.1)

with initial condition

$$H(x,0)=\widetilde{f}(x)-(1-x)g_{1}(0)-x g_{2}(0),\quad 0< x< 1,$$
(5.2)

boundary conditions

\begin{aligned}& H(0,t)= 0,\quad 0< t< 1, \end{aligned}
(5.3)
\begin{aligned}& H(1,t)=0, \quad 0< t< 1, \end{aligned}
(5.4)

and compatibility conditions

\begin{aligned}& H(0,0)= 0, \end{aligned}
(5.5)
\begin{aligned}& H(1,0)= 0, \end{aligned}
(5.6)

where

\begin{aligned}& \widetilde{\lambda}(x,t)=\lambda\bigl(\varphi_{1}(t)+\bigl( \varphi_{2}(t)-\varphi _{1}(t)\bigr)x\bigr), \end{aligned}
(5.7)
\begin{aligned}& \widetilde{f}(x)=f\bigl(\bigl(\varphi_{2}(0)-\varphi_{1}(0) \bigr)x+\varphi_{1}(0)\bigr), \end{aligned}
(5.8)
\begin{aligned}& \widetilde{B}(x,t)=B\bigl(\varphi_{1}(t)+\bigl(\varphi_{2}(t)- \varphi_{1}(t)\bigr)x,t\bigr)= \frac{\varphi_{1}^{\prime}(t)+[\varphi_{2}^{\prime}(t)-\varphi _{1}^{\prime}(t)]x}{\varphi_{2}(t)-\varphi_{1}(t)}, \end{aligned}
(5.9)
\begin{aligned}& \begin{aligned}[b] K(x,t)={}&\widetilde{B}(x,t) \bigl(g_{2}(t)-g_{1}(t) \bigr)-\widetilde{\lambda}(x,t) \bigl((1-x)g_{1}(t)+xg_{2}(t) \bigr) \\ &{}-(1-x)\frac{d( g_{1}(t))}{d t}-x\frac{d( g_{2}(t))}{d t}. \end{aligned} \end{aligned}
(5.10)

Let

$$F(H)=\frac{\partial H}{\partial t} -\frac{1}{[\varphi_{2}(t)-\varphi_{1}(t)]^{2}}\cdot \frac{\partial^{2}H}{\partial x^{2}}-\widetilde{B}(x,t)\frac{\partial H}{\partial x}+\widetilde{ \lambda}(x,t)H(x,t)-K(x,t)=0.$$
(5.11)

A Ritz-Galerkin approximation to (5.11) is constructed as follows. An approximate solution $$\widetilde{H}(x,t)$$ is sought in the form of the truncated series

$$\widetilde{H}(x,t)=H(x,0)\cdot \Biggl(\sum _{i=0}^{N}\sum_{j=0}^{M}k_{i,j} t B_{i,N}(x)B_{j,M}(t) +1 \Biggr),$$
(5.12)

where $$B_{i,N}(x)$$, $$B_{j,M}(t)$$ are Bernstein polynomials. From compatibility conditions (5.5)-(5.6) it is easy to see that the approximation solution $$\widetilde{H}(x,t)$$ satisfies the initial condition (5.2) and the boundary conditions (5.3) and (5.4).

Now the expansion coefficients $$k_{i,j}$$ are determined by the Galerkin equations

$$\bigl\langle F\bigl(\widetilde{H}(x,t)\bigr),B_{i,N}(x)B_{j,M}(t) \bigr\rangle =0 \quad(i=0,1,\ldots,N, j=0,1,\ldots,M),$$
(5.13)

where $$\langle\cdot,\cdot\rangle$$ denotes the inner product defined by

$$\bigl\langle F\bigl(\widetilde{H}(x,t)\bigr),B_{i,N}(x)B_{j,M}(t) \bigr\rangle = \int_{0}^{1} \int _{0}^{1}F\bigl(\widetilde{H}(x,t) \bigr)B_{i,N}(x)B_{j,M}(t)\,dt\,dx.$$
(5.14)

The Galerkin equations (5.13) give a system of $$(N+1)(M+1)$$ linear equations, which can be solved for the elements $$k_{i,j}$$ using mathematical software.

## 6 Numerical application

In this section, we perform two numerical examples with the Ritz-Galerkin methods described in previous sections. The validity and efficiency of our numerical scheme are demonstrated by comparing the approximate result with the exact solution.

### Example 1

Consider (1.1)-(1.6) with

\begin{aligned}& \lambda(x)=x, \end{aligned}
(6.1)
\begin{aligned}& \varphi_{1}(t)=0,\quad 0\leq t\leq1, \end{aligned}
(6.2)
\begin{aligned}& \varphi_{2}(t)=\frac{1}{2-t},\quad 0\leq t\leq1, \end{aligned}
(6.3)
\begin{aligned}& f(x)=e^{2x},\quad 0=\varphi_{1}(0)\leq x\leq \varphi_{2}(0)=\frac{1}{2}, \end{aligned}
(6.4)
\begin{aligned}& g_{1}(t)=e^{\frac{1}{3}t^{3}-2t^{2}+4t},\quad 0\leq t\leq1, \end{aligned}
(6.5)
\begin{aligned}& g_{2}(t)=e^{\frac{1}{3}t^{3}-2t^{2}+4t+1},\quad 0\leq t\leq1, \end{aligned}
(6.6)

which has the exact solution

$$u(x,t)=e^{x(2-t)+\frac{1}{3}t^{3}-2t^{2}+4t},$$
(6.7)

From (2.21)-(2.26) we obtain the following equivalent problem:

$$\frac{\partial H}{\partial t} =(2-t)^{2}\cdot \frac{\partial^{2}H}{\partial x^{2}}+ \frac{x}{2-t}\frac{\partial H}{\partial x}-\frac{x}{2-t}H(x,t)+K(x,t),\quad 0< x< 1, 0< t< 1,$$
(6.8)

with initial condition

$$H(x,0)=e^{x}-1+x(1-e),\quad 0< x< 1,$$
(6.9)

boundary conditions

\begin{aligned}& H(0,t)= 0,\quad 0< t< 1, \end{aligned}
(6.10)
\begin{aligned}& H(1,t)=0,\quad 0< t< 1, \end{aligned}
(6.11)

where

$$K(x,t)=e^{\frac{1}{3}t^{3}-2t^{2}+4t} \biggl(\frac {x(e-2+x-ex)}{2-t}-(t-2)^{2}(1-x+ex) \biggr).$$
(6.12)

From (2.2), (2.17), and (6.7) we can deduce that problem (6.8)-(6.11) has the exact solution

$$H(x,t)=e^{\frac{1}{3}t^{3}-2t^{2}+4t} \bigl(e^{x}-1+x(1-e) \bigr).$$
(6.13)

We applied the method presented in this paper with $$N=2$$, $$M=4$$ and solved equation (6.8).

From Galerkin equations (5.13) we have

$$\left \{ \textstyle\begin{array}{@{}l} k_{0,0}=4.026,\quad k_{0,1}=5.411,\quad k_{0,2}=7.706,\quad k_{0,3}=9.082,\quad k_{0,4}=9.311, \\ k_{1,0}=4.027, \quad k_{1,1}=5.406,\quad k_{1,2}=7.711,\quad k_{1,3}=9.077,\quad k_{1,4}=9.313, \\ k_{2,0}=4.024,\quad k_{2,1}=5.414,\quad k_{2,2}=7.701, \quad k_{2,3}=9.085, \quad k_{2,4}=9.310. \end{array}\displaystyle \right .$$
(6.14)

From equations (5.12) we can obtain the approximate solution $$\widetilde{H}(x,t)$$ of problem (6.8)-(6.11) as follows:

$$\widetilde{H}(x,t)=H(x,0)\cdot \Biggl(\sum _{i=0}^{N=2}\sum_{j=0}^{M=4}k_{i,j} t B_{i,N}(x)B_{j,M}(t) +1 \Biggr).$$
(6.15)

According to (2.29), we can get following corresponding approximate solution $$\widetilde{u}(x,t)$$ of problem (1.1)-(1.6):

$$\widetilde{u}(x,t)= \widetilde{H}\bigl((2-t)x,t\bigr)+ \bigl(1-(2-t)x\bigr)e^{\frac {1}{3}t^{3}-2t^{2}+4t}+(2-t)xe^{\frac{1}{3}t^{3}-2t^{2}+4t+1}.$$
(6.16)

Similarly, we can get approximate solutions of problems (6.8)-(6.11) and (1.1)-(1.6) for different values of N and M.

In Figure 1, the exact and approximate solutions of $$H(x,t)$$ with $$N=2$$, $$M=4$$ are plotted.

In Figure 2, the exact and approximate solutions of $$u(x,t)$$ with $$N=2$$, $$M=4$$ are plotted.

Table 1 and Table 2 present respectively the absolute error for $$H(x,t)$$ and $$u(x,t)$$ in Example 1 after using the method presented in this paper with different N and M.

Table 3 presents the $$L^{2}$$ norm errors for the functions $$H(x,t)-\widetilde{H}(x,t)$$ and $$u(x,t)-\widetilde{u}(x,t)$$ in Example 1 with different N and M.

### Example 2

In this example, we solve (1.1)-(1.6) with

\begin{aligned}& \lambda(x)=0, \end{aligned}
(6.17)
\begin{aligned}& \varphi_{1}(t)=\sin\biggl(\frac{\pi}{2} t\biggr), \quad 0\leq t \leq1, \end{aligned}
(6.18)
\begin{aligned}& \varphi_{2}(t)=1+\sin\biggl(\frac{\pi}{2} t\biggr),\quad 0\leq t \leq1, \end{aligned}
(6.19)
\begin{aligned}& f(x)=e^{x},\quad 0=\varphi_{1}(0)\leq x\leq \varphi_{2}(0)=1, \end{aligned}
(6.20)
\begin{aligned}& g_{1}(t)=e^{t+\sin(\frac{\pi}{2} t)}, \quad 0\leq t\leq1, \end{aligned}
(6.21)
\begin{aligned}& g_{2}(t)=e^{t+\sin(\frac{\pi}{2} t)+1},\quad 0\leq t\leq1, \end{aligned}
(6.22)

which has the exact solution

$$u(x,t)=e^{t+x},$$
(6.23)

From (2.21)-(2.26) we obtain the following equivalent problem:

$$\frac{\partial H}{\partial t} = \frac{\partial^{2}H}{\partial x^{2}}+\frac{\pi}{2} \cos \biggl(\frac{\pi}{2} t\biggr)\frac{\partial H}{\partial x}+K(x,t),\quad 0< x< 1, 0< t< 1,$$
(6.24)

with initial condition

$$H(x,0)=e^{x}-1+x(1-e),\quad 0< x< 1,$$
(6.25)

boundary conditions

\begin{aligned}& H(0,t)= 0,\quad 0< t< 1, \end{aligned}
(6.26)
\begin{aligned}& H(1,t)=0,\quad 0< t< 1, \end{aligned}
(6.27)

where

$$K(x,t)=e^{t+\sin(\frac{\pi}{2} t)} \biggl(\frac{\pi}{2} \cos\biggl( \frac{\pi}{2} t\biggr) (e-1)-\biggl(1+\frac{\pi}{2} \cos\biggl( \frac{\pi}{2} t\biggr)\biggr) (1-x+xe) \biggr).$$
(6.28)

From (2.2), (2.17), and (6.23) we deduce that problem (6.24)-(6.27) has the exact solution

$$H(x,t)=e^{t+\sin(\frac{\pi}{2} t)} \bigl(e^{x}-1+x(1-e) \bigr).$$
(6.29)

We applied the method presented in this paper with $$N=2$$, $$M=4$$ and solved equation (6.24).

From the Galerkin equations (5.13) we have

$$\left \{ \textstyle\begin{array}{@{}l} k_{0,0}=2.600,\quad k_{0,1}=3.321,\quad k_{0,2}=4.689,\quad k_{0,3}=6.159,\quad k_{0,4}=6.389, \\ k_{1,0}=2.600,\quad k_{1,1}=3.321,\quad k_{1,2}=4.690,\quad k_{1,3}=6.158,\quad k_{1,4}=6.390, \\ k_{2,0}=2.593,\quad k_{2,1}=3.336,\quad k_{2,2}=4.674,\quad k_{2,3}=6.167,\quad k_{2,4}=6.387. \end{array}\displaystyle \right .$$
(6.30)

From equations (5.12) we obtain the following approximate solution $$\widetilde{H}(x,t)$$ of problem (6.24)-(6.27):

$$\widetilde{H}(x,t)=H(x,0)\cdot \Biggl(\sum _{i=0}^{N=2}\sum_{j=0}^{M=4}k_{i,j} t B_{i,N}(x)B_{j,M}(t) +1 \Biggr).$$
(6.31)

According to (2.29), we get following corresponding approximate solution $$\widetilde{u}(x,t)$$ of the problem (1.1)-(1.6):

\begin{aligned}[b] \widetilde{u}(x,t)={}&\widetilde{H}\biggl(x-\sin\biggl( \frac{\pi t}{2} \biggr),t\biggr)+\biggl(1-\biggl(x-\sin\biggl( \frac{\pi t}{2} \biggr)\biggr)\biggr)e^{t+\sin(\frac{\pi t}{2} )}\\ &{}+\biggl(x-\sin\biggl( \frac{\pi t}{2} \biggr)\biggr)e^{t+\sin(\frac{\pi t}{2} )+1}. \end{aligned}
(6.32)

Similarly, we get approximate solutions of problems (6.8)-(6.11) and (1.1)-(1.6) for different values of N and M.

In Figure 3, the exact and approximate solutions of $$H(x,t)$$ with $$N=2$$, $$M=4$$ are plotted.

In Figure 4, the exact and approximate solutions of $$u(x,t)$$ with $$N=2$$, $$M=4$$ are plotted.

Table 4 and Table 5 present respectively the absolute errors for $$H(x,t)$$ and $$u(x,t)$$ in Example 2 after using the method presented in this paper with different N and M.

Table 6 present the $$L^{2}$$ norm error for the functions $$H(x,t)-\widetilde{H}(x,t)$$ and $$u(x,t)-\widetilde{u}(x,t)$$ in Example 2 with different N and M.

### Remark

In Example 2, we easily obtain

$$\bigl\| H(x,t)-\widetilde{H}(x,t) \bigr\| _{L^{2}(\Omega_{1})}= \bigl\| u(x,t)- \widetilde{u}(x,t) \bigr\| _{L^{2}(\Omega_{2})},$$
(6.33)

where

\begin{aligned} &\Omega_{1}:=[0,1]\times[0,1],\\ &\Omega_{2}:= \bigl[\varphi_{1}(t),\varphi_{2}(t) \bigr]\times[0,1]=\biggl[\sin\biggl(\frac{\pi t}{2}\biggr),1+\sin\biggl( \frac{\pi t}{2}\biggr)\biggr]\times[0,1]. \end{aligned}
(6.34)

In fact, we have

\begin{aligned} & \bigl\| u(x,t)-\widetilde{u}(x,t) \bigr\| _{L^{2}(\Omega_{2})} \\ &\quad= \int_{0}^{1} \int_{\varphi_{1}(t)}^{\varphi_{2}(t)}\bigl(u(x,t)-\widetilde {u}(x,t) \bigr)^{2}\,dx \,dt\quad \bigl(\mbox{applying equation } (2.29) \bigr) \\ &\quad= \int_{0}^{1} \int_{\varphi_{1}(t)}^{\varphi_{2}(t)} \biggl(H \biggl(\frac {x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi_{1}(t)},t \biggr)- \widetilde{H} \biggl(\frac{x-\varphi_{1}(t)}{\varphi_{2}(t)-\varphi _{1}(t)},t \biggr) \biggr)^{2} \,dx \,dt \\ &\quad= \int_{0}^{1} \int_{0}^{1}\frac{(H(x,t)-\widetilde {H}(x,t))^{2}}{\varphi_{2}(t)-\varphi_{1}(t)}\,dx \,dt\quad \bigl( \mbox{noting } \varphi_{2}(t)-\varphi_{1}(t)=1\bigr) \\ &\quad= \bigl\| H(x,t)-\widetilde{H}(x,t)\bigr\| _{L^{2}(\Omega_{1})}. \end{aligned}

## 7 Conclusion

In this paper, the Ritz-Galerkin method in Bernstein polynomial basis is implemented to obtain an approximate solution of a nonclassical parabolic equation subject to given initial and moving boundary conditions. Also, the existence and uniqueness of a solution are discussed. The properties of Bernstein polynomials and the Ritz-Galerkin method are first presented’ then the Ritz-Galerkin method is used to reduce the parabolic equation with moving boundaries to the solution of algebraic equations. Illustrative examples are included to demonstrate the validity and applicability of new numerical technique developed.

## References

1. Byrne, HM, Chaplain, MAJ: Growth of necrotic tumours in the presence and absence of inhibitors. Math. Biosci. 130, 151-181 (1995)

2. Byrne, HM, Chaplain, MAJ: Growth of necrotic tumours in the presence and absence of inhibitors. Math. Biosci. 135, 187-216 (1996)

3. Friedman, A, Reitich, F: Analysis of a mathematical model for the growth of tumours. J. Math. Biol. 38, 262-284 (1999)

4. Adam, JA, Bellomo, N: A Survey of Models for Tumour-Immune System Dynamics. Birkhäuser, Basel (1997)

5. Burton, AC: Rate of growth of solid tumours as a problem of diffusion growth. J. Math. Biol. 30, 157-176 (1966)

6. Franks, SJ, Byrne, HM, Mudhar, HS, Underwood, JC, Lewis, CE: Mathematical modelling of comedo ductal carcinoma in situ of the breast. Math. Med. Biol. 20, 277-308 (2003)

7. Greenspan, HP: Models for the growth of tumour by diffusion. Stud. Appl. Math. 52, 317-340 (1972)

8. Li, H, Zhou, J: Direct and inverse problem for the parabolic equation with initial value and time-dependent boundaries. Appl. Anal. (2015). doi:10.1080/00036811.2015.1064111

9. Xu, Y, Gilbert, R: Some inverse problems raised from a mathematical model of ductal carcinoma in situ. Math. Comput. Model. 49, 814-828 (2009)

10. Xu, Y: A free boundary problem model of ductal carcinoma in situ. Discrete Contin. Dyn. Syst., Ser. B 4(1), 337-348 (2004)

11. Xu, Y: A mathematical model of ductal carcinoma in situ and its characteristic stationary solutions. In: Begehr, H, et al. (eds.): Advances in Analysis. World Scientific, Hackensack (2005)

12. Xu, Y: A free boundary problem of diffusion equation with integral condition. Appl. Anal. 85(9), 1143-1152 (2006)

13. Xu, Y: A free boundary problem of parabolic complex equation. Complex Var. Elliptic Equ. 51(8-11), 945-951 (2006)

14. Xu, Y: An inverse problem for the free boundary model of ductal carcinoma in situ. In: Begehr, H, Nicolosi, F (eds.) More Progresses in Analysis, pp. 1429-1438. World Science Publisher, Singapore (2008)

15. Cannon, JR, Lin, Y Wang, S: Determination of source parameter in parabolic equations. Meccanica 27, 85-94 (1992)

16. Dehghan, M: Parameter determination in a partial differential equation from the overspecified data. Math. Comput. Model. 41, 196-213 (2005)

17. Bouziani, A, Merazga, N, Benamira, S: Galerkin method applied to a parabolic evolution problem with nonlocal boundary conditions. Nonlinear Anal. 69, 1515-1524 (2008)

18. Dehghan, M, Yousefi, SA, Rashedi, K: Ritz-Galerkin method for solving an inverse heat conduction problem with a nonlinear source term via Bernstein multi-scaling functions and cubic B-spline functions. Inverse Probl. Sci. Eng. 21, 500-523 (2013)

19. Rashedi, K, Adibi, H, Dehghan, M: Application of the Ritz-Galerkin method for recovering the spacewise-coefficients in the wave equation. Comput. Math. Appl. 65, 1990-2008 (2013)

20. Yousefi, SA, Barikbin, Z: Ritz-Galerkin method with Bernstein polynomial basis for finding the product solution form of heat equation with non-classic boundary conditions. Int. J. Numer. Methods Heat Fluid Flow 22, 39-48 (2012)

21. Yousefi, SA: Finding a control parameter in a one-dimensional parabolic inverse problem by using the Bernstein Galerkin method. Inverse Probl. Sci. Eng. 17(6), 821-828 (2009)

22. Cannon, JR: The One-Dimensional Heat Equation. Addison-Wesley, Menlo Park (1984)

23. Bhatti, MI, Bracken, P: Solution of differential equations in a Bernstein polynomial basis. J. Comput. Appl. Math. 205, 272-280 (2007)

24. Farouki, RT: Legendre-Bernstein basis transformations. J. Comput. Appl. Math. 119(1-2), 145-160 (2000)

25. Datta, KB, Mohan, BM: Orthogonal Functions in Systems and Control. World Scientific, River Edge (1995)

26. Li, YM, Zhang, XY: Basis conversion among Bézier, Tchebyshev and Legendre. Comput. Aided Geom. Des. 15, 637-642 (1998)

## Acknowledgements

The present investigation was supported in part by the National Natural Science Foundation of the People’s Republic of China under grant numbers 11201070 and the Science Research Fund of Department of Guangdong Province of the People’s Republic of China under grant numbers Yq2013161.

## Author information

Authors

### Corresponding author

Correspondence to Heng Li.

### Competing interests

The authors declare that they have no competing interests.

### Authors’ contributions

Both authors contributed equally and significantly in writing this article. Both authors read and approved the final manuscript.

## Rights and permissions

Reprints and permissions

Zhou, J., Li, H. A Ritz-Galerkin approximation to the solution of parabolic equation with moving boundaries. Bound Value Probl 2015, 236 (2015). https://doi.org/10.1186/s13661-015-0503-5