# variational problem

The variational problem is following:

$$J[u,x] = \int _{ t _{ 0 } } ^{ t _{ 1 } } u \left( x \left( t \right) , t \right) {\text{d}t}$$

So how to calculate the $$\delta J$$ ?

I am new to this subject, and one immature thought is:

\begin{aligned}\delta J & = \int _{ t _{ 0 } } ^{ t _{ 1 } } \left( u + \delta u \right) \left[ x + \delta x , t \right] - u \left( x , t \right) {\text{d}t} \\ & = \int _{ t _{ 0 } } ^{ t _{ 1 } } \left( \frac{ \partial u }{ \partial x } \delta x + \delta u \right) {\text{d}t}\end{aligned}

I don't know how to handle the $$\delta u$$

Your reasoning is correct, you just need to unpack the notation a bit. You have shown that $$\delta J[u,x](\delta u, \delta x) = \int_{t_0}^{t_1}u'(x(t),t)\delta x(t) + \delta u(x(t),t)~dt.$$ You can think of this as a directional derivative in the direction $$(\delta u,\delta x)$$. Since $$J$$ depends on two functions, it makes sense that the directional derivative will contain terms relating to the perturbation in each input, both $$u$$ and $$x$$.