lecture 4: Formal definition of a function, simple examples of functions (linear, quadratic), how to draw them and how to figure out their domain and range.
What is a function?
1. Motivational Real-World Example
Vending Machine Analogy:
A vending machine takes in a selection code (e.g., A1, B2) and gives you a unique snack. If you press A1, you always get the same item. It doesn't give two snacks, and it doesn't give you different items each time.
That’s the essence of a function: Each input leads to exactly one output.
2. Formal Definition
A function is a rule that assigns each element from a set called the domain to exactly one element in another set called the range.
Notation:
, where for each .
( is the domain and is the range.)
3. Domain and Range
- Domain: All the inputs for which the function is defined.
- Range: All possible outputs the function can produce.
Two functions can have the same domain and range but be completely different rules.
(e.g., vs. ).
Co-domain vs. Range
- Co-domain: The set of all possible outputs that could be produced by the function.
- Range: The set of all actual outputs that are produced by the function.
So, the range is a subset of the co-domain.
Example:
- Co-domain: all real numbers
- Range: all non-negative real numbers
4. Why Do We Care?
-
Functions are how we model relationships between quantities: position vs. time, cost vs. production, temperature vs. altitude.
-
In calculus, functions are the primary objects of study for understanding change and motion.
5. Examples
- A temperature converter:
- A vending machine:
- A calculator: pressing "=" gives you the result of the expression you entered.
- This is a function because each input (expression) gives exactly one output (result).
Examples of mappings that are not functions:
- Person to their phone number: a person can have multiple phone numbers.
- Restaurant menu special: a special can change every day.
- Birthday to person: same birthday maps to multiple people.
- Language translation: same word can have multiple meanings.
Questions:
- Is ChatGPT a function?
- Is Google search a function?
Linear Functions
1. Example
If you earn 10 Riyals for every hour worked: is a linear function.
2. General Form
- m = slope (rate of change)
- b = y-intercept (starting value)
3. Graph
- Always a straight line.
- Slope = rise/run.
- Domain = all real numbers ()
- Range = all real numbers ()
Example:
Graph of :![]()
Quadratic Functions
1. Why Use Quadratics?
Used to model things like:
- Projectile motion
- Revenue as a function of sales
- Area as a function of side length
2. General Form
- Parabolic shape (opens up if , down if )
- Vertex is turning point
3. Domain and Range
- Domain:
- Range:
- If ,
- If ,
Example:
Graph of
- Domain: all real numbers
- Range: depends on the minimum point. In this case, the minimum point is at .
![]()
4. Vertex
The vertex of a quadratic function is the point where the function changes direction.
The x-coordinate of the vertex of a quadratic function is given by the formula:
The y-coordinate of the vertex is then found by plugging the x-coordinate back into the function.
Example:
- The x-coordinate of the vertex is .
- The y-coordinate of the vertex is .
- The vertex is at .
Function evaluation
If given a formula, function evaluated at a point is the value of the function at that point.
Examples:
By the same logic, we can evaluate functions at points represented by expressions.
Examples:
Regular Exercises
1. Water Tank Domain and Range
A water tank is being drained. The function gives the amount of water (in liters) left in the tank after minutes.
The tank starts full at 100 liters, and drains at 5 liters per minute, until empty.
- a) Write a possible rule for .
- b) What is the domain of ?
- c) What is the range of ?
- d) Could this function continue forever?
Solution
a) The tank starts full at 100 liters and drains at a rate of 5 liters per minute. Once it’s empty, the amount of water stays at 0.A piecewise function to represent this is:
b) The domain is all non-negative real numbers since time can continue indefinitely:
c) The range is all the possible values of . The tank drains from 100 liters to 0 and stays at 0:
d) Yes, the function continues forever. After 20 minutes, the tank is empty and the water level remains at 0 for all .
2. Photo Frame
You have a square photo print with side length centimeters. You want to add a frame of constant width centimeters all around it.
- Suppose you have exactly of frame material available.
- Write and solve an equation to find the side length of the photo that would exactly use up the available frame material.
Hint: Write the area of the frame as a function of , and then solve for .
Solution
Let the photo side length be cm. The frame adds 2 cm all around, so the total side length with frame is:
The area of the photo alone is:
The area of the photo plus frame is:
The area of the frame alone is the difference:
Given frame area = 100 cm², write the equation:
Expand:
Solve for :
So, the photo side length should be 10.5 cm.
3. Quadratic Function Construction
Construct a quadratic function that satisfies the following:
- The vertex is at
Solution
The vertex form of a quadratic is:
where vertex is at . Here, vertex gives:
Use to find :
Therefore, the function is:
4. Reverse Engineering a Function
You are given that:
-
-
-
-
- a) Can you guess a formula for ?
- b) Is your function linear or nonlinear? How can you tell?
- c) Could more than one rule produce these values? Why or why not?
Solution
a) Look at the values:
Notice that each time increases by 1, increases by 3. So the function increases linearly with slope 3.
A possible formula is:
b) The function is linear because the output changes by a constant amount (3) for every increase of 1 in .
c) Could more than one rule produce these values?
Technically, yes — more than one function could match these four points but behave differently elsewhere.For example, consider the absolute value function:
Let's check the values:
These outputs do not match the original values, proving this is a different rule. However, with careful design, a nonlinear function could be made to match specific points.
This example shows that just a few input-output pairs aren’t enough to uniquely determine a function, especially if you're not assuming linearity. Different rules can fit the same values at some but behave differently elsewhere.
Extra Advanced Exercises
1. Fencing a Rectangular Area
You are given 40 meters of fencing and want to enclose a rectangular area against a wall (so you only need to fence three sides). Let be the width of the fenced rectangle.
- a) Write a function for the area in terms of .
- b) What is the domain of ?
- c) Find the value of that gives the maximum area, and explain how you know it's a maximum.
2. Composing Functions
You’re told that:
And someone tells you it came from composing two functions and , so that
- a) Find at least one possible pair such that this is true.
- b) Can you find a different pair of functions that also work?
- c) What is the domain of ? How does that relate to the domains of and ?