- #1
- 19
- 0
Homework Statement
According to Stone Weierstrass Theorem, there exists a polynomial such that lim P = |x|.
Can anyone give me an example of P? Maybe within the range of 0.01?
ie. |f-P|< 0.01
In the interest of making correct statements, what you mean is that there is a sequence of polynomials {P_{n}} such that lim_{n -> inf} P_{n}(x) = |x| uniformly in x. (Or... maybe you just mean that it converges at each value of x)According to Stone Weierstrass Theorem, there exists a polynomial such that lim P = |x|.
Can anyone give me an example of P? Maybe within the range of 0.01?
ie. |f-P|< 0.01
The important facts are that the Legendre polynomials are both orthogonal and complete. This means that the mean square of the difference between f and the first n terms in the series goes to zero as n → ∞, i.e. the series converges uniformly to f.
The functions in your example are not orthogonal. I could be wrong, but I remember reading somewhere that orthogonality and completeness imply uniform convergence.
I think it converges in the mean. Since the Legendre polynomials are orthogonal, then we can write:
[tex]f(x)=a_0 P_0(x)+a_1 P_1(x)+a_2 P_2(x)+\cdots[/tex]
with:
[tex]a_k=\frac{2k+1}{2}\int_{-1}^{1} f(x)P_k(x)dx[/tex]
I'd try say 25 of them programatically (in Mathematica) then compare it to [tex]f(x)=|x|[/tex] happybear.
f[x_] := Abs[x];
clist = Table[((2*n + 1)/2)*
Integrate[f[x]*LegendreP[n, x],
{x, -1, 1}], {n, 0, 25}];
g[x_] := Sum[clist[[n]]*LegendreP[n - 1,
x], {n, 1, 26}];
Plot[{f[x], g[x]}, {x, -1, 1}]