<s>[INST] Looking for a basis of a vector subspace Let $n \geq 4$ and $\mathbb{R_n}$[x] a vector space of all polynomials of degree n at most.
There is given a set:
$
  U = \{p \in \mathbb{R_n}[x]; p(1) = p(-1), p''(0) = 2p(1)\}
$
Find some basis of a vector subspace U and deterime $dimU$
My attempted solution:
$p(x) = a_nx^n + \dots + a_1x + a_0$
$p'(x) = na_nx^{n-1} + \dots + 2a_2x +a_1$
$p''(x) = n(n-1)a_nx^{n-2} + (n-1)(n-2)a_{n-1}x^{n-3} + \dots + 6a_3x +2a_2$
$p(1) = a_n + \dots + a_0$, if $n = 2k, k \in \mathbb{N}$: $p(-1) = a_n - a_{n-1} + \dots -a_1 
+a_0$
$\rightarrow 2(a_{n-1} + a_{n-3} + \dots a_1) = 0$
$p''(0) = 2a_2 = 2p(1) = 2(a_n + \dots a_0) \rightarrow a_n + \dots + a_3 + a_1 + a_0 =0$
$$
  a_1= -a_{n-1}-a_{n-3}- \dots a_3
  \\ a_0 = -a_n - \dots - a_3 -a_1  
$$
$p(x) = a_nx^n + \dots + a_2x^2 - x(a_{n-1} + a_{n-3} + \dots a_3) - a_n - \dots - a_3 - a_1 =
\\=a_n(x^n-1) + a_{n-1}(x^{n-1}-x-1) + a_{n-2}(x^{n-2}-1)+ \dots + a_3(x^3-x-1) + a_2x^2 - a_1$
Not sure if the process is correct, because the polynomials by the coefficients, which should form a basis, seem different from the solution.
 [/INST] You have not computed any basis. You have tried to eliminate the coefficients using the equations but only have done so for $a_{0}$ and not $a_{1}$. Note that you can actually eliminate both $a_{1}$ and $a_{0}$ and write your $p(x)$ in terms of $a_{n},...a_{2}$ .
You should proceed like this:-
Let $n$ be even . Let $n=2m$ , $m\geq 2 $
Then $p(1)=p(-1)\implies a_{0}+a_{1}+...+a_{n}=a_{0}-a_{1}+...-a_{n-1}+a_{n}$
Which gives $a_{1}+a_{3}+...+a_{2m-1}=0$
$p''(0)=2\cdot(\text{coefficient of}\, x^{2})=2a_{2}$ .
So $2a_{2}=2(a_{0}+a_{1}+...+a_{2m})\implies a_{2}=a_{0}-(a_{3}+a_{5}+...+a_{2m-1})+a_{2}+...+a_{2m}\\=a_{0}+a_{2}+...+a_{2m}$ .
So $a_{0}+a_{4}+a_{6}+...+a_{2m}=0$ . So $a_{0}=-(a_{4}+a_{6}+...+a_{2m})$
This means $p(x)=-(a_{4}+...+a_{2m})-(a_{3}+a_{5}+...+a_{2m-1})x+a_{2}x^{2}+a_{3}x^{3}+...+x^{2m}a_{2m}$
So $p(x)=a_{2}x^{2}+a_{3}(x^{3}-1)+a_{4}(x^{4}-1)+...+(x^{2m}-1)a_{2m}$.
So $U=\{ a_{2}x^{2}+a_{3}(x^{3}-x)+a_{4}(x^{4}-1)+a_{5}(x^{5}-x)+...+(x^{2m}-1)a_{2m}\,,a_{i}\in\Bbb{R}\}$
That is $U=\text{span}\{x^{2},x^{3}-x,x^{4}-1,...,x^{2m-1}-x,x^{2m}-1\}$
Now you need to extract a linearly independent set out of the above. Matrices and Row Reduced Echelon Form is the best way to go.
These above vectors represented as row vectors of an $(2m-1)\times (2m+1)$ matrix gives us the following :-
$$\begin{bmatrix} 1 & 0 & 0 &\cdots & 0 & 0 & -1 \\ 0 & 1 & 0 &\cdots & 0 &   -1 &0 \\ \vdots &\vdots&\vdots &\cdots&\vdots&\vdots&\vdots\\ 0 & 0 & 0 &\cdots & 0 & -1 & 0 \\ 0 & 0 & 0&\cdots & 1 & 0 & 0 \end{bmatrix}$$ .
Now you can use induction to prove that this matrix has  full rank of $2m-1$ (as is evident from the Row reduced form of the matrix which it is already in ) and this would imply that $\{x^{2m}-1,x^{2m-1}-x,...,x^{3}-x,x^{2}\}$ is a basis for $U$.
For the case $m=1$ we have that $p(1)=p(-1)\implies a_{0}+a_{1}+a_{2}=a_{0}-a_{1}+a_{2}\implies a_{1}=0 $ and  $2a_{2}=2(a_{0}+a_{1}+a_{2})\implies a_{0}=0 $ and $U=\{a_{2}x^{2}\,,a_{2}\in\Bbb{R}\}=\text{span}\{x^{2}\}$ .
Now use the same method to conclude when $n$ is an odd number . First solve the case for $n=1$ and then for $n=2m-1\,m\geq 2 $.
</s>