1 Introduction

Variational principle plays a key role in both numerical and analytical analyses of a practical problem, it suggests an energy conservation for the whole solution domain, and a variational-based numerical algorithm guarantees the energy conservation at each point, while a variational-based analytical solution is an optimal one for a given trial-solution and valid for the whole solution domain.

Recently Recio et al. [1] studied the following equation

$$ u_{t} + (f(u)u_{xxx} + g(u)u_{x} )_{x} + h(u) = 0 $$
(1)

where f, g and h are functions of u.

Equation (1) can describe a thin film problem, which can be found widely applications in electrochemistry [2], cell culture [3], fiber fabrication [4], nanoscale adhesion [5], coating [6], wetting [7] and micro/nano devices [8]. Many analytical methods and numerical methods were applied to study such problems [9,10,11,12,13,14,15]. This paper aims at establishing a variational formulation for Eq. (1) by the semi-inverse method [16,17,18,19,20,21,22,23,24,25,26,27].

2 The semi-inverse method and the variational formulation

The semi-inverse method [16,17,18,19] is to establish a variational principle directly from governing equations. In order to effectively use the method, we write Eq. (1) in a conservation form

$$ u_{t} + \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]_{x} = 0 $$
(2)

where F, G and H satisfy the following relationships

$$ (F(u))_{xxx} = f(u)u_{xxx} $$
(3)
$$ (G(u))_{x} = g(u)u_{x} $$
(4)
$$ (H(u))_{u} = h(u) $$
(5)

According to Eq. (2), we can introduce a special function \( \varphi \), satisfying the following relations

$$ \frac{\partial \varphi }{\partial x} = u $$
(6)
$$ \frac{\partial \varphi }{\partial t} = - \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right] $$
(7)

The defined special function (\( \varphi \)) is potential-like function. By the semi-inverse method [16,17,18,19], we can establish a trial functional in the form

$$ J(u,\varphi ) = \iint {\left\{ {u\varphi_{t} + \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]\varphi_{x} + \sigma } \right\}}dxdt $$
(8)

where \( \sigma \) is an unknown function of u and its derivatives. The advantage of the above trial-functional is the stationary condition with respect to \( \varphi \) is Eq. (2), but we can not identify \( \sigma \), so we modify Eq. (8) in the form

$$ J(u,\varphi ) = \iint {\left\{ {au\varphi_{t} + b\varphi_{x} \varphi_{t} + \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]\varphi_{x} + \sigma } \right\}}dxdt $$
(9)

where a and b are constants to be further determined.

The Euler–Lagrange equations of Eq. (9) are

$$ - au_{t} - 2b\varphi_{xt} - \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]_{x} = 0 $$
(10)
$$ a\varphi_{t} - \frac{\partial F}{\partial u}\varphi_{xxxx} - \frac{\partial G}{\partial u}\varphi_{xx} + \frac{\partial H}{\partial u}\varphi_{x} + \frac{\delta \sigma }{\delta u} = 0 $$
(11)

where \( \delta \sigma /\delta u \) is the variational derivative. In this paper it can be written in the form

$$ \frac{\delta \sigma }{\delta u} = \frac{\partial \sigma }{\partial u} - \frac{\partial }{\partial x}(\frac{\partial \sigma }{{\partial u_{x} }}) - \frac{{\partial^{3} }}{{\partial x^{3} }}(\frac{\partial \sigma }{{\partial u_{xxx} }}) $$
(12)

In view of Eq. (6), we can write Eq. (10) in the form

$$ (a + 2b)u_{t} + \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]_{x} = 0 $$
(13)

which should be Eq. (2), so we have

$$ {\text{a}} + 2{\text{b}} = 1 $$
(14)

In view of Eqs. (6) and (7), we can write Eq. (11) in the form

$$ - a\left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right] - fu_{xxx} - gu_{x} + hu + \frac{\delta \sigma }{\delta u} = 0 $$
(15)

or

$$ - a\left[ {f(u)u_{xxx} + g(u)u_{x} + H(u)} \right] - fu_{xxx} - gu_{x} + hu + \frac{\delta \sigma }{\delta u} = 0 $$
(16)

In order to identify \( \sigma \) in Eq. (16), we set

$$ {\text{a}} = - 1 $$
(17)

Equation (16) becomes

$$ \frac{\delta \sigma }{\delta u} = - H(u) - h(u)u $$
(18)

From Eq. (18) we can determine \( \sigma \) easily, which satisfies the following relation

$$ \frac{\partial \sigma }{\partial u} = - H(u) - h(u)u $$
(19)

We, therefore, obtain the following variational formulation

$$ J(u,\varphi ) = \iint {\left\{ { - u\varphi_{t} + \varphi_{x} \varphi_{t} + \left[ {(F(u))_{xxx} + (G(u))_{x} + H(u)} \right]\varphi_{x} + \sigma } \right\}}dxdt $$
(20)

where \( \sigma \) is defined in Eq. (19).

Remark

if a = 1 as suggested in Eq. (8), we have difficulty in identifying \( \sigma \) from Eq. (16).

3 An example

We consider a special case of Eq. (1)

$$ u_{t} + (u_{xxx} + uu_{x} )_{x} + u^{2} = 0 $$
(21)

Hereby \( f(u) = 1 \), \( g(u) = u \),\( h(u) = u^{2} \), \( F(u) = u \),\( G(u) = \frac{1}{2}u^{2} \), \( H(u) = \frac{1}{3}u^{3} \), and

$$ \frac{\partial \varphi }{\partial x} = u $$
(22)
$$ \frac{\partial \varphi }{\partial t} = - (u_{xxx} + uu_{x} + \frac{1}{3}u^{3} ) $$
(23)
$$ \frac{\partial \sigma }{\partial u} = - H(u) - h(u)u = - \frac{1}{3}u^{3} - u^{3} = - \frac{4}{3}u^{3} $$
(24)

From Eq. (24) \( \sigma \) can be identified as

$$ \sigma = - \frac{1}{3}u^{4} $$
(25)

We, therefore, obtain the following variational principle for Eq. (21):

$$ J(u,\varphi ) = \iint {\left\{ { - u\varphi_{t} + \varphi_{x} \varphi_{t} + \left[ {u_{xxx} + \frac{1}{2}(u^{2} )_{x} + \frac{1}{3}u^{3} } \right]\varphi_{x} - \frac{1}{3}u^{4} } \right\}}dxdt $$
(26)

which is subject to the constraint of Eq. (22).

Proof

The stationary conditions of Eq. (26) with respect to \( \varphi \) and u are

$$ u_{t} - 2\varphi_{xt} - \left[ {u_{xxx} + \frac{1}{2}(u^{2} )_{x} + \frac{1}{3}u^{3} } \right]_{x} = 0 $$
(27)
$$ - \varphi_{t} - \varphi_{xxxx} - u\varphi_{xx} + u^{2} \varphi_{x} - \frac{4}{3}u^{3} = 0 $$
(28)

In view of Eq. (22), we find Eqs. (27) and (28) are equivalent to Eq. (21) and Eq. (23), respectively.

4 Discussion and conclusion

A suitable construction of a trial functional is of great importance for the establishment of a variational principle. Equation (8) does not work, because if we set a = 1, Eq. (16) becomes

$$ - \left[ {f(u)u_{xxx} + g(u)u_{x} + H(u)} \right] - fu_{xxx} - gu_{x} + hu + \frac{\delta \sigma }{\delta u} = 0 $$
(29)

or

$$ - 2f(u)u_{xxx} - 2g(u)u_{x} - H(u) + hu + \frac{\delta \sigma }{\delta u} = 0 $$
(30)

In Eq. (30), we have difficulty in identification of \( \sigma \) due to the terms involving \( u_{xxx} \) and \( u_{x} \).

We can easily determine \( \sigma \) for all even-order derivatives from the following equation

$$ \frac{\delta \sigma }{\delta u} = m(u) + \alpha u_{xx} + \beta u_{xxxx} { + }\delta u_{xxxxxx} $$
(31)

where \( \alpha \), \( \beta \), and \( \delta \) are constants, m is a function of u. From Eq. (31) \( \sigma \) can be determined as

$$ \sigma = M(u) - \frac{1}{2}\alpha (u_{x} )^{2} + \frac{1}{2}\beta (u_{xx} )^{2} - \frac{1}{2}\delta (u_{xxx} )^{2} $$
(32)

where M is defined as

$$ \frac{\partial M}{\partial u} = m $$
(33)

In this paper, we find that the semi-inverse method provides an effective tool to finding a needed variational principle for a practical problem, the derivation process is explained step by step, so that it can be easily followed. Recently Wang et al. [27] successfully applied the semi-inverse method to fractal calculus [28, 29], and obtained a variational principle for wave traveling in a fractal space.

The variational principle is a foundation of the variational iteration method [30, 31], which is now widely applied in fractional calculus, and the present paper might give a hint for an effective identification of Lagrange multiplier in the fractional variational iteration method [30,31,32,33,34,35,36].