Class 2
Between Class Sessions - Prep for Day 2
Please spend around 2 hours working between class sessions, focusing on the tasks below. Use any extra time to complete KnewtonAlta assignments and/or work on Project tasks.
Pick something from your prep today that you can share with your group in class. It might be something new that you learned. It might be questions you have that are still unanswered, or a question along with what helped you eventually answer it. It might be something tricky that you solved. It might be a review topic that helped you remember something. It might be a conversation you had with AI that was helpful. You will have a chance to share this with your peers during class. Come ready to articulate your thinking and questions.
Preparation
(1) Familiarize yourself with class
- Read the Syllabus
- Complete the Background Survey
- Open a Knewton Alta assignment and answer some questions (for example you could open up “1 – Function Evaluation”). The point is to make sure you have gotten into the system, and seen how it works. Feel free to complete one of the assignments.
- Skim read the instructions for Project 1.
(2) Graphing Functions
Our first Unit is focused on expanding our knowledge and understanding of functions. Plot the following functions by hand. Select five or more input values, calculate the corresponding output values, plot the points, and connect the points with a line. Check your work by plotting the function with Desmos (or another graphing calculator).
- \(f(x) = 1-4x\)
| \(x\) | \(f(x)\) | \((x, f(x))\) |
|---|---|---|
| -2 | 9 | (-2,9) |
| -1 | ||
| 0 | ||
| 1 | ||
| 2 |
- \(g(x) = |2x+4|\)
| \(x\) | \(g(x)\) | \((x, g(x))\) |
|---|---|---|
| -4 | 4 | (-4,4) |
| -3 | ||
| -2 | ||
| -1 | ||
| 0 |
- \(h(x) = \frac{1}{2}x^2+3\)
| \(x\) | \(h(x)\) | \((x, h(x))\) |
|---|---|---|
| -2 | 5 | (-2,5) |
| -1 | ||
| 0 | ||
| 1 | ||
| 2 |
(3) Start working with R
- Install R.
- Install Positron — the recommended IDE for this course. It has R and Python support built in and works seamlessly with Quarto. Setup: Install Positron.
- Open a new file and use it to perform a few computations in R. One option is to repeat some of the computations you did during class in groups, but this time using R. Or pick something else of interest. Feel free to search the web for a short R tutorial.
- Construct the plot of a function (either one from part 2 above, from class, or one of your choice).
You could play with and adjust the code below as a starting point.
x <- c(1,2,3,4,5)
y <- c(1,4,9,16,25)
plot(x,y,type='l')Note for step 2 — Setting up R in VS Code (optional, click to expand)
If you prefer VS Code instead of Positron, here’s what you’ll need beyond the editor itself:
Install the R Extension for VS Code (publisher: REditorSupport).
In the R console, install the
languageserverpackage — this powers autocomplete and inline help inside VS Code:install.packages("languageserver")For plots to display nicely in VS Code, install
httpgd:install.packages("httpgd")Then in VS Code settings search for “R plot” and enable R > Plot: Use Httpgd.
For rendering Quarto documents, install the Quarto CLI plus the Quarto VS Code extension — then run
quarto render file.qmd(or use the Quarto preview command from VS Code’s command palette).Open an
.Ror.qmdfile and use Cmd/Ctrl + Enter to run the line at your cursor.
Because course materials assume Positron, if you’re on VS Code you’ll sometimes need to translate pane names (e.g. “Plots tab” → the httpgd browser window, “Environment” → the R Side Bar).
During Class
Brain Gains
- For the function \[\ds f(x) = \begin{cases} x^3 & \quad x < -1 \\ \\ -2 & \quad -1 < x < 4 \\ \\ \sqrt{x} & \quad x \geq 4. \end{cases},\] find \(f(-2)\), \(f(-1)\), and \(f(4)\).
Possible Solution
- We have \(f(-2) = (-2)^3 = -8\) because \(x=-2\) satisfies \(x<-1\).
- Note that \(-1\) does not lie in any of the three given regions, which means \(f(-1)\) is undefined.
- We know \(f(4) = \sqrt{4} = 2\) as \(x=4\) satisfies \(x\geq 4\).
- Let \(f(x) = x^2\). Determine whether or not \(f(3+4) = f(3) + f(4)\).
Possible Solution
Given \(f(x) = x^2\), we know \(f(3) = 9\), \(f(4) = 16\), and \(f(3+4)=f(7)=49\). Since \(9+16 = 25\neq 49\), then we know \(f(3+4) \neq f(3) + f(4)\).
Important take away:
- In general, the square of a sum is NOT the sum of the squares, \((a + b)^2 \neq a^2 + b^2\).
- The operation of addition must happen before the power. The order of operations is grouping and then exponents.
There is an entire class of functions for which \(f(a+b) = f(a)+f(b)\). We call these “linear functions” and they are studied in depth in Math 341: Linear Algebra.
Group Discussion
Start by giving each person a moment to share what they chose to prepare for class. Help each other address any questions. When each person has had a chance to share, move on the other activities.
Activity - Reading Definitions and Classifying Functions
Read the following definitions and then use them to classify each of the functions in the table.
Line
A line is a function that can be written in the form \(f(x) = mx+b\), where \(m\) and \(b\) are constants.
Note: The input to this function \(x\) is a variable and the constants \(m\) and \(b\) are parameters of this function \(f\). To make this explicit mathematically we can write \(f(x; m, b) = mx + b\). The colon separates the variables from the parameters.
Quadratic Function
A quadratic function is a function that can be written in the form \(f(x) = ax^2 + bx + c\), where \(a\), \(b\), and \(c\) are constants with \(a \neq 0\).
Polynomial Function
A polynomial function is any function that can be written in the form \(f(x) = a_nx^n + a_{n-1}x^{n-1} + ... + a_1x + a_0 = \sum_{k=0}^n a_kx^k\) for some integer \(n \geq 0\) and constants \(a_0\), \(a_1\), … \(a_{n-1}\), \(a_n\) (with \(a_n \neq 0\)). The integer \(n\) we call the degree of the polynomial.
When \(n=0\), we relax the condition (\(a_n \neq 0\)) and allow \(a_0 = 0\). The function \(f(x) = 0\) is called the zero function.
Power Function
A power function is any function of the form \(f(x) = ax^b\) where \(a\neq 0\) and \(b\) are real numbers.
Root Function
A root function is a power function of the form \(f(x) = x^{1/n}\) where \(n\) is a positive integer greater than one.
Rational Function
A rational function is any function of the form \(f(x) = \frac{p(x)}{q(x)}\) where \(p(x)\) and \(q(x)\) are polynomials.
Exponential Function
An exponential function is any function of the form \(f(x) = b^x\) where \(b > 0\) and \(b \neq 1\).
As a group, discuss whether each function is a power function, quadratic function, polynomial function, root function, and/or a rational function. Record your solutions in a table similar to the following. Note a function can be classified as multiple types.
| power fn. | quadratic fn. | polynomial fn. | root fn. | rational fn. | |
|---|---|---|---|---|---|
| \(f(x) = x^2\) | |||||
| \(g(x) = \sqrt{x}\) | |||||
| \(h(x) = x^3\) | |||||
| \(p(x) = \sqrt{3x+1}\) | |||||
| \(q(x) = x^3 - 3x + 2\) | |||||
| \(A(x) = (x-1)^2\) | |||||
| \(r(x) = \frac{2x+3}{x^2+1}\) | |||||
| \(w(x) = 5^x\) |
After you’ve finished classifying the functions, first compare your results with the other groups in class. Discuss any changes you believe need to be made. Then expand the solution below and discuss any questions you have.
Answer
| power fn. | quadratic fn. | polynomial fn. | root fn. | rational fn. | |
|---|---|---|---|---|---|
| \(f(x) = x^2\) | X | X | X | X | |
| \(g(x) = \sqrt{x}\) | X | X | |||
| \(h(x) = x^3\) | X | X | X | ||
| \(p(x) = \sqrt{3x+1}\) | |||||
| \(q(x) = x^3 - 3x + 2\) | X | X | |||
| \(A(x) = (x-1)^2\) | X | X | X | ||
| \(r(x) = \frac{2x+3}{x^2+1}\) | X | ||||
| \(w(x) = 5^x\) |
The function \(w(x) = 5^x\) is an exponential function.
Examples and Nonexamples - Give an example of a polynomial that is NOT a power function. - Give an example of a power function that is NOT a polynomial.
Possible Solutions
These are some solutions to the questions above. Come up with your own, and jot them on the chalk board.
- Examples of polynomials that are NOT power functions.
- \(q(x) = x^3 - 3x + 2\)
- \(A(x) = (x-1)^2\)
- Examples of power functions that are NOT polynomials
- \(g(x) = \sqrt{x}\)
- \(f(x) = -2x^{-4}\)
Activity - Exploring Functions
Let \(f(x) = x^2\). Complete each of the following exercises below.
- Complete each table below.
| \(x\) | \(f(x)\) |
|---|---|
| -2 | |
| -1 | |
| 0 | |
| 1 | |
| 2 |
| \(x\) | \(g(x) = f(x) + 2\) |
|---|---|
| -2 | |
| -1 | |
| 0 | |
| 1 | |
| 2 |
| \(x\) | \(h(x) = f(x+2)\) |
|---|---|
| 4 | |
| 1 | |
| 0 | |
| 1 | |
| 4 |
Graph each of the functions from part 1.
The graph of \(g\) is the same as the graph of \(f\) but shifted _________________.
The graph of \(h\) is the same as the graph of \(f\) but shifted _________________.
(True or False) Given \(a\) and \(b\) are constants, is the statement \(f(a+b) = f(a) + f(b)\) true or false.
Repeat parts 1-5 for \(f_2(x) = \sqrt{x}\)
Repeat parts A-E for \(f_3(x) = \frac{1}{x}\).
Class Discussion
Function Definitions
What is a function? Consider the following definitions of the mathematical object, a function.
Definition 1 (from OpenStax textbook)
A function \(f\) consists of a set of inputs, a set of outputs, and a rule for assigning each input to exactly one output. The set of inputs is called the domain of the function. The set of outputs is called the range of the function.
Definition 2 (Sister Johnson’s definition)
A function from set D to a set Y is a rule that assigns each element in set D exactly one element from set Y.
Note:
- The domain of a function from set D to a set Y is the set of inputs of the function. Notice all the values of set D must be used as inputs so the domain is the set D.
- The range of a function from set D to a set Y is the set of outputs of the function. Notice the range of the function is not necessarily set Y, not all the value of set Y must be used as outputs.
Definition 3 (Another Instructor’s definition)
A function is a rule that assigns to every value of the domain just one value in the range. The domain is the inputs of the function. The range is the outputs of the function.
All of these definitions are correct.
What similarities do you notice?
What differences do you notice?
What are the key characteristics of the mathematical object, a function?
What questions do you have?
There are at least four ways to represent a function:
- Algebraic (symbolic)
- Graph (visual)
- Table (numeric)
- Words (verbal)
Plotting with R
We’ll spend the rest of class time using R to plot functions from the work we’ve done in class today.
Source: Class.2 on byuimath.com