BHS Calculus logo

Equations of Lines

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 F4 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 2nd, then type the name. Press alpha 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 "(" ALPHA "h1," ALPHA "v1," ALPHA "h2," ALPHA "v2).

To enter the body of the function, type "=(" ALPHA "k2-" ALPHA "k1)/(" ALPHA "h2-" ALPHA "h1) ENTE R.

slope function

Here's an example: "What is the slope of the line that contains the points (4, 3) and (-1, 1)?"

You can press 2ndminus key (VAR-LINK) and select the slope function from the list (or press 2ndalpha and type the name), then the point coordinates enclosed in parentheses, then Enter. The slope of the line is 2/5.

using the slope function


A Line Through Two Points

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

2-point line equation

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

First press F4 "1" to get "1:Define " (or press ENTER 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 2ndALPHA "linepp" ALPHA.

I have named my parameters h1, v1, h2, and v2 instead of x1, etc. To enter them, type "(" ALPHA "h1," ALPHA "v1," ALPHA "h2," ALPHA "v2).

Define linepp(...

The body of the function follows the two-point equation shown above. Type "=((" ALPHA "v2-" ALPHA "v1)/(" ALPHA "h2-" ALPHA "h1))*(x-" ALPHA "h1)+" ALPHA "v1" ENTE R.

define linepp, part 2

This screen shows the right-hand side of the function body.

define linepp, part 3

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.

p. 17 #26


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 F4 and selecting "1: Define", then type the function name and its three parameters in parentheses, followed by "="

Define linepn, part 1

The function body is very simple.

linepm, part 2

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.

p. 17 #34


last update August 22, 2007 by JL Stanbrough