I can't find the error.
$$H=L_2[-1,1], \; w(t)=t^2 ~- \text{weight function}, \; x_1(t)=1, \; x_2(t)=t^2,\; x_3(t)=t^4, \\ x_0=\cos(t).$$
It is necessary to find the best approximation for $x_0$.
I used formulas:
$\langle x,y \rangle=\int\limits_{-1}^{1} w(t)x(t)y(t)dt$,
$\|x\|=\sqrt{\int\limits_{-1}^{1} w(t)x^2(t)dt}$;
$e_1(t)=\dfrac{ x_1(t)}{ \|x_1(t)\|}$, $e_2(t)=\dfrac{g_2(t)}{\|g_2(t)\|}$, $e_3(t)=\dfrac{g_3(t)}{\|g_3(t)\|}$;
$g_2(t)=x_2(t)-\alpha_{21}e_1(t)$, $g_3(t)=x_3(t)-\alpha_{31}e_1(t)-\alpha_{32}e_2(t)$;
$\alpha_{21}=\langle x_2(t), e_1(t) \rangle$, $\alpha_{31}=\langle x_3(t), e_1(t) \rangle$;, $\alpha_{32}=\langle x_3(t), e_2(t) \rangle$;
$x_0 \approx y(t)=\sum\limits_{k=1}^3 c_ke_k(t)$, $c_k=\langle x_0, e_k \rangle$;
My result (with 3 significant figures):
$e_1=1.22$, $e_2=4.65t^2-2.77$, $e_3=270t^4-305t^2+66$ ;
$g_2(t)=t^2-0.596$, $g_3(t)=t^4-1.13t^2+0.245$;
$\alpha_{21}=0.488$, $\alpha_{31}=0.349$, $\alpha_{32}=0.242$;
$c_1=0.583$, $c_2=-0.0879$, $c_3=-0.480$;
$x_0(t) \approx y(t)= -130t^4+146t^2-30.7, \; t \in [-1,1]$
$y(t)$ not even close to $x_0=\cos(t)$ by plot. I was checking for arithmetic errors, but still haven't found it.
UPD: I found error. 3 significant figures were too few. the more calculations the further the answer is from desired one. the numbers become very sensitive at one point.