# Calculus/Print version

## Integration

The definite integral of a function f(x) from x=0 to x=a is equal to the area under the curve from 0 to a.

### Integration Techniques

From bottom to top:
• an acceleration function a(t);
• the integral of the acceleration is the velocity function v(t);
• and the integral of the velocity is the distance function s(t).

## Appendix

• Choosing delta

# Introduction

 Calculus Contributing → Print version

## What is calculus?

Calculus is the broad area of mathematics dealing with such topics as instantaneous rates of change, areas under curves, and sequences and series. Underlying all of these topics is the concept of a limit, which consists of analyzing the behavior of a function at points ever closer to a particular point, but without ever actually reaching that point. As a typical application of the methods of calculus, consider a moving car. It is possible to create a function describing the displacement of the car (where it is located in relation to a reference point) at any point in time as well as a function describing the velocity (speed and direction of movement) of the car at any point in time. If the car were traveling at a constant velocity, then algebra would be sufficient to determine the position of the car at any time; if the velocity is unknown but still constant, the position of the car could be used (along with the time) to find the velocity.

However, the velocity of a car cannot jump from zero to 35 miles per hour at the beginning of a trip, stay constant throughout, and then jump back to zero at the end. As the accelerator is pressed down, the velocity rises gradually, and usually not at a constant rate (i.e., the driver may push on the gas pedal harder at the beginning, in order to speed up). Describing such motion and finding velocities and distances at particular times cannot be done using methods taught in pre-calculus, whereas it is not only possible but straightforward with calculus.

Calculus has two basic applications: differential calculus and integral calculus. The simplest introduction to differential calculus involves an explicit series of numbers. Given the series (42, 43, 3, 18, 34), the differential of this series would be (1, -40, 15, 16). The new series is derived from the difference of successive numbers which gives rise to its name "differential". Rarely, if ever, are differentials used on an explicit series of numbers as done here. Instead, they are derived from a continuous function in a manner which is described later.

Integral calculus, like differential calculus, can also be introduced via series of numbers. Notice that in the previous example, the original series can almost be derived solely from its differential. Instead of taking the difference, however, integration involves taking the sum. Given the first number of the original series, 42 in this case, the rest of the original series can be derived by adding each successive number in its differential (42+1, 43-40, 3+15, 18+16). Note that knowledge of the first number in the original series is crucial in deriving the integral. As with differentials, integration is performed on continuous functions rather than explicit series of numbers, but the concept is still the same. Integral calculus allows us to calculate the area under a curve of almost any shape; in the car example, this enables you to find the displacement of the car based on the velocity curve. This is because the area under the curve is the total distance moved, as we will soon see.

## Why learn calculus?

Calculus is essential for many areas of science and engineering. Both make heavy use of mathematical functions to describe and predict physical phenomena that are subject to continuous change, and this requires the use of calculus. Take our car example: if you want to design cars, you need to know how to calculate forces, velocities, accelerations, and positions. All require calculus. Calculus is also necessary to study the motion of gases and particles, the interaction of forces, and the transfer of energy. It is also useful in business whenever rates are involved. For example, equations involving interest or supply and demand curves are grounded in the language of calculus.

Calculus also provides important tools in understanding functions and has led to the development of new areas of mathematics including real and complex analysis, topology, and non-euclidean geometry.

Notwithstanding calculus' functional utility (pun intended), many non-scientists and non-engineers have chosen to study calculus just for the challenge of doing so. A smaller number of persons undertake such a challenge and then discover that calculus is beautiful in and of itself.

## What is involved in learning calculus?

Learning calculus, like much of mathematics, involves two parts:

• Understanding the concepts: You must be able to explain what it means when you take a derivative rather than merely apply the formulas for finding a derivative. Otherwise, you will have no idea whether or not your solution is correct. Drawing diagrams, for example, can help clarify abstract concepts.
• Symbolic manipulation: Like other branches of mathematics, calculus is written in symbols that represent concepts. You will learn what these symbols mean and how to use them. A good working knowledge of trigonometry and algebra is a must, especially in integral calculus. Sometimes you will need to manipulate expressions into a usable form before it is possible to perform operations in calculus.

## What you should know before using this text

There are some basic skills that you need before you can use this text. Continuing with our example of a moving car:

• You will need to describe the motion of the car in symbols. This involves understanding functions.
• You need to manipulate these functions. This involves algebra.
• You need to translate symbols into graphs and vice versa. This involves understanding the graphing of functions.
• It also helps (although it isn't necessarily essential) if you understand the functions used in trigonometry since these functions appear frequently in science.

## Scope

The first four chapters of this textbook cover the topics taught in a typical high school or first year college course. The first chapter, Precalculus, reviews those aspects of functions most essential to the mastery of calculus. The second, Limits, introduces the concept of the limit process. It also discusses some applications of limits and proposes using limits to examine slope and area of functions. The next two chapters, Differentiation and Integration, apply limits to calculate derivatives and integrals. The Fundamental Theorem of Calculus is used, as are the essential formulas for computation of derivatives and integrals without resorting to the limit process. The third and fourth chapters include articles that apply the concepts previously learned to calculating volumes, and as other important formulas.

The remainder of the central calculus chapters cover topics taught in higher-level calculus topics: parametric and polar equations, sequences and series, multivariable calculus, and differential equations.

The final chapters cover the same material, using formal notation. They introduce the material at a much faster pace, and cover many more theorems than the other two sections. They assume knowledge of some set theory and set notation.

 Calculus Contributing → Print version

# Precalculus

<h1> 1.1 Algebra</h1>

 ← Precalculus Calculus Trigonometry → Print version

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.

## Rules of arithmetic and algebra

The following laws are true for all ${\displaystyle a,b,c}$ whether these are numbers, variables, functions, or more complex expressions involving numbers, variable and/or functions.

• Commutative Law: ${\displaystyle a+b=b+a}$ .
• Associative Law: ${\displaystyle (a+b)+c=a+(b+c)}$ .
• Additive Identity: ${\displaystyle a+0=a}$ .
• Additive Inverse: ${\displaystyle a+(-a)=0}$ .

### Subtraction

• Definition: ${\displaystyle a-b=a+(-b)}$ .

### Multiplication

• Commutative law: ${\displaystyle a\times b=b\times a}$ .
• Associative law: ${\displaystyle (a\times b)\times c=a\times (b\times c)}$ .
• Multiplicative identity: ${\displaystyle a\times 1=a}$ .
• Multiplicative inverse: ${\displaystyle a\times {\frac {1}{a}}=1}$ , whenever ${\displaystyle a\neq 0}$
• Distributive law: ${\displaystyle a\times (b+c)=(a\times b)+(a\times c)}$ .

### Division

• Definition: ${\displaystyle {\frac {a}{b}}=a\times {\frac {1}{b}}}$ , whenever ${\displaystyle b\neq 0}$ .

Let's look at an example to see how these rules are used in practice.

 ${\displaystyle {\frac {(x+2)(x+3)}{x+3}}}$ ${\displaystyle =\left[(x+2)\times (x+3)\right]\times \left({\frac {1}{x+3}}\right)}$ (from the definition of division) ${\displaystyle =(x+2)\times \left[(x+3)\times \left({\frac {1}{x+3}}\right)\right]}$ (from the associative law of multiplication) ${\displaystyle =((x+2)\times (1)),\qquad x\neq -3}$ (from multiplicative inverse) ${\displaystyle x+2,\qquad x\neq -3}$ (from multiplicative identity)

Of course, the above is much longer than simply cancelling ${\displaystyle 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:

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

The correct simplification is

${\displaystyle {\frac {2\times (x+2)}{2}}=\left(2\times {\frac {1}{2}}\right)\times (x+2)=1\times (x+2)=x+2}$ ,

where the number ${\displaystyle 2}$ cancels out in both the numerator and the denominator.

## Interval notation

There are a few different ways that one can express with symbols a specific interval (all the numbers between two numbers). One way is with inequalities. If we wanted to denote the set of all numbers between, say, 2 and 4, we could write "all ${\displaystyle x}$ satisfying ${\displaystyle 2 ." This excludes the endpoints 2 and 4 because we use ${\displaystyle <}$ instead of ${\displaystyle \leq }$ . If we wanted to include the endpoints, we would write "all ${\displaystyle x}$ satisfying ${\displaystyle 2\leq x\leq 4}$ ." This includes the endpoints.

Another way to write these intervals would be with interval notation. If we wished to convey "all ${\displaystyle x}$ satisfying ${\displaystyle 2 " we would write ${\displaystyle (2,4)}$ . This does not include the endpoints 2 and 4. If we wanted to include the endpoints we would write ${\displaystyle [2,4]}$ . If we wanted to include 2 and not 4 we would write ${\displaystyle [2,4)}$ ; if we wanted to exclude 2 and include 4, we would write ${\displaystyle (2,4]}$ .

Thus, we have the following table:

Endpoint conditions Inequality notation Interval notation
Including both 2 and 4 all ${\displaystyle x}$ satisfying ${\displaystyle 2\leq x\leq 4}$
${\displaystyle [2,4]}$
Not including 2 nor 4 all ${\displaystyle x}$ satisfying ${\displaystyle 2
${\displaystyle (2,4)}$
Including 2 not 4 all ${\displaystyle x}$ satisfying ${\displaystyle 2\leq x<4}$
${\displaystyle [2,4)}$
Including 4 not 2 all ${\displaystyle x}$ satisfying ${\displaystyle 2
${\displaystyle (2,4]}$

In general, we have the following table:

Meaning Interval Notation Set Notation
All values greater than or equal to ${\displaystyle a}$ and less than or equal to ${\displaystyle b}$ ${\displaystyle [a,b]}$ ${\displaystyle \{x:a\leq x\leq b\}}$
All values greater than ${\displaystyle a}$ and less than ${\displaystyle b}$ ${\displaystyle (a,b)}$ ${\displaystyle \{x:a
All values greater than or equal to ${\displaystyle a}$ and less than ${\displaystyle b}$ ${\displaystyle [a,b)}$ ${\displaystyle \{x:a\leq x
All values greater than ${\displaystyle a}$ and less than or equal to ${\displaystyle b}$ ${\displaystyle (a,b]}$ ${\displaystyle \{x:a
All values greater than or equal to ${\displaystyle a}$ ${\displaystyle [a,\infty )}$ ${\displaystyle \{x:x\geq a\}}$
All values greater than ${\displaystyle a}$ ${\displaystyle (a,\infty )}$ ${\displaystyle \{x:x>a\}}$
All values less than or equal to ${\displaystyle a}$ ${\displaystyle (-\infty ,a]}$ ${\displaystyle \{x:x\leq a\}}$
All values less than ${\displaystyle a}$ ${\displaystyle (-\infty ,a)}$ ${\displaystyle \{x:x
All values ${\displaystyle (-\infty ,\infty )}$ ${\displaystyle \{x:x\in \mathbb {R} \}}$

Note that ${\displaystyle \infty }$ and ${\displaystyle -\infty }$ must always have an exclusive parenthesis rather than an inclusive bracket. This is because ${\displaystyle \infty }$ is not a number, and therefore cannot be in our set. ${\displaystyle \infty }$ is really just a symbol that makes things easier to write, like the intervals above.

The interval ${\displaystyle (a,b)}$ is called an open interval, and the interval ${\displaystyle [a,b]}$ is called a closed interval.

Intervals are sets and we can use set notation to show relations between values and intervals. If we want to say that a certain value is contained in an interval, we can use the symbol ${\displaystyle \in }$ to denote this. For example, ${\displaystyle 2\in [1,3]}$ . Likewise, the symbol ${\displaystyle \notin }$ denotes that a certain element is not in an interval. For example ${\displaystyle 0\notin (0,1)}$ .

There are a few rules and properties involving exponents and radicals that you'd do well to remember. As a definition we have that if ${\displaystyle n}$ is a positive integer then ${\displaystyle a^{n}}$ denotes ${\displaystyle n}$ factors of ${\displaystyle a}$ . That is,

${\displaystyle a^{n}=a\cdot a\cdot a\cdots a\qquad (n~{\mbox{times}})}$

If ${\displaystyle a\neq 0}$ then we say that ${\displaystyle a^{0}=1}$ .

If ${\displaystyle n}$ is a negative integer then we say that ${\displaystyle a^{-n}={\frac {1}{a^{n}}}}$ .

If we have an exponent that is a fraction then we say that ${\displaystyle a^{\frac {m}{n}}={\sqrt[{n}]{a^{m}}}=({\sqrt[{n}]{a}})^{m}}$ . In the expression ${\displaystyle {\sqrt[{n}]{a}}}$ , ${\displaystyle n}$ is called the index of the radical, the symbol ${\displaystyle {\sqrt {\;\;}}}$ is called the radical sign, and ${\displaystyle a}$ is called the radicand.

In addition to the previous definitions, the following rules apply:

Rule Example
${\displaystyle a^{n}\cdot a^{m}=a^{n+m}}$ ${\displaystyle 3^{6}\cdot 3^{9}=3^{15}}$
${\displaystyle {\frac {a^{n}}{a^{m}}}=a^{n-m}}$ ${\displaystyle {\frac {x^{3}}{x^{2}}}=x^{1}=x}$
${\displaystyle (a^{n})^{m}=a^{n\cdot m}}$ ${\displaystyle (x^{4})^{5}=x^{20}}$
${\displaystyle (ab)^{n}=a^{n}b^{n}}$ ${\displaystyle (3x)^{5}=3^{5}x^{5}}$
${\displaystyle \left({\frac {a}{b}}\right)^{n}={\frac {a^{n}}{b^{n}}}}$ ${\displaystyle \left({\frac {7}{3}}\right)^{3}={\frac {7^{3}}{3^{3}}}}$

We will use the following conventions for simplifying expressions involving radicals:

1. Given the expression ${\displaystyle a^{\frac {b}{c}}}$, write this as ${\displaystyle {\sqrt[{c}]{a^{b}}}}$
2. No fractions under the radical sign
3. No radicals in the denominator
4. The radicand has no exponentiated factors with exponent greater than or equal to the index of the radical
 Example: Simplify the expression ${\displaystyle \left({\frac {1}{8}}\right)^{\frac {1}{2}}}$ Using convention 1, we rewrite the given expression as (1) ${\displaystyle \left({\frac {1}{8}}\right)^{\frac {1}{2}}={\sqrt[{2}]{\left({\frac {1}{8}}\right)^{1}}}={\sqrt {\frac {1}{8}}}}$ The expression now violates convention 2. To get rid of the fraction in the radical, apply the rule ${\displaystyle \left({\frac {a}{b}}\right)^{n}={\frac {a^{n}}{b^{n}}}}$ and simplify the result: (2) ${\displaystyle {\sqrt {\frac {1}{8}}}={\frac {\sqrt {1}}{\sqrt {8}}}={\frac {1}{\sqrt {8}}}}$ The resulting expression violates convention 3. To get rid of the radical in the denominator, multiply by ${\displaystyle {\frac {\sqrt {8}}{\sqrt {8}}}}$: (3) ${\displaystyle {\frac {1}{\sqrt {8}}}={\frac {1}{\sqrt {8}}}\cdot {\frac {\sqrt {8}}{\sqrt {8}}}={\frac {\sqrt {8}}{8}}}$ Notice that ${\displaystyle 8=2^{3}}$. Since the index of the radical is 2, our expression violates convention 4. We can reduce the exponent of the expression under the radical as follows: (4) ${\displaystyle {\frac {\sqrt {8}}{8}}={\frac {\sqrt {2^{3}}}{8}}={\frac {\sqrt {2^{2}\cdot 2}}{8}}={\frac {2\cdot {\sqrt {2}}}{8}}={\frac {\sqrt {2}}{4}}}$

#### Exercise

1. Simplify the expression ${\displaystyle 144^{\frac {5}{3}}}$

${\displaystyle 1728{\sqrt[{3}]{12}}}$

Solution

## Logarithms

Consider the equation

(5) ${\displaystyle y=b^{x}}$

${\displaystyle b}$ is called the base and ${\displaystyle x}$ is called the exponent. Suppose we would like to solve for ${\displaystyle x}$ . We would like to apply an operation to both sides of the equation that will get rid of the base on the right-hand side of the equation. The operation we want is called the logarithm, or log for short, and it is defined as follows:

Definition: (Formal definition of a logarithm)
${\displaystyle \log _{b}y}$ is the number ${\displaystyle x}$ such that ${\displaystyle y=b^{x}}$

The result of applying the operation to both sides of the equation is

(6) ${\displaystyle \log _{b}y=x}$

Logarithms are taken with respect to some base. What equation 6 is saying is that ${\displaystyle x}$ is the exponent of ${\displaystyle b}$ that will give you ${\displaystyle y}$.

### Example

 Example: Calculate ${\displaystyle \log _{10}100000}$ ${\displaystyle \log _{10}100000}$ is the number ${\displaystyle x}$ such that ${\displaystyle 10^{x}=100000}$. Well ${\displaystyle 10^{5}=100000}$, so ${\displaystyle \log _{10}100000=5}$

### Common bases for logarithms

When the base is not specified, ${\displaystyle \log }$ is taken to mean the base 10 logarithm. Later on in our study of calculus we will commonly work with logarithms with base ${\displaystyle e\approx 2.718282}$ . In fact, the base ${\displaystyle e}$ logarithm comes up so often that it has its own name and symbol. It is called the natural logarithm, and its symbol is ${\displaystyle \ln }$ . In computer science the base 2 logarithm often comes up.

### Properties of logarithms

Logarithms have the property that ${\displaystyle \log _{b}x+\log _{b}y=\log _{b}(x\cdot y)}$ . To see why this is true, suppose that ${\displaystyle \log _{b}x=r}$ , ${\displaystyle \log _{b}y=s}$ , and ${\displaystyle \log _{b}(x\cdot y)=t}$ . These assumptions imply that ${\displaystyle x=b^{r}}$ , ${\displaystyle y=b^{s}}$ , and ${\displaystyle x\cdot y=b^{t}}$ . Then by substitution, ${\displaystyle x\cdot y=b^{r}\cdot b^{s}=b^{t}}$ . By the property of exponents, we know that ${\displaystyle b^{r}\cdot b^{s}=b^{r+s}}$ , so ${\displaystyle b^{r+s}=b^{t}}$ . The equation will only hold if the exponents on each side are equal, so ${\displaystyle r+s=t}$ . Applying our assumptions, we have what we wanted to show, namely, ${\displaystyle \log _{b}x+\log _{b}y=\log _{b}(x\cdot y)}$ .

Historically, the development of logarithms was motivated by the usefulness of this fact for simplifying hand calculations by replacing tedious multiplication by table look-ups and addition.

Another useful property of logarithms is that ${\displaystyle \log _{b}a^{c}=c\cdot \log _{b}a}$ . To see why, consider the expression ${\displaystyle \log _{b}a^{c}}$ . Let us represent the value of this expression with ${\displaystyle x}$ . Then we have ${\displaystyle \log _{b}a^{c}=x}$ . If we make each side of the equation the exponent of ${\displaystyle b}$, then after simplification we have ${\displaystyle a^{c}=b^{x}}$ . Now raise each side of the equation to the power ${\displaystyle {\frac {1}{c}}}$ and simplify to get ${\displaystyle a=b^{\frac {x}{c}}}$ . Now if you take the base ${\displaystyle b}$ log of both sides, you get ${\displaystyle \log _{b}a={\frac {x}{c}}}$ . Solving for ${\displaystyle x}$ shows that ${\displaystyle x=c\cdot \log _{b}a}$ , which is what we wanted to show.

### Converting between bases

Most scientific calculators have the ${\displaystyle \log }$ and ${\displaystyle \ln }$ functions built in. But what if you want to compute a logarithm for a different base? For example, suppose you want to compute ${\displaystyle \log _{2}45}$ . To answer this specific question, let's first come up with a general formula and then apply it to our specific problem. Consider how one might compute ${\displaystyle \log _{b}a}$, where ${\displaystyle b}$ and ${\displaystyle a}$ are given known numbers, when we can only compute logarithms in some base ${\displaystyle \beta }$. Let the value of ${\displaystyle \log _{b}a}$ be ${\displaystyle x}$ . Then the definition of logarithm implies that ${\displaystyle a=b^{x}}$ . If we take the base ${\displaystyle \beta }$ log of each side, we get ${\displaystyle \log _{\beta }a=\log _{\beta }b^{x}=x\cdot \log _{\beta }b}$ . Solving for ${\displaystyle x}$ , we find that ${\displaystyle x={\frac {\log _{\beta }a}{\log _{\beta }b}}}$ . So for our example, if we use base 10, we get ${\displaystyle \log _{2}45={\frac {\log 45}{\log 2}}\approx {\frac {1.653212514}{0.301029996}}\approx 5.491853096}$ .

## Factoring and roots

Given the expression ${\displaystyle x^{2}+3x+2}$ , one may ask "what are the values of ${\displaystyle x}$ that make this expression 0?" If we factor we obtain

${\displaystyle x^{2}+3x+2=(x+2)(x+1)}$

.

If ${\displaystyle x=-1,-2}$ , then one of the factors on the right becomes zero. Therefore, the whole must be zero. So, by factoring we have discovered the values of ${\displaystyle x}$ that render the expression zero. These values are termed "roots." In general, given a quadratic polynomial ${\displaystyle px^{2}+qx+r}$ that factors as

${\displaystyle px^{2}+qx+r=(ax+c)(bx+d)}$

then we have that ${\displaystyle x=-{\frac {c}{a}}}$ and ${\displaystyle x=-{\frac {d}{b}}}$ are roots of the original polynomial.

A special case to be on the look out for is the difference of two squares, ${\displaystyle a^{2}-b^{2}}$ . In this case, we are always able to factor as

${\displaystyle a^{2}-b^{2}=(a+b)(a-b)}$

.

For example, consider ${\displaystyle 4x^{2}-9}$ . On initial inspection we would see that both ${\displaystyle 4x^{2}}$ and ${\displaystyle 9}$ are squares (${\displaystyle (2x)^{2}=4x^{2}}$ and ${\displaystyle 3^{2}=9}$) . Applying the previous rule we have

${\displaystyle 4x^{2}-9=(2x+3)(2x-3)}$

.

The following is a general result of great utility.

Given any quadratic equation ${\displaystyle ax^{2}+bx+c=0\ ,\ a\neq 0}$, all solutions of the equation are given by the quadratic formula:

${\displaystyle x={\frac {-b\pm {\sqrt {b^{2}-4ac}}}{2a}}}$ .
 Example: Find all the roots of ${\displaystyle 4x^{2}+7x-2}$ Finding the roots is equivalent to solving the equation ${\displaystyle 4x^{2}+7x-2=0}$ . Applying the quadratic formula with ${\displaystyle a=4\ ,\ b=7\ ,\ c=-2}$ , we have: ${\displaystyle x={\frac {-7\pm {\sqrt {7^{2}-4(4)(-2)}}}{2(4)}}}$ ${\displaystyle x={\frac {-7\pm {\sqrt {49+32}}}{8}}}$ ${\displaystyle x={\frac {-7\pm {\sqrt {81}}}{8}}}$ ${\displaystyle x={\frac {-7\pm 9}{8}}}$ ${\displaystyle x={\frac {2}{8}}\ ,\ x={\frac {-16}{8}}}$ ${\displaystyle x={\frac {1}{4}}\ ,\ x=-2}$

The quadratic formula can also help with factoring, as the next example demonstrates.

 Example: Factor the polynomial ${\displaystyle 4x^{2}+7x-2}$ We already know from the previous example that the polynomial has roots ${\displaystyle x={\frac {1}{4}}}$ and ${\displaystyle x=-2}$ . Our factorization will take the form ${\displaystyle C(x+2)\left(x-{\tfrac {1}{4}}\right)}$ All we have to do is set this expression equal to our polynomial and solve for the unknown constant C: ${\displaystyle C(x+2)\left(x-{\tfrac {1}{4}}\right)=4x^{2}+7x-2}$ ${\displaystyle C\left(x^{2}+\left(-{\tfrac {1}{4}}+2\right)x-{\tfrac {2}{4}}\right)=4x^{2}+7x-2}$ ${\displaystyle C\left(x^{2}+{\tfrac {7}{4}}x-{\tfrac {1}{2}}\right)=4x^{2}+7x-2}$ You can see that ${\displaystyle C=4}$ solves the equation. So the factorization is ${\displaystyle 4x^{2}+7x-2=4(x+2)\left(x-{\tfrac {1}{4}}\right)=(x+2)(4x-1)}$

Note that if ${\displaystyle 4ac>b^{2}}$ then the roots will not be real numbers.

## Simplifying rational expressions

Consider the two polynomials

${\displaystyle p(x)=a_{n}x^{n}+a_{n-1}x^{n-1}+\cdots +a_{1}x+a_{0}}$

and

${\displaystyle q(x)=b_{m}x^{m}+b_{m-1}x^{m-1}+\cdots +b_{1}x+b_{0}}$

When we take the quotient of the two we obtain

${\displaystyle {\frac {p(x)}{q(x)}}={\frac {a_{n}x^{n}+a_{n-1}x^{n-1}+\cdots +a_{1}x+a_{0}}{b_{m}x^{m}+b_{m-1}x^{m-1}+\cdots +b_{1}x+b_{0}}}}$

The ratio of two polynomials is called a rational expression. Many times we would like to simplify such a beast. For example, say we are given ${\displaystyle {\frac {x^{2}-1}{x+1}}}$ . We may simplify this in the following way:

${\displaystyle {\frac {x^{2}-1}{x+1}}={\frac {(x+1)(x-1)}{x+1}}=x-1,\qquad x\neq -1}$

This is nice because we have obtained something we understand quite well, ${\displaystyle x-1}$ , from something we didn't.

## Formulas of multiplication of polynomials

Here are some formulas that can be quite useful for solving polynomial problems:

${\displaystyle (a+b)^{2}=a^{2}+2ab+b^{2}}$
${\displaystyle (a-b)^{2}=a^{2}-2ab+b^{2}}$
${\displaystyle (a-b)(a+b)=a^{2}-b^{2}}$
${\displaystyle (a\pm b)^{3}=a^{3}\pm 3a^{2}b+3ab^{2}\pm b^{3}}$
${\displaystyle a^{3}\pm b^{3}=(a\pm b)(a^{2}\mp ab+b^{2})}$

## Polynomial Long Division

Suppose we would like to divide one polynomial by another. The procedure is similar to long division of numbers and is illustrated in the following example:

### Example

 Divide ${\displaystyle x^{2}-2x-15}$ (the dividend or numerator) by ${\displaystyle x+3}$ (the divisor or denominator) Similar to long division of numbers, we set up our problem as follows: ${\displaystyle {\begin{array}{rl}\\x+3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x^{2}-2x-15\end{array}}\end{array}}}$ First we have to answer the question, how many times does ${\displaystyle x+3}$ go into ${\displaystyle x^{2}}$? To find out, divide the leading term of the dividend by leading term of the divisor. So it goes in ${\displaystyle x}$ times. We record this above the leading term of the dividend: ${\displaystyle {\begin{array}{rl}&~~\,x\\x+3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x^{2}-2x-15\end{array}}\\\end{array}}}$ , and we multiply ${\displaystyle x+3}$ by ${\displaystyle x}$ and write this below the dividend as follows: ${\displaystyle {\begin{array}{rl}&~~\,x\\x+3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x^{2}-2x-15\end{array}}\\&\!\!\!\!-{\underline {(x^{2}+3x)~~~}}\\\end{array}}}$ Now we perform the subtraction, bringing down any terms in the dividend that aren't matched in our subtrahend: ${\displaystyle {\begin{array}{rl}&~~\,x\\x+3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x^{2}-2x-15\end{array}}\\&\!\!\!\!-{\underline {(x^{2}+3x)~~~}}\\&\!\!\!\!~~~~~~-5x-15~~~\\\end{array}}}$ Now we repeat, treating the bottom line as our new dividend: ${\displaystyle {\begin{array}{rl}&~~\,x-5\\x+3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x^{2}-2x-15\end{array}}\\&\!\!\!\!-{\underline {(x^{2}+3x)~~~}}\\&\!\!\!\!~~~~~~-5x-15~~~\\&\!\!\!\!~~~-{\underline {(-5x-15)~~~}}\\&\!\!\!\!~~~~~~~~~~~~~~~~~~~0~~~\\\end{array}}}$ In this case we have no remainder.

### Application: Factoring Polynomials

We can use polynomial long division to factor a polynomial if we know one of the factors in advance. For example, suppose we have a polynomial ${\displaystyle P(x)}$ and we know that ${\displaystyle r}$ is a root of ${\displaystyle P}$ . If we perform polynomial long division using P(x) as the dividend and ${\displaystyle (x-r)}$ as the divisor, we will obtain a polynomial ${\displaystyle Q(x)}$ such that ${\displaystyle P(x)=(x-r)Q(x)}$ , where the degree of ${\displaystyle Q}$ is one less than the degree of ${\displaystyle P}$ .

### Exercise

2. Factor ${\displaystyle x-1}$ out of ${\displaystyle 6x^{3}-4x^{2}+3x-5}$ .

${\displaystyle (x-1)(6x^{2}+2x+5)}$

Solution

### Application: Breaking up a rational function

Similar to the way one can convert an improper fraction into an integer plus a proper fraction, one can convert a rational function ${\displaystyle P(x)}$ whose numerator ${\displaystyle N(x)}$ has degree ${\displaystyle n}$ and whose denominator ${\displaystyle D(x)}$ has degree ${\displaystyle d}$ with ${\displaystyle n\geq d}$ into a polynomial plus a rational function whose numerator has degree ${\displaystyle \nu }$ and denominator has degree ${\displaystyle \delta }$ with ${\displaystyle \nu <\delta }$ .

Suppose that ${\displaystyle N(x)}$ divided by ${\displaystyle D(x)}$ has quotient ${\displaystyle Q(x)}$ and remainder ${\displaystyle R(x)}$ . That is

${\displaystyle N(x)=D(x)Q(x)+R(x)}$

Dividing both sides by ${\displaystyle D(x)}$ gives

${\displaystyle {\frac {N(x)}{D(x)}}=Q(x)+{\frac {R(x)}{D(x)}}}$

${\displaystyle R(x)}$ will have degree less than ${\displaystyle D(x)}$ .

#### Example

 Write ${\displaystyle {\frac {x-1}{x-3}}}$ as a polynomial plus a rational function with numerator having degree less than the denominator. ${\displaystyle {\begin{array}{rl}&~~\,1\\x-3\!\!\!\!&{\big )}\!\!\!{\begin{array}{lll}\hline \,x-1\end{array}}\\&\!\!\!\!-{\underline {(x-3)~~~}}\\&\!\!\!\!~~~~~~~~~2~~~\\\end{array}}}$ so ${\displaystyle {\frac {x-1}{x-3}}=1+{\frac {2}{x-3}}}$
 ← Precalculus Calculus Trigonometry → Print version

<h1> 1.3 Functions</h1>

 ← Trigonometry Calculus Graphing linear functions → Print version

## What functions are and how are they described

Note: This is an attempt at a rewrite of "Classical understanding of functions". If others approve, consider deleting that section.

Whenever one quantity uniquely determines the value of another quantity, we have a function.

ie X uniquely determines Y but Y is not uniquely determined by X

Let set X consists of x's and set Y consists of y's

two x's can have same y ie one y can be determined by two x's

but one x cannot have two y's

 ---- end of comments ------


}

You can 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.

 A function in everyday life Think about dropping a ball from a bridge. At each moment in time, the ball is a height above the ground. The height of the ball is a function of time. It was the job of physicists to come up with a formula for this function. This type of function is called real-valued since the "finished product" is a number (or, more specifically, a real number).
 A function in everyday life (Preview of Multivariable Calculus) Think about a wind storm. At different places, the wind can be blowing in different directions with different intensities. The direction and intensity of the wind can be thought of as a function of position. This is a function of two real variables (a location is described by two values - an ${\displaystyle x}$ and a ${\displaystyle y}$) which results in a vector (which is something that can be used to hold a direction and an intensity). These functions are studied in multivariable calculus (which is usually studied after a one year college level calculus course). This a vector-valued function of two real variables.

We will be looking at real-valued functions until studying multivariable calculus. Think of a real-valued function as an input-output machine; you give the function an input, and it gives you an output which is a number (more specifically, a real number). 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.

There are many ways which people describe functions. In the examples above, a verbal descriptions is given (the height of the ball above the earth as a function of time). Here is a list of ways to describe functions. The top three listed approaches to describing functions are the most popular and you could skip the rest if you like.

1. A function is given a name (such as ${\displaystyle f}$) and a formula for the function is also given. For example, ${\displaystyle f(x)=3x+2}$ describes a function. 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.
2. A function is described using an equation and two variables. One variable is for the input of the function and one is for the output of the function. The variable for the input is called the independent variable. The variable for the output is called the dependent variable. For example, ${\displaystyle y=3x+2}$ describes a function. The dependent variable appears by itself on the left hand side of equal sign.
3. A verbal description of the function.

When a function is given a name (like in number 1 above), the name of the function is usually a single letter of the alphabet (such as ${\displaystyle f}$ or ${\displaystyle g}$). Some functions whose names are multiple letters (like the sine function ${\displaystyle y=\sin(x)}$ .

 Plugging a value into a function If we write ${\displaystyle f(x)=3x+2}$ , then we know that The function ${\displaystyle f}$ is a function of ${\displaystyle x}$ . To evaluate the function at a certain number, replace the ${\displaystyle x}$ with that number. Replacing ${\displaystyle 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 ${\displaystyle f}$ is interpreted, "Given a number, ${\displaystyle f}$ will return two more than the triple of that number." How would we know the value of the function ${\displaystyle f}$ at 3? We would have the following three thoughts: ${\displaystyle f(3)=3(3)+2}$ ${\displaystyle 3(3)+2=9+2}$ ${\displaystyle 9+2=11}$ and we would write ${\displaystyle f(3)=3(3)+2=9+2=11}$. The value of ${\displaystyle f}$ at 3 is 11. Note that ${\displaystyle f(3)}$ means the value of the dependent variable when ${\displaystyle 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. People often summarize the work above by writing "the value of ${\displaystyle f}$ at three is eleven", or simply "${\displaystyle f}$ of three equals eleven".

## 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 ${\displaystyle -1}$ and gives the output value 1.

A function is usually written as ${\displaystyle f}$ , ${\displaystyle 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, ${\displaystyle f(x)=3x+2}$ tells us:

• The function ${\displaystyle f}$ is a function of ${\displaystyle x}$ .
• To evaluate the function at a certain number, replace the ${\displaystyle x}$ with that number.
• Replacing ${\displaystyle 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 ${\displaystyle f}$ is interpreted, "Given a number, ${\displaystyle 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:

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

See? It's easy!

Note that ${\displaystyle f(3)}$ means the value of the dependent variable when ${\displaystyle 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 ${\displaystyle f(x)}$ 'depends' on the value of the independent variable ${\displaystyle x}$ . This is read as "the value of ${\displaystyle f}$ at three is eleven", or simply "${\displaystyle f}$ of three equals eleven".

## 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 ${\displaystyle f}$ , ${\displaystyle g}$ , and ${\displaystyle h}$ to denote functions, and the variable ${\displaystyle x}$ to denote an independent variable. ${\displaystyle y}$ is used for both dependent and independent variables.

When discussing or working with a function ${\displaystyle f}$ , it's important to know not only the function, but also its independent variable ${\displaystyle x}$ . Thus, when referring to a function ${\displaystyle f}$, you usually do not write ${\displaystyle f}$, but instead ${\displaystyle f(x)}$ . The function is now referred to as "${\displaystyle f}$ of ${\displaystyle 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

${\displaystyle f(x)=7x+1}$ ,

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

${\displaystyle f(2)=7(2)+1=14+1=15}$

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

## 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 ${\displaystyle f(x)}$ , all of the possible ${\displaystyle x}$ values constitute the domain, and all of the values ${\displaystyle f(x)}$ (${\displaystyle y}$ on the x-y plane) constitute the range.

## 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 ${\displaystyle a=b}$ , then ${\displaystyle f(a)=f(b)}$ , but if we only know that ${\displaystyle f(a)=f(b)}$ then we can't be sure that ${\displaystyle 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.

## The vertical line test

The vertical line test, mentioned in the preceding paragraph, is a systematic test to find out if an equation involving ${\displaystyle x}$ and ${\displaystyle y}$ can serve as a function (with ${\displaystyle x}$ the independent variable and ${\displaystyle y}$ the dependent variable). Simply graph the equation and draw a vertical line through each point of the ${\displaystyle 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".)

## Important functions

 Constant function ${\displaystyle f(x)=c}$ It disregards the input and always outputs the constant ${\displaystyle c}$ , and is a polynomial of the zeroth degree where ${\displaystyle f(x)=cx^{0}=c(1)=c}$ . Its graph is a horizontal line. Linear function ${\displaystyle f(x)=mx+c}$ Takes an input, multiplies by ${\displaystyle m}$ and adds ${\displaystyle c}$ . It is a polynomial of the first degree. Its graph is a line (slanted, except ${\displaystyle m=0}$ ). Identity function ${\displaystyle f(x)=x}$ Takes an input and outputs it unchanged. A polynomial of the first degree, ${\displaystyle f(x)=x^{1}=x}$ . Special case of a linear function. Quadratic function ${\displaystyle f(x)=ax^{2}+bx+c}$ A polynomial of the second degree. Its graph is a parabola, unless ${\displaystyle a=0}$ . (Don't worry if you don't know what this is.) Polynomial function ${\displaystyle f(x)=a_{n}x^{n}+a_{n-1}x^{n-1}+\cdots +a_{2}x^{2}+a_{1}x+a_{0}}$ The number ${\displaystyle n}$ is called the degree. Signum function ${\displaystyle {\mbox{sgn}}(x)=\left\{{\begin{matrix}-1&{\text{if}}&x<0\\0&{\text{if}}&x=0\\1&{\text{if}}&x>0\end{matrix}}\right.}$

## Example functions

Some more simple examples of functions have been listed below.

 ${\displaystyle 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 ${\displaystyle 0}$ . Mathematics describes this condition by saying ${\displaystyle 0}$ is not in the domain of the function. ${\displaystyle g(y)=y^{2}}$ Takes an input and squares it. ${\displaystyle 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 ${\displaystyle x}$ or ${\displaystyle y}$ in the same paragraph.) ${\displaystyle f(x)=\left\{{\begin{matrix}5^{x^{2}},&{\mbox{if }}&x>0\\0,&{\mbox{if }}&x\leq 0\end{matrix}}\right.}$ Note that we can define a function by a totally arbitrary rule. Such functions are called piecewise functions.

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.

## Manipulating functions

### Addition, Subtraction, Multiplication and Division of functions

For two real-valued functions, we can add the functions, multiply the functions, raised to a power, etc.

 Example: Adding, subtracting, multiplying and dividing functions which do not have a name If we add the functions ${\displaystyle y=3x+2}$ and ${\displaystyle y=x^{2}}$ , we obtain ${\displaystyle y=x^{2}+3x+2}$ . If we subtract ${\displaystyle y=3x+2}$ from ${\displaystyle y=x^{2}}$ , we obtain ${\displaystyle y=x^{2}-(3x+2)}$ . We can also write this as ${\displaystyle y=x^{2}-3x-2}$ . If we multiply the function ${\displaystyle y=3x+2}$ and the function ${\displaystyle y=x^{2}}$ , we obtain ${\displaystyle y=(3x+2)x^{2}}$ . We can also write this as ${\displaystyle y=3x^{3}+2x^{2}}$ . If we divide the function ${\displaystyle y=3x+2}$ by the function ${\displaystyle y=x^{2}}$ , we obtain ${\displaystyle y={\frac {3x+2}{x^{2}}}}$ .

If a math problem wants you to add two functions ${\displaystyle f}$ and ${\displaystyle g}$ , there are two ways that the problem will likely be worded:

1. If you are told that ${\displaystyle f(x)=3x+2}$ , that ${\displaystyle g(x)=x^{2}}$ , that ${\displaystyle h(x)=f(x)+g(x)}$ and asked about ${\displaystyle h}$ , then you are being asked to add two functions. Your answer would be ${\displaystyle h(x)=x^{2}+3x+2}$ .
2. If you are told that ${\displaystyle f(x)=3x+2}$ , that ${\displaystyle g(x)=x^{2}}$ and you are asked about ${\displaystyle f+g}$ , then you are being asked to add two functions. The addition of ${\displaystyle f}$ and ${\displaystyle g}$ is called ${\displaystyle f+g}$ . Your answer would be ${\displaystyle (f+g)(x)=x^{2}+3x+2}$ .

Similar statements can be made for subtraction, multiplication and division.

 Example: Adding, subtracting, multiplying and dividing functions which do have a name Let ${\displaystyle f(x)=3x+2}$ and: ${\displaystyle g(x)=x^{2}}$ . Let's add, subtract, multiply and divide. {\displaystyle {\begin{aligned}(f+g)(x)&=f(x)+g(x)\\&=(3x+2)+(x^{2})\\&=x^{2}+3x+2\,\end{aligned}}} , {\displaystyle {\begin{aligned}(f-g)(x)&=f(x)-g(x)\\&=(3x+2)-(x^{2})\\&=-x^{2}+3x+2\,\end{aligned}}} , {\displaystyle {\begin{aligned}(f\times g)(x)&=f(x)\times g(x)\\&=(3x+2)\times (x^{2})\\&=3x^{3}+2x^{2}\,\end{aligned}}} , {\displaystyle {\begin{aligned}\left({\frac {f}{g}}\right)(x)&={\frac {f(x)}{g(x)}}\\&={\frac {3x+2}{x^{2}}}\\&={\frac {3}{x}}+{\frac {2}{x^{2}}}\end{aligned}}} .

### Composition of functions

We begin with a fun (and not too complicated) application of composition of functions before we talk about what composition of functions is.

 Example: Dropping a ball If we drop a ball from a bridge which is 20 meters above the ground, then the height of our ball above the earth is a function of time. The physicists tell us that if we measure time in seconds and distance in meters, then the formula for height in terms of time is ${\displaystyle h=-4.9t^{2}+20}$ . Suppose we are tracking the ball with a camera and always want the ball to be in the center of our picture. Suppose we have ${\displaystyle \theta =f(h)}$ The angle will depend upon the height of the ball above the ground and the height above the ground depends upon time. So the angle will depend upon time. This can be written as ${\displaystyle \theta =f(-4.9t^{2}+20)}$ . We replace ${\displaystyle h}$ with what it is equal to. This is the essence of composition.

Composition of functions is another way to combine functions which is different from addition, subtraction, multiplication or division.

The value of a function ${\displaystyle f}$ depends upon the value of another variable ${\displaystyle x}$ ; however, that variable could be equal to another function ${\displaystyle g}$ , so its value depends on the value of a third variable. If this is the case, then the first variable is a function ${\displaystyle h}$ of the third variable; this function (${\displaystyle h}$) is called the composition of the other two functions (${\displaystyle f}$ and ${\displaystyle g}$).

 Example: Composing two functions Let ${\displaystyle f(x)=3x+2}$ and: ${\displaystyle g(x)=x^{2}}$ . The composition of ${\displaystyle f}$ with ${\displaystyle g}$ is read as either "f composed with g" or "f of g of x." Let ${\displaystyle h(x)=f(g(x))}$ Then {\displaystyle {\begin{aligned}h(x)&=f(g(x))\\&=f(x^{2})\\&=3(x^{2})+2\\&=3x^{2}+2\,\end{aligned}}} . Sometimes a math problem asks you compute ${\displaystyle (f\circ g)(x)}$ when they want you to compute ${\displaystyle f(g(x))}$ , Here, ${\displaystyle h}$ is the composition of ${\displaystyle f}$ and ${\displaystyle g}$ and we write ${\displaystyle h=f\circ g}$ . Note that composition is not commutative: ${\displaystyle f(g(x))=3x^{2}+2}$ , and {\displaystyle {\begin{aligned}g(f(x))&=g(3x+2)\\&=(3x+2)^{2}\\&=9x^{2}+12x+4\,.\end{aligned}}} so ${\displaystyle f(g(x))\neq g(f(x))}$ .

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

${\displaystyle {\mbox{square}}(x)=x^{2}}$
${\displaystyle {\mbox{sine}}(x)=\sin(x)}$

Thus, the expression ${\displaystyle \sin ^{2}(x)}$ is a composition of functions:

 ${\displaystyle \sin ^{2}(x)}$ ${\displaystyle ={\mbox{square}}(\sin(x))}$ ${\displaystyle ={\mbox{square}}({\mbox{sine}}(x))}$

(Note that this is not the same as ${\displaystyle {\mbox{sine}}({\mbox{square}}(x))=\sin(x^{2})}$ .) Since the function sine equals ${\displaystyle {\tfrac {1}{2}}}$ if ${\displaystyle x={\frac {\pi }{6}}}$ ,

${\displaystyle {\mbox{square}}\left(\sin \left({\tfrac {\pi }{6}}\right)\right)={\mbox{square}}\left({\tfrac {1}{2}}\right)}$ .

Since the function square equals ${\displaystyle {\frac {1}{4}}}$ if ${\displaystyle x={\frac {\pi }{6}}}$ ,

${\displaystyle \sin ^{2}\left({\tfrac {\pi }{6}}\right)={\mbox{square}}\left(\sin \left({\tfrac {\pi }{6}}\right)\right)={\mbox{square}}\left({\tfrac {1}{2}}\right)={\frac {1}{4}}}$ .

### 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:

${\displaystyle f(2\times x)}$ Dilation
${\displaystyle f(x+2)}$ Translation
${\displaystyle 2\times f(x)}$ Dilation
${\displaystyle 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

${\displaystyle 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 ${\displaystyle x}$, I add two to the input of ${\displaystyle f}$, so it will now change twice as quickly. Thus, this is a horizontal dilation by ${\displaystyle {\frac {1}{2}}}$ because the distance to the ${\displaystyle y}$-axis has been halved. A vertical dilation, such as

${\displaystyle 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 ${\displaystyle x}$-axis, so in effect, you have made the graph of the function 'taller'. Here are a few basic examples where ${\displaystyle a}$ is any positive constant:

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

## Domain and Range

### 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

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

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

${\displaystyle f(x){\mbox{ is defined for }}x\in [-1,1],{\mbox{ or }}\{x:-1\leq x\leq 1\}}$ .
The range of the function is the interval from 0 to 1

### Range

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

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

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

### One-to-one Functions

A function ${\displaystyle f(x)}$ is one-to-one (or less commonly injective) if, for every value of ${\displaystyle f}$, there is only one value of ${\displaystyle x}$ that corresponds to that value of ${\displaystyle f}$ . For instance, the function ${\displaystyle f(x)={\sqrt {1-x^{2}}}}$ is not one-to-one, because both ${\displaystyle x=1}$ and ${\displaystyle x=-1}$ result in ${\displaystyle f(x)=0}$ . However, the function ${\displaystyle f(x)=x+2}$ is one-to-one, because, for every possible value of ${\displaystyle f(x)}$, there is exactly one corresponding value of ${\displaystyle x}$ . Other examples of one-to-one functions are ${\displaystyle f(x)=x^{3}+ax}$ , where ${\displaystyle a\in [0,\infty )}$ . 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 ${\displaystyle x}$ or ${\displaystyle f}$ by a zero factor).

#### Horizontal Line Test

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.

#### Algebraic 1-1 Test

You can also show one-to-oneness algebraically by assuming that two inputs give the same output and then showing that the two inputs must have been equal. For example, Is ${\displaystyle f(x)={\frac {1-2x}{1+x}}}$ a 1:1 function?

${\displaystyle f(a)=f(b)}$

${\displaystyle {\frac {1-2a}{1+a}}={\frac {1-2b}{1+b}}}$

${\displaystyle (1+b)(1-2a)=(1+a)(1-2b)}$

${\displaystyle 1-2a+b-2ab=1-2b+a-2ab}$

${\displaystyle 1-2a+b=1-2b+a}$

${\displaystyle 1-2a+3b=1+a}$

${\displaystyle 1+3b=1+3a}$

${\displaystyle a=b}$

Therefore by the algebraic 1:1 test, the function ${\displaystyle f(x)}$ is 1:1.

You can show that a function is not one-to-one by finding two distinct inputs that give the same output. For example, ${\displaystyle f(x)=x^{2}}$ is not one-to-one because ${\displaystyle f(-1)=f(1)}$ but ${\displaystyle -1\neq 1}$ .

### Inverse functions

We call ${\displaystyle g(x)}$ the inverse function of ${\displaystyle f(x)}$ if, for all ${\displaystyle x}$ :

${\displaystyle g(f(x))=f(g(x))=x}$

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

#### Notation

The inverse function of ${\displaystyle f}$ is denoted as ${\displaystyle f^{-1}(x)}$ . Thus, ${\displaystyle f^{-1}(x)}$ is defined as the function that follows this rule

${\displaystyle f(f^{-1}(x))=f^{-1}(f(x))=x}$

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

Example: Given ${\displaystyle f(x)=2x-7}$ , find ${\displaystyle f^{-1}(x)}$ .

Substitute ${\displaystyle f^{-1}(x)}$ for ${\displaystyle x}$ and substitute ${\displaystyle x}$ for ${\displaystyle f(x)}$ . Then solve for ${\displaystyle f^{-1}(x)}$ :

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

To check your work, confirm that ${\displaystyle f^{-1}(f(x))=x}$ :

${\displaystyle f^{-1}(f(x))=}$

${\displaystyle f^{-1}(2x-7)={}}$

${\displaystyle {\frac {(2x-7)+7}{2}}={\frac {2x}{2}}=x}$

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

Example: Given ${\displaystyle f(x)=x^{2}}$ , find ${\displaystyle f^{-1}(x)}$.

Substitute ${\displaystyle f^{-1}(x)}$ for ${\displaystyle x}$ and substitute ${\displaystyle x}$ for ${\displaystyle f(x)}$ . Then solve for ${\displaystyle f^{-1}(x)}$ :

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

Since there are two possibilities for ${\displaystyle f^{-1}(x)}$ , it's not a function. Thus ${\displaystyle f(x)=x^{2}}$ 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 ${\displaystyle f(x)}$ but not a graph.