1 Introduction

The Schrödinger (NLS) equation is one of the most important equations of mathematical physics with applications in many fields [14] such as plasma physics, nonlinear optics, water waves, and bimolecular dynamics. There are many studies on numerical approaches, including finite difference [511], finite element [1214], and polynomial approximation methods [15, 16], of the initial or initial-boundary value problems of the Schrödinger equations. We consider the initial-boundary value problem for the NLS equation involving a quintic term:

$$\begin{aligned} &i\frac{\partial u}{\partial t}+ \frac{\partial^{2} u}{\partial x^{2}}-\bigl( \vert u \vert ^{2}+ \vert u \vert ^{4}\bigr)u=f(x,t)u\quad (x_{l} < x < x _{r},0 < t \leq T), \end{aligned}$$
(1.1)
$$\begin{aligned} &u(x, 0)=u_{0}(x)\quad (x_{l} < x < x_{r}), \end{aligned}$$
(1.2)
$$\begin{aligned} &u(x_{l}, t)=u(x_{r}, t)=0\quad (0 < t \leq T), \end{aligned}$$
(1.3)

where \(u(x, t)\) is a complex function, \(f(x, t)\) is a real function, \(u_{0}(x)\) is a prescribed smooth function, and \(i^{2}=-1\).

Computing the inner product of equation (1.1) with u and \(\frac{\partial u}{\partial t}\) and then taking the imaginary part and the real part, respectively, the two conservative laws are obtained as follows:

$$\begin{aligned} &Q(t) = \Vert u \Vert ^{2}_{L_{2}}=Q(0), \end{aligned}$$
(1.4)
$$\begin{aligned} &E(t) = \biggl\Vert \frac{\partial u}{\partial x} \biggr\Vert ^{2}_{L_{2}}+ \int^{x_{r}}_{x _{l}}\biggl(\frac{1}{2} \vert u \vert ^{4}+\frac{1}{2} \vert u \vert ^{6}\biggr)\, \mathrm{d}x=E(0)- \int^{t } _{0} \int^{x_{r}}_{x_{l}}f(x,t)\frac{\partial }{\partial t} \vert u \vert ^{2} \,\mathrm{d}x\,\mathrm{d}t, \end{aligned}$$
(1.5)

where \(\|\cdot\|_{L_{2}}\) is the \({L_{2}}\) norm.

Zhang et al. found that the nonconservative schemes may easily show nonlinear blow-up when studying for NLS equation, so they presented a conservative difference scheme in [11]. Moreover, extensive mathematical and numerical studies have been carried out for the NLS equations in the literature [1728]. Zhang presented a difference scheme for the NLS equation involving a quintic term [27], and it was proved with order \(O({\tau }^{2}+h^{2})\). Then, in [28] Wang proposed a new difference scheme for NLS equation involving a quintic term and showed that convergence rates of the present scheme were of order \(O({\tau }^{2}+h ^{4})\). Wang presented a compact finite difference scheme for the NLS equation in [22], which provided a new thinking on the theoretical proving of a compact difference scheme. There are lots of literature works concerning the Schrödinger equations using different treatments, but, to the best of our knowledge, there are few results of unconditional maximum norm convergence of compact difference scheme for NLS equations involving a quintic term. Thus, the purpose of this paper is to prove maximum norm error estimates of a fourth-order compact difference scheme for the NLS equation involving a quintic term.

The remainder of this paper is organized as follows. A fourth-order compact difference scheme is proposed in Sect. 2. The discrete conservation laws of the difference scheme are discussed in Sect. 3. In Sect. 4, the convergence and stability for the compact difference scheme are proved. In the last section, numerical results will be discussed.

2 Some notations and compact finite difference scheme

For simplicity of exposition, some notations are firstly introduced. Thus, the following notations for difference operators are used:

$$\begin{aligned} &\delta_{t}u^{n}_{j}=\frac{u^{n}_{j}-u^{n-1}_{j}}{\tau }, \qquad \delta _{x}u^{n}_{j}=\frac{u^{n}_{j+1}-u^{n}_{j}}{h}, \qquad \delta_{\bar{x}}u^{n} _{j}=\frac{u^{n}_{j}-u^{n}_{j-1}}{h},\qquad u^{n+\frac{1}{2}}_{j}=\frac{u ^{n+1}_{j}+u^{n}_{j}}{2}, \\ &\delta^{2}_{x}u^{n}_{j}= \delta_{x}\delta_{\bar{x}}u^{n}_{j}= \frac{u ^{n}_{j-1}-2u^{n}_{j}+u^{n}_{j+1}}{h^{2}},\qquad A_{h}u^{n}_{j}=u^{n}_{j}+ \frac{h ^{2}}{12}\delta^{2}_{x}u^{n}_{j}= \frac{1}{12}\bigl(u^{n}_{j-1}+10u^{n}_{j}+u ^{n}_{j+1}\bigr), \end{aligned}$$

where \(h=\frac{x_{r}-x_{l}}{J}\) and \(\tau =\frac{T}{N}\) are step sizes of space and time, respectively, and J, N are two positive integers.

For any \(\pmb{u}, \pmb{v}\in V_{h}=\{\pmb{v}|\pmb{v}=(v_{0},v _{1},\ldots,v_{J}),v_{0}=v_{J}=0\}\), the inner product is defined as

$$ (\pmb{u},\pmb{v})=h\sum^{J-1}_{j=1}u_{j} \bar{v}_{j}. $$

The discrete norms of u are defined as

$$\begin{aligned} \Vert \pmb{u} \Vert ^{p}_{p}=h\sum ^{J-1}_{j=1} \vert u_{j} \vert ^{p},\qquad \Vert \delta_{x}\pmb{u} \Vert ^{2}=h\sum^{J-1}_{j=0} \vert \delta_{x}u_{j} \vert ^{2},\qquad \Vert \pmb{u} \Vert _{ \infty }=\max_{1\le j \le J-1} \vert u_{j} \vert . \end{aligned}$$

For simplicity, we define \(\{U^{n}_{j}\}\) as the exact solution and \(\{u^{n}_{j}\}\) as the numerical one. Let C denote a positive constant independent of discretization parameters, but it may have different values at different occurrences. For the exact solution of the initial-boundary value problem (1.1)–(1.3), we assume that

$$ \max \bigl\{ \bigl\Vert U^{n} \bigr\Vert , \bigl\Vert \delta_{x}U^{n} \bigr\Vert , \bigl\Vert U^{n} \bigr\Vert _{\infty }\bigr\} \leq C. $$
(2.1)

Now, we present the following compact finite difference scheme for problem (1.1)–(1.3):

$$\begin{aligned} &iA_{h}\delta_{t}u^{n}_{j}+ \frac{1}{2}\delta^{2}_{x}\bigl(u^{n+1}_{j}+u ^{n}_{j}\bigr) -\frac{1}{4}A_{h}\bigl[ \bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{2}+ \bigl\vert u^{n}_{j} \bigr\vert ^{2}\bigr) \bigl(u^{n+1} _{j}+u^{n}_{j}\bigr)\bigr] \\ &\quad {}-\frac{1}{6}A_{h}\bigl[\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{4}+ \bigl\vert u^{n+1}_{j} \bigr\vert ^{2} \bigl\vert u^{n}_{j} \bigr\vert ^{2}+ \bigl\vert u ^{n}_{j} \bigr\vert ^{4}\bigr) \bigl(u^{n+1}_{j}+u^{n}_{j}\bigr) \bigr]=A_{h}\biggl[f^{n+\frac{1}{2}}\frac{u ^{n+1}_{j}+u^{n}_{j}}{2}\biggr] \\ &\quad (j=1, 2, \ldots, J-1, n=1, 2, \ldots, N-1), \end{aligned}$$
(2.2)
$$\begin{aligned} &u^{n}_{0}=u^{n}_{J}=0\quad (n=1, 2, \ldots, N), \end{aligned}$$
(2.3)
$$\begin{aligned} &u^{0}_{J}=u_{0}(x_{j})\quad (j=1, 2, \ldots, J). \end{aligned}$$
(2.4)

Let

$$\begin{aligned} &\pmb{u}^{n}=\bigl(u^{n}_{0},u^{n}_{1}, \ldots,u^{n}_{J-1}\bigr)^{T}, \\ & \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}=\pmb{\operatorname{diag}}\bigl( \bigl\vert u^{n+1}_{0} \bigr\vert ^{2}+ \bigl\vert u ^{n}_{0} \bigr\vert ^{2},\ldots, \bigl\vert u^{n+1}_{J-1} \bigr\vert ^{2}+ \bigl\vert u^{n}_{J-1} \bigr\vert ^{2}\bigr). \end{aligned}$$

(2.2) can be rewritten as

$$\begin{aligned} &i\pmb{M}\delta_{t}\pmb{u}^{n}+\frac{1}{2} \delta^{2}_{x}\bigl(\pmb{u}^{n+1}+\pmb{u} ^{n}\bigr) -\frac{1}{4}\pmb{M}\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl(\pmb{u} ^{n+1}+\pmb{u}^{n}\bigr) \\ &\quad -\frac{1}{6}\pmb{M}\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2} \bigl\vert \pmb{u} ^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{4}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u}^{n}\bigr) =\pmb{M}f ^{n+\frac{1}{2}} \frac{\pmb{u}^{n+1}+\pmb{u}^{n}}{2}, \\ &\quad n=1, 2, \ldots, N-1, \end{aligned}$$

where the matrix M is defined by

$$ \pmb{M}=\frac{1}{12} \left ( \begin{matrix} 10 &1 &0 &\cdots &0 \\ 1 &10 &1 &\cdots &0 \\ &\ddots &\ddots &\ddots & \\ 0 &\cdots &0 &1 &10 \end{matrix} \right ) _{(J-1)\times (J-1)}. $$

\(\pmb{M}\) is a tridiagonal symmetric matrix, and there is a symmetric positive definite matrix \(\pmb{H}\) such that \(\pmb{H}=\pmb{M}^{-1}\). Thus, the compact finite difference scheme (2.2)–(2.4) can be rewritten as the following matrix equation:

$$\begin{aligned} &i\delta_{t}\pmb{u}^{n}+ \frac{1}{2}\pmb{H}\delta^{2}_{x}\bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr) -\frac{1}{4}\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr) \\ &\quad {}-\frac{1}{6}\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{4}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u}^{n}\bigr) =\pmb{f}^{n+\frac{1}{2}} \frac{\pmb{u} ^{n+1}+\pmb{u}^{n}}{2} \\ &\quad (n=1, 2, \ldots, N-1), \end{aligned}$$
(2.5)
$$\begin{aligned} &u^{n}_{0}=u^{n}_{J}=0\quad (n=1, 2, \ldots, N), \end{aligned}$$
(2.6)
$$\begin{aligned} &u^{0}_{J}=u_{0}(x_{j})\quad (j=0,1, 2, \ldots, J). \end{aligned}$$
(2.7)

3 Some useful lemmas and discrete conservation laws

Lemma 3.1

([29])

For any two mesh functions \(\pmb{u},\pmb{v}\in V_{h}\), there is

$$ h\sum^{J-1}_{j=1}\bigl(\delta^{2}_{x} u_{j}\bigr)\bar{v}_{j}=-h\sum^{J-1}_{j=1}( \delta_{x} u_{j}) (\delta_{x} \bar{v}_{j}). $$

Lemma 3.2

([22])

For any real symmetric positive definite matrices \(\pmb{H}\), we have

$$ \operatorname{Re}\bigl(\pmb{H}\delta^{2}_{x}\bigl(\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr),\pmb{u}^{n+1}-\pmb{u} ^{n}\bigr)=- \bigl( \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{R}\delta_{x}\pmb{u} ^{n} \bigr\Vert ^{2}\bigr), $$

where \(\pmb{R}\) is obtained by the Cholesky decomposition for \(\pmb{H}\), denoted as \(\pmb{R}= \operatorname{chol}(\pmb{H})\).

Theorem 3.1

The difference scheme (2.2)(2.4) is conservative in the sense

$$\begin{aligned} &Q^{n} = \bigl\Vert \pmb{u}^{n} \bigr\Vert =Q^{n-1}=\cdots =Q^{0}, \end{aligned}$$
(3.1)
$$\begin{aligned} &E^{n} = \bigl\Vert \pmb{R}\delta_{x} \pmb{u}^{n} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{4}_{4}+\frac{1}{3} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{6}_{6}+h \sum^{J-1}_{j=1}f^{n- \frac{1}{2}}_{j} \bigl\vert u^{n}_{j} \bigr\vert ^{2} \\ &\hphantom{E^{n}} =E^{n-1}+h\sum^{J-1}_{j=1} \bigl(f^{n- \frac{1}{2}}_{j}-f^{n-\frac{3}{2}}_{j}\bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2} \\ &\hphantom{E^{n}}=E^{0}+\sum^{n}_{l=1} \sum^{J-1}_{j=1}\bigl(f^{l-\frac{1}{2}}_{j}-f^{l- \frac{3}{2}}_{j} \bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}h, \end{aligned}$$
(3.2)

for \(n=1, 2, \ldots, N\), where \(Q^{n}\) is discrete mass, \(E^{n}\) is discrete energy.

Proof

Computing the inner product of (2.2) with \(\pmb{u}^{n+1}+\pmb{u} ^{n}\) and then taking the imaginary part, we obtain

$$ I_{1}+I_{2}-I_{3}-I_{4}=I_{5}, $$

where

$$\begin{aligned} &I_{1} =\operatorname{Im}\bigl(i\delta_{t}\pmb{u}^{n}, \pmb{u}^{n+1}+\pmb{u}^{n}\bigr)=\operatorname{Re}\bigl(\delta _{t} \pmb{u}^{n},\pmb{u}^{n+1}+\pmb{u}^{n}\bigr)= \frac{1}{\tau }\bigl( \bigl\Vert \pmb{u} ^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{2} \bigr), \\ &I_{2} =\frac{1}{2}\operatorname{Im}\bigl(\pmb{H}\delta^{2}_{x} \bigl(\pmb{u}^{n+1}+\pmb{u}^{n}\bigr),\pmb{u} ^{n+1}+ \pmb{u}^{n}\bigr)=-2\operatorname{Im}\bigl(\pmb{R}\delta_{x} \pmb{u}^{n+\frac{1}{2}},\pmb{R} \delta_{x}\pmb{u}^{n+\frac{1}{2}}\bigr)=0, \\ &I_{3} =\frac{1}{4}\operatorname{Im}\bigl(\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl(\pmb{u} ^{n+1}+\pmb{u}^{n}\bigr),\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr)=0, \\ &I_{4} =\frac{1}{6}\operatorname{Im}\bigl(\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u} ^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr),\pmb{u}^{n+1}+\pmb{u} ^{n}\bigr)=0, \\ &I_{5} =\frac{1}{2}\operatorname{Im}\bigl(\pmb{f}^{n+\frac{1}{2}}\bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr),\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr)=0. \end{aligned}$$

We can obtain

$$ \bigl\Vert \pmb{u}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{2}=0. $$

Then we have

$$ Q^{n}= \bigl\Vert \pmb{u}^{n} \bigr\Vert =Q^{n-1}=\cdots =Q^{0}. $$

Computing the inner product of (2.2) with \(\pmb{u}^{n+1}-\pmb{u} ^{n}\), and then taking the real part, we get

$$ I_{6}+I_{7}-I_{8}-I_{9}=I_{10}, $$

where

$$\begin{aligned} &I_{6} =\operatorname{Re}\tau \bigl(i\delta_{t}\pmb{u}^{n}, \delta_{t}\pmb{u}^{n}\bigr)=0, \\ &I_{7} =\frac{1}{2}\operatorname{Re}\bigl(\pmb{H}\delta^{2}_{x} \bigl(\pmb{u}^{n+1}+\pmb{u}^{n}\bigr),\pmb{u} ^{n+1}- \pmb{u}^{n}\bigr)=-\frac{1}{2}\bigl( \bigl\Vert \pmb{R} \delta_{x}\pmb{u}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2}\bigr), \\ &I_{8} =\frac{1}{4}\operatorname{Re}\bigl(\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl(\pmb{u} ^{n+1}+\pmb{u}^{n}\bigr),\pmb{u}^{n+1}- \pmb{u}^{n}\bigr)=\frac{1}{4}\bigl( \bigl\Vert \pmb{u} ^{n+1} \bigr\Vert ^{4}_{4}- \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{4}_{4}\bigr), \\ &I_{9} =\frac{1}{6}\operatorname{Re}\bigl(\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u} ^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr),\pmb{u}^{n+1}-\pmb{u} ^{n}\bigr) \\ &\hphantom{I_{9}}= \frac{1}{6}\bigl( \bigl\Vert \pmb{u}^{n+1} \bigr\Vert ^{6}_{6}- \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{6}_{6}\bigr), \\ &I_{10} =\frac{1}{2}\operatorname{Re}\bigl(\pmb{f}^{n+\frac{1}{2}}\bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr),\pmb{u}^{n+1}- \pmb{u}^{n}\bigr)=\frac{h}{2}\sum^{J-1}_{j=1}f^{n+ \frac{1}{2}} \bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{2}- \bigl\vert u^{n}_{j} \bigr\vert ^{2}\bigr). \end{aligned}$$

Let

$$ E^{n}= \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{4}_{4}+\frac{1}{3} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{6}_{6}+h\sum ^{J-1}_{j=1}f^{n- \frac{1}{2}}_{j} \bigl\vert u^{n}_{j} \bigr\vert ^{2}. $$

We can obtain

$$ E^{n}=E^{n-1}+h\sum^{J-1}_{j=1} \bigl(f^{n-\frac{1}{2}}_{j}-f^{n- \frac{3}{2}}_{j}\bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}. $$

Summing up for n, we have

$$ E^{n}=E^{0}+\sum^{n}_{l=1} \sum^{J-1}_{j=1}\bigl(f^{l-\frac{1}{2}}_{j}-f ^{l-\frac{3}{2}}_{j}\bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}h. $$

 □

4 Numerical analysis

To obtain the error estimate in the maximum norm, we need the following lemmas.

Lemma 4.1

(Discrete Sobolev’s inequality [30])

Suppose that \({u_{j}}\) is mesh functions. Given \(\varepsilon \geq 0 \), there exists a constant C dependent on ε such that

$$ \Vert u \Vert _{\infty } \leq \varepsilon \Vert \delta_{x}u \Vert +C \Vert u \Vert . $$

Lemma 4.2

(Gronwall’s inequality [30])

Suppose that the nonnegative mesh function \(\{ u^{n}|n=0, 1, 2, \ldots, N, N\tau =T\}\) satisfies the inequality

$$ u^{n}\leq A+\tau \sum^{n}_{l=1}B_{k}u^{k}, $$

where A and \(B_{k}\) (\(k=1, 2, \ldots, N, N\tau =T\)) satisfying the inequality are nonnegative constants. Then, for any \(0\leq n \leq N\), there is

$$ \bigl\Vert u^{n} \bigr\Vert _{\infty }\leq Ae^{2\tau \sum^{N}_{k=1}B_{k}}, $$

where τ is sufficiently small such that \(\tau ({\max }_{k=1, 2, \ldots, N} B_{k})\leq \frac{1}{2}\).

Lemma 4.3

([22])

For any real symmetric positive definite matrices \(\pmb{H}\), there exist two positive numbers \(C_{*}\) and \(C^{*}\) such that

$$ C_{*} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{2} \leq \bigl(\pmb{H}\pmb{u}^{n},\pmb{u}^{n}\bigr)\leq C ^{*} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{2}. $$

Theorem 4.1

Suppose that \(|f(x,t)|\leq M_{1}\), \(|f_{t}(x,t)|\leq M_{2}\), \(u_{0} \in H^{1}_{0} \), then, for any n (\(0\leq n\tau \leq T\)), the following estimates hold:

$$ \bigl\Vert \pmb{u}^{n} \bigr\Vert \leq C,\qquad \bigl\Vert \pmb{u}^{n} \bigr\Vert _{\infty }\leq C. $$

Proof

From (3.1), we have

$$ \bigl\Vert \pmb{u}^{n} \bigr\Vert \leq C. $$
(4.1)

From (3.2), we obtain

$$ \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2}+\frac{1}{2} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{4} _{4}+\frac{1}{3} \bigl\Vert \pmb{u}^{n} \bigr\Vert ^{6}_{6}+h\sum ^{J-1}_{j=1}f^{n- \frac{1}{2}}_{j} \bigl\vert u^{n}_{j} \bigr\vert ^{2} =E^{0}+\sum^{n}_{l=1}\sum ^{J-1}_{j=1}\bigl(f ^{l-\frac{1}{2}}_{j}-f^{l-\frac{3}{2}}_{j} \bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}h, $$

thus, we have

$$ \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2} \leq E^{0}+\sum^{n}_{l=1} \sum^{J-1}_{j=1}\bigl(f^{l-\frac{1}{2}}_{j}-f^{l-\frac{3}{2}}_{j} \bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}h-h \sum^{J-1}_{j=1}f^{n-\frac{1}{2}}_{j} \bigl\vert u^{n}_{j} \bigr\vert ^{2}. $$

On the one hand, from (4.1), we have

$$\begin{aligned} \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2} &\leq E^{0}+\sum^{n}_{l=1} \sum^{J-1}_{j=1}\bigl(f^{l-\frac{1}{2}}_{j}-f^{l-\frac{3}{2}}_{j} \bigr) \bigl\vert u^{n}_{j} \bigr\vert ^{2}h-h \sum^{J-1}_{j=1}f^{n-\frac{1}{2}}_{j} \bigl\vert u^{n}_{j} \bigr\vert ^{2} \\ &\leq \bigl\vert E^{0} \bigr\vert +M_{1}h\sum ^{J-1}_{j=1} \bigl\vert u^{n}_{j} \bigr\vert ^{2}+h\sum^{n}_{l=1} \sum^{J-1}_{j=1} \biggl\vert \biggl( \frac{\partial f}{\partial t}\biggr)_{(j,l+\theta)} \biggr\vert \cdot \bigl\vert u^{l}_{j} \bigr\vert ^{2} \\ & \leq C. \end{aligned}$$

On the other hand, from Lemma 4.3, we have

$$ \bigl\Vert \pmb{R}\delta_{x}\pmb{u}^{n} \bigr\Vert ^{2}=\bigl(\pmb{H}\delta_{x}\pmb{u}^{n}, \delta_{x}\pmb{u}^{n}\bigr)\geq C_{*} \bigl\Vert \delta_{x}\pmb{u}^{n} \bigr\Vert ^{2}. $$

Then we see that

$$ \bigl\Vert \delta_{x}\pmb{u}^{n} \bigr\Vert \leq C. $$
(4.2)

From (4.1)–(4.2) and Lemma 4.1, we obtain

$$ \bigl\Vert \pmb{u}^{n} \bigr\Vert _{\infty }\leq C. $$
(4.3)

 □

Suppose that the truncation error

$$ \pmb{r}^{n}=\bigl(r^{n}_{0},r^{n}_{1}, \ldots,r^{n}_{J-1}\bigr)^{T}\in V_{h}, $$

then we have

$$\begin{aligned} \pmb{r}^{n}={} &i \delta_{t}\pmb{U}^{n}+\frac{1}{2}\pmb{H} \delta^{2}_{x}\bigl(\pmb{U} ^{n+1}+ \pmb{U}^{n}\bigr) -\frac{1}{4}\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}\bigr) \bigl(\pmb{U} ^{n+1}+\pmb{U}^{n}\bigr) \\ &{}-\frac{1}{6}\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{U}^{n} \bigr\vert ^{2} \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U} ^{n} \bigr\vert ^{4}\bigr) \bigl( \pmb{U}^{n+1}+\pmb{U}^{n}\bigr) -\pmb{f}^{n+\frac{1}{2}} \frac{\pmb{U} ^{n+1}+\pmb{U}^{n}}{2}. \end{aligned}$$
(4.4)

According to Taylor’s expansion, the following can be easily obtained.

Lemma 4.4

Suppose that \(u_{0}(x)\in H^{1}_{0}\), \(u(x,t)\in C^{6,3}\), then we have

$$\begin{aligned} & \bigl\vert r^{n}_{j} \bigr\vert \leq O \bigl(h^{4}+\tau^{2}\bigr), \end{aligned}$$
(4.5)
$$\begin{aligned} & \bigl\vert \delta_{t} r^{n}_{j} \bigr\vert \leq O\bigl(h^{4}+\tau^{2}\bigr). \end{aligned}$$
(4.6)

Lemma 4.5

[[22]] For \(u=\{u^{0},u^{1},\ldots,u^{n},u^{n+1}\}\) and \(g=\{g^{0},g ^{1},\ldots,g^{n-1},g^{n}\}\), we have

$$ \Biggl\vert 2\tau \sum^{n}_{l=0}g^{l} \delta_{t}u^{l} \Biggr\vert \leq \bigl\vert u^{0} \bigr\vert ^{2}+\tau \sum ^{n}_{l=1} \bigl\vert u^{l} \bigr\vert ^{2}+ \bigl\vert u^{n+1} \bigr\vert ^{2}+ \bigl\vert g^{0} \bigr\vert ^{2}+\tau \sum ^{n-1}_{l=0} \bigl\vert \delta_{t}g^{l} \bigr\vert ^{2}+ \bigl\vert g^{n} \bigr\vert ^{2}. $$
(4.7)

Theorem 4.2

Suppose that the conditions of Theorem 4.1 and Lemma 4.4 are satisfied, then the numerical solution of scheme (2.2)(2.4) converges to the solution of problem (1.1)(1.3) with order \(O(h^{4}+\tau^{2})\) in the discrete \(\|\cdot \|_{\infty }\) norm.

Proof

Let

$$ \pmb{e}^{n}=\pmb{U}^{n}-\pmb{u}^{n}. $$

Subtracting (2.5) from (4.4), we obtain

$$\begin{aligned} \begin{aligned} \pmb{r}^{n}=i \delta_{t}\pmb{e}^{n}+\frac{1}{2}\pmb{H} \delta^{2}_{x}\bigl(\pmb{e} ^{n+1}+ \pmb{e}^{n}\bigr) -\frac{1}{4}\pmb{F}^{n}- \frac{1}{6}\pmb{G}^{n} -\pmb{f} ^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e}^{n}}{2}, \end{aligned} \end{aligned}$$
(4.8)

where

$$\begin{aligned} \begin{aligned}&\pmb{F}^{n}=\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U}^{n} \bigr\vert ^{2} \bigr) \bigl(\pmb{U}^{n+1}+\pmb{U} ^{n}\bigr)-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr), \\ &\pmb{G}^{n}=\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{U} ^{n} \bigr\vert ^{4}\bigr) \bigl( \pmb{U}^{n+1}+\pmb{U}^{n}\bigr) \\ &\hphantom{\pmb{G}^{n}=}{}-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{u}^{n+1}+ \pmb{u}^{n}\bigr), \\ &\pmb{F}^{n}=\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}\bigr) \bigl( \pmb{U}^{n+1}+\pmb{U} ^{n}\bigr)-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr) \\ &\hphantom{\pmb{F}^{n}}=\bigl[\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}\bigr)-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{2}\bigr)\bigr]\bigl(\pmb{U}^{n+1}+ \pmb{U}^{n}\bigr) \\ &\hphantom{\pmb{F}^{n}=}{}+\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{2} \bigr) \bigl(\pmb{e}^{n+1}+\pmb{e}^{n}\bigr) \\ &\hphantom{\pmb{F}^{n}}=\bigl[\bigl(\pmb{U}^{n+1}\bar{\pmb{e}}^{n+1}+ \pmb{e}^{n+1}\bar{\pmb{U}}^{n+1}\bigr)+\bigl(\pmb{U} ^{n}\bar{\pmb{e}}^{n}+\pmb{e}^{n}\bar{\pmb{U}}^{n}\bigr)\bigr]\bigl(\pmb{U}^{n+1}+\pmb{U} ^{n}\bigr)+\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \\ &\hphantom{\pmb{F}^{n}=}{}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2} \bigr) \bigl(\pmb{e}^{n+1}+\pmb{e} ^{n}\bigr). \end{aligned} \end{aligned}$$
(4.9)

Noting that \(F^{n}_{0}=F^{n}_{J}=0\), from (2.1), (4.9), and Theorem 4.1, we have

$$ \bigl\Vert \pmb{F}^{n} \bigr\Vert ^{2}\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr). $$
(4.10)

Similarly, we obtain

$$\begin{aligned}& \bigl\Vert \delta_{x}\pmb{F}^{n} \bigr\Vert ^{2}\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x} \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x} \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr), \end{aligned}$$
(4.11)
$$\begin{aligned}& \pmb{G}^{n}= \bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{U} ^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{U}^{n+1}+ \pmb{U}^{n}\bigr) \\& \hphantom{\pmb{G}^{n}=}{}-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u} ^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{4}\bigr) \bigl( \pmb{u}^{n+1}+\pmb{u} ^{n}\bigr) \\& \hphantom{\pmb{G}^{n}}= \bigl[\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{U} ^{n} \bigr\vert ^{4}\bigr)-\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{4}\bigr)\bigr] \\& \hphantom{\pmb{G}^{n}=}{}\times \bigl(\pmb{U}^{n+1}+ \pmb{U}^{n}\bigr) \\& \hphantom{\pmb{G}^{n}=}{}+\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{e}^{n+1}+ \pmb{e}^{n}\bigr) \\& \hphantom{\pmb{G}^{n}}= \bigl[\bigl( \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}+ \bigl\vert \pmb{U}^{n+1} \bigr\vert ^{2}\bigr) \bigl( \pmb{U}^{n+1}\bar{\pmb{e}} ^{n+1}+\pmb{e}^{n+1}\bar{\pmb{U}}^{n+1}\bigr)+\bigl( \bigl\vert \pmb{U}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{U} ^{n} \bigr\vert ^{2}\bigr) \bigl(\pmb{U}^{n}\bar{\pmb{e}}^{n}+ \pmb{e}^{n}\bar{\pmb{U}}^{n}\bigr) \\& \hphantom{\pmb{G}^{n}=}{}+ \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}\bigl( \pmb{U}^{n+1}\bar{\pmb{e}}^{n+1}+\pmb{e}^{n+1}\bar{\pmb{u}} ^{n+1}\bigr)+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2}\bigl(\pmb{U}^{n}\bar{\pmb{e}}^{n}+ \pmb{e}^{n}\bar{\pmb{u}} ^{n}\bigr)\bigr]\bigl( \pmb{U}^{n+1}+\pmb{U}^{n}\bigr) \\& \hphantom{\pmb{G}^{n}=}{}+\bigl( \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{4}+ \bigl\vert \pmb{u}^{n+1} \bigr\vert ^{2} \bigl\vert \pmb{u}^{n} \bigr\vert ^{2}+ \bigl\vert \pmb{u} ^{n} \bigr\vert ^{4}\bigr) \bigl(\pmb{e}^{n+1}+ \pmb{e}^{n}\bigr). \end{aligned}$$
(4.12)

Similarly, we obtain

$$\begin{aligned} &\bigl\Vert \pmb{G}^{n} \bigr\Vert ^{2}\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr), \end{aligned}$$
(4.13)
$$\begin{aligned} &\bigl\Vert \delta_{x}\pmb{G}^{n} \bigr\Vert ^{2}\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e} ^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x} \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x} \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr). \end{aligned}$$
(4.14)

Computing the inner product of (4.9) with \(e^{n+1}+e^{n}\) and taking the imaginary part, we have

$$\begin{aligned} &\operatorname{Im}\bigl(\pmb{r}^{n}, \pmb{e}^{n}+\pmb{e}^{n+1}\bigr) \\ &\quad = \operatorname{Im}\bigl(i \delta_{t}\pmb{e}^{n},\pmb{e} ^{n}+ \pmb{e}^{n+1}\bigr)+\operatorname{Im}\bigl(\pmb{H}\delta^{2}_{x} \bigl(\pmb{e}^{n}+\pmb{e}^{n+1}\bigr),\pmb{e} ^{n}+ \pmb{e}^{n+1}\bigr) -\frac{1}{2}\operatorname{Im}\bigl(\pmb{F}^{n}, \pmb{e}^{n}+\pmb{e} ^{n+1}\bigr) \\ &\qquad {}-\frac{1}{3}\operatorname{Im}\bigl(\pmb{G}^{n},\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr)-\frac{1}{2}\operatorname{Im}\bigl(\pmb{f} ^{n+\frac{1}{2}} \bigl(\pmb{e}^{n}+\pmb{e}^{n+1}\bigr),\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr). \end{aligned}$$
(4.15)

For each term on the right-hand side of (4.15), we bound them as follows:

$$ \operatorname{Im}\bigl(i\delta_{t}\pmb{e}^{n},\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr)=\frac{1}{\tau }\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\bigr). $$
(4.16)

As to the second term

$$ \operatorname{Im}\bigl(\pmb{H}\delta^{2}_{x}\bigl(\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr),\pmb{e}^{n}+\pmb{e} ^{n+1}\bigr)=4 \operatorname{Im}\bigl(\pmb{R}\delta_{x}\pmb{e}^{n+\frac{1}{2}},\pmb{R}\delta _{x}\pmb{e}^{n+\frac{1}{2}}\bigr)=0. $$
(4.17)

For the last three terms on the right-hand side of (4.15), by using the Cauchy–Schwarz inequality, we obtain

$$\begin{aligned} & \biggl\vert \frac{1}{2}\operatorname{Im}\bigl(\pmb{F}^{n}, \pmb{e}^{n}+\pmb{e}^{n+1}\bigr) \biggr\vert \leq \frac{1}{4}\biggl( \bigl\Vert \pmb{F}^{n} \bigr\Vert ^{2}+\frac{1}{2}\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e} ^{n+1} \bigr\Vert ^{2}\bigr)\biggr) \\ &\hphantom{\biggl\vert \frac{1}{2}\operatorname{Im}\bigl(\pmb{F}^{n}, \pmb{e}^{n}+\pmb{e}^{n+1}\bigr) \biggr\vert }\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr), \end{aligned}$$
(4.18)
$$\begin{aligned} & \biggl\vert \frac{1}{3}\operatorname{Im}\bigl(\pmb{G}^{n}, \pmb{e}^{n}+\pmb{e}^{n+1}\bigr) \biggr\vert \leq \frac{1}{6}\biggl( \bigl\Vert \pmb{G}^{n} \bigr\Vert ^{2}+\frac{1}{2}\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e} ^{n+1} \bigr\Vert ^{2}\bigr)\biggr) \\ &\hphantom{\biggl\vert \frac{1}{3}\operatorname{Im}\bigl(\pmb{G}^{n}, \pmb{e}^{n}+\pmb{e}^{n+1}\bigr) \biggr\vert }\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr), \end{aligned}$$
(4.19)
$$\begin{aligned} &\frac{1}{2}\operatorname{Im}\bigl(\pmb{f}^{n+\frac{1}{2}}\bigl(\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr),\pmb{e} ^{n}+\pmb{e}^{n+1}\bigr)\leq C\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr). \end{aligned}$$
(4.20)

For the term on the left-hand side of (4.15), we have

$$ \operatorname{Im}\bigl(\pmb{r}^{n},\pmb{e}^{n}+ \pmb{e}^{n+1}\bigr)\leq \frac{1}{2}\biggl( \bigl\Vert \pmb{r} ^{n} \bigr\Vert ^{2}+\frac{1}{2}\bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr)\biggr). $$
(4.21)

From (4.15)–(4.21), we can obtain

$$ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\leq \tau \bigl( \bigl\Vert \pmb{r}^{n} \bigr\Vert ^{2}+C\tau \bigl( \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}\bigr)\bigr). $$
(4.22)

Summing (4.22) up for n, we have

$$ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\leq \bigl[O \bigl(h^{4}+\tau^{2}\bigr)\bigr]^{2}+C\tau \sum ^{n}_{l=1}\bigl( \bigl\Vert \pmb{e}^{l} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{l+1} \bigr\Vert ^{2}\bigr). $$
(4.23)

When τ is small enough, it follows from Lemma 4.2 that

$$ \bigl\Vert \pmb{e}^{n} \bigr\Vert \leq O \bigl(h^{4}+\tau^{2}\bigr). $$
(4.24)

Computing the inner product of (4.8) with \(\delta_{t}\pmb{e} ^{n}\) and taking the real part, we have

$$\begin{aligned} \operatorname{Re}\bigl(\pmb{r}^{n}, \delta_{t}\pmb{e}^{n}\bigr)= {}&\operatorname{Re}\bigl(i \delta_{t}\pmb{e}^{n}, \delta_{t} \pmb{e}^{n}\bigr)+\frac{1}{2}\operatorname{Re}\bigl(\pmb{H} \delta^{2}_{x}\bigl(\pmb{e} ^{n}+ \pmb{e}^{n+1}\bigr),\delta_{t}\pmb{e}^{n}\bigr) - \frac{1}{4}\operatorname{Re}\bigl(\pmb{F}^{n}, \delta_{t} \pmb{e}^{n}\bigr) \\ &{}-\frac{1}{6}\operatorname{Re}\bigl(\pmb{G}^{n},\delta_{t} \pmb{e}^{n}\bigr)-\frac{1}{2}\operatorname{Re}\bigl(\pmb{f} ^{n+\frac{1}{2}} \bigl(\pmb{e}^{n}+\pmb{e}^{n+1}\bigr),\delta_{t} \pmb{e}^{n}\bigr). \end{aligned}$$
(4.25)

For each term on the right-hand side of (4.25), we bound them as follows:

$$ \operatorname{Re}\bigl(i\delta_{t}\pmb{e}^{n},\delta_{t} \pmb{e}^{n}\bigr)=0. $$
(4.26)

For the second term, it follows from Lemma 3.1 that

$$ \frac{1}{2}\operatorname{Re}\bigl(\pmb{H}\delta^{2}_{x}\bigl( \pmb{e}^{n}+\pmb{e}^{n+1}\bigr),\delta _{t} \pmb{e}^{n}\bigr)=\frac{-1}{2\tau }\bigl( \bigl\Vert \pmb{R} \delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert ^{2}\bigr). $$
(4.27)

As to the third term, it follows from (4.8) that

$$\begin{aligned} \begin{aligned} \delta_{t}\pmb{e}^{n}=i \frac{1}{2}\pmb{H}\delta^{2}_{x}\bigl( \pmb{e}^{n+1}+\pmb{e} ^{n}\bigr) -\frac{i}{4} \pmb{F}^{n}-\frac{i}{6}\pmb{G}^{n} -i \pmb{f}^{n+ \frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e}^{n}}{2}-i\pmb{r}^{n}. \end{aligned} \end{aligned}$$
(4.28)

By using the Cauchy–Schwarz inequality, we obtain

$$\begin{aligned} \operatorname{Re}\bigl(\pmb{F}^{n},\delta_{t} \pmb{e}^{n}\bigr)= {}&\frac{1}{2}\operatorname{Re}\biggl(\pmb{F}^{n},i \pmb{H} \delta^{2}_{x}\bigl(\pmb{e}^{n+1}+ \pmb{e}^{n}\bigr) -\frac{i}{4}\pmb{F}^{n}- \frac{i}{6}\pmb{G}^{n}-i\pmb{f}^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e} ^{n}}{2}-i \pmb{r}^{n}\biggr) \\ = {}&\frac{-1}{2}\operatorname{Im}\bigl(\pmb{F}^{n},\pmb{H} \delta^{2}_{x}\bigl(\pmb{e}^{n+1}+\pmb{e} ^{n}\bigr)\bigr)+\frac{1}{6}\operatorname{Im}\bigl(\pmb{F}^{n}, \pmb{G}^{n}\bigr) \\ &{}+\operatorname{Im}\biggl(\pmb{F}^{n},\pmb{f}^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e} ^{n}}{2} \biggr)+\operatorname{Im}\bigl(\pmb{F}^{n},\pmb{r}^{n}\bigr) \\ = {}&\frac{1}{2}\operatorname{Im}\bigl(\pmb{R}\delta_{x}\pmb{F}^{n}, \pmb{R}\delta_{x}\bigl(\pmb{e} ^{n+1}+\pmb{e}^{n} \bigr)\bigr)+\frac{1}{6}\operatorname{Im}\bigl(\pmb{F}^{n}, \pmb{G}^{n}\bigr) \\ &{}+\operatorname{Im}\biggl(\pmb{F}^{n},\pmb{f}^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e} ^{n}}{2} \biggr)+\operatorname{Im}\bigl(\pmb{F}^{n},\pmb{r}^{n}\bigr), \end{aligned}$$
(4.29)

where

$$\begin{aligned} &\operatorname{Im}\bigl(\pmb{R}\delta_{x} \pmb{F}^{n},\pmb{R}\delta_{x}\bigl(\pmb{e}^{n+1}+ \pmb{e} ^{n}\bigr)\bigr) \\ &\quad \leq \frac{1}{2}\biggl( \bigl\Vert \pmb{R}\delta_{x}\pmb{F}^{n} \bigr\Vert ^{2}+ \frac{1}{2}\bigl( \bigl\Vert \pmb{R}\delta_{x} \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta _{x}\pmb{e}^{n} \bigr\Vert ^{2}\bigr)\biggr) \\ &\quad \leq C_{1}\bigl( \bigl\Vert \delta_{x} \pmb{F}^{n} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \delta_{x}\pmb{e}^{n} \bigr\Vert ^{2} \bigr) \\ &\quad \leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta _{x}\pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert ^{2}\bigr), \\ &\operatorname{Im}\biggl(\pmb{F}^{n},\pmb{f}^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e} ^{n}}{2}\biggr) \\ &\quad \leq \frac{1}{2} \biggl( \bigl\Vert \pmb{F}^{n} \bigr\Vert ^{2}+\frac{M_{1}}{2}\bigl( \bigl\Vert \pmb{e} ^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\bigr)\biggr) \\ &\quad \leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\bigr), \\ &\operatorname{Im}\bigl(\pmb{F}^{n},\pmb{r}^{n}\bigr)\leq \frac{1}{2}\bigl( \bigl\Vert \pmb{F}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{r} ^{n} \bigr\Vert ^{2} \bigr)\leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{r} ^{n} \bigr\Vert ^{2}\bigr), \\ &\operatorname{Im}\bigl(\pmb{F}^{n},\pmb{G}^{n}\bigr)\leq \frac{1}{2}\bigl( \bigl\Vert \pmb{F}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{G} ^{n} \bigr\Vert ^{2} \bigr)\leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}\bigr). \end{aligned}$$

Then we have

$$ \operatorname{Re}\bigl(\pmb{F}^{n},\delta_{t}\pmb{e}^{n}\bigr) \leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e} ^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{r}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R} \delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert ^{2}\bigr). $$
(4.30)

Similarly, we obtain

$$\begin{aligned} &\operatorname{Re}\bigl(\pmb{G}^{n},\delta_{t}\pmb{e}^{n} \bigr)\leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e} ^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{r}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R} \delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert ^{2}\bigr), \end{aligned}$$
(4.31)
$$\begin{aligned} &\operatorname{Re}\biggl(\pmb{f}^{n+\frac{1}{2}}\frac{\pmb{e}^{n+1}+\pmb{e}^{n}}{2},\delta _{t} \pmb{e}^{n}\biggr) \\ &\quad \leq C\bigl( \bigl\Vert \pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{r} ^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e} ^{n} \bigr\Vert ^{2}\bigr). \end{aligned}$$
(4.32)

From (4.25)–(4.32), we can obtain

$$\begin{aligned}& \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}- \bigl\Vert \pmb{R}\delta_{x} \pmb{e}^{n} \bigr\Vert ^{2} \\& \quad \leq \tau C\tau \bigl( \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R} \delta_{x}\pmb{e}^{n+1} \bigr\Vert ^{2}\bigr))+\operatorname{Re}\bigl(\pmb{r}^{n}, \delta_{t}\pmb{e}^{n}\bigr)+ \tau \bigl[O \bigl(h^{4}+\tau^{2}\bigr)\bigr]^{2}. \end{aligned}$$
(4.33)

Summing (4.33) up for n, we obtain

$$\begin{aligned} \bigl\Vert \pmb{e}^{n} \bigr\Vert ^{2} \leq& C\tau \bigl[O\bigl(h^{4}+\tau^{2}\bigr) \bigr]^{2}+C\tau \sum^{n} _{l=1} \bigl( \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{l} \bigr\Vert ^{2}+ \bigl\Vert \pmb{R}\delta_{x}\pmb{e} ^{l+1} \bigr\Vert ^{2}\bigr)) \\ &{} +C\tau \sum ^{n}_{l=1}\operatorname{Re}\bigl(\pmb{r}^{l}, \delta_{t}\pmb{e} ^{l}\bigr). \end{aligned}$$
(4.34)

From Lemma 4.4 and Lemma 4.5, we have

$$ \Biggl\vert \tau \operatorname{Re}\sum^{n}_{l=1} \operatorname{Re}\bigl(\pmb{r}^{l},\delta_{t}\pmb{e}^{l}\bigr) \Biggr\vert \leq \bigl[O\bigl(h ^{4}+\tau^{2}\bigr) \bigr]^{2}. $$
(4.35)

Substituting (4.35) into (4.34) and applying the discrete Gronwall inequality when taking τ sufficiently small, we have

$$ \bigl\Vert \pmb{R}\delta_{x}\pmb{e}^{n} \bigr\Vert \leq \bigl[O\bigl(h^{4}+\tau^{2}\bigr)\bigr]. $$
(4.36)

Then, from Lemma 4.3, we have

$$ \bigl\Vert \delta_{x}\pmb{e}^{n} \bigr\Vert \leq \bigl[O\bigl(h^{4}+\tau^{2}\bigr)\bigr]. $$
(4.37)

From (4.2) and (4.34), and using Lemma 4.1, we have

$$ \bigl\Vert \pmb{e}^{n} \bigr\Vert _{\infty }\leq \bigl[O \bigl(h^{4}+\tau^{2}\bigr)\bigr]. $$
(4.38)

 □

Similarly, we can prove the stability of the difference solution.

Theorem 4.3

Under the conditions of Theorem 4.2, the solution of the difference scheme (2.2)(2.4) is unconditionally stable for initial data in the \(\|\cdot \|_{\infty }\) norm.

5 Numerical experiment

In this section, we consider the following problem:

$$\begin{aligned} &i\frac{\partial u}{\partial t}+\frac{\partial^{2} u}{\partial x^{2}}-\bigl( \vert u \vert ^{2}+ \vert u \vert ^{4}\bigr)u \\ &\quad =\bigl[4(x-2t)^{2}-e^{-2(x-2t)^{2}}-e ^{-4(x-2t)^{2}}\bigr]u\quad (-15 < x < 15,0< t \leq 1), \end{aligned}$$
(5.1)
$$\begin{aligned} &u(x, 0)=e^{-x^{2}+ix}\quad (-15 < x < 15), \end{aligned}$$
(5.2)
$$\begin{aligned} &u(-15, t)=u(15, t)=0\quad (0 < t \leq 1). \end{aligned}$$
(5.3)

An exact solution is given by

$$ u(x,t)=e^{-(x-2t)^{2}+i(x-3t)}. $$
(5.4)

For problems (5.1)–(5.3), we have the following CFD scheme:

$$\begin{aligned} &\frac{i}{\tau }A_{h} \bigl(u^{n+1}_{j}-u^{n}_{j}\bigr)+ \frac{1}{2}\delta^{2} _{x}\bigl(u^{n+1}_{j}+u^{n}_{j} \bigr) -\frac{1}{4}A_{h}\bigl[\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{2}+ \bigl\vert u ^{n}_{j} \bigr\vert ^{2}\bigr) \bigl(u^{n+1}_{j}+u^{n}_{j}\bigr)\bigr] \\ &\quad {}-\frac{1}{6}A_{h}\bigl[\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{4}+ \bigl\vert u^{n+1}_{j} \bigr\vert ^{2} \bigl\vert u^{n}_{j} \bigr\vert ^{2}+ \bigl\vert u ^{n}_{j} \bigr\vert ^{4}\bigr) \bigl(u^{n+1}_{j}+u^{n}_{j}\bigr) \bigr]=A_{h}\biggl[f^{n+\frac{1}{2}}\frac{u ^{n+1}_{j}+u^{n}_{j}}{2}\biggr] \\ &\quad (j=1, 2, \ldots, J-1, n=1, 2, \ldots, N-1), \end{aligned}$$
(5.5)
$$\begin{aligned} &u^{n}_{0}=u^{n}_{J}=0\quad (n=1, 2, \ldots, N), \end{aligned}$$
(5.6)
$$\begin{aligned} &u^{0}_{J}=u_{0}(x_{j})\quad (j=1, 2, \ldots, J). \end{aligned}$$
(5.7)

In order to obtain the numerical solution \(u^{n+1}_{j}\), an iterative algorithm can be used. We define the following iterative algorithm:

$$ A^{n+1(s)}_{j-1}u^{n+1(s+1)}_{j-1}+ B^{n+1(s)}_{j}u^{n+1(s+1)}_{j}+ C ^{n+1(s)}_{j+1}u^{n+1(s+1)}_{j+1}= D^{n+1(s)}_{j}, $$
(5.8)

where s denotes the number of iteration, and

$$\begin{aligned} &A^{n+1(s)}_{j-1}=\frac{i}{12}+\frac{r}{2}- \frac{\tau }{48}E^{n+1(s)} _{j-1}-\frac{\tau }{72}F^{n+1(s)}_{j-1}- \frac{\tau }{24}f^{n+ \frac{1}{2}}_{j-1}, \\ &C^{n+1(s)}_{j+1}=\frac{i}{12}+\frac{r}{2}- \frac{\tau }{48}E^{n+1(s)} _{j+1}-\frac{\tau }{72}F^{n+1(s)}_{j+1}- \frac{\tau }{24}f^{n+ \frac{1}{2}}_{j+1}, \\ &B^{n+1(s)}_{j}=\frac{5i}{6}-r-\frac{5\tau }{24}E^{n+1(s)}_{j}- \frac{5 \tau }{36}F^{n+1(s)}_{j}-\frac{5\tau }{12}f^{n+\frac{1}{2}}_{j}, \\ &D^{n+1(s)}_{j}= \biggl( \frac{i}{12}-\frac{r}{2}+\frac{\tau }{48}E^{n+1(s)} _{j-1}+\frac{\tau }{72}F^{n+1(s)}_{j-1}+ \frac{\tau }{24}f^{n+ \frac{1}{2}}_{j-1}\biggr)u^{n}_{j-1} \\ &\hphantom{D^{n+1(s)}_{j}=}{}+\biggl(\frac{5i}{6}+r+\frac{5\tau }{24}E^{n+1(s)}_{j}+ \frac{5\tau }{36}F ^{n+1(s)}_{j}+\frac{5\tau }{12}f^{n+\frac{1}{2}}_{j} \biggr)u^{n}_{j} \\ &\hphantom{D^{n+1(s)}_{j}=}{}+\biggl(\frac{i}{12}-\frac{r}{2}+\frac{\tau }{48}E^{n+1(s)}_{j+1}+ \frac{ \tau }{72}F^{n+1(s)}_{j+1}+\frac{\tau }{24}f^{n+\frac{1}{2}}_{j+1} \biggr)u ^{n}_{j+1}. \end{aligned}$$

The initial value of iteration \(u^{n+1(0)}_{j}=u^{n}_{j}\), when \(\|u^{n+1(s+1)}-u^{n+1(s)}\|_{\infty }\leq \varepsilon \), it is the end of iteration (this paper has \(\varepsilon =10^{-6}\)).

In order to compare the efficiency of CFD scheme with reference to the scheme in [27, 28], we give their schemes

$$\begin{aligned} &i\delta_{\hat{t}}u^{n}_{j}+ \frac{1}{2}\delta^{2}_{x}\bigl(u^{n+1}_{j}+u ^{n-1}_{j}\bigr) -\frac{1}{2} \bigl\vert u^{n}_{j} \bigr\vert ^{2}\bigl(u^{n+1}_{j}+u^{n-1}_{j} \bigr) \\ &\qquad {}- \frac{1}{6}\bigl[\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{4}+ \bigl\vert u^{n+1}_{j} \bigr\vert ^{2} \bigl\vert u^{n-1}_{j} \bigr\vert ^{2}+ \bigl\vert u ^{n-1}_{j} \bigr\vert ^{4}\bigr) \bigl(u^{n+1}_{j}+u^{n-1}_{j} \bigr)\bigr] \\ &\quad =\biggl[f^{n}\frac{u^{n+1}_{j}+u^{n-1}_{j}}{2}\biggr]\quad (j=1, 2, \ldots, J-1, n=1, 2, \ldots, N-1), \\ &i\delta_{t}u^{n}_{j}+ \frac{1}{24}\bigl[\bigl(-\delta^{2}_{x}u^{n+1}_{j-1}+14 \delta^{2}_{x}u^{n+1}_{j}- \delta^{2}_{x}u^{n+1}_{j+1}\bigr)+\bigl(- \delta^{2} _{x}u^{n}_{j-1}+14 \delta^{2}_{x}u^{n}_{j}- \delta^{2}_{x}u^{n}_{j+1}\bigr)\bigr] \\ &\qquad {} - \frac{1}{4}\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{2}+ \bigl\vert u^{n}_{j} \bigr\vert ^{2}\bigr) \bigl(u^{n+1}_{j}+u^{n}_{j}\bigr)- \frac{1}{6}\bigl[\bigl( \bigl\vert u^{n+1}_{j} \bigr\vert ^{4}+ \bigl\vert u^{n+1}_{j} \bigr\vert ^{2} \bigl\vert u ^{n}_{j} \bigr\vert ^{2}+ \bigl\vert u^{n}_{j} \bigr\vert ^{4}\bigr) \bigl(u^{n+1}_{j}+u^{n}_{j} \bigr)\bigr] \\ &\quad =\biggl[f^{n+ \frac{1}{2}}\frac{u^{n+1}_{j}+u^{n}_{j}}{2}\biggr], \\ &\quad (j=1, 2, \ldots, J-1, n=1, 2, \ldots, N-1). \end{aligned}$$

For convenience, we denote the one in [27] as Scheme 2, and the one in [28] as Scheme 3, respectively.

From Fig. 1 and Fig. 2, we can see that the numerical solution of the compact scheme and the exact solution are in good agreement. As shown in Table 1, the accuracy of CFD Scheme is higher than that of the other schemes. As indicated in Table 2, the CPU time of CFD Scheme has the same CPU time cost as that of Scheme 2 and Scheme 3 in computation. From Table 3, it is obvious that CFD Scheme is convergent in maximum norm, and the convergence order is \(O(h^{4}+\tau^{2})\). Figure 3 indicates that the two conservations of CFD Scheme are very good.

Figure 1
figure 1

The numerical solution with \(h=0.05\), \(\tau = 0.0025\)

Figure 2
figure 2

The exact solution with \(h=0.05\), \(\tau = 0.0025\)

Figure 3
figure 3

Discrete mass Q and energy E with \(h= 0.1\), \(\tau =0.01\)

Table 1 Comparison of the accuracy for the numerical solutions
Table 2 CPU time of the three schemes
Table 3 Errors and convergence order at difference steps

6 Conclusion

In this paper, a compact finite difference scheme is constructed for the nonlinear Schrödinger equation involving a quintic term. The discrete maximum norm error estimates show that the proposed schemes are in second and fourth order accurate in time and space, respectively. In numerical experiment, numerical results are carried out to confirm the theoretical analysis.