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.

Example: Solve the equation x5 + x + 1 = 0

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.
  1. 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).
  2. Look at the plot of f(x) and identify the point at which it crosses through the horizontal axis line (y = 0).
  3. Zoom in on the region about the point of intersection, place the cursor on the point and read the x coordinate from the display.
  4. Check your solution for x by plugging it into the equation.
Tip: Use the line plotting symbol to help interpolate the point of intersection.

Example 2.2: Solve the equation e-x = x

For this case f(x) = e-x and g(x) = x.
  1. Generate f(x) using Template once and the Rescale operation twice. The first Rescale expression is y*-1, and the second is exp(y).
  2. Generate g(x) using Template.
  3. Find the point of intersection between the two curves in the plot.
  4. Check your solution for x by plugging it into the equation.