Does anyone know how and when and where used Legendre polynomial?
Legendre polynomials are orthogonal on the interval $[-1,1]$ and are therefore useful for approximating functions on a finite interval in a least squares sense. I.e., if you are looking for a polynomial $p^*_K(t)$ of degree $K$ which approximates a given function $f(t)$ on the interval $[-1,1]$ - other intervals are possible by shifting and scaling - by minimizing the error

$$\epsilon=\int_{-1}^1[f(t)-p_K(t)]^2dt$$

then the optimal polynomial $p^*_K(t)$ is given by

$$p^*_K(t)=\sum_{k=0}^Ka_k\bar{L}_k(t)\tag{1}$$

where

$$\bar{L}_k(t)=\sqrt{\frac{2k+1}{2}}L_k(t),\quad k\in\mathbf{N}$$

are the normalized Legendre polynomials $L_k(t)$ (i.e., $\bar{L}_k(t)$ are orthonormal, not only orthogonal). Because of the orthonormality of $\bar{L}_k(t)$ the coefficients $a_k$ in (1) can be easily found by computing

$$a_k=\int_{-1}^1\bar{L}_k(t)x(t)dt$$