Algebra & Functions · Graph of a function

Graph of a function

The set of all points (x, f(x)) for x in the domain. For x in the domain, f(x) is the y-coordinate of the graph’s point above or below it; where the line y = c meets the graph, the x-coordinates give all the solutions of f(x) = c.

The graph of a function in this visualization

The graph of a function ff consists of the points (x,f(x))(x, f(x)) for xx in its domain DD. From it you can read the output at a given input, or find every input that gives a chosen output. A point lies on the graph exactly when its yy-coordinate is the function's value at its xx-coordinate, which is why the graph is often described by the equation y=f(x)y = f(x).

Graph of f
{ (x,f(x)):x∈D }\{\, (x, f(x)) : x \in D \,\}

Switch the graph off and move xx: the moving point traces the part of the graph it visits. The curve you usually see is this track with every input visited. Because each input has exactly one output, each vertical line through an input in the domain meets the graph exactly once; the Function page explains this test.

Reading it both ways

For aa in the domain, go from aa on the xx-axis straight up or down to the graph, then across to the yy-axis. The height you arrive at is f(a)f(a).

To solve f(x)=cf(x) = c, read the other way. Draw the horizontal line y=cy = c; each point where it meets the graph has height cc, so its xx-coordinate is a solution, and every solution appears this way. Counting meeting points counts solutions. A point where the line only touches the graph is still one point and one solution. The line can also miss the graph entirely, lie along a flat piece so that a whole interval solves the equation, or meet a graph that keeps returning to the same height infinitely often.

Domain and range as shadows

Press the graph flat onto the xx-axis and the shadow it leaves is the set of inputs that have a point: the domain. Pressed onto the yy-axis, it leaves every height the graph reaches: the range. So f(x)=cf(x) = c has a solution exactly when cc lies in the range. At the end of a shadow, a filled dot means that coordinate is included and an open circle means it is not. For 4/x4/x, with no point above 00 and no height 00, both shadows have a gap at 00. A graph that runs off the picture does not stop there; the cubic's range is every real number, though only part of it fits on the screen.

Why joining plotted points can mislead

Drawing a graph by hand usually means working out a few points and joining them. The points are true; the joins are a guess about what happens between them, and finitely many points cannot settle that. Samples taken at a fixed step can all land at the same height while the graph swings up and down in between. A smaller step can reveal what a larger one missed, as the sine's peaks and troughs show, but it cannot always mend the picture: on the floor function every join across a jump is a slant the graph never takes, however small the step. Joining points works when you already know the function has no surprises between them, and that knowledge comes from the function, not from the points.

Controls

  • The handles for x and c move with the arrow keys, 0.1 at a time (0.01 with Shift). The horizontal line can be dragged anywhere along its length. Where the things you can drag overlap, drag sideways to change x or up and down to change c.

Related