# on the TI-89

In AP Calculus, finding an equation for a line needs to become almost as automatic as writing your own name - certainly not something that you need a calculator to do for you. (Come to think of it, there isn't anything in AP Calculus that you should need a calculator to do for you!)

However, it certainly can be handy to have a way to quickly check your work or generate some practice or review problems. Below are two user-defined functions that generate equations for lines that you might find handy from time to time.

## Slope of a Line

Calculating the slope of a line segment is a fundamental and very mechanical operation. Slope is defined as:

It is very easy to write a function that will calculate slope. Here's how:

 To begin, press and select "1: Define". I named my function "slope" instead of "m" because 1-character function names get erased when you do a "NewProb". To type the name, press , then type the name. Press again when you finish. The function should look like: Define slope(h1,k1,h2,k2)=(k2-k1)/(h2-h1) I've used "h" and "k" in this function instead of "x" and "y" because "y1" and "y2" are used for special purposes by the calculator. To enter them, type "(" "h1," "v1," "h2," "v2). To enter the body of the function, type "=(" "k2-" "k1)/(" "h2-" "h1) . Here's an example: "What is the slope of the line that contains the points (4, 3) and (-1, 1)?" You can press (VAR-LINK) and select the slope function from the list (or press and type the name), then the point coordinates enclosed in parentheses, then . The slope of the line is 2/5.

## A Line Through Two Points

We know that the equation of a line through the points (x1, y1) and (x2, y2) is:

This is a routine calculation, and it is easy to program the calculator to perform it automatically. Here's how:

 First press "1" to get "1:Define " (or press when "1:Define" is highlighted). I have chosen the name "linepp", meaning "line,point-point" for my function (you can choose another), to enter it, press "linepp" . I have named my parameters h1, v1, h2, and v2 instead of x1, etc. To enter them, type "(" "h1," "v1," "h2," "v2). The body of the function follows the two-point equation shown above. Type "=((" "v2-" "v1)/(" "h2-" "h1))*(x-" "h1)+" "v1" . This screen shows the right-hand side of the function body. Problem 26 on p. 17 of the Larsen text asks you to write an equation of the line that passes through the points (-3, -4) and (1, 4), and then sketch the graph of the line. The TI-89 solution is shown at right. Note that the equation of the line is actually y = 2x + 2. The "y =" is intentionally omitted from the function result to make it quick and easy to copy and paste the result into the "y =" graph screen. Do this to complete the problem.

## A Line Through a Point With a Given Slope

An extraordinarily common exercise in AP Calculus is to generate the equation of a line through some given point with some given slope. Of course, the line through the point (x1, y1) with slope m is:

y - y1 = m(x - x1)

and a simple user-defined function follows readily from this.

 I have named my function "linepm", to mean "line, point-slope". First, enter "Define " by pressing and selecting "1: Define", then type the function name and its three parameters in parentheses, followed by "=" The function body is very simple. Here is a solution for problem 34 on p. 17 of the Larsen text, which asks you to "find an equation of the line through the point" ((-2, 4) with slope = -3/5. Again, the "y =" part of the equation has been omitted to make it more convenient to copy and paste the function results into other places, like the "y =" graph menu to graph the line.

last update August 22, 2007 by JL Stanbrough