Minimize an integral of a function and its derivative I'm trying to find the function $x(t)$ that minimizes the quantity
$$\int_0^1 (x^2 +\dot{x}^2)dt$$
given that $x(0)=1$ and $x(1)$ is free (so I'm expecting the result to be a function of $x(1)$ itself).
I am however utterly lost on this. One could say that the smallest value the integral could take is $0$, and therefore solve $x^2 +\dot{x}^2 = 0 \Rightarrow \dot{x}^2 = -x^2$, but this is an ODE that I find particularly weird (and even if it does make sense, I have no idea how to solve it).
Any insight or solution would be greatly appreciated.

Note $J(x) = \int_0^1 x^2 + \dot{x}^2$.


*

*you can't solve the ODE because LHS is $\ge 0$ as RHS is $\le 0$, and $x(0) = 1$.

*the method here is to consider $$x(t) = x^*(t) + \epsilon f(t)$$
where $x^*(t)$ is the solution to your problem.
If $x(t)$ is another input, $x(0) = x^*(0)$ so $f(0) = 0$.


Now consider the asymptotic $\epsilon\to 0$:
$$x^2(t) = [x^*(t)]^2 + 2\epsilon f(t) x^*(t) + O(\epsilon^2)$$
$$[\dot x^*(t)]^2 + 2\epsilon \dot f(t) \dot x^*(t) + O(\epsilon^2)$$
$$J(x) = J(x^*) + 2\epsilon\int_0^1 [f x^* + \dot f \dot x^*]+O(\epsilon^2)$$ 
Now as $J$ is minimum for $x^*$:
$$
0=
\int_0^1 [f x^* + \dot f \dot x^*] =
\int_0^1 f x^* + [f\dot x^*]_0^1 - \int_0^1 f \ddot x^*
$$
you eventually get, taking every function $f$ such as $f(0) = f(1) = 0$:
$$
x^* - \ddot x^*  = 0
$$
You can express the solution as a function of $x^*(1)$, because $x^*(0) = 1$.
Of course you need to check that this is the solution, but here just take the steps backward and there should not be any problem.
