# Converting a Piecewise function to a Heaviside function

## Homework Statement

Use the Heaviside function as an on the switch over the interval [a,b].

## Homework Equations

Let the H(x) be the Heaviside function defined as a piece-wise function such that it is zero if x is less than zero, and 1 if it is greater than or equal zero. From that, we can use the Heaviside function as an on/off function, to represent piece-wise functions.

## The Attempt at a Solution

I know that I can use H(x-a) where a is an element of the reals to indicate a horizontal translation of the Heaviside function. Similarly, I can write (H(x-a)-H(x-b)), where a and b are reals to denote an on the switch over the interval a<x<=b. If I was to reverse the position of "x" and "a", as well as "x" and "b", I could represent the "on" switch over the interval a<=x<b. However, I can't seem to represent the interval a<=x<=b. Where the endpoints are included.

andrewkirk
Homework Helper
Gold Member
The function H(x-b) is right-continuous and limited-at left (Càdlàg). What would be the corresponding features of H(b-x)?

The function H(x-b) is right-continuous and limited-at left (Càdlàg). What would be the corresponding features of H(b-x)?
By using H(b-x) instead of H(x-b) we would make the function defined on the left endpoint value but that leaves the right endpoint undefined

LCKurtz
Homework Helper
Gold Member
Of course, if you are using Heaviside functions to help calculate LaPlace transforms of piecewise functions, the values at the endpoints don't affect the values of the transforms anyway.

SammyS
Staff Emeritus
Homework Helper
Gold Member

## Homework Statement

Use the Heaviside function as an on the switch over the interval [a,b].

## Homework Equations

Let the H(x) be the Heaviside function defined as a piece-wise function such that it is zero if x is less than zero, and 1 if it is greater than or equal zero. From that, we can use the Heaviside function as an on/off function, to represent piece-wise functions.

## The Attempt at a Solution

I know that I can use H(x-a) where a is an element of the reals to indicate a horizontal translation of the Heaviside function. Similarly, I can write (H(x-a)-H(x-b)), where a and b are reals to denote an on the switch over the interval a<x<=b. If I was to reverse the position of "x" and "a", as well as "x" and "b", I could represent the "on" switch over the interval a<=x<b. However, I can't seem to represent the interval a<=x<=b. Where the endpoints are included.
Investigate some possibilities with H(x − b) , such as −H(x − b) , H(b − x), etc.

Try adding functions and try multiplying functions, etc.

andrewkirk
Homework Helper
Gold Member
By using H(b-x) instead of H(x-b) we would make the function defined on the left endpoint value but that leaves the right endpoint undefined
What makes you think that? The right endpoint is at x=b. What is the value of H(b-x) when x=b? Draw a graph of the function H(b-x) and it should be immediately apparent how it can solve your problem, in conjunction with other function(s) you have mentioned above.

What makes you think that? The right endpoint is at x=b. What is the value of H(b-x) when x=b? Draw a graph of the function H(b-x) and it should be immediately apparent how it can solve your problem, in conjunction with other function(s) you have mentioned above.
if x = b at H(b-x) it will be on at the value x <= b. Though I need a<=x<=b.

Investigate some possibilities with H(x − b) , such as −H(x − b) , H(b − x), etc.

Try adding functions and try multiplying functions, etc.
I'm have already tried but can't seem to think of what to write. I know I can use H(x-a)-H(x-b) for a<x<=b but this excludes b

andrewkirk
Homework Helper
Gold Member
if x = b at H(b-x) it will be on at the value x <= b. Though I need a<=x<=b.
That's why I said you'll need at least one of the other functions. Graph the others, and also graph the function you want to construct, and you should get an idea of how to put functions together to achieve the target.

That's why I said you'll need at least one of the other functions. Graph the others, and also graph the function you want to construct, and you should get an idea of how to put functions together to achieve the target.
I tried using (H(x-a)-H(x-b))+H(b-x)-H(x-a)) Though that doesn't work. I've been stuck for a while. Could you please give me a hint?

andrewkirk
Homework Helper
Gold Member
Look at the target curve. Count how many jumps it has and, for each jump, note:
- the x value at which it occurs,
- is it up or down; and
- is the jump left- or right-continuous.

For each jump, find a version of a single Heaviside function that matches the target on all three of those properties at the relevant value of x, disregarding what it does elsewhere (Consider versions that have been discussed above).

Add the Heaviside versions together and graph the result.

You should now have a function whose graph is exactly the correct shape. It may be generally higher or lower than you want though. Can you add or subtract something (not a Heaviside function) that will correct that by shifting the whole graph up or down?