Main Page Everything for Finite Math Everything for Applied Calc Everything Topic Summaries On Line Tutorials On Line Utilities
← Previous Summary Next Summary → Tutorial for This Topic Review Exercises E-mail Webmaster Textbook Lleveme a la Página Español
Applied calculus topic summary: functions and linear models

Tools: Function Evaluator & Grapher | Excel Grapher | Simple Regression Utility

Subtopics: Functions and Domains | Intervals | Graph of a Function | Linear Functions | Straight Lines | Graph of a Linear Function | Linear Models | Interpretation of the Slope | Cost, Revenue, Profit | Demand and Revenue | Linear Regression


Functions and Domains

A real-valued function f of a real variable is a rule that assigns to each real number x in a specified set of numbers, called the domain of f, a single real number f(x).

The variable x is called the independent variable. If y = f(x) we call y the dependent variable.

A function can be specified:

  • numerically: by means of a table
  • algebraically: by means of a formula
  • graphically: by means of a graph

Note on Domains
The domain of a function is not always specified explicitly; if no domain is specified for the function f, we take the domain to be the largest set of numbers x for which f(x) makes sense. This "largest possible domain" is sometimes called the natural domain.

Press here to link to a page that will allow you to evaluate and graph functions on-line.
Press here to download an Excel grapher.

Top of Page

Examples

A Numerically Specified Function: Let the function f be specified by the following table.

x0123
f(x) 3.01 -1.03 2.22 0.01

Then, f(0) = 3.01, f(1) = -1.03, and so on.

An Algebraically Specified Function: Let the function f be specified by f(x) = 3x2 - 4x + 1. Then

    f(2) = 3(2)2 - 4(2) + 1 = 12 - 8 + 1 = 5,
    f(-1) = 3(-1)2 - 4(-1) + 1 = 3 + 4 + 1 = 8.
Since f(x) is defined for every x, the domain of f is the set of all real numbers.

A Graphically Specified Function: Suppose f is specified by the following graph.

Then, f(0) = 1, f(1) = 0, and f(3) = 5.

Top of Page
Intervals

The closed interval [a, b] is the set of all real numbers x with axb.

The open interval (a, b) is the set of all real numbers x with a < x < b.

The interval (a, ∞) is the set of all real numbers x with a < x < +∞, while (-∞, b) is the set of all real numbers x with -∞ < x < b.

We also have half open intervals of the form [a, b) and (a, b].

Top of Page
Examples

IntervalPicture Description
[-1, 6)-1 ≤ x < 6
(2, 4)2 < x < 4
(-∞, 0]-∞ < x ≤ 0

Top of Page
Graph of a Function

The graph of a function f is the set of all points (x, f(x)) in the xy-plane, where we restrict the values of x to lie in the domain of f.

The following diagram illustrates the graph of a function

Vertical Line Test
For a graph to be the graph of a function, each vertical line must intersect the graph in at most one point.

Top of Page
Example

To get the graph of

f(x) = 3x2 - 4x + 1   Function notation
with domain restricted to [0, + ∞), we replace f(x) by y, getting the equation
y = 3x2 - 4x + 1.   Equation notation
We then graph it by plotting points, restricting x to lie in [0, + ∞), and obtain the following picture.

There is nothing to the left of the y-axis, since we have restricted x to be ≥ 0.

Top of Page
Linear Functions

A linear function is a function of the form

    f(x) = mx + b     Function notation
    y = mx + b     Equation notation

with m and b being fixed numbers (the names 'm' and 'b' are traditional).

Role of m: If y = mx + b, then:
 (a) y changes by m units for every 1-unit change in x.
 (b) A change of Δx units in x results in a change of Δy = mΔx units in y.
 (c) Solving for m, we obtain

    m=
    Δy

    Δx
    =
    change in y

    change in x

Role of b: When x = 0, y = b (Equation form), or f(0) = b (Function form)

Top of Page
Examples

The function

f(x) = 5x - 1
is a linear function with m = 5 and b = -1.

The following equations can be solved for y as linear functions of x.

    3x - y + 4 = 0   y = 3x + 4
    4y = 0y = 0
    3x + 4y = 5y = -(3/4)x + 5/4

Top of Page
Straight Lines

The graph of a linear equation or function is a straight line. The slope of the line through (x1, y1) and (x2, y2) is given by the formula

    m=
    y2 - y1

    x2 - x1
    =
    Δy

    Δx

The graph of the linear function

f(x) = mx + b   Function form
or    
y = mx + b   Equation form

is a line with slope m and y-intercept b.

Top of Page
Examples

The slope of the line through (2, -3) and (1, 2) is given by

    m=
    y2 - y1

    x2 - x1
    =
    2 + 3

    1 - 2
    =-5.

To see how to sketch the graph of a linear function, see the next item

Top of Page
Sketching the Graph of a Linear Function

There are two good ways to sketch the graph of a linear function.

(a) Put the function in y = mx+b form, and draw the line with y-intercept b and slope m.

(b) Find the x- and y-intercepts and draw the line going through those two points. To find the x-intercept of a line, set y = 0 in its equation and solve for x. To find the y-intercept, set x = 0 and solve for y. This method works only if the line does not pass through the origin. If it does, then you will need to plot an extra point or use the first method.

Top of Page
Examples

Here are the these techniques applied to the line with equation 2x - 3y = -6.

(a) Solving for y, we get y = 2x/3 + 2. Thus, the slope is 2/3 and the y-intercept is 2. The following figure shows two stages of drawing its graph.

Step 1
Start with the y-intercept.
Step 2
Draw a line with the given slope.
y-intercept =2
slope = 2/3

(b) To get the x-intercept, set y = 0. The equation becomes 2x - 3(0) = -6, giving x = -3. This is the x-intercept. To get the y-intercept, set x = 0, to obtain 2(0) - 3y = -6, giving y = 2. The following figure shows two stages of drawing its graph.

Step 1
Start with x- and y-intercepts.
x-intercept = -3
y-intercept = 2
Step 2
Draw the line through the intercepts.

Top of Page
Fitting a Linear Equation to Data: How to Make a Linear Model

Point-Slope Formula:

An equation of the line through the point (x1, y1) with slope m is given by

y = mx + b    
where
b = y1 - mx1

When to Apply the Point-Slope Formula

  • Apply the point-slope formula to find the equation of a line whenever you are given information about a point and the slope of a line. The formula does not apply if the slope is undefined.
  • If you already know the slope m and y-intercept b, then you can just write down the linear function as
        y = mx + b.
    This is known as the slope-intercept formula

Horizontal and Vertical Lines

An equation of the horizontal line through (x1, y1) is

y = y1.

An equation of the vertical line through (x1, y1) is

x = x1.

Top of Page
Examples

An equation of the line through (1, 2) with slope -5 is given by
y = -5x + b,
where
b = y1 - mx1 = 2 - (-5)(1) = 7
so
y = -5x + 7.


An equation of the horizontal line through (3, -4) is given by

    y = -4.

An equation of the vertical line through (3, -4) is given by

    x = 3.

Top of Page
Interpretation of the Slope in Applications

The slope of the line y = mx + b is the rate at which y is changing per unit of change in x. The units of measurement of the slope are units of y per unit of x

If y is displacement and x is time, then the slope represents velocity. Its units are units of displacement per unit time (for example, meters per second)

If y is cost and x is the number of items, then the slope represents marginal cost. Its units are units of cost per item (for example, Eurodollars per item).

Top of Page
Example

The number of web pages in this site is given by the equation

n = 1.2t + 200,
where t is time in weeks since June 1, 1997. The slope is m = 1.2 web pages per week. Thus, the number of web pages is growing at a rate of 1.2 web pages per week.

Top of Page
Cost, Revenue and Profit

A cost function C gives the cost C(x) as a function of the number of items x. A linear cost function has the form

C(x) = mx + b,

where m is the marginal cost, and b is the fixed cost. A revenue function R gives the total revenue R(x) from the sale of x items. A profit function P gives the total profit P(x) from the sale of x items. The profit, cost and revenue functions are related by the formula

P(x) = R(x) - C(x).

Break-even occurs when

P(x) = 0

or equivalently when

R(x) = C(x).
Example

If the fixed cost is $400, the marginal cost is $40 per item, and you sell the items at $60 per item, then

    C(x) = 40x + 400
    R(x) = 60x
    P(x) = R(x) - C(x)
      = 60x - (40x + 400)
      = 20x - 400.
For break-even,
    P(x) = 0
    20x - 400 = 0,
so that x = 20. Therefore, you must sell 20 items to break even.

Top of Page
Demand and Revenue

A linear demand equation has the form q = mp + b, where q is the demand (number of items sold) and p is the price per item. One can construct a linear demand equation from a knowledge of the demand at two different prices. The revenue is given by

R = pq (price times quantity).

One can specify revenue as a function of p alone by using a demand equation to substitute for q.

Top of Page
Example

If you sell 100 T-shirts per week when the price is $10, and 200 per week when you lower the price to $8, then the demand equation is

    q = -50p + 600     Equation of the line through (10, 100) and (8, 200)
The associated revenue function is then
    R = pq = p(-50p+600)
        = -50p2 + 600p.

    Top of Page
Linear Regression

Observed and Predicted Values

Suppose we are given a collection of data points (x1, y1), ..., (xn, yn). The n quantities y1, y2, ..., yn are called the observed y values. If we model these data with a linear equation


    y
    =mx + b      

    y
      stands for "estimated" or "predicted" y.
then the y values we get by substituting the given x-values into the equation are called the predicted y values:

    y1
    = mx1 + b       Substitute x1 for x

    y2
    = mx2 + b Substitute x2 for x
        . . .    

    yn
    = mxn + b Substitute xn for x

Residuals and Sum-of-Squares Error (SSE)

If we model a collection of data (x1, y1), ... , (xn, yn) with a linear equation as above, then the residuals are the n quantities (Actual Value - Predicted Value):

         
    (y1 - y1),  
         
    (y2 - y2),  
    . . .   ,    
    (yn - yn)

The sum-of-squares error (SSE) is the sum of the squares of the residuals:

    SSE =          
    (y1 - y1)2 +
           
    (y2 - y2)2 +
    . . .   +        
    (yn - yn)2 +

Regression Line

The regression line (least squares line, best-fit line) associated with the points (x1, y1), (x2, y2), . . ., (xn, yn) is the line that gives the minimum value for SSE.

The regression line has the form

    y = mx + b

where

    m=
    nxy) -x)(Σy)

    nx2) -x)2
    b=
    Σy - mx)

    n
    n= number of data points

Try the on-line regression utility if you want to see regression at work.

Top of Page
Examples

Observed and Predicted Values

For the three data points (0, 2), (2, 5), and (4, 6), the observed y values are y1 = 2, y2 = 5, and y3 = 6. If we model these data with the equation


    y
    =2x + 1.5
then the predicted values are obtained by substituting the x-values in the equation of the line:

    y1
    =
    2x1 + 1.5 = 2(0) + 1.5 = 1.5

    y2
    =
    2x2 + 1.5 =  

    y3
    =
    2x3 + 1.5 =
     

Residuals and Sum-of-Squares Error (SSE)

For the three data points (0, 2), (2, 5), and (4, 6) and linear model 2x + 1.5 as given above, the residuals are:

     
    y1 - y1
    =2 - 1.5 = 0.5
     
    y2 - y2
    =
     
     
    y2 - y2
    =
     

The sum-of-squares error is obtained by squaring and adding the answers:

    SSE = (0.5)2 + (-0.5)2 + (-3.5)2 = 12.75

Top of Page
Last Updated: July 2007
Copyright © Stefan Waner

Top of Page