# Legendre polynomial (legendre_p)

Legendre polynomial.

## How to write it

### legendre_p(n, x)

**n**

The degree. Takes a whole number.

**x**

The variable. Takes an expression.

## Examples

- $\displaystyle \mathrm{P}_{2}(x) = \frac{3 x^{2}}{2}-\frac{1}{2}$

  `legendre_p(2, x)`

  In the solver, `legendre_p(2, x)` gives `3x^2/2 - 1/2`.

  [Open in the solver](https://hilberon.com/?q=legendre_p%282%2C%20x%29)

## Related functions

- [legendre_q](https://hilberon.com/library/legendre_q)

  Legendre function of the second kind.
- [lambert_w](https://hilberon.com/library/lambert_w)

  Lambert W function: the inverse of w exp(w), on its principal branch.
- [lerch_phi](https://hilberon.com/library/lerch_phi)

  Lerch transcendent: the sum of z^k / (k + a)^s over k from 0.
- [laguerre_l](https://hilberon.com/library/laguerre_l)

  Laguerre polynomial.
- [log_gamma](https://hilberon.com/library/log_gamma)

  Logarithm of the gamma function.
- [kronecker_delta](https://hilberon.com/library/kronecker_delta)

  Kronecker delta: 1 when the arguments are equal, otherwise 0.

---
Source: https://hilberon.com/library/legendre_p
