Find the extremals of the functional $$\text{J}(y)= y^2(1) + \int_0^1 y'^2(x)dx , \qquad y(0)=1.$$ Answer: $y(x)=1-\frac{1}{2}x$.
My solution:
$$ F (x,y,y')=y'^2(x).$$
After solving the Euler Lagrange equation we get $$\frac{\mathrm{d}}{\mathrm{d}x}(2y')=0.$$
Which implies that $$y=\frac{a}{2}x+b,$$ using initial value condition we get $b=1$. Could you please help me find value of $a$?
Your approach is correct, but it could be expressed more precisely. The first step is to replace the free boundary problem by a more familiar variational problem: find $$ M(c) = \inf\left\{\int_0^1 (y'(x))^2\,dx : y(0)=1, \ y(1)=c \right\}\tag{1} $$ Having found $M(c)$, you can minimize $c^2+M(c)$ over all $c\in\mathbb{R}$ and thus obtain the minimum of functional $J$.
The Euler-Lagrange equation for $(1)$ is $y''=0$, which leads to the minimizer $y(x) = 1+(c-1)x$ and subsequently $M(c) = (c-1)^2$.
Then $c^2+M(c) = c^2+(c-1)^2 $ is minimized at $ c= 1/2$, which delivers $\min J = 1/2$, attained by $y(x) = 1-x/2$.