Calculus/Functions

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search


Previous: Precalculus
Current: Calculus/Functions
Next: Limits
Back to Calculus


Contents

[edit] Functions

[edit] Classical understanding of functions

To provide the classical understanding of functions, think of a function as a kind of machine. You feed the machine raw materials, and the machine changes the raw materials into a finished product based on a specific set of instructions. The kinds of functions we consider here, for the most part, take in a real number, change it in a formulaic way, and give out a real number (possibly the same as the one it took in). Think of this as an input-output machine; you give the function an input, and it gives you an output. For example, the squaring function takes the input 4 and gives the output value 16. The same squaring function takes the input − 1 and gives the output value 1.

A function is usually written as f, g, or something similar - although it doesn't have to be. A function is always defined as "of a variable" which tells us what to replace in the formula for the function.

For example, f(x) = 3x+2 \ tells us:

  • The function f is a function of x.
  • To evaluate the function at a certain number, replace the x with that number.
  • Replacing x with that number in the right side of the function will produce the function's output for that certain input.
  • In English, the definition of f \ is interpreted, "Given a number, f will return two more than the triple of that number."

Thus, if we want to know the value (or output) of the function at 3:

f(x) = 3x+2 \
f(3) = 3(3)+2 \ We evaluate the function at x = 3.
f(3) = 9+2 = 11 \ The value of f \ at 3 is 11.

See? It's easy!

Note that f(3) \ means the value of the dependent variable when x \ takes on the value of 3. So we see that the number 11 is the output of the function when we give the number 3 as the input. We refer to the input as the argument of the function (or the independent variable), and to the output as the value of the function at the given argument (or the dependent variable). A good way to think of it is the dependent variable f(x) \ 'depends' on the value of the independent variable x \ . This is read as "the value of f at three is eleven", or simply "f of three equals eleven".

[edit] Notation

Functions are used so much that there is a special notation for them. The notation is somewhat ambiguous, so familiarity with it is important in order to understand the intention of an equation or formula.

Though there are no strict rules for naming a function, it is standard practice to use the letters f, g, and h to denote functions, and the variable x to denote an independent variable. y is used for both dependent and independent variables.

When discussing or working with a function f, it's important to know not only the function, but also its independent variable x. Thus, when referring to a function f, you usually do not write f, but instead f(x). The function is now referred to as "f of x". The name of the function is adjacent to the independent variable (in parentheses). This is useful for indicating the value of the function at a particular value of the independent variable. For instance, if


f(x)=7x+1\,,


and if we want to use the value of f for x equal to 2, then we would substitute 2 for x on both sides of the definition above and write


f(2)=7(2)+1=14+1=15\,


This notation is more informative than leaving off the independent variable and writing simply 'f', but can be ambiguous since the parentheses can be misinterpreted as multiplication.

[edit] Modern understanding of functions

The formal definition of a function states that a function is actually a rule that associates elements of one set called the domain of the function, with the elements of another set called the range of the function. For each value we select from the domain of the function, there exists exactly one corresponding element in the range of the function. The definition of the function tells us which element in the range corresponds to the element we picked from the domain. Classically, the element picked from the domain is pictured as something that is fed into the function and the corresponding element in the range is pictured as the output. Since we "pick" the element in the domain whose corresponding element in the range we want to find, we have control over what element we pick and hence this element is also known as the "independent variable". The element mapped in the range is beyond our control and is "mapped to" by the function. This element is hence also known as the "dependent variable", for it depends on which independent variable we pick. Since the elementary idea of functions is better understood from the classical viewpoint, we shall use it hereafter. However, it is still important to remember the correct definition of functions at all times.

To make it simple, for the function f(x), all of the possible x values constitute the domain, and all of the values f(x) (y on the x-y plane) constitute the range.

[edit] Remarks

The following arise as a direct consequence of the definition of functions:

  1. By definition, for each "input" a function returns only one "output", corresponding to that input. While the same output may correspond to more than one input, one input cannot correspond to more than one output. This is expressed graphically as the vertical line test: a line drawn parallel to the axis of the dependent variable (normally vertical) will intersect the graph of a function only once. However, a line drawn parallel to the axis of the independent variable (normally horizontal) may intersect the graph of a function as many times as it likes. Equivalently, this has an algebraic (or formula-based) interpretation. We can always say if a = b, then f(a) = f(b), but if we only know that f(a) = f(b) then we can't be sure that a = b.
  2. Each function has a set of values, the function's domain, which it can accept as input. Perhaps this set is all positive real numbers; perhaps it is the set {pork, mutton, beef}. This set must be implicitly/explicitly defined in the definition of the function. You cannot feed the function an element that isn't in the domain, as the function is not defined for that input element.
  3. Each function has a set of values, the function's range, which it can output. This may be the set of real numbers. It may be the set of positive integers or even the set {0,1}. This set, too, must be implicitly/explicitly defined in the definition of the function.
This is an example of an expression which fails the vertical line test.

[edit] The vertical line test

The vertical line test, mentioned in the preceding paragraph, is a systematic test to find out if an equation involving x and y can serve as a function (with x the independent variable and y the dependent variable). Simply graph the equation and draw a vertical line through each point of the x-axis. If any vertical line ever touches the graph at more than one point, then the equation is not a function; if the line always touches at most one point of the graph, then the equation is a function.

(There are a lot of useful curves, like circles, that aren't functions (see picture). Some people call these graphs with multiple intercepts, like our circle, "multi-valued functions"; they would refer to our "functions" as "single-valued functions".)

[edit] Important functions

Constant function f(x)=c\,

It disregards the input and always outputs the constant c, and is a polynomial of the zeroth degree where f(x) = cx0= c(1) = c. Its graph is a horizontal line.

Linear function f(x)=mx+c\,

Takes an input, multiplies by m and adds c. It is a polynomial of the first degree. Its graph is a line (slanted, except m = 0).

Identity function f(x)=x\,

Takes an input and outputs it unchanged. A polynomial of the first degree, f(x) = x1 = x. Special case of a linear function.

Quadratic function f(x)=ax^2+bx+c \,

A polynomial of the second degree. Its graph is a parabola, unless a = 0. (Don't worry if you don't know what this is.)

Polynomial function f(x)=a_n x^n + a_{n-1}x^{n-1} + \cdots + a_2 x^2 + a_1 x + a_0

The number n is called the degree.

Signum function  \operatorname{sgn}(x) = \left\{ \begin{matrix}
-1 & : &  x < 0 \\
0 & : &  x = 0 \\
1 & : &  x > 0. \end{matrix} \right.

Determines the sign of the argument x.

[edit] Example functions

Some more simple examples of functions have been listed below.

h(x)=\left\{\begin{matrix}1,&\mbox{if }x>0\\-1,&\mbox{if }x<0\end{matrix}\right.
Gives 1 if input is positive, -1 if input is negative. Note that the function only accepts negative and positive numbers, not 0. Mathematics describes this condition by saying 0 is not in the domain of the function.
g(y)=y^2\,
Takes an input and squares it.

g(z)=z^2\,

Exactly the same function, rewritten with a different independent variable. This is perfectly legal and sometimes done to prevent confusion (e.g. when there are already too many uses of x or y in the same paragraph.)
f(x)=\left\{\begin{matrix}5^{x^2},&\mbox{if }x>0\\0,&\mbox{if }x\le0\end{matrix}\right.
Note that we can define a function by a totally arbitrary rule.

It is possible to replace the independent variable with any mathematical expression, not just a number. For instance, if the independent variable is itself a function of another variable, then it could be replaced with that function. This is called composition, and is discussed later.

[edit] Manipulating functions

Functions can be manipulated in the same ways as variables; they can be added, multiplied, raised to powers, etc. For instance, let


f(x)=3x+2\, and
g(x)=x^2\,.

Then

\begin{align}
f+g &= (f+g)(x)\\
    &= f(x)+g(x)\\
    &= (3x+2)+(x^2)\\
    &= x^2+3x+2\,
\end{align},


\begin{align}
f-g &= (f-g)(x)\\
    &= f(x)-g(x)\\
    &= (3x+2)-(x^2)\\
    &= -x^2+3x+2\,
\end{align},


\begin{align}
f\times g &= (f\times g)(x)\\
          &= f(x)\times g(x)\\
          &= (3x+2)\times(x^2)\\
          &= 3x^3+2x^2\,
\end{align},


\begin{align}
\frac{f}{g} &= \left(\frac{f}{g}\right)(x)\\
            &= \frac{f(x)}{g(x)}\\
            &= \frac{3x+2}{x^2}\\
            &= \frac{3}{x}+\frac{2}{x^2}
\end{align}.

[edit] Composition of functions

However, there is one particular way to combine functions which cannot be done with variables. The value of a function f depends upon the value of another variable x; however, that variable could be equal to another function g, so its value depends on the value of a third variable. If this is the case, then the first variable is a function h of the third variable; this function (h) is called the composition of the other two functions (f and g). Composition is denoted by


f\circ g=(f\circ g)(x)=f(g(x)).

This can be read as either "f composed with g" or "f of g of x."


For instance, let

f(x)=3x+2\, and
g(x)=x^2\,.

Then

\begin{align}
h(x) &= f(g(x))\\
     &= f(x^2)\\
     &= 3(x^2)+2\\
     &= 3x^2+2\,
\end{align}.


Here, h is the composition of f and g and we write h=f\circ g. Note that composition is not commutative:


f(g(x))=3x^2+2\,, and
\begin{align}
g(f(x)) &= g(3x + 2)\\
        &= (3x + 2)^2\\
        &= 9x^2+12x+4\,
\end{align}
so f(g(x))\ne g(f(x))\,.

Composition of functions is very common, mainly because functions themselves are common. For instance, squaring and sine are both functions:


\operatorname{square}(x)=x^2,
\operatorname{sine}(x)=\sin x


Thus, the expression sin2x is a composition of functions:

sin2x = \operatorname{square}(\sin x)
= \operatorname{square}( \operatorname{sine}(x)).

(Note that this is not the same as \operatorname{sine}(\operatorname{square}(x))=\sin x^2.) Since the function sine equals 1 / 2 if x = π / 6,


\operatorname{square}(\operatorname{sine}(\pi/6))= \operatorname{square}(1/2).


Since the function square equals 1 / 4 if x = 1 / 2,

\sin^2 \pi/6=\operatorname{square}(\operatorname{sine}(\pi/6))=\operatorname{square}(1/2)
=1/4.

[edit] Transformations

Transformations are a type of function manipulation that are very common. They consist of multiplying, dividing, adding or subtracting constants to either the input or the output. Multiplying by a constant is called dilation and adding a constant is called translation. Here are a few examples:

f(2\times x) \, Dilation
f(x+2)\, Translation
2\times f(x) \, Dilation
2+f(x)\, Translation
Examples of horizontal and vertical translations
Examples of horizontal and vertical dilations

Translations and dilations can be either horizontal or vertical. Examples of both vertical and horizontal translations can be seen at right. The red graphs represent functions in their 'original' state, the solid blue graphs have been translated (shifted) horizontally, and the dashed graphs have been translated vertically.

Dilations are demonstrated in a similar fashion. The function

f(2\times x) \,

has had its input doubled. One way to think about this is that now any change in the input will be doubled. If I add one to x, I add two to the input of f, so it will now change twice as quickly. Thus, this is a horizontal dilation by \frac{1}{2} because the distance to the y-axis has been halved. A vertical dilation, such as

2\times f(x) \,

is slightly more straightforward. In this case, you double the output of the function. The output represents the distance from the x-axis, so in effect, you have made the graph of the function 'taller'. Here are a few basic examples where a is any positive constant:

Original graph f(x)\, Reflection about origin -f(-x)\,
Horizontal translation by a units left f(x+a)\, Horizontal translation by a units right f(x-a)\,
Horizontal dilation by a factor of a f(x\times \frac{1}{a}) \, Vertical dilation by a factor of a a\times f(x) \,
Vertical translation by a units down f(x)-a\, Vertical translation by a units up f(x)+a\,
Reflection about x-axis -f(x)\, Reflection about y-axis f(-x)\,

[edit] Domain and Range

[edit] Notation

The domain and range of functions are commonly expressed using interval notation. This notation is very simple, but sometimes ambiguous because of the similarity to ordered pair notation:

Meaning Interval Notation Set Notation
All values greater than or equal to a and less than or equal to b \left[a,b\right] \left\{x:a\le x\le b\right\}
All values greater than a and less than b \left(a,b\right) \left\{x:a < x < b\right\}
All values greater than or equal to a and less than b \left[a,b\right) \left\{x:a\le x < b\right\}
All values greater than a and less than or equal to b \left(a,b\right] \left\{x:a < x\le b\right\}
All values greater than or equal to a. \left[a,\infty\right) \left\{x:x\ge a\right\}
All values greater than a. \left(a,\infty\right) \left\{x:x > a\right\}
All values less than or equal to a. \left(-\infty,a\right] \left\{x:x\le a\right\}
All values less than a. \left(-\infty,a\right) \left\{x:x < a\right\}
All values. \left(-\infty,\infty\right) \left\{x: x\in\mathbb{R}\right\}

Note that \infty and -\infty must always have an exclusive parenthesis rather than an inclusive bracket. This is because \infty is not a number, and therefore cannot be in our set. \infty is really just a symbol that makes things easier to write, like the intervals above.
Note: ( is also denoted by ], and ) by [, i.e., (a,b) is the same as ]a,b[, and [a,b) is [a,b[. This is a source of funny misunderstandings.

[edit] Domain

The domain of the function is the interval from -1 to 1

The domain of a function is the set of all points over which it is defined. More simply, it represents the set of x-values which the function can accept as input. For instance, if


f(x)=\sqrt{1-x^2}


then f(x) is only defined for values of x between − 1 and 1, because the square root function is not defined (in real numbers) for negative values. Thus, the domain, in interval notation, is \left[-1,1\right]. In other words,


f(x) \mbox{is defined for } x\in [-1,1], \operatorname{ or } \{x:-1\le x\le 1\}.


The range of the function is the interval from 0 to 1

[edit] Range

The range of a function is the set of all values which it attains (i.e. the y-values). For instance, if:


f(x)=\sqrt{1-x^2},


then f(x) can only equal values in the interval from 0 to 1. Thus, the range of f is \left[0,1\right].

[edit] One-to-one Functions

A function f(x) is one-to-one (or less commonly injective) if, for every value of f, there is only one value of x that corresponds to that value of f. For instance, the function f(x)=\sqrt{1-x^2} is not one-to-one, because both x = 1 and x = - 1 result in f(x) = 0. However, the function f(x) = x + 2 is one-to-one, because, for every possible value of f(x), there is exactly one corresponding value of x. Other examples of one-to-one functions are f(x) = x3 + ax, where a\in \left[0,\infty\right). Note that if you have a one-to-one function and translate or dilate it, it remains one-to-one. (Of course you can't multiply x or f by a zero factor).

If you know what the graph of a function looks like, it is easy to determine whether or not the function is one-to-one. If every horizontal line intersects the graph in at most one point, then the function is one-to-one. This is known as the Horizontal Line Test.

[edit] Inverse functions

We call g(x) the inverse function of f(x) if, for all x:

g(f(x)) = f(g(x)) = x\ .

A function f(x) has an inverse function if and only if f(x) is one-to-one. For example, the inverse of f(x) = x + 2 is g(x) = x - 2. The function f(x)=\sqrt{1-x^2} has no inverse.

[edit] Notation

The inverse function of f is denoted as f - 1(x). Thus, f - 1(x) is defined as the function that follows this rule

f(f − 1(x)) = f − 1(f(x)) = x:

To determine f - 1(x) when given a function f, substitute f - 1(x) for x and substitute x for f(x). Then solve for f - 1(x), provided that it is also a function.

Example: Given f(x) = 2x − 7, find f - 1(x).

Substitute f - 1(x) for x and substitute x for f(x). Then solve for f - 1(x):

f(x) = 2x - 7\,
  x  = 2[f^{-1}(x)] - 7\,
x + 7  = 2[f^{-1}(x)]\,
\frac{x + 7}{2} = f^{-1}(x)\,

To check your work, confirm that f − 1(f(x)) = x:

f − 1(f(x)) =

f − 1(2x − 7) =

\frac{2x - 7 + 7}{2} = \frac{2x}{2} = x

If f isn't one-to-one, then, as we said before, it doesn't have an inverse. Then this method will fail.

Example: Given f(x) = x2, find f - 1(x).

Substitute f - 1(x) for x and substitute x for f(x). Then solve for f - 1(x):

f(x) = x^2\,
x = (f^{-1}(x))^2\,
f^{-1}(x) = \pm\sqrt{x}\,

Since there are two possibilities for f - 1(x), it's not a function. Thus f(x) = x2 doesn't have an inverse. Of course, we could also have found this out from the graph by applying the Horizontal Line Test. It's useful, though, to have lots of ways to solve a problem, since in a specific case some of them might be very difficult while others might be easy. For example, we might only know an algebraic expression for f(x) but not a graph.

[edit] Graphing Functions

Graph of y=2x

It is sometimes difficult to understand the behavior of a function given only its definition; a visual representation or graph can be very helpful. A graph is a set of points in the Cartesian plane, where each point (x,y) indicates that f(x) = y. In other words, a graph uses the position of a point in one direction (the vertical-axis or y-axis) to indicate the value of f for a position of the point in the other direction (the horizontal-axis or x-axis).


Functions may be graphed by finding the value of f for various x and plotting the points (x, f(x)) in a Cartesian plane. For the functions that you will deal with, the parts of the function between the points can generally be approximated by drawing a line or curve between the points. Extending the function beyond the set of points is also possible, but becomes increasingly inaccurate.

Plotting points like this is laborious. Fortunately, many functions' graphs fall into general patterns. For a simple case, consider functions of the form


f(x)={a}x \,


The graph of f is a single line, passing through (0,0) and (1,a). Thus, after plotting the two points, a straightedge may be used to draw the graph as far as is needed. After having learned calculus, you will know many more techniques for drawing good graphs of functions.



[edit] Algebraic manipulation

[edit] Purpose of review

This section is intended to review algebraic manipulation. It is important to understand algebra in order to do calculus. If you have a good knowledge of algebra, you should probably just skim this section to be sure you are familiar with the ideas.

[edit] Rules of arithmetic and algebra

The following rules are always true.

  • Addition
    • Commutative Law: a+b=b+a \,.
    • Associative Law: (a+b)+c=a+(b+c)\,.
    • Additive Identity: a+0=a\,.
    • Additive Inverse: a+(-a)=0\,.
  • Subtraction
    • Definition: a-b = a+(-b)\,.
  • Multiplication
    • Commutative law: a\times b=b\times a\,.
    • Associative law: (a\times b)\times c=a\times (b\times c)\,.
    • Multiplicative Identity: a\times 1=a\,.
    • Multiplicative Inverse: a\times \frac{1}{a}=1, whenever a \neq 0\,
    • Distributive law: a\times (b+c)=a\times b+a\times c\,.
  • Division
    • Definition: \frac{a}{b}=a\times \frac{1}{b}, whenever b \neq 0\,.

The above laws are true for all a, b, and c, whether a, b, and c are numbers, variables, functions, or other expressions. For instance,

\frac{(x+2)(x+3)}{x+3} = (((x+2)\times (x+3))\times (\frac{1}{x+3}))
= ((x+2)\times ((x+3)\times (\frac{1}{x+3})))
= ((x+2)\times (1)),\qquad x \neq -3 \,
= x+2, \qquad x \neq -3.

Of course, the above is much longer than simply cancelling x + 3 out in both the numerator and denominator. But, when you are cancelling, you are really just doing the above steps, so it is important to know what the rules are so as to know when you are allowed to cancel. Occasionally people do the following, for instance, which is incorrect:


\frac{2\times (x + 2)}{2}=\frac{2}{2}\times \frac{x+2}{2}=\frac{x+2}{2}.


The correct simplification is


\frac{2\times (x + 2)}{2}=\frac{2}{2}\times \frac{x+2}{1}=1 \times \frac{x+2}{1}=x+2,


where the number 2 cancels out in both the numerator and the denominator.

Personal tools
Create a book
In other languages