Main content

### Course: Algebra 1 > Unit 10

Lesson 2: Piecewise functions- Introduction to piecewise functions
- Worked example: evaluating piecewise functions
- Evaluate piecewise functions
- Evaluate step functions
- Worked example: graphing piecewise functions
- Piecewise functions graphs
- Worked example: domain & range of step function
- Worked example: domain & range of piecewise linear functions
- Absolute value & piecewise functions: FAQ

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Worked example: domain & range of step function

Finding the domain and range of a piecewise function that is constant in each segment. Such functions are called "step functions.".

## Want to join the conversation?

- Can there be a video for when y isn't a static number, when we have equations for x and y? Because I do not know how to get the range for those, nonetheless graph it.

The only way I can think of doing it, is guess and check from the domain, but there has to be an easier way, is there?(37 votes)- This answer is a year late, I'm also new to this topic, but I'll try to answer. I don't know if you had done this or not by saying "guess and check for the domain". But anyway, for example, we had a piecewise function like this :
`/ 2x+3 , 0 < x <= 2`

f(x) = { x+2 , 2 < x <= 6

\ 3x , 6 < x <= 11

Find the range of each clause separately.

For

, since this is a straight line (with a slope), you just need to find the y values for the endpoints.`2x+3 , 0 < x <= 2`

If x were 0,`2*0+3 = 3`

If x were 2,`2*2+3 = 7`

What is the range of this clause? that would be

or it can be expressed more 'mathy' as`3 < y <= 7`

(this means all real values from 3 to 7 (3 is not included, 7 included))`y or the range of the clause = (3, 7]`

Now you can find the other clauses' y values the same way. You'll get the range of the clauses :

range of 2x+3 = (3, 7]

range of x+2 = (4, 8]

range of 3x = (18, 66]

I'm not sure if this is legit, but the range of the whole function is the union of sets (3, 7], (4, 8], (18, 66] or (3, 7] U (4, 8] U (18, 66]

Am I making myself clear? Please correct me if I made any mistakes. Hope this helps(39 votes)

- This answer is a year late, I'm also new to this topic, but I'll try to answer. I don't know if you had done this or not by saying "guess and check for the domain". But anyway, for example, we had a piecewise function like this :

/ 2x+3 , 0 < x <= 2

f(x) = { x+2 , 2 < x <= 6

\ 3x , 6 < x <= 11(4 votes)- If you want the person who submitted the question to actually see your response, you must use the "reply" link underneath the question. This ties your response to the question and the person who posted the question gets notified. If you don't do this, the chance of that person seeing your response is pretty low.(7 votes)

- If the lowest number is 0, how can -7 be an input value?(3 votes)
- -7 is not an input value. The function specifies f(x) = -7 if x is in the interval: 6 <= x <= 11. This means -7 is an output value.

The function is undefined for x = -7.

Hope this helps.(6 votes)

- I'm confused here: I remember learning that a function is such only insofar as there's one (and one) only output for a given input. Isn't this case different?(2 votes)
- No. Each input creates only one output, so it is a function. Notice the domain restrictions for each step happen to use the same numbers, but the end/start numbers are included in one step and excluded from the other step. Thus, there is no case where one input creates 2 outputs.

Hope this helps.(7 votes)

- Can there be a problem like:

f(x)= 1 , 0<x≤2

5 , 4≤x<6

-7 , 6≤x≤11

Where here there is no function defined for 3, if there is how do we find the domain?

Thanks(3 votes)- The domain is a union of 2 sets of values. In interval notation it would be written as:

(0, 2] U [4, 11]

The range would be written as a set of 3 values = {-7, 1, 5}

Hope this helps.(4 votes)

- So -7 is the x and 6 is the y and then we will switch y's with 11, and make a line, correct?(3 votes)
- No, inside the parenthesis, the left hand side is the y and the right hand side is the x.

When x is between (and including) 6 and 11, y is always equal to -7.

You can imagine that someone has collected data of temperature in one location every day for a month. The data shows that between day 6 and day 11, the temperature was -7 every day.

Hope that helps!(3 votes)

- If the intervals for x were 0<x<2 and 4<x<6 (as integers) then would the domain be {1,6}?(2 votes)
- There are a couple of issues with your result:

1) {1, 6} is roster notation for a set. It tells you the set includes 2 numbers, the 1 and the 6. Interval notation uses parentheses or square brackets.

2) Interval notation assumes the interval is across all real numbers within the interval. It would not be limited to integers. And, your two inequalities have a gap. All the numbers from 2 up thru 4 are not included.

The best way to write your domain would be to use set builder notation: {x | x ε Integers, 0<x<2 and 4<x<6}(5 votes)

- So would it be called a "piecewise function" or "piecewise defined function"(1 vote)
- Generally they are called "piecewise functions". I've never seen them referred do as "piecewise defined function", though the words imply the same thing.(4 votes)

- Nice Video, I just don't know how to solve for range in questions like

[1-x x<1

f(x)=[

[√x-1 x>=1(2 votes)- If I understand correctly, you are looking for the range for the following definition:
`f(x) = { 1-x for x < 1`

`{ √(x-1) for x ≥ 1`

Here is what I would do:`f(x) = 1-x`

generates values from -∞ to almost 0 (for x almost equal 1)`f(x) = √(x-1)`

generates values from 0 (for x=1) to ∞.

The range is -∞ < x < +∞(2 votes)

- shouldn't it be (x,y) but it looks as if the y is i front. could someone please explain this to me?(2 votes)
- If you are plotting a point the the format is (X ,y) yes, but when you write out a piecewise function, the rule for calculating the output (y) is on the left, and the specific domain for that rule is on the right. For example, say that over the interval -5<x≤5, the rule is 2x+1, it is written like this: f(x){2x+1, -5<x≤5} and then you just take a random working value from the domain on the right, plug it in to the formula on the left, and you get your new output.:f(-5)= 2(-5)+1 = -9. since the rule description is not the point itself, it is not written like a point. Hope this helps!:)(2 votes)

## Video transcript

I have a piecewise defined function here,
and my goal is to figure out its domain and its range. So first let's think about the
domain. And just a bit overview, the domain is
the set of all inputs for which our function is defined.
And over here, an input variable is x, so to think about, it's the set of all
the values that x can take on, and actually have this function be defined,
and actually figure out what f of x is. And when we look at this, we see, okay, if 0 is
less than x is less than or equal to 2. We're in this clause, it's x crosses 2 and it is greater than 2.
We follow this clause As we approach 6 but right when we get
to 6, we fall into this clause right over here, all the way up to and including 11.
But if we get larger than 11, the function is no longer defined. I don't know which of
these to use. And if we're 0 or less, the function is
longer defined as well. So in order for this to be defined, x has
to be greater than 0 or if we say 0 is less than x, and you see that part right over there.
And x has to be less than or equal to 11. and x has to be less then or equal to 11. It's defined for everything in between.
As we, as we see, once again, as we get to 2, we're here.
As we cross 2, between 2 and 6, we're here, and at 6, from 6 to 11 we're over here. So we're defined for all real
numbers in this interval. So our domain is -- actually let me write this all, all real values, are all real all real values. maybe -- Let me write that way. All real value such
that, such that, 0 is less than x, is less than
or equal to 11. So now think about the range.
Let's think about the range of this piecewise
defined function. And that's a set of all values that this
function can actually take on. and this one is, is maybe deceptively
simple because there're only three values that this function can take on. You can take on, f of x can be equal to
1. It can be equal to 5, or it could be equal to negative 7. So the range here, we could say that f of x needs to be a member of,
this is just a fancy mathy symbol, just to say this is a member of the set 1, 5, negative 7. f of x is going to take, is going to take on one of these three
values. Another way to say it is that f of x is going to be equal 1, 5 or negative 7. This is maybe a little less -- a little -- a less a less mathy way, a less precise way of saying the same thing. But one way
or another, f of x can only take on one over these three values.