Functions:

Combination and Composition

Lesson Overview

Instructor Presentation

Introduction

Sometimes it is more advantageous to graph a combination of functions by graphing the individual parts and combining them on the graph.  This gives the grapher a better idea of the function as a whole and why the parts are important.

Goals

Students will be able to use Mathematica to graph functions and combinations of functions.

Students will work backwards and Decompose a combination into two functions that can be added to create it.

Students will make predictions before graphing functions concerning the domain, range, and other characteristics.  This is especially helpful in more "abstract" graphing situations, such as Absolute Value, Greatest Integer, and Rational functions.

Notes

Absolute Value functions: y = |x|

Plot[Abs[x],{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->Thick]

Greatest Integer functions: y = [[x]]

Plot[Floor[x],{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->Thickness[0.01]]

Rational functions: y = (1/(x-1))

Plot[(1/(x-1)),{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->Thick]

Concept Exploration

Bases of Exponential functions

Combining 2 graphs

Let's look at the graphs of y = |x|, y = |x + 2|, and their sum.

Plot[{Abs[x],Abs[x+2]},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thick,Red},{Thick,Blue}}]

Now...let's add the two functions together.

Plot[{Abs[x],Abs[x+2],Abs[x]+Abs[x+2]},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thick,Blue},{Thick,Red},{Thick,Purple}}]

You'll notice that at each x-value, the blue graph's function value plus the purple graph's function value equals the function value of the thicker graph.

Examples

Example 1

Graph y = |x|, y = |x - 2|, and y = |x + 3| on the same set of axes.

Plot[{Abs[x],Abs[x-2],Abs[x+3]},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thick,Blue},{Thick,Red},{Thick,Green}}]

Now graph the sum: y = |x| + |x - 2| + |x + 3|.  But before you do, answer the following questions.

1)  What is the domain of the new graph?

Answer:

2)  What is the range?

Answer:

3)  At what x-values do you expect sharp points? (To answer this proceed to the graph.

Plot[{Abs[x],Abs[x-2],Abs[x+3],Abs[x]+Abs[x-2]+Abs[x+3]},{x,-10,10},GridLines->{Range[-10, 10], Range[-5, 15]}, AspectRatio->Automatic, PlotRange->{-5, 15},PlotStyle->{{Thick,Blue},{Thick,Red},{Thick,Green},{Thick,Purple}}]

Example 2

Graph the Step Function y = [[x]] along with y = [[x + 4]]

Plot[{Floor[x],Floor[x+4]},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thickness[0.01],Blue},{Thickness[0.01],Red}}]

Now, add the results.

Plot[{Floor[x],Floor[x+4],Floor[x]+Floor[x+4]},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thickness[0.01],Blue},{Thickness[0.01],Red},{Thickness[0.015],Purple}}]

Answer the following questions concerning this example.

1)  Why did the resultant graph show the steps as "steeper" or increasing more rapidly?

Answer:

2)  What does the resultant graph "mimic?"  (hint: rather than 
y = [[x]], think of y = x, etc.)

Answer:

Example 3

Graph the following rational functions on the same set of axes: y = (1/x) and      y = (1/(x+2))

Plot[{(1/x),(1/(x+2))},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thick,Blue},{Thick,Red}}]

In a moment, you will be asked to graph their sum.  But, before you do this, answer the following questions.

1) What is the domain of the graph created by the sum of the two graphs?

Answer:

2)  What is the range of the graph created by the sum of the two graphs

Answer:

3)  Now, graph the function y = (1/x) + (1/(x+2)).

Plot[{(1/x),(1/(x+2)),(1/x)+(1/(x+2))},{x,-10,10},GridLines->{Range[-10, 10], Range[-10, 10]}, AspectRatio->Automatic, PlotRange->{-10, 10},PlotStyle->{{Thick,Blue},{Thick,Yellow},{Thick,Green}}]

Examples - Answer Key

Example 1

1)  Domain = all real numbers.

2)  Range = all real numbers greater than or equal to 5.

Example 2

1)  The steps for each individual function increase by 1 unit with each step.  When the two functions are combined, as the x-values increase by 1, the y-values are added, so each increases by 2.

2)  The step function mimics a line.  (y = x) + (y = x + 4) creates (y = 2x + 4).

Example 3

1)  Domain = all real numbers except 0 and 2.

2)  Range = all real numbers except 0.