# Homework Help: Hilbert Space Sequence

1. Sep 16, 2009

### keniwas

1. The problem statement, all variables and given/known data
Let f(x) be the discontinuous function
$$f(x)=e^{-x},\text{for }x>0$$
$$f(x)=x,\text{for }x\leq 0$$

Construct explicitly a sequence of functions $$f_n(x)$$, such that
$$||f_n(x)-f(x)||<\frac{1}{n}$$,
and $$f_n(x)$$ is a continuous function of x, for any finite n. Here $$||\;||$$ represents the metric in the Hilbert space of square-integrable functions on the line, $$-\infty<x<\infty$$. By construction, under this metric $$\lim_{n\rightarrow\infty}f_n=f.$$

3. The attempt at a solution
I have tried to find different sequences that might work for this (ex. Power Series expansion where n indicates the highest order term to use.) but I can't seem to find one that fits the requirement that it be less than 1/n. I have a feeling the triangle inequality is going to be used somewhere but I am not sure how yet...

2. Sep 16, 2009

### LCKurtz

Your f(x) isn't square integrable but you can find a continuous fn whose difference from f is square integrable. Try something like this. Make your fn(x) equal f(x) except on $$\left[ \frac {-1} n, 0\right ]$$, and a straight line joining your two pieces on this interval.

3. Sep 16, 2009

### keniwas

I like your idea, but I think it still produces a discontinuous function in the limit as $$n\rightarrow\infty$$

Using your example I would define a function
$$f_n(x) = \left\{ \begin{array}{lr} e^{-x} & \text{for } x>0\\ nx+1 & \text{for } -\frac{1}{n}<x\leq0\\ 0 & \text{for } x\leq-\frac{1}{n} \end{array} \right.$$

Which would be continuous, but in the limit as $$n\rightarrow\infty$$ it approaches the discontinuity observed in the original equation at x=0 since the linear part has an infinite slope and hence there is a jump from 0 to 1.

If I missed something you were intending please correct me.

4. Sep 16, 2009

### keniwas

Or perhaps is that the point? That this continuous function converges to a discontinuous one? The problem does say it has to be continuous for any finite n, which it is... Ok so if this is correct, how am I to prove it is always less than 1/n?

Last edited: Sep 16, 2009
5. Sep 16, 2009

### LCKurtz

Are you sure your $$f_n$$ get close to f in any sense of the word for x < 0? Look a little more closely at my hint.

It would be good to be more precise in your writing. When you say "it has to be continuous", what is the it?

Then you say prove it is less than 1/n. To what does that it refer? Is it the same "it"? A different "it"? It would be best not to use the pronoun "it" at all. Use the symbol(s) in question; it will help you to keep your thinking straight.

Anyway, answer the question of what is supposed to be less than 1/n. Then just calculate it once you have all the formulas.

Last edited: Sep 16, 2009
6. Sep 16, 2009

### keniwas

Well, fn gets 'close' to f in the sense that their difference is small... except for right in the center region? Hmm I am not sure if you are trying to hint at the fact i have chosen an incorrect form for fn or just trying to make me understand why it is correct...

Lets assume its the latter for a moment, then here is a new attempt at the solution.

We have the function:
$$f(x) = \left\{ \begin{array}{lc} e^{-x} &x>0\\ 0 &x\leq 0 \end{array} \right.$$
Now define the function:
$$f_n(x) = \left\{ \begin{array}{lc} e^{-x} &x>0\\ nx+1 & -\frac{1}{n}<x\leq0\\ 0 &x\leq-\frac{1}{n} \end{array} \right.$$
This function is continuous for any finite n, and additionally $$\lim_{n\rightarrow\infty}f_n(x)=f(x)$$
We can then take the pointwise difference between these two functions to get the new function $$g(x)=f_n(x)-f(x)$$ which we find to be
$$g(x)=\left\{ \begin{array}{lc} 0 &x>0\\ nx+1 & -\frac{1}{n}<x\leq0\\ 0 &x\leq-\frac{1}{n} \end{array} \right.$$
This function is square integrable, so we can find the value of $$||g(x)||$$ by performing the following integral,
$$||g(x)||=\int_{-\infty}^{\infty} g(x)^2dx=\int_{-\infty}^{-\frac{1}{n}}0dx+\int_{-\frac{1}{n}}^{0}(nx+1)^2dx+\int_{0}^{\infty}0dx$$
Two of the three integrals vanish everywhere, and we are left with the center integral,
$$\begin{array}{lcl} \int_{-\frac{1}{n}}^{0}(nx+1)^2dx&=&\int_{-\frac{1}{n}}^{0}(n^2x^2+2nx+1)dx\nonumber\\ &=&\frac{n^2}{3}x^3+nx^2+x|_{-1/n}^{0}\nonumber\\ &=&-(\frac{n^2}{3}(-\frac{1}{n})^3+n(-\frac{1}{n})^2+(-\frac{1}{n}))\nonumber\\ &=&-(\frac{-1}{3n}+\frac{1}{n}-\frac{1}{n})\nonumber\\ &=&\frac{1}{3n} \end{array}$$

Then $$||g(x)||=||f_n(x)-f(x)||<1/n$$ for all $$x$$ and $$n$$. Hence we have found a sequence of functions that produces the desired results and converges to the original function in the limit as $$n\rightarrow\infty$$

Though my problem with this is that the difference between f and fn grows with increasing n, yet the interval where this difference is occuring gets smaller and smaller... so overall the difference is still small. Something feels funny about my logic here which usually means its wrong.

Last edited: Sep 17, 2009
7. Sep 16, 2009

### Office_Shredder

Staff Emeritus
The difference between f and fn actually decreases at every single point in this example. The center region is a line going from the value (-1/n) on the x-axis to the value 1 on the y-axis. So if you pick any negative x value, eventually it's to the left of -(1/n) and f(x) and fn(x) match up perfectly.

Your post looks pretty good. Two points:
1) in your original post, you had f(x)=x for negative x, and now it's zero. It doesn't really make a difference in the analysis, but make sure you use the right one when turning in your homework!

2) You state
$$\lim_{n \rightarrow \infty} f_n(x)=f(x)$$

in your post far before you've proven it. You realize that this:

$$\lim_{n \rightarrow \infty} ||f_n(x) - f(x)|| = 0$$

is the definition of

$$\lim_{n\rightarrow\infty}f_n(x)=f(x)$$
right? So even though at first glance it seems kind of obvious that the limit holds, you do need to do the calculations to make that conclusion

8. Sep 16, 2009

### keniwas

Essentially the x-intercept gets closer and closer to zero as n grows so the functions eventually match up?

Oops! the correct definition is f(x)=0 for x<0 thanks for pointing that out.

Hmm, I see what you mean, I will add that in. Thank you for the help!

Last edited: Sep 16, 2009
9. Sep 16, 2009

### LCKurtz

Are you saying your original post had f(x) wrong for x < 0? Because what you have done won't work with your original statement.

10. Sep 16, 2009

### keniwas

Yes the original post was incorrect the right form of f(x) is

$$f(x) = \left\{ \begin{array}{lr} e^{-x} & x>0\\ 0 & x\leq 0 \end{array} \right.$$

EDIT: In proving the last statement, it seems that the integrals would diverge as n goes to infinity? Well actually I am not sure how to treat an integral like
$$\int_{0}^{0} (\infty) dx$$
which is what the integral seems to do as n grows to infinity.

Last edited: Sep 16, 2009
11. Sep 17, 2009

### keniwas

Mathematica gives me an output of 0 for the following function

Limit[Integrate[n*x, {x, -1/n, 0}], n -> \[Infinity]].

Which seems ok, but it seems weird that it would work that way. Are we performing the integration first then the limit? (This is clearly what mathematica does since the order of functional operations always starts from the center of the statement outwards) but is this mathematically correct?

12. Sep 17, 2009

### Office_Shredder

Staff Emeritus
That is in fact correct (although your function should be nx+1, but you get the same value). I'll draw a couple pictures for you:
http://img21.imageshack.us/img21/3690/nx1u.jpg [Broken]

Last edited by a moderator: May 4, 2017
13. Sep 17, 2009

### keniwas

Nice Picture =). I understand now, thank you for the help.

Yes I realized after I posted my last post that I hadn't included the + 1, but like you said the result is the same.

Thanks again!