Equations of the form f(x) = g(x) may be solved
for x graphically using the function generation
and plotting capabilities of XYPLOT. The general procedure
is to create the functions f(x) and g(x) and
to identify the points of intersection between the
two curves. Some examples are given below.
In this case f(x) = x5 + x + 1 and g(x) = 0.
Example 1.4 illustrated how to
generate the function f(x). The function g(x) need not
be generated since XYPLOT draws the y = 0 axis line.
- Generate f(x) over the interval (-2,2) using a step size
of 0.01 or finer. Note: You have to make a guess about the
region in which the solution is likely to exist; in this case we
chose the domain interval to be (-2,2).
- Look at the plot of f(x) and
identify the point at which it crosses through the horizontal axis
line (y = 0).
- Zoom in on the region about the point of
intersection, place the cursor on the point and read the x
coordinate from the display.
- Check your solution for x by plugging it into the equation.
Tip: Use the line plotting symbol to help
interpolate the point of intersection.
For this case f(x) = e-x and g(x) = x.
- Generate f(x) using Template
once and the Rescale
operation twice. The first Rescale expression is y*-1,
and the second is exp(y).
- Generate g(x) using Template.
- Find the point of intersection between the two curves in
the plot.
- Check your solution for x by plugging it into the equation.