Go backward to 6.4 Sequences and SeriesGo up to 6 More on FunctionsGo forward to 6.6 Asymptotic Bounds |

Real functions can be constructed in a
modular manner by composing more complex functions from simpler ones. The
composition operations are defined "pointwise", i.e., the value of a
composed function at point `x` is determined only by the values of the
component functions at this point.

. : R-> RealFunc(x) :=c;+: (RealFun x RealFun) -> RealFun ( f+g)(x) :=f(x) +g(x);-: (RealFun x RealFun) -> RealFun ( f+g)(x) :=f(x) -g(x);: (RealFun x RealFun) -> RealFun ( f*g)(x) :=f(x) *g(x);./.: (RealFun x RealFun) -> ( R->^{partial}R)( f/g)(x) :=f(x)/g(x);. ^{.}: (RealFun xZ) -> (R->^{partial}R)( f^{n})(x) :=f(x)^{n};sqrt ^{ }( ): (Zx RealFun) -> (R->^{partial}R)(sqrt ^{n}(f))(x) := sqrt^{n}(f(x));

The first composition operation makes a function from a constant, e.g., the
number 5 can be interpreted as the constant function 5(`x`) := 5. The
domain of a quotient function `f`/`g` is the set of all reals
`x` such that `g`(`x`) != 0. The domain of
`f`^{n} and of sqrt^{n}(`f`) is **R**, if
`n` >= 0. Otherwise, their domain is the set of all reals `x`
such that `f`(`x`) > 0.

- Let
`f`(`x`) := 2`x`^{2}and`g`(`y`) :=`y`+4. Then, for every`x`in**R**,(sqrt(

`f`+`g`))(`x`) = sqrt(2`x`^{2}+`x`+ 4). - The function
`f`(`x`) := 3`x`^{2}+`x`sqrt(`x`) equals3*

where`g`+`h``g`(`x`) :=`x`^{2}and`h`(`x`) =`x`sqrt(`x`). - The function
1
_{R}^{2}+sqrt( )/1_{R}+1 equals the function`f`(`x`) :=`x`^{2}+sqrt(`x`)/`x`+1.

**Integer Functions**
Various functions map real numbers to integers.

floor(Analogously, thex) := max {yinZ:y<=x}.

ceiling(x) := min {yinZ:y>=x}.

In above definition, we consider **Z** as a subset of **R** (instead of
writing `h`(**Z**) where `h` is the homomorphism that
actually maps **Z** into **R**).

The graphs of these functions are depicted by the following diagram (with the floor denoted by a solid line and the ceiling denoted by the dotted line):

We see that the floor function lies on or below the first diagonal while the ceiling lies above the diagonal. If we shift the diagonal line down one unit, it lies completely below the floor function; if we shift it up one unit, it lies completely above the floor function. Furthermore, functions intersect with each other at the diagonal exactly for the integer points. Finally, the functions are reflections of each other about both axes. We thus have the following three results.

x-1 < floor(x) <=x<= ceiling(x) <x+1,floor( x) =x<=>xinZ<=> ceiling(x) =x,floor(- x) = -ceiling(x), ceiling(-x) = -floor(x).

(We use in above proposition `A` <=> `B` <=> `C` to
denote (`A` <=> `B`) /\ (`B` <=> `C`)).

Furthermore, we have the following property that allows us to shift integer terms out of a floor or a ceiling.

floor( x+i) = floor(x)+i,ceiling( x+i) = ceiling(x)+i.

Please note that above rule does not hold for multiplication, i.e., there
exist `x` in **R** and `i` in **Z** such that
floor(`x`*`i`) != floor(`x`)*`i` (e.g.,
2*floor(0.5) = 0 != 1 = floor(2*0.5)).

The following rules help us to get rid of the floor and ceiling brackets under certain circumstances.

x<i<=> floor( x) <i,i<x<=> i< ceiling(x),x<=i<=> ceiling( x) <=i,i<=x<=> i<= floor(x).

Computer languages and pocket calculators sometimes provide operations to truncate the fractional part of a number.

trunc( x) :=ifx< 0thenceiling(x)elsefloor(x).

For this function, we have the following result.

forallxinR: trunc(-x) = -trunc(x).

Apart from that, truncation does not have many nice mathematical properties (as we have for floor and ceiling), therefore it is rarely used in mathematical practice. A number of other interesting functions can be defined with the help of floor and ceiling.

The graph in above example is an infinite replication of the graph in the interval [0, 1[, i.e., the corresponding function has period 1.

A function is

fhas perioda: <=>f:R->R/\ainR/\forallxinR:f(x+a) =f(x).

fis periodic : <=>existsainR:fhas perioda.

With the help of the floor function, we can also perform "integer division"
(see Proposition *Integer Operations*) of two reals `x` and `y` as
floor(`x`/`y`). A corresponding remainder operation is then
defined as follows.

mod: ( RxR) ->Rxmody:=x-y*floor(x/y).

As an immediate consequence of this definition, we have, for every `x`
in **R** and `y` in **R** with `y` != 0,

x=y*floor(x/y) +xmody.

For positive x and y, the intuitive meaning of integer quotient and
remainder in **R** can be easily grasped by imagining a circle of
circumference `y` on which we travel from a denoted starting point
distance x:

The number of times that we traverse the circle is
floor(`x`/`y`), the distance of the final point from the starting
point is `x` mod `y`.

- floor(5.44/4) = 1; 5.44 mod 4 = 5.44 - 4*1 = 1.44.
- floor(-5.44/4) = -2; -5.44 mod 4 = -5.44 - 4*(-2) = 2.56.
- floor(5.44/-4) = -2; 5.44 mod -4 = 5.44 - (-4)*(-2) = -2.56.
- floor(-5.44/-4) = 1; -5.44 mod -4 = -5.44 - (-4)*1 = -1.44.

From above examples, we realize the following facts about the remainder operation.

y> 0 => (0 <=xmody<y),y< 0 => (0 >=xmody>y).

**Polynomial Functions and Rational Functions**
Functions may be defined by polynomials.

pis polynomial function of degreenwith coefficientsa: <=>ninN/\a:N_{n+1}->R/\forallxinR:p(x) = (sum_{0 <= i <= n}a_{</sub>i); }pis polynomial function : <=>existsninN,a:pis polynomial function of degreenwith coeff.a;degree( p) :=suchninN:existsa:N_{n+1}inR:pis polynomial function of degreenwith coefficientsa;coefficients( p) :=sucha:existsninN:a:N_{n+1}inR/\pis polynomial function of degreenwith coefficientsa.

Degree and coefficients of a polynomial function are uniquely defined (which we do not show here). Every polynomial function can be pointwise defined from identity and constant functions just by use of +, -, * and exponentiation (with non-negative exponents); vice versa, any function defined in such a way is a polynomial function.

- The
*constant function (konstante Funktion)*`f`(`x`) :=`c`(for any`c`in**R**) is a polynomial function of degree 0 and with coefficients [`c`]. - The
*linear function (lineare Funktion)*`f`(`x`) :=`a``x`+`b`(for any`a`in**R**and`b`in**R**) is a polynomial function of degree 1 with coefficients [`a`,`b`]. -
The
*square function (Quadratfunktion)*`f`(`x`) :=`x`^{2}is a polynomial function of degree 2 with coefficients [1, 0, 0]. `f`(`x`) :=`x`^{5}-3`x`^{2}+1 is a polynomial function with degree 5 and coefficients [5, 0, 0, -3, 0, 1].- The function
`f`(`x`) := (2`x`+1)*(`x`^{2}-3) is a polynomial function because it can be represented (by simplification of the defining term) as

It thus is of degree 3 and has coefficients <2, 1, -6, -3>.`f`(`x`) := 2`x`^{3}+`x`^{2}-6`x`-3.

Every polynomial function has a function graph with a single "smooth" path such as the graph for the function in the last last example:

By allowing also division as a function composition operation, we get the following class of real functions:

ris a rational function : <=>existsp,q:pis polynomial function /\qis polynomial function /\forallx inR:r(x) =p(x)/q(x).

- The
*reciprocal function (Reziprokfunktion)*`f`(`x`) := 1/`x`is a rational function with domain**R**- {0}. `f`(`x`) := 3`x`^{2}-2`x`+1/`x`^{2}+1 is a rational function with domain**R**.`f`(`x`) := 3`x`^{2}-2`x`+1/`x`^{2}-1 is a rational function with domain**R**- {-1,1}.

Rational functions may have function graphs with multiple paths separated by those horizontal coordinates where the denominator becomes zero; e.g. for the rational function in the last example we have:

The dashed lines denote the discontinuities at -1 and 1 where the rational function is not defined.

**Exponentiation and Natural Logarithm**
The sequence [`e`^{i}]_{i} (where `e` denotes Euler's
number) can be smoothly extended to a function over **R**.

exp: R->R_{> 0}exp( x) := (sum_{i=0}^{ oo }x^{i}/i!);

ln: R_{> 0}->Rln( x) := exp^{-1}(x).

One can show that, for every `x` in **R**,
[(**sum**_{0 <= i <= n} `x`^{i}/`i`!)]_{n} converges
and that exp(`x`) is thus well defined. Furthermore, the
function is bijective and thus, for every `x` > 0,
ln(`x`) is well-defined. The graphs of both functions are
depicted as follows:

where we see for instance exp(0) = 1 and ln(1) = 0. More general, we have the following properties.

exp( x+y)= exp( x) * exp(y),exp( x-y)= exp( x) / exp(y),exp(- x)= 1/exp( x),exp( x*y)= exp( x)^{y},exp(0) = 1, exp(1) = e,

ln( x*y)= ln( x)+ln(y),ln( x/y)= ln( x)-ln(y),ln(1/ x)= -ln( x),ln( x^{y})= y*ln(x),ln( e)= 1, ln(1) = 0.

exp(We havex+y) = exp(x) * exp(y).

(*) The fact (

exp( x+y)= (( sum_{i=0}^{ oo }x^{i}/i!)) + ((sum_{i=0}^{ oo }y^{i}/i!))= ( sum_{k=0}^{ oo }(sum_{0 <= i <= k}x^{i}/i!y^{k-i}/(k-i)!))= ( sum_{k=0}^{ oo }1/k! (sum_{0 <= i <= k}k!/i!(k-i)!x^{i}y^{k-i}))= ( sum_{k=0}^{ oo }1/k! (sum_{0 <= i <= k}(ki)x^{i}y^{k-i}))= (*) ( sum_{k=0}^{ oo }(x+y)^{k}/k!)= exp( x)+exp(y).

Most properties about exponentiation are easy consequences of the first fact
in above proposition, e.g. we have, for every `x` in **R**,

exp(0) = exp(and consequently exp(0) = 1. Properties of the logarithm are direct consequences of its definition as the inverse of exponentiation.x+ 0) = exp(x)*exp(0)

ln(We havex*y) = ln(x)+ln(y).

ln( x) + ln(y)= ln(exp(ln( x) + ln(y)))= ln(exp(ln( x)) * exp(ln(y)))= ln( x*y).

On the basis of "exp" and "ln" a more general kind of exponentiation and logarithm can be defined.

exp: ( R_{>0}xR) ->R_{> 0}exp _{a}(x) := exp(x*ln(a)),

log: ( R_{>0}xR_{> 0}) ->Rlog _{a}(x) := ln(x)/ln(a).

Both functions are the inverse of each other, e.g. we have
for every `a` in **R**_{> 0} and `x` in **R**_{> 0}

exp_{a}(log_{a}(x)) = exp_{a}(ln(x)/ln(a)) = (ln(x)/ln(a)*ln(a) =x.

The graphs of generalized exponentiation and logarithm look like their basic
counterparts but are scaled by a constant factor ln(`a`).

**Trigonometric Functions**
The trigonometric functions are defined as limits of some power series.

sin: R-> [-1,1]sin( x) := (sum_{i=0}^{ oo }(-1)^{k}x^{2k+1}/(2)!);k+1

cos: R-> [-1,1]cos( x) := (sum_{i=0}^{ oo }(-1)^{k}x^{2k}/(2)!);k

tan: R->^{partial}Rtan( x) := sin(x)/cos(x);

cot: R->^{partial}Rcot( x) := cos(x)/sin(x).

The function graphs of sine and cosine are depicted as follows:

We see that the sine is zero for every multiple of pi and alternates between its maximum +1 and minimum -1 at the points in the middles between; the function has period 2 pi . The cosine is just a copy of the sine shifted by pi /2 to the left.

sin(2 pi i)= 0, sin(2 pi i+ pi /2)= 1, sin(2 pi i+ pi )= 0, sin(2 pi i+3 pi /2)= -1,

cos(2 pi i)= 1, cos(2 pi i+ pi /2)= 0, cos(2 pi i+ pi )= -1, cos(2 pi i+3 pi /2)= 0.

Many properties of sine and cosine can be derived from the following fundamental proposition (which we state without proof).

sin( x+y)= sin( x)*cos(y) + cos(x)*sin(y),cos( x+y)= cos( x)*cos(y) - sin(x)*sin(y).

We then have the following results.

sin( x+2 pi )= sin( x),sin( x+ pi /2)= cos( x),sin( pi /2- x)= cos( x),sin(- x)= -sin( x),sin(2 x)= 2sin( x)cos(x),

cos( x+2 pi )= cos( x),cos( x+ pi /2)= -sin( x),cos( pi /2- x)= -sin( x),cos(- x)= cos( x),cos(2 x)= cos ^{2}(x)-sin^{2}(x).

cos ^{2}(x)+sin^{2}(x) = 1,

2 sin(x)*sin(y) = cos(x-y) - cos(x+y),

2 cos(x)*cos(y) = cos(x-y) + cos(x+y),

2 sin(x)*cos(y) = sin(x-y) + sin(x+y).

sin(We havex+2 pi ) = sin(x).

sin( x+2 pi ) = sin(x)*cos(2 pi )+cos(x)*sin(2 pi )= sin( x)*1+cos(x)*0 = sin(x).

The function graphs of tangent and cotangent look as follows:

The tangent function has period pi , its value is 0 at every multiple of pi and undefined at every odd multiple of pi /2; furthermore the function is unbounded in both directions. The cotangent is the tangent horizontally flipped and shifted left by pi /2. Both functions meet at odd multiples of pi /4 at values +/-1.

tan( pi i)= 0, tan( pi i+ pi /4)= 1, tan( pi i- pi /4)= -1,

cot( pi i+ pi /2)= 0, cot( pi i+ pi /4)= 1, cot( pi i- pi /4)= -1.

Many properties of tangent and cotangent can be derived from the following proposition (which we state without proof).

tan(x+y) = tan(x)+tan(y)/1-tan(x)*tan(y), cot(x+y) = cot(x)*cot(y)-1/cot(x)+cot(y).

We than also have the following results.

tan(- x)= -tan( x),tan( x)= -cot( x+ pi /2),

cot(- x)= -cot( x),tan( x)= -tan( x- pi /2).

tan(-We have tan(-x) = - tan(x).

Author: Wolfgang Schreiner

Last Modification: October 4, 1999