Integration with a step function?

1. Sep 16, 2007

physgirl

Integration with a step function??

1. The problem statement, all variables and given/known data
How do you go about integrating a function that has parameters "x" and "delta" where "delta" is a step function of "x" (delta is 1 for x>0, 0.5 for x=0, and 0 for x<0)??

I don't remember doing anything like this in any of my math classes before :(

2. Relevant equations
3. The attempt at a solution
No clue as to where to even start? Do you divide up the integrals to include the different ranges for the step functions? So like, integral of whole function from negative infinity to 0 and then from 0 to positive infinity? Except that doesn't make sense to me either...

2. Sep 16, 2007

HallsofIvy

Staff Emeritus
I have no idea what you mean by "How do you go about integrating a function that has parameters "x" and "delta" where "delta" is a step function of "x" (delta is 1 for x>0, 0.5 for x=0, and 0 for x<0)"

Do you simply mean that f(x)= 1 if x> 0, f(x)= 0.5 if x= 0, f(x)= 0 for x < 0? and are you doing a definite integral or indefinite integral.

You integrate a piecewise function by doing the pieces separately. If should be obvious that x< 0 contributes nothing to an integral. Similarly, "f(x)= 0.5, if x= 0", since that is at a single point, contributes nothing (the "area" under a single point is 0). For x> 0, you are just looking at the anti-derivative of f(x)= 1.

3. Sep 16, 2007

physgirl

Sorry, what I meant was, for example, a function like:

y=x(delta(2-x))+(1-x)(delta(x-3))

where delta(x) is a step function: delta=1 for x>0, delta=0.5 for x=0, and delta=0 for x<0.

Integrate with respect to dx... and it's an indefinite integral.

Does that make any more sense? I'm just as confused :(

4. Sep 16, 2007

genneth

Can you imagine what the integral of your delta function would look like? Imagine doing the following integral:

$$\int_{-\infty}^{x} \delta(u)\,du$$

What's the answer in terms of x?

Hints:

1. Draw a picture.
2. Use the fact that $$\int_{a}^{b} f(x)\,dx + \int_{b}^{c} f(x)\,dx = \int_{a}^{c} f(x)\,dx$$ to split the function into pieces which you know how to integrate.

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

physgirl

Sorry I'm still lost :( I know that fact you listed as #2 but I'm not sure how that applies to the integral you told me to picture and how that relates to my original question?

6. Sep 16, 2007

genneth

Draw a picture of delta... it might help you visualise the following:

if x < 0, $$\int_{-\infty}^x \delta(u)\,du = 0$$

if x > 0, $$\int_{-\infty}^x \delta(u)\,du = \int_{-\infty}^0 0\,du + \int_0^x 1\,du = x$$

7. Sep 16, 2007

EnumaElish

What is confusing is that it is an indef. integral. First off the bat, do you know which value of delta will never come into play in any kind of integration? (Hint: one of its values is defined over a measure-zero set.) You have 2 values that matter; so you have 4 possibilities:
2-x > 0 and x-3 > 0,
2-x < 0 and x-3 > 0,
2-x > 0 and x-3 < 0,
2-x < 0 and x-3 < 0.

For each of these possibilities you can solve the indef. integral separately.

8. Sep 16, 2007

physgirl

oh man, sorry, the integral is not an indefinite one. It goes from 0 to "L."

This is a particle in a box normalization problem where I got completely lost when I had to integrate the square of that function (ie. y^2) from 0 to L with respect to x...

9. Sep 16, 2007

EnumaElish

Okay, even easier. Do you understand the bit about measure zero interval?

10. Sep 16, 2007

genneth

Btw, you should probably not call it a delta function, as that is usually used to denote a different, but related function. Your function is called the step function, because it looks like a step. See: http://en.wikipedia.org/wiki/Heaviside_step_function where there is a picture of it. Try imagining integrating over various ranges of it -- and seeing what the area under the line would turn out to be.

11. Sep 16, 2007

genneth

I'd be surprised if she's been taught integration via measure theory...

12. Sep 16, 2007

physgirl

Yeah, I'm not sure what that's about :(

13. Sep 16, 2007

EnumaElish

Well, an integral is an area under a curve defined over an interval, correct?

Look at the "intervals" over which the 3 values of the delta function have been defined. Can you visualize each of the intervals? Does one look different that the other two? Which one? What is different about it?

14. Sep 16, 2007

physgirl

$$\Psi$$=x$$\vartheta$$(l/2-x)+(l-x)$$\vartheta$$(x-l/2)

That's the equation that I have to square and find the integral from 0 to l given the above definition of $$\vartheta$$...

So I drew the graph of delta, but I'm still confused as to if it'll still be the same graph when it is squared (since 1^2 is still 1) or what's thing about delta=0.5 when x=0... and this delta term is multiplied by other x terms, so how would that affect integration techniques?

15. Sep 16, 2007

EnumaElish

Okay, so it's a theta, whatever, function. What is the exact definition of $\vartheta$, same as "1 for x>0, 0.5 for x=0, and 0 for x<0"?

The part about "squaring": you mean, $\Psi^2$?

Let L = 10. Now substitute that value into your formulas. Then c-a-r-e-f-u-l-l-y make a graph of $\Psi^2$ over 0 < x < 10.

Last edited: Sep 16, 2007
16. Sep 16, 2007

genneth

The usual way to do these to to split the function into pieces that you can tackle individually. So in your case, I'd split the integral into [0, l/2] and [l/2, l]. Then inside each interval, delta(l/2-x) equals 1 and 0, and delta(x-l/2) equals 0 and 1. That should let you work out the integral.

17. Sep 16, 2007

EnumaElish

And, do you understand why you need to split it into two and not three?

18. Sep 16, 2007

physgirl

Thanks so much! I got the answer that I was expecting. So just to make sure, is this the correct method?
====================
using the relationship such as: theta(l/2-x) is 1 when x<l/2 [and therefore theta^2(l/2-x) is also 1 in that case], theta(l/2-x) is 0 when x>l/2, etc...

and since: psi^2=x^2 theta^2 (l/2-x) + (l-x)^2 theta^2(x-l/2)

if you do Integ(psi^2)=Integ(x^2 dx) + Integ((l-x)^2 dx)
where the 1st integral on the right hand side is from 0-->l/2 and the second one is from l/2-->1... and just evaluate that?
======================

And I think I see why it's split into two integrals not three (by the third one, do you mean an integral that goes from l/2 to l/2??)... but I thought the range that you integrate stuff over is including the endpoint values itself... so in my first integral, I'd be finding the area from 0 to l/2, including the points 0 AND l/2... but I know at point l/2 exactly, it's value isn't 0 or 1.... so are we just ignoring that point?

19. Sep 16, 2007

genneth

More importantly, any integral like:

$$\int_a^a \ldots\,dx = 0$$

because the limits are the same. In other words, it didn't matter what your function was at 0, as long as it was finite.

You might want to wonder what the derivative of the step function is -- that is what we usually call the delta function (I seriously recommend this nomenclature, otherwise people will get confused).

20. Sep 16, 2007

EnumaElish

psi^2 is NOT x^2 theta^2 (l/2-x) + (l-x)^2 theta^2(x-l/2). You are missing the interaction term.

Hint: how do you expand (a + b)^2? [Edit: I do realize that the interaction term happens to be 0 in this case, but that should have been part of your argument.]

Did you mean the second one is from L/2 --> L? (I suggest using uppercase L instead of l, which you seem to be confusing with 1.)

Last edited: Sep 17, 2007