"2) Why n = 10 don't work?"

Look at the equation it's trying to solve:

```
sage: solve(gen_legendre_P(10, 0, x) == 0, x)
[0 == 46189*x^10 - 109395*x^8 + 90090*x^6 - 30030*x^4 + 3465*x^2 - 63]
```

after substituting x^2->y, this is a 5th-order polynomial in y, and in general you can't solve an arbitrary polynomial higher than fourth order by radicals. This result is known as the Abel-Ruffini theorem.

The good news is that if you only care about numerical values, you can work in a polynomial ring over a real or complex field and get numerical results:

```
R.<x> = RealField(100)[]
for n in [1..10]:
p = gen_legendre_P(n, 0, x)
print n, p.real_roots()
1 [0.00000000000000000000000000000]
2 [-0.57735026918962576450914878050, 0.57735026918962576450914878050]
3 [-0.77459666924148337703585307996, 0.00000000000000000000000000000, 0.77459666924148337703585307996]
4 [-0.86113631159405257522394648889, -0.33998104358485626480266575910, 0.33998104358485626480266575910, 0.86113631159405257522394648889]
5 [-0.90617984593866399279762687830, -0.53846931010568309103631442070, 0.00000000000000000000000000000, 0.53846931010568309103631442070, 0.90617984593866399279762687830]
6 [-0.93246951420315202781230155449, -0.66120938646626451366139959502, -0.23861918608319690863050172168, 0.23861918608319690863050172168, 0.66120938646626451366139959502, 0.93246951420315202781230155449]
7 [-0.94910791234275852452618968405, -0.74153118559939443986386477328, -0.40584515137739716690660641208, 0.00000000000000000000000000000, 0.40584515137739716690660641208, 0.74153118559939443986386477328, 0.94910791234275852452618968405]
8 [-0.96028985649753623168356086857, -0.79666647741362673959155393647, -0.52553240991632898581773904919, -0.18343464249564980493947614236, 0.18343464249564980493947614236, 0.52553240991632898581773904919, 0.79666647741362673959155393647, 0.96028985649753623168356086857]
9 [-0.96816023950762608983557620291, -0.83603110732663579429942978806, -0.61337143270059039730870203934, -0.32425342340380892903853801464, 0.00000000000000000000000000000, 0.32425342340380892903853801464, 0.61337143270059039730870203934, 0.83603110732663579429942978806, 0.96816023950762608983557620291]
10 [-0.97390652851717172007796401209, -0.86506336668898451073209668842, -0.67940956829902440623432736512, -0.43339539412924719079926594316, -0.14887433898163121088482600113, 0.14887433898163121088482600113, 0.43339539412924719079926594316, 0.67940956829902440623432736512, 0.86506336668898451073209668842, 0.97390652851717172007796401209]
```

The line `R.<x> = RealField(100)[]`

generates a one-variable polynomial ring called `R`

over (an approximation to) the real field, in this case with 100 bits of precision, and defines a variable "x" which lives there:

```
sage: R.<x> = RealField(100)[]
sage: R
Univariate Polynomial Ring in x over Real Field with 100 bits of precision
sage: x
x
sage: parent(x)
Univariate Polynomial Ring in x over Real Field with 100 bits of precision
```