# Using nlsolve for roots of Legendre Polynomials in terms of RadauIIA method

**URL:** <https://discourse.julialang.org/t/using-nlsolve-for-roots-of-legendre-polynomials-in-terms-of-radauiia-method/84872>\
**Category:** New to Julia\
**Tags:** polynomials, nlsolve\
**Created:** [July 27, 2022, 1:04pm UTC](https://discourse.julialang.org/t/using-nlsolve-for-roots-of-legendre-polynomials-in-terms-of-radauiia-method/84872 "2022-07-27T13:04:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vick](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Vick](https://discourse.julialang.org/u/Vick)\
**Post date:** [July 27, 2022, 1:04pm UTC](https://discourse.julialang.org/t/using-nlsolve-for-roots-of-legendre-polynomials-in-terms-of-radauiia-method/84872/1 "2022-07-27T13:04:31Z")

</div>

Hi,

I need to find root for Legendre polynomials in terms of the RadauIIA method

```julia
using ClassicalOrthogonalPolynomials, NLsolve

function P(x, n)
    return legendrep(n, x)
end

function radc(x, s)
    v = 2 * x - 1
    return P(v, s) - P(v, s-1)
end

s = 3

k = zeros(s)

function radc!(fk, k)
    fk .= radc(k, s)
  end

c = nlsolve(radc!, k)

```

nlsolve is difficult to use. I used this same method of nlsolve for something else and it worked, but not for the above.

Please help me.  
Thanks
