Functions: Mapping Diagram
Author: Jamie Mulholland

Here we look at a function as a mapping diagram.  The inputs to the function g are along the real number line a the top, the outputs of g are on the real number line in the middle.  The green point A gets mapped to the blue point B by the rule g.
<br><br>
Drag the point A to see how the output B changes.

Click the "composition of two functions" button to see the mapping diagram for the composition of two functions.

You may change the functions by using the input line at the bottom of the applet.  For example to change the function g to cos(x) + e^(x) you would type:
g(x)=cos(x)+exp(x)

0

0

0

1

1

1

R

R

R

compositions of two functions

Move Me

hA: 0.1 * y(Corner[1.0]) + (1.0 - 0.1) * y(Corner[3.0])
hB: 0.5 * y(Corner[1.0]) + (1.0 - 0.5) * y(Corner[3.0])
hC: 0.9 * y(Corner[1.0]) + (1.0 - 0.9) * y(Corner[3.0])
A0: (0.0, hA)
SetA = OrthogonalLine(A0, yAxis)
B0: (0.0, hB)
SetB = OrthogonalLine(B0, yAxis)
C0: (0.0, hC)
SetC = OrthogonalLine(C0, yAxis)
f(x) = sqrt(x)
g(x) = (x^(2.0) - 3.0 * x + 2.0) / (x^(2.0) + 1.0)
A1: A0 + (1.0, 0.0)
B1: B0 + (1.0, 0.0)
C1: C0 + (1.0, 0.0)
A = Point(SetA)
B: (g(x(A)), hB)
InputA: "" + (x(A))
OutputB: "" + (x(B))
Functiong: "g(x)=" + g
textpointg: (0.95 * x(Corner[1.0]) + (1.0 - 0.95) * x(Corner[3.0]), 0.3 * y(Corner[1.0]) + (1.0 - 0.3) * y(Corner[4.0]))
textpointf: (0.95 * x(Corner[1.0]) + (1.0 - 0.95) * x(Corner[3.0]), 0.7 * y(Corner[1.0]) + (1.0 - 0.7) * y(Corner[4.0]))
C: (f(x(B)), hC)
text1: "" + (x(C))
arrowf = Vector(B + 0.01 * (C - B), B + 0.95 * (C - B))
arrowg = Vector(A + 0.01 * (B - A), A + 0.95 * (B - A))
a = false
arrowh = Vector(A + 0.01 * (C - A), A + 0.95 * (C - A))
h(x) = f(g(x))
text2: "h(x) = f(g(x)) = " + h
Functionf: "f(x)=" + f