I want to talk about piecewise defined functions. This is an example of a piecewise defined function; f(x) equals ½x² when x is less than or equal to 4, and 5 when x is greater than 4. A piecewise defined function, the name kind of makes sense. We have it defined differently for different values of x.
So how do these work? Well to see let's compute some values, and then we'll graph it. Let's compute first f(0). Now the first thing you have to do is figure out which of these conditions 0 belongs in. Well, 0 is less than or equal to 4, so I would use this top definition for f(x).
So ½ 0² is going to be 0. F(4), well 4 is in this top condition, less than or equal to 4. It's equal to 4, so ½(4)² is ½(16) or 8. Now 4.01 is bigger than 4, so we're in this category. When x is bigger than 4, the output is just 5. So this is going to be 5.
Same thing here. F(100), it doesn't matter how big x is as long as it's bigger than 4, the output is going to be 5. So when you're graphing these piecewise functions, you basically have to graph each of the pieces separately. Think about the quadratic function ½x² for x less than or equal to 4. I'm thinking about graphing that function on this restricted domain. I'm thinking of graphing this constant function on this restricted domain.
So let's do that as we graph y equals f(x). Now we have ½x² for x less than or equal to 4. Let's graph that part first. Now let me plot 4 equals 4, we get again ½(16) or 8. So let's see. That's going to be about 8. So it will go up to say here and here. Its vertex will be at 0, 0.
Let's see what happens at say 2. At x equals 2, we get 2² or 4 times ½ is 2. So we'll get this point here. My graph looks something like this, and something like this. It's going to go off forever in this direction. But in this direction it's got to stop right here at x equals 4.
The other piece 5 when x is greater than 4. Well, 5 is right here, between 4, and 6. So 5 is a constant function. It looks like that, and if 5 or x greater than 4, then there has to be an open circle here. There has to be an open circle for another reason. This won't be a function if the function has two different values at x equals 4. It can only have 1, and currently its value at 4 is 8, up here.
So this point is right above this open circle. So that's our graph of the piecewise function f(x) equals ½x² for x less than, or equal to 4, and 5 for x greater than 4.