CITE THIS NOTEBOOK: Class Materials: Introduction to Functions by Athanasios Paraskevopoulos. Wolfram Community FEB 13 2023.
I use this notebook when teaching functions as an additional interactive teaching aid so that my students can better understand each type of function.
It will ensure you’re familiar with functions and function notation. Both will appear in almost every section in a Calculus class so you will need to be able to deal with them.
It will ensure you’re familiar with functions and function notation. Both will appear in almost every section in a Calculus class so you will need to be able to deal with them.
First of all, we will answer the following question. What exactly is a function?
Functions
In mathematics, a function from a set X to a set Y assigns to each element of X exactly one element of Y. The set X is called the domain of the function and the set Y is called the codomain of the function.
A function is a rule that assigns to each element x in a set of X exactly one elements , called f[x], in a set Y.
Example 1
Example 1
Plot[Sin[x],{x,-10,10}]
Out[]=
Define a function:
In[]:=
f[x_]:=x^2
f[2]
Out[]=
4
Here is a function that depend on variables x and t:
In[]:=
g[x_,t_]:=xt+t^3
g[2,3]
Out[]=
33
We can also sketch the graph of the function:
Plot[f[x],{x,0,10}]
Out[]=
We can also use the expression x^2
Plot[x^2,{x,0,10}]
Out[]=
Plug the expression x+1 into the function f[x]
f[x+1]
Out[]=
2
(1+x)
If you want to expand the given expression, use Expand
Expand[f[x+1]]
Out[]=
1+2x+
2
x
f[x+1]//Expand
Out[]=
1+2x+
2
x
In[]:=
Clear[f,g]
Plug the expression x+y into the following expression
In[]:=
g[x_]:=3x^2-2x^2+6x-4
g[x+y]
Out[]=
-4+6(x+y)+
2
(x+y)
g[x+y]//Expand
Out[]=
-4+6x++6y+2xy+
2
x
2
y
Problem:
Problem:
A metal box has volume 100cm^3. It height is twice the length. If the material for the top and the bottom costs $5 per square centimeter, and the material for the sides costs $8 per square centimeter, write a function that gives the total cost of the material needed to make the box in terms of the box's length.
Solution
Solution
In[]:=
cost=5(2lw)+8(2lh+2wh);
In[]:=
v=lwh;
In[]:=
h=2l;
Solve[100==v/.h2l,w]
Out[]=
w
50
2
l
In[]:=
boxcost[l_]:=5(2l(50/(l^2)))+8(2l(2l)+2(50/(l^2))(2l))
boxcost[10]
Out[]=
3410
Vertical Line Test
Vertical Line Test
ParametricPlot[{Cos[t],Sin[t]},{t,0,2π}]
Out[]=
This is not a graph of a function.
You can determine if a graph is a graph of a function by using the vertical line test.
Show[{ParametricPlot[{Cos[t],Sin[t]},{t,0,2π}],ParametricPlot[{2/3,t},{t,-1.1`,1.1`},PlotStyleRed]}]
Out[]=
Piecewise Functions
Piecewise Functions
In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function defined by multiple sub-functions, where each sub-function applies to a different interval in the domain. Piecewise definition is actually a way of expressing the function, rather than a characteristic of the function itself.
A distinct, but related notion is that of a property holding piecewise for a function, used when the domain can be divided into intervals on which the property holds. Unlike for the notion above, this is actually a property of the function itself. A piecewise linear function (which happens to be also continuous) is depicted as an example.
Symmetry
Symmetry
Even Function
Even Function
A function is an even function if f [x] is equal to f [−x] for all the values of x. This means that the function is the same for the positive x-axis and the negative x-axis, or graphically, symmetric about the y-axis.
Odd function
Odd function
The odd functions are functions that return their negative inverse when x is replaced with –x. This means that f(x) is an odd function when f(-x) = -f(x).
Increasing and Decreasing functions
Increasing and Decreasing functions
Increasing Function - A function f(x) is said to be increasing on an interval I if for any two numbers x and y in I such that x < y, we have f(x) ≤ f(y).
Decreasing Function - A function f(x) is said to be decreasing on an interval I if for any two numbers x and y in I such that x < y, we have f(x) ≥ f(y).
The above function is decreasing on [-1,0] and increasing on [0,1] .
The following function is neither increasing nor decreasing:
Elementary functions
Elementary functions
Linear
Linear
A linear function is a function that represents a straight line on the coordinate plane.
The general function f[x]=m x +b is called a linear function and has slope and y-intercept b .
Power functions
Power functions
A power function is a single-term function that contains a variable at its base and a constant for its exponent.
Root functions
Root functions
A root function is a power function of the form f(x)=x^{1/n}, where n is a positive integer greater than one.
Surd is for odd functions
Polynomials
Polynomials
A polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables
Rational
Rational
A rational function is a function that is the ratio of polynomials. Any function of one variable, x, is called a rational function if, it can be represented as f(x) = p(x)/q(x), where p(x) and q(x) are polynomials such that q(x) ≠ 0.
Algebraic
Algebraic
An algebraic function is a function that involves only algebraic operations, like addition, subtraction, multiplication, and division, as well as fractional or rational exponents. Think of an algebraic function as a machine, where real numbers go in, mathematical operations occur, and other numbers come out.
Trigonometric
Trigonometric
Trigonometric functions are the basic six functions that have a domain input value as an angle of a right triangle, and a numeric answer as the range.
There are six basic trigonometric functions used in Trigonometry. These functions are trigonometric ratios. The six basic trigonometric functions are sine function, cosine function, secant function, co-secant function, tangent function, and co-tangent function. The trigonometric functions and identities are the ratio of sides of a right-angled triangle. The sides of a right triangle are the perpendicular side, hypotenuse, and base, which are used to calculate the sine, cosine, tangent, secant, cosecant, and cotangent values using trigonometric formulas.
Reciprocal Trigonometric
Reciprocal Trigonometric
The reciprocal functions are not defined where the corresponding trigonometric functions are 0.
Secant and cosecant have period 2pi.
Cotangent has period pi.
Cotangent has period pi.
Exponential
Exponential
An exponential function is a function of form f (x) = a^x, where “x” is a variable and “a” is a constant which is called the base of the function and it should be greater than 0.
When a > 1 , there is an exponential growth function. For example,
When 0 < a < 1, there is an exponential decay function. For example,
Logarithmic
Logarithmic
Logarithmic functions have the form f[x]=log x .
They are the inverses of the exponential functions. So a^f{x]=x .
They are the inverses of the exponential functions. So a^f{x]=x .
Here is the plot of the logarithmic function with base 1/4 :