I have been asked to find the extremums for the functional$$\int \limits _0^1(x')^2+t^2\,dt$$subjected to$$\int \limits _0^1x^2\,dt=2,\quad x(0)=0,\quad x(1)=0,$$with $x=x(t)$ and $x'=x'(t)$.
Here,$$L(t,x,x')=(x')^2+t^2,$$$$L_\mu (t,x,x')=x^2.$$The Euler-Lagreange Equation to solve this is$$\frac{d}{dt}\left (\frac{\partial L}{\partial x'_i}\right )-\frac{\partial L}{\partial x_i}-\sum \limits _{\mu =1}^p\left (\lambda _\mu \left [\frac{d}{dt}\left (\frac{\partial L_\mu}{\partial x'_i}\right )-\frac{\partial L_\mu}{\partial x_i}\right ]-\frac{\partial L_\mu}{\partial x'_i}\frac{d\lambda_\mu}{dt}\right )=0,$$where $\lambda$ is the Lagrange Multiplier.
This gave me the equation$$\frac{d}{dt}(2x')-0-\lambda \left [\frac{d}{dt}(0)-2x\right ]-0=0$$$$2x''+2\lambda x=0,$$which is$$x''+\lambda x=0.$$Solving for $x_c$ gives me$$x_c(t)=e^{\sqrt{\lambda}t}=c_1\cos \left (\sqrt{\lambda}t\right )+c_2\sin \left (\sqrt{\lambda}t\right ),$$and when solving for $x_p$ I found$$x_p(t)=A\sin (t)+B\cos (t).$$This gives me $x'_p$ and $x''_p$:$$x'_p(t)=-A\cos (t)+B\sin (t),$$$$x''_p(t)=-A\sin (t)-B\sin (t).$$Plugging in gives me$$-A\sin (t)-B\sin (t)+\lambda (A\sin (t)+B\sin (t))=0$$$$(\lambda A-A)\sin (t)+(\lambda B-B)\cos (t)=0,$$this means that $\lambda A-A=0$ and $\lambda B-B=0$.$$A(\lambda -1)=0,\quad B(\lambda -1)=0.$$Both give me $\lambda =1$.
As well as $x_p(t)=0$, which leaves me with $x(t)=x_c(t)=c_1\cos (t)+c_2\sin (t)$.
Plugging in the initial values should remove the constants $c_1$ and $c_2$$$x(0)=0$$$$c_1\cos (0)+c_2\sin (0)=0$$$$c_1=0,$$leaving me with $x(t)=c_2\cos (t)$, but when using the second initial value, I end up with$$x(1)=0$$$$c_2\sin (1)=0,$$which gives me that $c_2=0$.
This means that $x(t)=0$.
What am I doing wrong here?
TL;DR: Yes, the zero solution that OP found is not correct. It violates the constraint for starters.
Well, let's roll up our sleeves and start from the beginning. The action functional reads $$S[x] ~=~\int_0^1 \! dt~\dot{x}^2 + \lambda \left(2 -\int_0^1 \! dt~x^2 \right),\tag{A}$$ where $\lambda$ is a Lagrange multiplier. The Euler-Lagrange (EL) equation becomes $$ \ddot{x}+\lambda x~=~0. \tag{B}$$ Keeping the Dirichlet boundary conditions in mind, the stationary solutions are of the form $$x_n(t)~=~A\sin(\pi n t), \qquad \lambda~=~(\pi n)^2, \qquad n~\in~\mathbb{N}_0.\tag{C}$$ The stationary solution with $n=0$ does not satisfy the constraint. The constraint becomes for $n>0$ $$2~=~\int_0^1 \! dt~x_n^2~=~\frac{A^2}{2} \qquad\Rightarrow\qquad A~=~\pm 2 .\tag{D}$$ So the stationary values become $$S[x_n] ~=~\int_0^1 \! dt~\dot{x}_n^2 ~=~ 2(\pi n)^2 , \qquad n~\in~\mathbb{N}.\tag{E}$$ The minimum corresponds to the stationary solutions with $n=1$ (with either sign on $A$).