Sign In | Subscribe

Enter your Sign on user name and password.

Forgot password?
  • Follow us on:
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Math Analysis
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Transcription

  • Related Books

Lecture Comments (8)

1 answer

Last reply by: Professor Selhorst-Jones
Sun Aug 28, 2016 2:22 PM

Post by Hitendrakumar Patel on August 24, 2016

Why are these new piecewise rules implemented?

1 answer

Last reply by: Mohammed Jaweed
Sun Jul 12, 2015 4:56 PM

Post by Mohammed Jaweed on July 10, 2015

In example 2, for the bottom potion, how did you end up with -1 from -1^2

1 answer

Last reply by: Professor Selhorst-Jones
Fri Aug 29, 2014 6:35 PM

Post by John K on August 23, 2014

In the graphing piece wise function example(16:26), for f(x)=2, why did we use inclusion at the point -1?

1 answer

Last reply by: Professor Selhorst-Jones
Fri Oct 4, 2013 6:08 PM

Post by Min Journey on October 4, 2013

@ 7:24

I thought the condition for -2x+4 is that 1<x. But -4 is not greater than 1. Or is this only after you plug in the x-value?

Piecewise Functions

  • Up until now, all the functions we've seen used a single "rule" over their entire domain. No matter what goes into the function (as long as it's in the domain), the same process happens to the input. In this lesson, though, we'll examine functions where the process changes depending on what goes into the function. This is the idea behind piecewise functions.
  • As a non-math example, we could imagine cooking potatoes in different ways depending on the size of the potato. If it's small, you boil and mash the potato. But if it's over a certain size, you cut it up and turn it into fries. In both cases, something happens to the potato. But the transformation is different depending on the type.
  • We use the following notation for piecewise functions:
    f(x) =

    Transformation Rule 1,
    x is in Category 1
    Transformation Rule 2,
    x is in Category 2
    Transformation Rule 3,
    x is in Category 3
    That is, given some input, we first check which category it belongs to, then use the corresponding transformation. [Check out the video for some concrete examples of this.]
  • We graph piecewise functions the same way as other functions: a series of points ( x, f(x) ). The difference is that the rule determining where x maps to can change depending on which x we're looking at. Often it looks like the graph "changes" at switchovers between rules: when x switches from one category to another, the shape/location of the curve can change.
  • An important graphical note is that we show inclusion with a solid circle. We show exclusion with an empty circle. That way, when we have two categories like x < 1 and 1 ≤ x, we can see which curve in the graph "owns" x=1.
  • This is a great time to bring up the idea of a continuous function. We'll occasionally refer to this idea in this course, and it will come up often in Calculus. It's hard to formally define continuous with symbols and numbers right now, but we can understand what it means graphically. All the below mean the same thing:
    • All the parts of its graph are connected.
    • Its graph could be drawn without ever having to lift your pencil off the paper.
    • There are no "breaks" in the graph.

Piecewise Functions

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Introduction 0:04
  • Analogies to a Piecewise Function 1:16
    • Different Potatoes
    • Factory Production
  • Notations for Piecewise Functions 3:39
    • Notation Examples from Analogies
  • Example of a Piecewise (with Table) 7:24
  • Example of a Non-Numerical Piecewise 11:35
  • Graphing Piecewise Functions 14:15
  • Graphing Piecewise Functions, Example 16:26
  • Continuous Functions 16:57
    • Statements of Continuity
    • Example of Continuous and Non-Continuous Graphs
  • Interesting Functions: the Step Function 22:00
    • Notation for the Step Function
    • How the Step Function Works
    • Graph of the Step Function
  • Example 1 26:22
  • Example 2 28:49
  • Example 3 36:50
  • Example 4 46:11

Transcription: Piecewise Functions

Hi--welcome back to

Today, we are going to talk about piecewise functions.0002

So far, all of the functions we have seen use a single rule over their entire domain.0005

No matter what goes into the function, as long as it is part of the domain, the same process happens to that input.0009

For example, consider x2 + 3; the same process happens, no matter what input goes in.0015

While f(1), f(27), f(-473) all produce different outputs, the function is doing the exact same thing to each.0022

It squares the input; then it adds 2; f(1) is 12 + 3; f(27) is 272 + 3; f(-473) is (-473)2 + 3.0034

Different inputs will make different outputs, but ultimately the process we are going through is the same for each one of these.0046

What if the rule wasn't always the same, though--what if the rule we used, the process we used, changed depending on the input?0053

Instead of always using the same process, the transformation could vary based on what goes into the function.0061

This is the idea behind piecewise functions--functions that do different things over different pieces of their domain.0066

Let's start by looking at two analogies, to get this idea really into our heads.0073

The first analogy: imagine you are cooking potatoes, and you are going to turn them either into mashed potatoes or French fries.0078

Now, since the large potatoes make better French fries, you decide to turn your big potatoes into fries, and to mash up the small potatoes.0085

You just bought a big pile of potatoes, so you have some big potatoes and some small potatoes.0092

So, some of them are going to make better fries, and some of them would probably make better mashed potatoes.0097

So, the big ones become fries, and the small ones will become mashed potatoes--OK, that makes sense.0101

When you start cooking, you begin to work through your pile of potatoes.0106

You pick up one potato at a time, and you start by deciding if it is small or if it is big.0109

If it is a small potato, you boil it and mash the potato; if it is a big potato, you cut it up and turn it into fries--it seems pretty simple.0114

But we are getting sort of that idea of piecewise functions here, because in both cases, something will happen to the potato.0122

The potato will go through a process, but the transformation is different, depending on the type.0128

Depending on what kind of potato we have--if it is big potato or if it is a small potato--different processes are going to occur next.0134

We have to pay attention to what we are putting into our cooking process before we know what steps to take next.0141

Another one--here is another analogy: let's consider a factory.0148

Imagine this factory where, depending on what materials you bring to the factory, it produces different things.0151

If you bring along two kilograms of wood, they make a chair.0157

If you bring in 400 kilograms of metal, they make a car.0160

2 kilograms of wood--the factory makes a chair; if you bring in 400 kilograms of metal to the factory, it makes a car.0165

Now, notice that it is not enough to simply say how much material you bring.0172

If you bring in a mass of 400 kilograms, that is not enough information.0176

We need to know if it is wood or metal; if it is wood, then 400 kilograms of wood at 2 kilograms for a chair means we will make 200 chairs.0181

But if it is 400 kilograms of metal, well, it was 400 kilograms of metal to make 1 car; so you would get one car.0191

400 kilograms isn't enough information; we need to know 400 kilograms and what type it is.0198

We need to know what category it belongs to.0202

So, something is going to happen to the material, no matter what; but we have to know the category that the material belongs to.0205

We have to know what we are putting in--not just a specific number, but what sort of group it is from, before we can tell what is going to happen.0210

This is now a vague sense of piecewise functions; we have this idea that a piecewise function0219

is something where a process will happen to the input, but different things will happen, depending on the specific nature of the input.0225

That is a really good sense for what a piecewise function is.0232

So now, let's consider the notation that is used for piecewise functions.0234

Generally, it is f(x) = [...and this bracket just says that it breaks into multiple different things.0237

There are different possible paths that we can take.0243

So, transformation rule 1 is our normal rule, like x2 + 7; and then it says x is in category 1.0246

So, what that means is that we look at our input; and then we go and we look at the various categories we have.0253

Is x wood? Is x metal? Is the potato big? Is the potato small?0262

We look for which category it belongs to; once we have found that it belongs to category 2,0268

then we go ahead and use transformation rule 2 on that input.0275

We look at the input that is going into the function; we then see which one of the categories it belongs to.0281

And that tells us which of the rules to use.0287

When we want to talk about the function, we have this bracket, so we can see all of the possible rules at once,0289

and all of the categories that go along with the possible rules.0294

Which set of circumstances do we use each rule under?0297

Given some input, we first check which category it belongs to.0301

Then, we use the corresponding transformation; so there are all of these transformation rules; we first check the category; then we use it.0306

Also, notice that since f is a function, two categories cannot overlap.0313

So, categories cannot overlap--why? because, if they overlapped, and they had different rules,0320

we would get two different outputs from using the same input.0326

We would get two different outputs from using two different rules, if the categories overlapped.0330

Remember, if we put x into a function, it has to only produce one output.0335

If we put in x into a function, it can't put out a and put out b; it is not allowed to produce two different things.0341

So, if we put in x, and x belongs to two different categories, each of those rules would have to either be the same thing,0347

or we would have to make sure that the categories don't overlap.0353

We are allowed to have categories overlap; but if that is the case, we have to make sure that the transformation rules0356

produce the same output during that overlapping space; otherwise, we have broken the nature of being a function.0361

All right, let's start looking at some examples to help us get a sense of how to use this notation.0367

So, this isn't really formal mathematics; but we can get an idea of how this notation works by seeing how it would work on those previous analogies.0372

First, our potatoes analogy: potatoes of does our potato function work on input?0378

If we plug in x, the first thing we do is see, "Is x small?"0385

If x is small, then we turn it into mashed potatoes; if x is big, then we turn it into French fries.0389

So, we plug in our potato x, and then we see which category x belongs to.0396

The same sort of thing is going on at the factory.0403

If we plug x, our input, into the factory function, some sort of quantity--some number of kilograms--of a material,0405

we then say, "OK, is x wood? If x is wood, it is x/2," because remember, it took 2 kilograms of wood to make one chair.0414

So, it is x/2 chairs; or if x happens to be metal, it is x/400 cars, because it was 400 kilograms of metal to make one car.0422

We plug in the x; we take the x; we see which category it belongs to; and then we plug it into the appropriate rule, based on the category.0435

Great; all right, let's see an example of the piecewise function, actually working through with numbers.0443

Here is a table; this is the most extreme sort of table we can use.0449

When we are actually doing this, we probably won't want to use a table that has this much possible information in it.0453

But we will get the idea of how piecewise functions work from this table.0459

So, to start with, let's look at what would happen to -4.0463

Well, actually, first let's look...which one would -4 belong to?0467

-4 would be in x < -1; so it is going to belong in x2 - 1, and it is not going to belong in the 2 rule,0471

because -4 is not between -1 and 1, and -4 is not greater than 1.0480

So, it is going to knock out these two rules.0488

Next, -3: -3 is still less than -1, so once again, that knocks out the second rule and the third rule.0491

What about -2? Well, once again, -2 is still less than -2, so that knocks out the second rule and the third rule again.0499

What about if we plug in -1? Well, -1 is not less than -1; -1 equals -1, so we have this less than or equal right here.0506

-1 is less than or equal; it knocks out that first rule, but -1 is still not greater than 1 from our third category.0514

So, it knocks out the third rule, as well.0523

What about plugging in 0? Well, 0 is not less than -1; and 0 is not greater than 1;0525

so our first and third categories just got knocked out--the first and third rules are out.0532

What if we plug in 1? Well, once again, 1 is equal to 1, so it is part of this second category.0535

1 is not less than -1, so it knocks out the first rule; and 1 is not greater than 1, so it knocks out the third rule.0541

We get to 2, and finally 1 is less than 2; 2 is greater than 1; we have 1 being less than 2,0550

so we are using the third rule, which means that our first rule and our second rule are knocked out.0558

What about 3? 3 is still greater than 1; 3 is not less than -1, and 3 is not between -1 and 1, so those rules and categories are out.0565

What about 4? 4 is not less than -1, and 4 is not between -1 and 1; but 4 is greater than 1, so only the third rule gets used there.0575

So now, we have a sense of how this table comes together.0585

So now, let's actually start plugging in numbers.0588

-4 goes into x2 - 1: (-4)2 - 1 gets us +16 - 1, so we get 15.0590

What about -3? We plug in (-3)2 - 1; that gets 9 - 1, so we get 8.0602

What about -2? We plug in (-2)2 - 1; 4 - 1 gets us 3.0611

All right, now we switch rules; for this one, we plug in -1, but -1 doesn't really do anything.0620

All the function says is that, if you are between -1 and 1 as your input, it outputs 2.0627

It doesn't care what you are putting in as an input, as long as it is between -1 and 1.0632

It is going to be constant; it is going to always give the same thing in there; so it is going to just be 2, 2, 2; 2 for all of those.0636

-1, 0, and 1; it is is going to be a constant value of 2 in that interval.0644

Now, we switch rules once again, and we are at 2, -2(2) + 4; -2(2) gets us -4; -4 + 4 gets us 0.0649

What about 3? -2...plug in our 3...+ 4; -2(3) gets us -6; -6 + 4 gets us -2.0660

Plug in 4: -2(4) + 4...-2 times 4 gets us -8; -8 + 4 gets us -4.0670

We have managed to fill out this table.0679

The important thing is to start by figuring out which one of these inputs is going to go to which category.0681

Where are my inputs going to go? You have to figure out an input and its connection to which of the possible categories it can be connected to.0688

All right, let's also see an example of a non-numerical piecewise.0694

Many lessons ago, when we first introduced the idea of a function, we talked about a non-numerical initial function.0698

It took in names spelled with the Roman alphabet, and it output the first letter of the name.0704

For example, if we gave it the name Robert, the initial function would come along,0708

and it would say, "Your first letter is R, so we put out the letter R; done!"0715

So, it is just going and saying, "Let's grab the first initial and do that."0722

That was our idea of the initial function when we first introduced it.0725

We can have functions operating on non-numerical things.0728

But we can also have piecewise functions on non-numerical things.0730

We can modify that and make a piecewise function; we will have f(x) is equal to two categories.0734

Our first rule will be the first letter of x, the first letter of the name, if the name starts with A to M (x is just a placeholder for a name here).0740

It is the first letter of the name, if x starts with A - M.0749

And then, it is the last letter of the name, if the name starts with N - Z.0752

And notice that that covers all of the possible letters that names could start with: A to M, N to Z;0758

A, B, C, D, E, F, G, H, I, J, K, L, M; N, O, P, Q, R, S, T, U, V, W, X, Y, Z; great.0763

Albert: we plug in Albert, and Albert belongs to the red category; it belongs to starting with A to M.0771

That one is pretty easy; we use the first letter, so it gets A as the letter out of it.0778

What about Isabella? Well, Isabella is between A and M (A, B, C, D, E, F, G, H, I, J, K, L, M);0784

so Isabella also belongs to the red category; so it is going to return an I.0794

What about Nicole? Nicole is an N, so it is using the blue category; so it uses the last letter of the name.0800

The last letter of Nicole is E.0808

Vincent begins with a V, which is between N and Z (M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z).0812

So, we are going to be using the blue category, the second category where you use that last letter, T.0822

What about Zach? If we have Zach, Zach is pretty clearly going to be starting with a Z.0827

That means we are in the second category; we are going to cut off that last letter.0832

We are going to get the last letter, and it will be H.0836

We can have a piecewise function operating on non-numerical things.0838

The idea of a piecewise function is just that we take in things; we see which category the thing belongs to;0841

and then we apply a rule based on the category it belongs to.0848

We figure out the category; then we apply a rule based on it; great.0851

Graphing piecewise functions: how do we graph these things?0857

It is actually really similar to graphing a normal function.0859

A series of points, (x,f(x)): when we graph x2, the reason why (0,0) is a point0862

is because, if we plug in 0, we get 0; (0,f(0)); for x2, we get a (0,0).0868

Then we plug in (1,f(1)), because we plug in 1, and it gets 12; so it is (1,1).0876

We plug in 2, and we get f(2); so that would be 2; and then 22 is 4, so we would be at (2,4).0883

We are moving to a height of 4; and that is how it is working for x2.0890

And that is how it works for graphing any function; we put in the input, and then we see what output that gets to.0893

The difference with a piecewise function is that the rule determining where x is going to map will change, depending on which x we are looking at.0898

So, often it will look to use like the graph is changing at switchovers--that we are breaking from one thing to another.0905

And in a way, we are: we are switching between rules.0911

So, when x switches from one category to another, the shape or location of the curve can change,0914

because all of a sudden, we are doing a new way of outputting things.0919

It is not that nice, smooth connection anymore, because we are working all through x2.0922

All of a sudden, we are jumping from x2 to maybe x3 - 1.0926

And we are going to see, suddenly, a new, totally different kind of output when we change categories.0929

An important graphical note is that, to show inclusion, we use a solid circle.0934

Solid circles say "this point is here--this point is actually being included."0940

We show exclusion, excluding it, saying it is not there, with an empty circle.0946

Empty circles give us exclusion; exclusion is an empty circle; inclusion is a filled-in circle.0952

That way, when we have two categories, like x < 1 and 1 ≤ x, we want to be able to know which curve owns x = 1.0961

And because it is less than or equal to, we would have 1 ≤ x, so it would get the dot at that point.0970

And x < 1 gets to go right up to 1, but it doesn't actually get to include 1; so it uses the exclusion, the hollow, empty circle.0977

Let's see an example: if we graph f(x) = x2 - 1 when x < -1, 2 when -1 ≤ x ≤ 1,0985

and -2x + 4, which is when 1 < x, we would see this graph right here.0996

And I also just want to point out that that is what we just did in our table--our really big table,1001

where we figured out all of the possibilities--that is what we just did a few slides back.1004

So, x2 - 1; we see this portion (I will make it in blue, actually) of the graph right here,1009

because x2 - 1 is a parabola; we are seeing the left portion of the parabola, because it is only1018

the portion of the parabola when x is less than -1.1023

We plug in those values, and we see where it gets mapped.1026

However, because x is less than -1, we have exclusion right here; we are not allowed to actually use that point.1028

It gets right up to it, but it can't actually touch x = -1, because it has exclusion on x < -1.1036

And it is strictly less than; it is not actually allowed to equal -1.1044

Similarly, we have to flip to inclusion on the rule of being 2; so it gets to include it on this.1048

And then, it is just a constant from -1 up until 1; so we have this nice straight line here.1055

And then, in green, -2x + 4: 1 < x; we have this thing right here.1062

Now, why don't we see a dot at this junction right here?1069

Well, it is because it is actually agreed on; this point shows up here, and it would show up here, if it were able to hold it.1076

-2x + 4, evaluated at 2...sorry, not 2, but 1, because we are at the point 1; 1 is our changeover, right here;1084

1 < x and x ≤ 1; so -2...plug in 1; plus 4; we get -2 + 4; so we get 2.1095

If -2x + 4 was allowed to use x = 1, it would end up agreeing with it; so it is actually going to the exact same point.1107

It is sort of a hollow for -2x + 4; but then, it immediately gets filled in for 2.1116

So, ultimately, we don't see a break there.1123

There is no loss, because while one end is excluding it, the other one is including it.1125

And they are all in the same place, so we end up only seeing the inclusion; it is held there; they are together in that place.1129

And that is one example of graphing a piecewise function.1135

All right, this is a great time to bring up the idea of a continuous function.1138

We are going to occasionally refer to the idea in this course, and it is going to come up a whole bunch in calculus.1142

So, it is important to get used to it now.1146

It is hard to formally define continuous right now; right now, we don't have enough symbolic technology.1148

We aren't used to using symbols in the way we would need to to talk about continuous; we can't really talk about it with numbers right now.1154

But we can understand what it means graphically; it makes great intuitive sense in pictures.1160

All of these different things--all of these three different ways of talking about it--all mean the exact same thing.1165

So, if a function is continuous, all of the parts of its graph are connected.1170

Its graph could be drawn without ever having to lift your pencil off the paper.1176

And there are no breaks in the graph.1181

These three things all mean the exact same thing.1183

The parts of the graph are connected; that means that there are no breaks.1185

And if there are no breaks, then you could just put your pencil down and draw the whole thing, without ever having to lift your pencil off the paper.1188

They are three different ways of thinking about it, but they all mean the same thing: the whole thing is connected.1194

It is a continuous flow--this nice, connected piece of information.1198

Great; let's look at some examples to help us understand this.1203

For a function to be continuous, it must be any one of the below statements (we just said them; let's say them again).1206

The parts of its graph are connected; the graph could be drawn1211

without ever lifting your pencil or pen off the paper; and there are no breaks in the graph.1213

So, here is one example of something being continuous.1218

Even though it has this sort of "juke" (it suddenly changes direction there) in this corner,1221

it is still continuous, because the graph connects in this corner.1228

The two ends touch; you can draw it in one smooth thing without ever having to take your hand off of drawing.1232

You could draw it in one smooth thing, without ever having to lift up.1239

So, it is a continuous graph, at least in that viewing window--what we can see.1243

Now, here is an example of something being not continuous.1247

This one right here is not continuous, because we have this break; all of a sudden, we jump locations.1251

We have an empty circle here, and we are now, all of a sudden, in a totally different place.1257

If we were to try to draw this, we could get up to here; but to go any farther,1261

we would have to lift our pencil up, move down, and now start down here.1265

So, we would be in a totally different place; there is a break in the graph.1269

The parts of the graph are not connected; it is not just one nice, connected curve; it is not a continuous function.1272

Finally, another one that not continuous: this one is pretty close to being continuous.1278

We can draw and draw and draw and draw and draw, but there is an empty point here.1284

We have one point; we have this single discontinuity, this single point that has been moved off of the line.1288

We have to move down here to draw in this single point; and then we go back to normal.1294

So, it is really, really, really close to being continuous; but it is not perfectly continuous,1298

because this point here has been moved down here; it is in a different place; it is not where it needs to be, to be continuous.1302

So, a continuous function--all of the parts of its graph are connected.1309

And that means even one point could be out, and it would break the continuity.1312

It would break being continuous; it would no longer be connected.1316

Great; that is an interesting function.1320

At this point, it is probably becoming clear that you can have some kind of weird-looking functions.1322

So far, over the course of algebra and geometry, you have seen pretty reasonable-looking things, like x2, √x, x3...1327

Even the weirdest things you have seen have been pretty reasonable--just sort of smooth curves.1334

But we are starting to see, with piecewise functions, that things can be a little odd.1338

Let's look at another one, a little rule--a rule that is a little more complex than x2,1344

something that is a little more interesting than the ones we have been used to so far.1349

So, here is an example, the step function: sometimes it is also called the greatest integer function (and it will make sense why in just a second).1353

f(x) = double bracket x on both ends; it is just make a bracket; make another bracket; put x inside; and then close both of those brackets.1360

The greatest integer less than or equal to x--what does that mean?1370

The greatest integer less than or equal to x--let's try it out.1375

What would happen if we put in 3? Well, the greatest integer that is less than or equal to 3 is 3, because 3 is an integer.1377

And there are other integers out there, like 2; but 2 is not the greatest possible integer that is less than or equal to x,1387

since there is -1, 0, 1, 2, 3; 3 is the greatest one that is less than or equal to 3.1393

What if we went higher, if we said 4? Well, 4 would be greater than 3; so it is not in the running--it doesn't have a possibility.1402

So, that would be 3; but what if we tried something that wasn't just already a straight integer, like, say, 4.7?1410

If we plugged in 4.7, well, what is the greatest integer that is less than or equal to x?1417

3 is a possibility; 4 is a possibility; 5 is a possibility; and it would keep going in either direction.1423

Well, if we went from the left, let's start like this; we could say, "1--1 is a possible thing! Let's go with 1!"1429

Oh, well, if we look at 2, it turns out that is even bigger than 1, and it is still less than 4.7; so 2 is our best option.1444

Oh, what about 3? Well, 3 is still less than or equal to 4.7, and it is bigger than 2; so it is the best option.1450

Oh, what about 4? 4 is bigger than 3, and 4 is less than or equal to 4.7; so it is the best option so far.1456

What about 5? Oh, wait, 5 is greater than 4.7, so it is not in the running, because it has to be the greatest integer less than or equal to x.1465

So, that means 5 is out of the running, and also anything larger than 5.1478

So, everything less than 1, 2, 3...those are not going to work, because we have found 4, and it is the best so far.1481

And everything 5 or greater isn't going to work; so that means our answer is 4.7.1487

It is basically always rounding down; 4.7 would become 4; 3.5 would become 3; -2.5 would become -3,1492

because we have to round down, and what is below -2.5? -3.1501

All right, and finally, we can also sometimes call this the int(x), the integer function on x.1507

Sometimes you will see it denoted as that; it will be written as int(x), as opposed to [[x]].1514

It is the same idea though--this greatest integer thing, this step function where we are breaking.1520

Now, why is it called a step function? We will look at a picture, and that will help explain it a lot.1525

So, the graph of f(x) = [[x]] looks like this.1529

Why does it look like this? Well, remember, at -3, where do we get placed?1533

Well, -3 is an integer, so it just goes right here.1536

Well, what about anything in the middle? Anything in the middle would get placed onto -3,1540

because they would have to be rounded down to the greatest integer they are connected to.1545

So, that is what we get there.1548

As soon as we get to -2, though, we are going to jump up, because -2 is an integer, so it gets to be used here.1549

And so, it is going to have the same sort of thing; anything in the middle would end up getting placed onto -2.1555

But once we get to -1, we make it to this one; and so on and so forth.1560

And so, we just keep stepping along and stepping along and stepping along.1563

And every time we hit an integer, we jump up to the next height, and so on and so forth.1567

And so, we have the greatest integer less than or equal to x, which ends up looking like a staircase,1572

in terms of its steps, because we keep stepping up every time we hit a new integer.1577

Cool; all right, we are ready for some examples.1582

So, the first one just to get started: let's evaluate this function at four different points:1584

f(x) = 3x + 10 when x < -2, 8 when x = -1, and x2 - 10 when x > -1.1589

All right, at f(-3), first what we have to do is say, "Which category do you belong to?"1597

Well, -3 is less than -1, so it belongs to the 3x + 10 rule.1603

So, we use 3x + 10; we plug in the -3; we have 3(-3) + 10; -9 + 10; so we have 1; f(-3) = 1.1610

Great; what about f(-1)--what does that belong to?1624

Well, -1 = -1, so it is using this category right here, so that means we have 8; so we have 8.1631

There is nothing else that we have to do; it is already as simple as it can be; f(-1) = 8.1638

And that is our answer, right there.1642

What about f(-0.9)? This one is really close to -1; but remember, this thing was x = -1, and only happens on precisely -1.1645

-0.9 is, in fact, slightly greater than -1; -0.9 is greater than -1, so we use the rule x2 - 10.1655

We plug in that -0.9; we have (-0.9)2 - 10; -0.9 squared is 0.81; it becomes positive.1666

Anything squared becomes positive, as long as it is a real number.1676

0.81 - 10 becomes negative, because the 10 is bigger: -9.19.1679

So, f(-0.9) is equal to -9.9.1688

Finally, one more example, f(5); which category does this belong to?1694

It pretty clearly belongs to x > -1; 5 > -1, so we use the x2 - 10 rule once again; we use that process.1699

Plug in the 5; 52 - 10 is 25 - 10, is 15; so f(5) = 15.1707

And there we are; and that is how you evaluate a piecewise function.1720

You see which category it belongs to; then you plug it into the appropriate rule, and you just plug it in and work,1722

like you are doing a normal function at that point; great.1727

The next one: all right, in this one, we will graph a piecewise function; so our function this time is:1729

f(x) = x + 6 when x ≤ -3 and -x2 - 2x + 1 when x > -3.1734

So, first, let's make a table to help us graph this thing.1742

x and f(x); what would be a good place to start out?1746

Well, we have -3 showing up here and here; so that is probably going to be the midpoint, mid-"zone" in our graph.1755

So, let's start by plugging in -3; and we will go more negative as we go up: -4, -5, -6, and we will go more positive as we go down: -2, -1, 0, 1; great.1762

Let's try plugging in...which rule will we end up using?1778

Well, when x is less than or equal to -3, we will end up using the things that are above -3 or equal to -3.1781

So, this rule up here gets the x + 6 portion; and down here, when we are below the line, we get -x2 - 2x + 1,1791

because then x is greater than -3; -2 is greater than -3; 0 is greater than -3; etc.1805

All right, so let's try doing some of these.1811

If we plug in -3, -3 + 6 is going to equal positive 3; -4 + 6, -5 + 6, -6 + 6; what do these all come out to be?1813

-4 + 6 gets us 2; -5 + 6 gets us 1; -6 + 6 gets us 0; so we have a pretty good idea of how to graph the x + 6, the portion of the graph where x ≤ -3.1830

Now, what about going the other way?1844

Well, if we plug in -2 into -x2 - 2x + 1, we have -(-2)2 - 2(-2) + 1.1845

Let's plug in all of them, and then we will just do them at once.1855

-12 - 2(-1) + 1; -02 - 2(0) + 1; -12 - 2(1) + 1; what do these all come out to be?1857

Well, first, -2 squared becomes positive 4; so we hit that with another negative, and we have -4 right here.1874

-2 times -2 gets us +4, + 1, so -4 + 4 gets canceled; and then + 1...we get 1.1882

-1 squared gets us positive 1, but then, hit with another negative, we get -1; -2 times -1 gets us + 2, + 1; so -1 + 2 + 1...we get 2.1892

0 squared gets us 0; -2 times 0 gets us 0, plus 1--we get 1.1903

-1 squared gets us -1; -2 times 1 gets us -2, plus 1; so we get -2 here.1909

Great; all right, at this point, we can start graphing this thing.1920

We are graphing from -6 to 1; and our extreme y-values are...we have from 0, 1, 2, 3, so we will make it 1, 2, 3, 4, -1, -2, -3, -4, -5.1924

That is probably enough information; I have to do down there...1, 2, 3, 4, -1, -2, -3, -4, -5.1947

And there doesn't seem to be any reason why we shouldn't do this on a square axis.1957

So, the tick mark length, the length of our vertical tick marks, can be the same as our horizontal tick marks.1961

And of course, I am just doing this by hand, so it is approximate.1966

But this isn't too bad: 1, 2, 3, 4, 5, 6, and it would keep going out that way, as well.1968

All right, -1, -2, -3, -4, -5, and -6; positive 1, positive 2; great.1977

So, at this point, we plot down our points, just like we are doing a normal thing.1985

-6 goes to 0, right here; -5 goes to positive 1 here; -4 goes to positive 2 here; -3 goes to positive 3 here.1988

And at this point, we have the line portion.2003

Does the line keep going to the right, though? No, because it stops once it goes greater than -3.2005

It only works, the rule only happens, when x is less than or equal to -3.2013

But it would keep going off to the left; so it stops right here, but it does include that point, because of the "less than or equal."2016

Now, what about the parabola part of it?2024

Well, we plug in -2; -2 gets us 1; -1 gets us 2; 0 gets us 1; 1 gets us -2; and 2 would continue down.2026

So, we have a pretty clear parabolic arc going on here.2039

We are used to this; and it is going to keep going straight off forever to the right,2045

because it is x > -3; so as long as we are continuing to go to the right, it will continue on.2049

What happens to the left, though? We know what is happening--it is going to be in a parabolic arc.2054

But we are not quite sure where it is going to land, because it has to stop somewhere.2058

But we don't know what height it will stop at.2062

We know it will stop just before -3; so it will stop at -2.9999999999999...forever, continuing forever and ever.2065

It can't actually touch -3, but it can get infinitely close; it can get right up next to it.2074

So, let's figure out where it would be going if it got right up next to it.2078

What we do is: let's see what would happen if we plugged in -2.99999; now, I need even more nines, right? -2.99999999...nines forever.2082

Now...well, not quite forever, because then it would turn into 3.2093

But the point is -2.lots-of-nines; now, I don't know about you, but I don't want to have to plug in -2.9999999 into a calculator,2096

because it is going to end up getting me these ugly numbers, and I will end up having decimals.2104

And really, when you get right down to it, isn't -2.99999999 going to behave a lot like we plugged in -3?2106

It is so close to -3 that we could probably just plug it in as if we had plugged in -3; and indeed, we can do that.2113

We will just know that it will be an empty circle of that, because it has exclusion; it has strictly greater than.2120

So, we will plug in -2.99999999 and 9, which still belongs to the -x2 - 2x + 1,2126

because -2.999999999 is greater than -3, if only by a little tiny bit.2132

And it is going to behave pretty much the same as if we had plugged in -3, so we can calculate it more easily by plugging in -3.2137

So, -(-3)2 - 2(-3) + 1--what does that come out to be?2144

-(-3)2 becomes -9; -2(-3) becomes +6; plus 1, so we have -9 + 7 = -2.2151

So, we know that this is going to go out to -2 when it gets to -3; but it is not actually going to be at -3.2163

It is going to be hollow there, because we are excluding it--it is not actually allowed to go to that point,2170

because the exclusion was already put on that first category on that first rule.2175

This will curve down in a parabolic arc into the exclusion hole, and then just stop right there.2180

It doesn't actually get to touch -3, but we can basically calculate it as if it had gotten to -3,2185

because -2.999999999999 is so close to being just like -3, we can calculate it as if it had gotten there.2190

But then, we just have to remember that we have to make sure that we put it in this circle here,2198

because we are actually excluding it at -3, because x isn't equal to -3 if x > -3.2202

Great; all those ideas that we just talked about are going to come up a lot with this.2209

Let's go just a little bit off and pretend that we are using the real number, and then see what it is like.2214

And we are going to do that here; so if what I do here doesn't quite make sense, look back at the explanation of that 2.999999 thing.2219

And we will get an idea of "Oh, that is why we can do this sort of thing."2226

So, once again, we will set this up in the same way: (x,f(x)): now what values...2229

Clearly, -2 is kind of important; it shows up in a lot of places.2239

What are we going to do? Well, the first thing that we are told to do in this problem is to give the domain of f; then graph it.2244

First, let's do the domain; how do we come up with the domain?2251

Well, remember, domain is all of the inputs that are allowed to go into a function.2256

x2 - 5 never breaks down; 3 never breaks down; -2x + 1 never breaks down; so none of the rules break down.2261

So, none of the processes, none of the rules, break; they are always defined.2272

However, are the categories always defined?2281

x < -2 means we can just keep on going; we can keep on going.2286

So, it is really negative infinity less than x; so we can go all the way down to negative infinity.2290

What about to the right, though? Is there anything that we are not allowed to get to?2295

Well, negative infinity up to -2; and then -2 is here at equal; and then -2 is less than...2298

so we have covered all of our bases, from negative infinity up to -2; and keep going, up until 1.2302

Are there any rules for what happens if x is greater than 1?2309

No, we don't have any rules; we have x < -2, x = -2, and -2 < x ≤ 1; but we don't have any rules for when x > 1.2313

So, no rules for x > 1 means that f doesn't tell us what to do if we are plugging something in.2324

The f fails to tell us what to do to this input if we plug in something that is greater than 1.2334

If we plug in, say, 500, we look at this, and we say, "Oh, this doesn't belong to any categories."2340

So, f is undefined at 500; it doesn't work; it is not in the domain.2345

So, the domain fails to contain everything in x > 1; so that means our domain is not going to be x > 1.2350

That is the things of failure, because we don't have rules; the domain is everything from negative infinity2362

(we use a parenthesis for negative infinity, and infinity), and we go up until 1; and we include the 1,2367

because we have less than or equal to, but we can't go past it; we have no more rules to go up past it.2373

So, f has a domain from negative infinity up until 1, including 1.2378

Great; now, let's build up that table.2383

-2 seems like a good place to make our middle; and if we are above -2, we will use which rule?2385

We use the x2 - 5 rule.2394

Sorry, by "above," I meant to say more negative than -2.2399

And if we are below on this table, which is to say more positive, closer to 0, we are going to use -2x + 1.2402

So, -2...we will have -3 and -4, -1, 0, 1...but just like we did in the last thing, it will be useful to know2411

where it is going if it had been allowed to get to -2.2423

So, for the above part, we will say -2.0001; and -1.9999; these things are because -.1999999 is greater than -2,2426

and -2.000001 is less than -2, but they are going to behave effectively as if we had plugged in -2.2440

So, when we are actually figuring out the numbers, we can pretend as if we had plugged in -2, just to make it easier on us to do the calculation.2448

All right, the first one, -2: what are our f(x)'s?2454

-2's rule just says to give out 3; it doesn't matter what your input is, even though we have to use the category of -2.2459

So, it automatically gives out 3 at -2.2466

What about -2.00001, which would use the x2 - 5 rule? Well, that is about the same thing as plugging in -2.2471

We have (-2)2 - 5; keep going--let's just keep going up to get them all written out.2477

(-3)2 - 5, and (-4)2 - 5--what do those all equal?2484

Well, (-2)2 becomes 4; 4 - 5 is -1; (-3)2 is 9; 9 - 5 is not -4, but +4; 9 isn't bigger than -5.2491

And (-4)2 is +16; 16 - 5 is 11; OK.2502

What about the other way, if we go to the -2x + 1 rule?2506

Well, if we had plugged in -2, we would get -2 times -2; we aren't literally plugging it in.2510

We are just saying, "What if we had gone all the way up to it? Let's see what would have happened,"2514

even though ultimately we will have to exclude it, because we have these strictly less than and strictly greater than signs.2519

So, -2 times -2 plus 1; -2 times -1 plus 1; -2 times 0 plus 1; 1 times 0...sorry, not 1; sorry about that...2531

-2 times positive 1 (I got that confused with the one above it); -2 times 1 plus 1; what do those all equal?2543

The thing that is effectively going to be like -2...-2 times -2 is positive 4; 4 plus 1 is 5.2551

-2 times -1 is positive 2, plus 1 is 3; -2 times 0 is 0, plus 1 is 1; -2 times 1 is -2, plus 1 is -1.2557

Great; so now we are in a position to be able to graph it.2567

Our extremes...vertically we can get up to really high things when we are in the x2 - 5; so we won't worry about the 11 part.2569

But we are going between extremes of 5, maybe a little lower; so we will graph this...2575

We never get to very low values, it seems; so we will put our corner down here.2585

And we also never get past 1; remember, our domain is only -∞ up until 1.2589

So, we also don't have to have a whole lot of stuff on the right.2593

So, we have positive 1 here, positive 2 here, positive 1, positive 2, positive 3, positive 4, positive 5, positive 6; -1, -2, -1, -2, -3, -4, -5.2597

Great, and that is plenty of room, because we only get up to -4; and we know that x2 - 5 is going to blow out.2622

So, 1, 2, 3, 4, 5, 6, -1, -2, 1, 2, 3, -1, -2, -3, -4, -5; making tables...making axes.2627

So, let's plug in some things and see what happens.2643

We plug in -4, and it goes out to 11; so we can't even see it; it is so high up.2646

-3 gets to 4, though; we can definitely plot that; so -3 goes to 4, (-3,4).2651

-2, if it had a doesn't actually have it, but we know that -2.0001 would practically be going to -1.2659

So, we are putting an exclusion hole down here, just below the -2.2670

At -2, though, we actually end up being at 3; so we have this single point right there.2676

If we had -2 for the -2x + 1 process, we would be at 5; but we can't actually go there, so once again, we have an exclusionary hole there.2683

-1 is at 3; 0 is at 1; 1 is at -1; and it stops right there, because we stop at 1.2693

We can't go any higher than positive 1; our domain caps out there.2704

So, our straight line is just a straight line, up until where it stops at that exclusionary hole.2709

We have this point in the middle, the 3 point, but it is just x = -2; and then we have a parabola curving up.2715

It is already moving pretty fast by this point, so it is not going to be a nice, smooth parabola like this.2722

It is already moving fast up, because it is pretty far up.2727

It manages to jump from -1 to 4, and then from 4 to 11; so it is not the bottom part of the parabola.2731

It is already in process, in a way; so curve this parabola up, and it just zooms way, way off really quickly.2735

All right, that is basically what we are seeing here for our graph.2745

We have a parabola on the left-hand side, which drops to the single point--there is just a single point in the middle.2747

And then, we switch to -2x + 1, which goes to 1, and then stops at 1,2754

because the category just stops at 1; so it stops right here, and we don't have anything farther to the right.2760

There is nothing further off to the right, because the categories don't include anything further right.2765

All right, the final example: A certain phone company charges $20 for using its service, along with 10 cents for each minute under 200 minutes.2771

After 200 minutes, they charge 5 cents for each additional minute.2780

Let's give a piecewise function, p(t), price in terms of t, that will describe the price in terms of t, the minutes spoken.2784

So, t is the minutes spoken.2791

It is pretty easy for us to figure out what the first part is.2793

The first portion: when we are under 200 minutes, which is to say when t ≤ 200, the price of t is not too hard for that.2796

p(t) =...well, a $20 flat rate--they charge us $20, and then they charge us 10 cents for each additional minute.2812

So, $20 plus that additional 10 many minutes did we have? We had t.2820

So, 0.1t--that is what it is; let's do a really quick test--let's say if we had talked 100 minutes.2825

Then 100 minutes times 10 cents would be $10, so we would have a $30 total,2834

which, if we plug that into our new function that we just made, p(t), p(100) would be 20 + .1(100), which would come out to be 30.2839

Great, so the first part of it checks out.2846

What about the second portion, though?--that is where things start to get a little complicated.2848

So, in the second portion, when we are over 200, which is to say t > 200...2853

and actually can be greater than or equal, because we know that they are going to have to agree;2861

there is not going to be a sudden jump there; and we will talk about that more later.2865

It is a way of checking this function, actually.2867

We know that it is going to be 5 cents for each additional minute.2870

Our first thought might be, "Oh, great, easy; it is going to be 0.05t."2875

Not true--this is not going to be the case.2880

Why not? Because it is for each additional minute, over 200; so after 200, you get charged at 5 cents per minute.2884

Before that, you still get charged at the 10 cents; so how many minutes over 200?2894

Well, that is not too hard; we know that we have t minutes total.2904

We know that we are already over 200, so it is going to be the number of minutes we have talked, minus 200.2908

So, t - 200 is the number of minutes we talked; so it is 0.05 cents, times t - 200.2914

Now, that is the amount of additional money that will be on top of some lump.2922

How much is it to even make it to 200 minutes in the first place?2927

Well, 200 minutes in the first place: let's see what it is from our first one.2930

p(200) would be equal to 20 + 0.1(200); just move the decimal place over one, so it becomes 20; so 20 + 20 is 40.2934

So, it costs $40 to get up to 200 minutes; so it costs $40 at 200, and then it is plus the additional amount per minute.2947

So, for the second portion, our function is going to be p(t) = $40, the lump sum that we have to pay at first2967

to have even made it to the 200-minute mark, plus 5 cents for the number of minutes over 200 minutes.2975

So, our function has been broken into 2 pieces; so we have a piecewise function here, p(t) = 20 + 0.1t when t ≤ 200,2984

and 40 + 0.05 times the minutes over 200 when t ≥ 200.3001

Now, we know that the two have to agree; otherwise, people would make sure to make that jump or not make that jump,3014

because otherwise with the sudden change, or the switch--it wouldn't make sense for the phone company3019

to have it suddenly leap more on your bill or cut off a portion of your bill if you were to hit the 200 mark.3024

It is going to just continue in a continuous function, we would expect.3029

So, we can check this; and we can check and make sure that, indeed, p(200) = 20 + 0.1(200).3034

We already did this before; it was $40; and let's check and make sure that the second portion, p(200), would agree.3044

40 + 0.05 at the minutes over 200, so that is 200; 200 - 200 is just 0, so that cancels out the 0.05; so we get 40.3053

So, those two things check, and our function, price in respect to time, makes perfect sense.3068

So, p(t) = 20 + 10 cents per minutes when minutes are less than or equal to 200,3075

or 40 + 5 cents per minutes over 200, when the number of minutes is greater than or equal to 200.3080

Great; I hope piecewise functions are making a lot more sense now.3087

Remember: it is an idea about putting into the category, then applying the rule based on the category.3090

That is the prime, the major idea in piecewise functions; if you can hang onto that, you will be able to make sense of them.3095

All right, we will see you at later--goodbye!3100