## Real Numbers, Functions, and Graphs

Functions relate a set of inputs to a set of outputs such that each input is related to exactly one output. Graphs can be used to represent these relationships pictorially.

### Learning Objectives

Generate a function, sketch a graph

### Key Takeaways

#### Key Points

• The real numbers include all the rational numbers, such as the integer −5 and the fraction $\displaystyle \frac{4}{3}$, and all the irrational numbers such as $\sqrt{2}$ (1.41421356… the square root of two, an irrational algebraic number) and $\pi$ (3.14159265…, a transcendental number).
• A function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output.
• The graph of a function f is the collection of all ordered pairs $(x, f(x))$.

#### Key Terms

• domain: the set of all possible mathematical entities (points) where a given function is defined
• Cartesian: of or pertaining to coordinates based on mutually orthogonal axes

### Real Numbers

Real numbers can be thought of as points on an infinitely long line called the number line or real line, where the points corresponding to integers are equally spaced. The real numbers include all the rational numbers, such as the integer -5 and the fraction $\displaystyle \frac{4}{3}$, and all the irrational numbers such as $\sqrt{2}$ (1.41421356… the square root of two, an irrational algebraic number) and $\pi$ (3.14159265…, a transcendental number).

Any real number can be determined by a possibly infinite decimal representation such as that of 8.632, where each consecutive digit is measured in units one tenth the size of the previous one. The real line can be thought of as a part of the complex plane, and correspondingly, complex numbers include real numbers as a special case.

### Functions

A function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output. An example is the function that relates each real number $x$ to its square: $f(x)= x^{2}$. Here, the domain is the entire set of real numbers and the function maps each real number to its square. The output of a function $f$ corresponding to an input $x$ is denoted by $f(x)$(read “f of x”). In this example, if the input is $-3$, then the output is 9, and we may write $f(-3) = 9$. The input variable(s) are sometimes referred to as the argument(s) of the function.

### Graphs

The graph of a function $f$ is the collection of all ordered pairs $(x, f(x))$. In particular, if $x$ is a real number, “graph” means the graphical representation of this collection, in the form of a line chart, a curve on a Cartesian plane, together with Cartesian axes, etc. Graphing on a Cartesian plane is sometimes referred to as curve sketching. If the function input $x$ is an ordered pair $(x_1, x_2)$ of real numbers, the graph is the collection of all ordered triples $(x_1, x_2, f(x_1, x_2))$ and its graphical representation is a surface (see the three-dimensional graph below).

Graph of a Function: This is a graph of the function $f(x,y) = \sin{x^2} \cos{y^2}$

## Linear and Quadratic Functions

Linear and quadratic functions make lines and a parabola, respectively, when graphed and are some of the simplest functional forms.

### Learning Objectives

Identify linear and quadratic functions

### Key Takeaways

#### Key Points

• Linear function refers to a function that satisfies the following two linearity properties: $f(x + y) = f(x) + f(y) \\ f(ax) = af(x).$
• Linear functions may be confused with affine functions. One variable affine functions can be written as $f(x)=mx+b$, which makes a line when graphed.
• A quadratic function, in mathematics, is a polynomial function of the form: $f(x)=ax^2+bx+c,\quad a \ne 0$. The graph of a quadratic function is a parabola whose axis of symmetry is parallel to the y-axis.

#### Key Terms

• polynomial: an expression consisting of a sum of a finite number of terms, each term being the product of a constant coefficient and one or more variables raised to a non-negative integer power
• linearity: a relationship between several quantities which can be considered proportional and expressed in terms of linear algebra; any mathematical property of a relationship, operation, or function that is analogous to such proportionality, satisfying additivity and homogeneity

Linear and quadratic functions make lines and parabola, respectively, when graphed. They are one of the simplest functional forms.

### Linear Function

In calculus and algebra, the term linear function refers to a function that satisfies the following two linearity properties:

$f(x + y) = f(x) + f(y) \\ f(ax) = af(x)$

Linear functions may be confused with affine functions. One variable affine functions can be written as $f(x)=mx+b$. Although affine functions make lines when graphed, they do not satisfy the properties of linearity. However, the term “linear function” is quite often loosely used to include affine functions of the form $f(x)=mx+b$. Linear functions form the basis of linear algebra.

### Affine Function

An affine transformation (from the Latin, affinis, “connected with”) is a transformation which preserves straight lines (i.e., all points lying on a line initially still lie on a line after transformation) and ratios of distances between points lying on a straight line (e.g., the midpoint of a line segment remains the midpoint after transformation). It does not necessarily preserve angles or lengths, but does have the property that sets of parallel lines will remain parallel to each other after an affine transformation.

### Quadratic Function

A quadratic function, in mathematics, is a polynomial function of the form: $f(x)=ax^2+bx+c, a \ne 0$. The graph of a quadratic function is a parabola whose axis of symmetry is parallel to the y-axis. The expression $ax^2+bx+c$ in the definition of a quadratic function is a polynomial of degree 2 or second order, or a 2nd degree polynomial, because the highest exponent of $x$ is 2. If the quadratic function is set equal to zero, then the result is a quadratic equation. The solutions to the equation are called the roots of the equation.

## Trigonometric Functions

Trigonometric functions are functions of an angle, relating the angles of a triangle to the lengths of the sides of a triangle.

### Learning Objectives

Define the three most familiar trigonometric functions

### Key Takeaways

#### Key Points

• The most familiar trigonometric functions are the sine, cosine, and tangent.
• The sine of an angle is the ratio of the length of the opposite side to the length of the hypotenuse.
• The cosine of an angle is the ratio of the length of the adjacent side to the length of the hypotenuse.
• The tangent of an angle is the ratio of the length of the opposite side to the length of the adjacent side.

#### Key Terms

• hypotenuse: the side of a right triangle opposite the right angle
• differential equation: an equation involving the derivatives of a function

Trigonometric functions are functions of an angle. They are used to relate the angles of a triangle to the lengths of the sides of a triangle. Trigonometric functions are important in the study of triangles and modeling periodic phenomena, among many other applications.

The most familiar trigonometric functions are the sine, cosine, and tangent. In the context of the standard unit circle with radius 1, where a triangle is formed by a ray originating at the origin and making some angle with the x-axis, the sine of the angle gives the length of the y-component (rise) of the triangle, the cosine gives the length of the x-component (run), and the tangent function gives the slope (y-component divided by the x-component).

Sine, Tangent, and Secant: The sine, tangent, and secant functions of an angle constructed geometrically in terms of a unit circle. The number θ is the length of the curve; thus angles are being measured in radians.

Base of Trigonometry: If two right triangles have equal acute angles, they are similar, so their side lengths are proportional. Proportionality constants are written within the image: $\sin{\theta}$, $\cos{\theta}$, $\tan{\theta}$ where $\theta$ is the common measure of five acute angles.

Trigonometric functions are commonly defined as ratios of two sides of a right triangle containing the angle, and can equivalently be defined as the lengths of various line segments from a unit circle. More modern definitions express them as infinite series or as solutions of certain differential equations, allowing their extension to arbitrary positive and negative values and even to complex numbers.

### Right-angle Triangle Definitions

The sine of an angle is the ratio of the length of the opposite side to the length of the hypotenuse. In our case $\sin A = \frac {\textrm{opposite}} {\textrm{hypotenuse}} = \frac {a} {h}$. Note that this ratio does not depend on size of the particular right triangle chosen, as long as it contains the angle $A$, since all such triangles are similar.

Right-Angle Triangle: Right-angle triangle used in defining trigonometric functions.

The cosine of an angle is the ratio of the length of the adjacent side to the length of the hypotenuse: so called because it is the sine of the complementary or co-angle. In our case $\cos A = \frac {\textrm{adjacent}} {\textrm{hypotenuse}} = \frac {b} {h}$.

The tangent of an angle is the ratio of the length of the opposite side to the length of the adjacent side: so called because it can be represented as a line segment tangent to the circle, that is the line that touches the circle, from Latin linea tangens or touching line (cf. tangere, to touch). In our case $\tan A = \frac {\textrm{opposite}} {\textrm{adjacent}} = \frac {a} {b}$.

## Inverse Functions

An inverse function is a function that undoes another function: For a function $f(x)=y$ the inverse function, if it exists, is given as $g(y)= x$.

### Learning Objectives

Compute an inverse function

### Key Takeaways

#### Key Points

• A function $f$ that has an inverse is called invertible; the inverse function is then uniquely determined by $f$ and is denoted by $f^{-1}$.
• If $f$ is invertible, the function $g$ is unique.
• The function $f(x)=x^{2}$ may or may not be invertible, depending on the domain. For a domain containing all real numbers, it is not invertible. But if the domain consists of the non-negative numbers, then the function is injective and invertible.

#### Key Terms

• domain: the set of all possible mathematical entities (points) where a given function is defined
• injective: of, relating to, or being an injection: such that each element of the image (or range) is associated with at most one element of the preimage (or domain); inverse-deterministic
• range: the set of values (points) which a function can obtain

Inverse function is a function that undoes another function: If an input $x$ into the function $f$ produces an output $y$, then putting $y$ into the inverse function $g$ produces the output $x$, and vice versa. i.e., $f(x)=y$, and $g(y)=x$. More directly, $g(f(x))=x$, meaning $g(x)$ composed with $f(x)$ leaves $x$ unchanged.

A function $f$ that has an inverse is called invertible; the inverse function is then uniquely determined by $f$ and is denoted by $f^{-1}$ (read f inverse, not to be confused with exponentiation). If $f$ is invertible, the function $g$ is unique; in other words, there is exactly one function $g$ satisfying this property (no more, no less). Not all functions have an inverse. For this rule to be applicable, for a function whose domain is the set $X$ and whose range is the set $Y$, each element $y \in Y$ must correspond to no more than one $x \in X$; a function $f$ with this property is called one-to-one, or information-preserving, or an injection.

A Function and its Inverse: A function $f$ and its inverse $f^{-1}$. Because $f$ maps $a$ to 3, the inverse $f^{-1}$ maps 3 back to $a$.

### Inverse operations that lead to inverse functions

Inverse operations are the opposite of direct variation functions. Direct variation function are based on multiplication; $y=kx$. The opposite operation of multiplication is division and an inverse variation function is $\displaystyle y=\frac{k}{x}$.

### Squaring and square root functions

The function $f(x)=x^2$ may or may not be invertible, depending on the domain. If the domain is the real numbers, then each element in the range $Y$ would correspond to two different elements in the domain $X$ ($\pm x$), and therefore $f$ would not be invertible. More precisely, the square of $x$ is not invertible because it is impossible to deduce from its output the sign of its input. Such a function is called non-injective or information-losing. Notice that neither the square root nor the principal square root function is the inverse of $x^2$ because the first is not single-valued, and the second returns $-x$ when $x$ is negative. If the domain consists of the non-negative numbers, then the function is injective and invertible.

## Exponential and Logarithmic Functions

Both exponential and logarithmic functions are widely used in scientific and engineering applications.

### Learning Objectives

Compute using logarithmic and exponential functions

### Key Takeaways

#### Key Points

• Exponential function is the function $e^x$, where $e$ is the number (approximately 2.718281828) such that the function $e^x$ is its own derivative.
• The exponential function may be defined by the following power series: $\displaystyle e^x = \sum_{n = 0}^{\infty} \frac{x^n}{n!} = 1 + x + {\frac{x^2}{2!} } + {\frac{x^3}{3!} } + \cdots$.
• The logarithm of a number $x$ with respect to base $b$ is the exponent by which $b$ must be raised to yield $x$. In other words, the logarithm of $x$ to base $b$ is the solution $y$ to the equation $b^y=x$.

#### Key Terms

• inverse function: a function that does exactly the opposite of another
• derivative: a measure of how a function changes as its input changes
• binary: the bijective base-2 numeral system, which uses only the digits 0 and 1

### Exponential Function

Exponential function is the function $e^x$ the number (approximately 2.718281828) such that the function $e^x$ is its own derivative. The function is often written as $\exp{(x)}$, especially when it is impractical to write the independent variable as a superscript. The exponential function is widely used in physics, chemistry, engineering, mathematical biology, economics and mathematics. Sometimes the term exponential function is used more generally for functions of the form $f(x)=cb^x$, where the base $b$ is any positive real number and $c$ is a constant.

Graph of $f(x)=e^x$: The derivative (or slope of a tangential line) of the exponential function is equal to the value of the function.

The exponential function arises whenever a quantity grows or decays at a rate proportional to its current value. One such situation is continuously compounded interest, and in fact it was this that led Jacob Bernoulli in 1683 to the number $\displaystyle \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n$, now known as e. Similarly, $\displaystyle \exp(x) = \lim_{n\to\infty}\left(1 + \frac{x}{n}\right)^{n}$ first given by Euler.

The exponential function $e^x$ can be characterized in a variety of equivalent ways. In particular it may be defined by the following power series: $\displaystyle e^x = \sum_{n = 0}^{\infty} {x^n \over n! } = 1 + x + {x^2 \over 2! } + {x^3 \over 3! } + \cdots$. From this definition, you can check that $e^x$ is its own derivative: $\displaystyle \frac{d}{dx} e^x = e^x$.

### Logarithmic Functions

The logarithm of a number $x$ with respect to base $b$ is the exponent by which $b$ must be raised to yield $x$. In other words, the logarithm of $x$ to base $b$ is the solution $y$ to the equation $b^y = x$. For example, the logarithm of 1000 to base 10 is 3, because 1000 is 10 to the power 3: $1000=10\cdot 10 \cdot 10 = 10^3$. More generally, if $x=b^y$, then $y$ is the logarithm of $x$ to base $b$, and is written $y=\log_b(x)$, so $\log_{10}(1000)=3$.

Plot of $\log_2(x)$: The graph of the logarithm to base 2 crosses the x-axis (horizontal axis) at 1 and passes through the points with coordinates $(2,1)$, $(4,2)$, and $(8,3)$. For example, $\log_2(8)=3$, because $2^3=8$. The graph gets arbitrarily close to the y-axis, but does not meet or intersect it.

For $f(x)=e^x$, $g(x)=\log_e(x)$ is the inverse function of $f(x)$ and vice versa. The logarithm to base $b=10$ is called the common logarithm and has many applications in science and engineering. The natural logarithm has the constant e ($\approx 2.718$) as its base; its use is widespread in pure mathematics, especially calculus. The binary logarithm uses base $b=2$ and is prominent in computer science.

## Using Calculators and Computers

For numerical calculations and graphing, scientific calculators and personal computers are commonly used in classes and laboratories.

### Learning Objectives

Describe how calculators and computers can assist with arithmetic, graphing, and other complicated operations.

### Key Takeaways

#### Key Points

• A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics.
• These days, scientific and graphing calculators are often replaced by personal computers or even by supercomputers.
• Either by using commercial softwares or by using programming languages, complicated, multi-step numerical calculations can be performed on a PC.

#### Key Terms

• supercomputer: any computer that has a far greater processing power than others of its day; typically they use more than one core and are housed in large clean rooms with high air flow to permit cooling. Typical uses are weather forecasting, nuclear simulations and animations
• programming language: code of reserved words and symbols used in computer programs, which give instructions to the computer on how to accomplish certain computing tasks

For numerical calculations and graphing, scientific calculators and personal computers are commonly used in classes and laboratories.

### Scientific calculators

A scientific calculator is a type of electronic calculator, usually but not always handheld, designed to calculate problems in science, engineering, and mathematics. They have almost completely replaced slide rules in almost all traditional applications, and are widely used in both education and professional settings.

In certain contexts such as higher education, scientific calculators have been superseded by graphing calculators, which offer a superset of scientific calculator functionality along with the ability to graph input data and write and store programs for the device. There is also some overlap with the financial calculator market.

Fig 1: A typical graphing calculator built by Texas Instruments, displaying a graph of a function $f(x)=2x^2-3$.

Scientific calculators are used widely in any situation where quick access to certain mathematical functions is needed, especially those such as trigonometric functions that were once traditionally looked up in tables; they are also used in situations requiring back-of-the-envelope calculations of very large numbers, as in some aspects of astronomy, physics, and chemistry. However, for more complicated applications, computers offer more powerful solutions to many problems.

### Computers

These days, scientific and graphing calculators are often replaced by personal computers or even by supercomputers. There are many softwares (such as Mathematica, Matlab, etc.) that allows not only numerical calculations and plotting of functions, but also helping with matrix manipulations, data manipulation, implementation of algorithms, creation of user interfaces, etc. In addition, by using programming languages such as Fortran, C, C++, Java, etc., complicated, multi-step numerical calculations can be performed on a PC. Therefore, computers are extremely useful tools in scientific and engineering disciplines.

Fig 2: A three-dimentional wireframe plot of the unnormalized sinc function $x=\text{sinc}(x^2+y^2)^{\frac{1}{2}}$.