Friday, December 11, 2009

Calculus 1 for Electrical Engineering and Computing

An engineer will probably be more concerned about using mathematics, rather than proof and rigour.


Α first year degree/diploma course in engineering mathematics with an
emphasis on important concepts, such as algebraic structure, symme
tries, linearity, and inverse problems. Developments in the fields of 
engineering, particularly the extensive use of computers and 
microprocessors, have changed the necessary subject emphasis within mathematics. This has meant incorporating areas such as Boolean 
algebra, graph and language theory, and logic into the content. A 
particular area of interest is digital signal processing, with applications 
as diverse as medical, control and structural engineering, non-destructive
testing, and geophysics. Ι give more prominence to the treatment
of discrete functions (sequences), solutions of difference equations and z
transforms, and also to contextualize the mathematics within a systems
approach to engineering problems.


Revision  by Bill Cox

Types of numbers
Numbers can be classified into different types:
  • natural numbers
  • zero
  • directed numbers
  • integers
  • rational numbers (fractions)
  • irrational numbers
  • real numbers
  • complex numbers
The counting numbers
              1, 2, 3, 4, . . .
are called natural numbers.

Zero, 0, is really in a class of its own – we always have to be careful with it. It is an integer and also, of course, a real number. Essentially, zero enables us to define negative numbers. Thus, the negative of 3 is the number denoted n = −3 satisfying:
              3+n=0
This enables us to ‘count in opposite directions’ using directed or negative numbers
               − 1, −2, −3, −4, . . .
The full set of numbers
              {. . . − 4, −3, −2, −1, 0, 1, 2, 3, 4, . . .}
is called the set of integers.

Numbers that can be written in the form:
              integer / non-zero integer  (e.g.  3 / 4 , −1 / 2)
              (including integers, such as 6 =  6 / 1)  
are called rational numbers or fractions. All measurements of a physical nature (length, time, voltage, etc.) can only be expressed in terms of such numbers.

Numbers which are not rational, and cannot be expressed as ratios of integers, are called irrational numbers. Examples are √2 and π

The set of all numbers: integers, rational and irrationals is called the set of real numbers. It can be shown that together these numbers can be used to ‘label’ every point on a continuous infinite line – the real line.

So called ‘complex numbers’ are really equivalent to pairs of real numbers.
Note that zero, 0, is an exceptional number in that one cannot divide by it. It is not that 1/0 is ‘infinity’, but simply that it does not exist at all. 
Infinity, denoted ∞, is not really a number. It is a concept that indicates that no matter what positive (negative) number you choose, you can always find another positive (negative) number greater (less) than it. Crudely, ∞ denotes a ‘number’ that is as large as we wish.

Use of inequality signs
Here we will need only the basic properties of inequalities. The real numbers are ordered. That is, we can always say whether one number a is less than, equal to, or greater than another given number b. To denote this we use the ‘comparator’ symbols or inequalities, < and ≤, > and ≥.
  • a > b means a is greater than b; a < b means a is less than b. Thus 6 > 5, 4 < 5. 
  • a ≥ b means a is greater than or equal to b, and similarly a ≤ b means a is less than or equal to b. Be very careful to distinguish between, for example a > b and a ≥ b. 
  • Sometimes it is also useful to use the ‘not equal to’ symbol, <>.
Care is needed when changing signs and forming reciprocals with inequalities. For example,
             if a > b > 0, then −a < −b and  1 / a <  1 / b
            However, if a > 0 > b then −a < −b is still true, but 1 / a > 1 / b

Often we wish to refer to the positive or absolute value of a number x (for example in a rectified sine wave). We denote this by the modulus of x, |x|. For example:
             | − 4| = 4
By definition |x| is never negative, so |x| ≥ 0. Also, note that
             |x| < a    means   −a < x < a.
For example:
             |x| < 3   means   −3 < x < 3            
because  if x is positive then 0 ≤ x < 3, but if x is negative then we must have
−3 < x ≤ 0. So, combining these we must have −3 < x < 3.

Highest common factor and lowest common multiple
A prime number is a positive integer which cannot be expressed as a product of two or more smaller distinct positive integers. That is, a prime number cannot be divided exactly by any integer other than 1 or itself
  • From the definition, 1 is not a prime number.
  • 6, for example, is not a prime, since it can be written as 2 × 3. The numbers 2 and 3 are called its (prime) factors. 
Another way of defining a prime number is to say that it is has no integer factors other than 1 and itself.
There are an infinite number of prime numbers:
             2, 3, 5, 7, 11, 13, . . .
but no formula for the nth prime has been discovered.

Prime numbers are very important in the theory of codes and cryptography. They are also the ‘building blocks’ of numbers, since any given integer can be written uniquely as a product of primes:
             12 = 2 × 2 × 3 = 2^2 × 3
This is called factorising the integer into its prime factors. It is an important operation, for example, in combining fractions. A maxima's example:

factor(1024); => 2^10


The highest common factor (HCF) of a set of integers is the largest integer which is a factor of all numbers of the set. For small numbers we can find the HCF ‘by inspection’ – splitting the numbers into prime factors and constructing products of these primes that divide each number of the set, choosing the largest such product.

The lowest common multiple (LCM) of a set of integers is the smallest integer which is a multiple of all integers in the set. It can again be found by prime factorisation of the numbers. Here you will only need to use the LCM in combining fractions and only for small, manageable numbers, so the LCM will usually be obvious ‘by inspection’. In such cases one can normally guess the answer by looking at the prime factors of the numbers, and then check that each number divides the guess exactly.
You may also have noticed that it  gets increasingly difficult to factorise, compared to multiplying – thus in 221= 13 × 17, it is so much easier to multiply 13 × 17 than to discover factors (factorising). This fact is actually the key idea behind many powerful coding systems – the trap-door principle – in some cases it is much easier doing a mathematical operation than undoing it!

Manipulation of numbers
Much of arithmetic is based on just a few operations:
  • addition, 
  • subtraction, 
  • multiplication and 
  • division
satisfying a small number of rules. The extension of these rules to include symbols as well as numbers leads us on to algebra.

Addition, denoted +, produces the sum of two numbers:
              6+3=9=3+6            (addition is ‘commutative’)
Subtraction, denoted −, produces the difference of two numbers:
              6 − 3 = 3 = −(3 − 6) (minus sign changes signs in brackets)
Multiplication, denoted by a × b or simply as ab in algebra, produces the product of two numbers:
              6 × 3 = (6)(3) = 18 = 3 × 6     (multiplication is commutative)
a · b is sometimes used to denote the product but can be confused with decimal notation in arithmetic.
Division, denoted by a ÷ b or a/b, or better (----)produces the quotient of two numbers:                                                  b
              6 ÷ 3 = 6/3 =2   (of course, 6 ÷ 3 <> 3 ÷ 6!)
                           
Note that ÷ and / are very rarely used in written calculations, where we use the form(----)    unless we need to call into play ÷ or / because we have a large number of divisions.
Also notice how we have simplified the quotient to 2. We always simplify such fractions to lowest form whenever we can .

The way the above and other arithmetic operations are combined is according to a set of conventional precedences – the rules of arithmetic. Thus we always perform multiplication before addition, so:
              2 × 3 + 5 = 6 + 5 = 11
Brackets can be used if we want to override such rules. For example:
              2 × (3 + 5) = 2 × 8 = 16

In general, an arithmetic expression, containing numbers, ( ), x, ÷, +, −, must be
evaluated according to the following priorities:
              BODMAS
              Brackets ( )                   first
              Of (as in ‘fraction of’ − rarely used these days)]
              Division ÷                                                           ]    second
              Multiplication ×                                                  ]
              Addition +          ]
                                         ]   third
              Subtraction −     ]
  • If an expression contains only multiplication and division we work from left to right. 
  • If it contains only addition and subtraction we again work from left to right. 
  • If an expression contains powers or indices then these are evaluated after any brackets.
Products and quotients of negative numbers can be obtained using the following rules:
                             (+1)(+1) = +1      (+1)(−1) = −1
                             (−1)(+1) = −1      (−1)(−1) = +1
                             1 / (−1) = −1
For example (−2)(−3) = (−1)(−1)6 = 6

Note that if you evaluate expressions on your calculator, it may not follow the BODMAS order, simply because of the way your calculator operates. However, BODMAS is the universal convention in Western mathematics and applies equally well to algebra.
Slips with brackets and signs crop up frequently in most people’s calculations (mine included!). Whereas this may only lose you one or two marks in an exam, in real life, an error in sign can convert a stable control system into an unstable one, or a healthy bank balance into an overdraft.
Handling fractions
A fraction or rational number is any quantity of the form:
               m / n (n<>0)
where m, n are integers but n is not equal to 0. It is of course essential that n <> 0, because as noted division by zero is not defined.
              m is called the numerator
              n is the denominator
If m ≥ n the fraction is said to be improper, and if m < n it is proper.

A number expressed in the form 2(1/2) (meaning 2 + 1/2 ) is called a mixed fraction. In mathematical expressions it is best to avoid this form altogether and write it as a vulgar fraction (----),  otherwise it might be mistaken for ‘2 × 1 /2= 1’, and it is also more difficult to do calculations such as multiplication and division using mixed fractions.

The numerator and denominator of a fraction may have common factors. These may be cancelled to reduce the fraction to its simplest or ‘lowest’ form:
               6/12 = 3*2 / 6*2 = 2/4 =1*2 / 2*2 = 1/2
Each of these forms are equivalent fractions, but clearly the last one is the simplest. However, sometimes one of the other forms may be convenient for particular purposes, such as adding fractions. A very common fraction where we tend not to cancel down in this way is the percentage. Thus we usually express 32/100 as ‘32 percent’ rather than as
its equivalent, ‘8 out of 25’!

Fractions are multiplied ‘top by top and bottom by bottom’ as you might expect:
                m/n × p/q = mp /nq  (n,q <>0)  e.g. 3/2  ×  5/11 =  15/22
with p and q also any integers. There may, of course, be common factors to cancel down, as for example in:
                3/2 × 6/7 = 3 × 3/7 = 9/7
The inverse or reciprocal of a fraction is obtained by turning it upside down:
                1/(m/n) = n/m   e.g. 1 / (3/2) = 2/3
where both m and n must be non-zero. So dividing by a vulgar fraction is done by inverting it and multiplying:
                (p/q) / (m/n) =  (p/q) × (n/m) = np/mq
                e.g. 7/2 / 14/6 = 7/2 × 6/14 = 3/2
Multiplication and division of fractions are therefore quite simple. Addition and subtraction are less so. Two fractions with the same denominator are easily added or subtracted:
                 m/n ± p/n = (m±p)/n
So to add and subtract fractions in general we rewrite them all with the same common denominator, which is the lowest common multiple of all the denominators. For example:
                 3/4 - 4/3 =     3×3/12 - 4×4/12 = (9 − 16)/12 = -7/12
In the example, 12 is the LCM of 3 and 4.

An electrical example – resistances in parallel
Three resistances R1 , R2 , R3 connected in parallel are equivalent to a single resistance R given by:
                 1/R = 1/R1 +1/R2 + 1/R3
So, for example if
                 R1 = 2Ω, R2 = 1/2Ω, R 2 = 3/2Ω
                  1/R = 1/2 + 2 + 2/3     [units of 1/Ω]
or, with 6 the LCM of 2 and 3
                  1/R = (3+12+4) / 6 = 19/6 Ω-1
and so the equivalent resistance is
                  R = 6/19 Ω

Finally, on fractions, recall the ideas of ratio and proportion. These are met early in our mathematical education, yet often continue to confuse us later in life. Specifically, it is not uncommon to see someone make errors such as:
                  a/b = 1/3  means a = 1 and b = 3
The notation a : b is used to indicate that the numbers a and b are in a certain ratio or proportionality to each other.
    a:b = 1:3 simply means that a/b = 1/3 certainly does not mean a = 1 and b = 3. For example
                  3 : 9 = 2 : 6 = 7 : 21 = 1 : 3
All a : b = 1 : 3 means is that  a = b / 3 i.e. a is a third of b. If we are given a (or b) then we can find b (or a). The review question illustrates this.

In general, if we can write a = kb where k is some given constant then we say ‘a is proportional to b’ and write this as a ∝ b. a and b are then in the ratio a : b = 1 : k. On the other hand if we can write a = k/b then we say ‘a is inversely proportional to b’ and write a ∝ 1/b.

Factorial and combinatorial notation – permutations  and combinations
The factorial notation is a shorthand for a commonly-occurring expression involving positive integers. It provides some nice practice in manipulation of numbers and fractions, and gently introduces algebraic ideas. If n is some positive integer ≥1 then we write
              n! = n(n − 1)(n − 2) . . . 2 × 1
read as ‘n factorial’. For example
              5! = 5 × 4 × 3 × 2 × 1 = 120
Notice that the factorial expression yields large values very quickly, that is n! increases rapidly with n. In calculations involving factorials it is often useful to remember such results as
              10! = 10 × 9 × 8 × 7!
i.e. we can pick out a lower factorial if this is convenient, and this often helps with cancellations in expressions containing factorials like
              24! / 23! = 24 × 23! / 23! = 23


Note that 1! = 1. Also, while the above definition does not define 0!, the convention is adopted that
              0! = 1

The factorial notation is useful in the binomial theorem  and in statistics. It can be used to count the number permutations of n objects, i.e. the number of ways of arranging n objects in a given order:
              First object can be chosen in n ways
              Second object can be chosen in (n − 1) ways
              Third object can be chosen in (n − 2) ways
                     .
                     .
                     .
              Last object can only be chosen in 1 way.
So the total number of permutations of n objects is:
              n × (n − 1) × (n − 2) . . . 2 × 1 = n!
              Note that n! = n × (n − 1)! .That's called recursive form
For 3 objects A, B, C, for example, there are 3! = 6 permutations, which are:
              ABC, ACB, BAC, BCA, CAB, CBA.
Each of these is the same combination of the objects A, B, C – Combination is a selection of three objects in which order is not important.

Now suppose we select just r objects from the n. Each such selection is a different combination of r objects from n. An obvious question is how many different permutations of r objects chosen from n can be formed in this way? This number is denoted by n Pr . It may be evaluated by repeating the previous counting procedure, but only until we have chosen r objects:
              The first may be chosen in n ways
              The second may be chosen in (n − 1) ways
              The third may be chosen in (n − 2) ways
                     .
                     .
                     .
              The rth may be chosen in (n − (r − 1)) ways
   So the total number of permutations will be
                n Pr = n × (n − 1) × (n − 2) × . . . × (n − r + 1)            
                 = n(n − 1)(n − 2) . . . (n − r + 1) × [(n − r)(n − r − 1) . . . 2 × 1] / [(n − r)(n − r − 1) . . . 2 × 1]                
                 = n! / [(n − r)!]
For example the number of ways that we can permute 3 objects chosen from 5 distinct objects is
                 5 P3 =  5! / (5 − 3)! = 5×4×3×2×1 / 2×1 = 60 
Since the order does not matter in a combination, n Pr will include r! permutations of the same combinations of r different objects. So the number of combinations of r objects chosen from n is
                   1/r!   =  n! / [(n − r)!]
This is usually denoted by  n Cr or (n r) (called the ‘n − C − r’ notation) or   – ‘choose r objects from n’:
                   n Cr (5 3) = 5!/(5-3)! 3!
which is very useful in binomial expansions and other areas, simply as a notation, regardless of its ‘counting’ significance.
                                                                                                                         Powers and indices
Powers, or indices, provide, in the first instance, a shorthand notation for multiplying a number by itself a given number of times:
                                2 × 2 = 22
                         2 × 2 × 2 = 23
                  2 × 2 × 2 × 2 = 24
                  etc.
For a given number a we have
                 an = a × a × a × . . . × a        (n times)
a is called the base, n the power or index. a1 is simply a. By convention we take a0 = 1 (with a <> 0). We introduce a −1 to denote the reciprocal 1/a, since then 1 = a × 1/a = a1 × 1/a = a1 × a−1 = a1−1 = a0 follows. In general, a −n = n . From these definitions we can derive the rules of indices:
                 am × an = am+n
                      am / an = am-n
                 (am)n = amn
                 (ab)n = an bn
 Note that for any index n, 1an = 1.

A square root of a positive number a, is any number that, when squared, yields the number a. We use √a to denote the positive value of the square root (although the notation has to be stretched when we get to complex numbers). For example 
                 2= √4 since 22 = 4
Since −2 = −√4 also satisfies (−2)2 = 4, − 4 is also a square root of 4. So the square roots of 4 are ±√4 = ±2.                     

We can similarly have cube roots of a number a, which yield a when they are cubed. If a is positive then 3 a denotes the positive value of the cube root. For example            
                2= 3√8     because 23 = 8                             
In the case of taking an odd root √ a negative number the convention is to let √ denote the negative root value, as in 3 √−8 = −2, for example.                

The corresponding nth root of a number a is denoted in general by
                n√ a  (also called a radical)
  • If n is even then a must be positive to yield a real root ( √−1 is an imaginary number, forming the basis of complex numbers). In this case, because (−1)2 = 1, there will be at least two values for the root differing only by sign. 

If n is odd then the nth root 2√a exists for both positive and negative values of a, as in 3√−8 = −2 above.

If a is a prime number such as 2, then √a is an irrational number, i.e. it can’t be
expressed in rational form as a ratio of integers. This is not just a mathematical nicety. √2 for example, is the diagonal of the unit square, and yet because it is irrational, it can never be written down exactly as a rational number or fraction ( √2 = 1.4142 is, for example, only an approximation -- to four decimal places -- to √2 ).

In terms of indices, roots are represented by fractional indices, for example:
               √a = a1/2
and in general
               n√a = a1/n
This fits in with the rules of indices, since
               ( a1/n )n = a(1/n)n = a

Fractional powers satisfy the same rules of indices as integer powers – but there are some new features:
  • multiplicity of roots: 22 = (−2)22 = 4
  • non-existence of certain roots of negative numbers: √−1 is not a real number                                                    
  • irrational values for roots of primes and their multiples: √2 cannot be expressed as a fraction
Quantities such as √2, √3, . . . containing square roots of primes, are called surds. The term originates from the Greek word for mute, referring to a number that cannot ‘speak’ its value – because its decimal part never ends. In  mathematical manipulation surds are always best left as they are – retaining the root sign. Any decimal form for them will simply be an approximation as noted for √2 above. Usually we try to manipulate surds so that the result is the simplest form, and none remain in denominators (although we would normally write, for example, sin 45° = 1/√2 ). To do this we can use the rules of indices, and also a process known as rationalisation, in which surds in denominators are moved to the numerator.           

Decimal notation
You probably know that 1/2 may be represented by the decimal 0.5, 1/4 by 0.25 and so on.
In fact any real number, a, 0 ≤ a < 1, has a decimal representation, written
              a = 0.d1 d2 d3 . . .
where each di is one of the digits 0, 1, 2, . . . , 9, and the sequence may not terminate (see below). The term decimal actually refers to the base 10 and represents the fact that:
              a = d1 × 10−1 + d2 × 10−2 + d3 × 10−3. . .
Note the importance of ‘place value’ here – the value of each of the digits depends on its place in the decimal.
Any real number can be represented by an integer part and such a decimal part. If, from some point on the decimal consists of a repeating string of one or more digits, then the decimal is said to be a repeating or recurring decimal. All rational numbers can be represented by a finite decimal representation or a recurring one. Irrational numbers cannot be represented in this way as a terminating or recurring decimal – thus the decimal representation of √2 is non-terminating:
              √2 = 1.4142135623 . . .
that is, the decimal part goes on forever.

All quantities measured in scientific or engineering experiments will have a finite
decimal – every human observation of any kind is subject to a limited accuracy and so to a limited number of decimal places. Similarly any mechanical or electronic device can only yield a terminating decimal representation with a finite number of decimal places. In particular any number that you output on your calculator must represent a finite or recurring decimal – a rational number. So, for example no calculator or computer could ever yield the exact value of √2 or π. In practice even the most finicky engineer has limited need for decimal places – it can be shown that to measure the circumference of a circle girdling the known universe with an error no greater than the radius of a hydrogen atom requires the value of π to only 39 decimal places. π is actually known to many millions of decimal places. Nevertheless, irrational numbers such as √2, √3 actually ocur frequently in engineering calculations, so we have to learn to handle them. 1/√2 occurs for example in the rms value of an alternating current.

A useful way of expressing numerical value is by specifying a certain number of significant digits. To discuss these we need to be clear about zeros in numbers and what they represent. Some zeros are needed in a number simply as place holders – i.e. to tell us whether we are dealing with units, tens, hundreds, or tenths, hundredths, etc. For example in
              1500, 0.00230, 2.1030
the bold zeros are essential to hold place value – the only way to avoid them is to write the number in scientific notation (see below). The final zeros in these last 2 numbers are not strictly necessary and should only be included if they are significant – i.e. they represent a level of accuracy. For example if the number 1.24 is only accurate to the three ‘significant figures’ given then it could lie between 1.235 and 1.245. But if we write 1.240 then we are saying that there are four significant figures of accuracy and the number must lie between 1.2395 and 1.2405. The two end zeros in 1500 may or may not represent an accuracy to four
figures – we have no way of knowing without further information. Therefore unless you are given further information, such zeros are assumed to be not significant. Similarly, the two first zeros in 0.002320 are assumed to be not significant – they are just place holders.

To count the number of significant figures in a number, start from the first non-zero digit on the left and count all digits (zero or not) to the right, counting final zeros if they are to the right of the decimal point, but not otherwise. Final zeros to the left of the decimal point are assumed not significant unless more information is given.

Examples
3.214 (4 sf), 2.041 (4 sf), 12.03500 (7 sf), 420 (2 sf), 0.003 (1 sf), 0.0801 (3 sf), 2.030(4 sf), 500.00 (5 sf)
  • Sometimes numbers are approximated by terminating the digits after a given number of digits and replacing them with zeros. If this is done with no regard to the size of the removed digits, then we say the number has been ‘chopped’ or ‘truncated’. For example 324829.1 chopped to 3 significant figures is 324000. 
  • Another, more accurate, method of approximation is ‘rounding’, in which we take account of the size of the removed digits.
When we ‘round’ a number we change the last non-zero digit not removed according to the size of the digits dropped. Specifically:
  • If the digit to be removed is >5 then the immediately preceding digit is increased by 1
  • If the digit to be removed is <5 the immediately preceding digit is left unchanged
  • if the digit to be removed is equal to 5 then you may round up or down – one ‘fair’ way to do this is to round up if the previous digit is odd and down otherwise, for example.
Although ‘chopping’ may seem to give bigger errors because, for example, 324829.1 is closer to 325000 than 324000, it is usually the preferred method in computer arithmetic because it is much quicker than the more accurate ‘rounding’.

Examples
213.457 chopped/rounded to 4 sf is 213.4/213.5, 56.0011 chopped/rounded to 4 sf is
56.00/56.00

We often need to convert between fractions and decimal representations. We can go from fraction to decimal by ordinary division. Conversely, we can convert a terminating decimal to the corresponding rational number by multiplying top and bottom by an appropriate factor as in, for example
           0.625 = 625/1000 = 25/40 = 5/8
Any decimal number can be written as a decimal number between 1 and 10 (the
mantissa) multiplied by an appropriate power (the exponent) of 10. For example:
             74.932 = 7.4932 × 10
          mantissa = 7.4932
          exponent = 1
The purpose of such representation, called scientific notation, is to reduce very large and very small numbers to manageable form. For example
                    573000000000000000 = 5.73 × 1017
            0.0000000000000000000137 = 1.37 × 10−20
In engineering there is a variation on scientific notation that uses only multiples of 3 as exponents, i.e. as powers of 10. This is so that we can use the standard prefixes kilo, mega, micro, nano, etc.


Estimation
With the availability of calculators we are now used to having enormous number crunching capability at our fingertips. But there are occasions when we don’t have our hands on a calculator, or we need to get a rough order of magnitude check on a messy calculation. In such situations the engineer’s most powerful tool has always been an ability to mentally estimate quantities and perform quick ‘back of the envelope’ (we still have them, despite email!) calculations. The trick is to approximate the numbers you are dealing with so that the calculations become simple, yet some sort of rough accuracy is retained. It is a matter of judgement and practice. Absolute values of numbers are less important than theirrelative values – for example 1021 is significant in
              3 × 1021 + 40 × 234
but is relatively insignificant in
               1021/10 − 103372415

So, inspect all the numbers occurring in an expression and approximate them each to an appropriate order of magnitude, rounding as necessary, then perform the (hopefully) simplified calculation with the results.







Sets and functions


Intro

Finding relationships between quantities is of central importance in engineering. For instance, we know that given a simple circuit with a 1000 Ω
resistance then the relationship between current and voltage is given by Ohm’s law, I = V /1000. For any value of the voltage V we can give an associated value of I . This relationship means that I is a function of V . From this simple idea there are many other questions that need clarifying, some of which are:
  1. Are all values of V permitted? For instance, a very high value of the voltage could change the nature of the material in the resistor and the expression would no longer hold.
  2. Supposing the voltage V is the equivalent voltage found from considering a larger network. Then V is itself a function of other voltage values in the network (see Figure 1.1). How can we combine the functions to get the relationship between this current we are interested in and the actual voltages in the network?
  3. Supposing we know the voltage in the circuit and would like to know the associated current. Given the function that defines how current depends on the voltage can we find a function that defines how the voltage depends on the current? In the case where I = V /1000, it is clear that V = 1000I . This is called the inverse function.
Another reason exists for better understanding of the nature of functions. In later sections, we shall study differentiation and integration. This looks at the way that functions change. A good understanding of functions and how to combine them will help considerably in those sections.

The values that are permitted as inputs to a function are grouped together. A collection of objects is called a set. The idea of a set is very simple, but studying sets can help not only in understanding functions but also help to understand the properties of logic circuits.


Sets
A set is a collection of objects, called elements, in which the order is not important and an object cannot appear twice in the same set.

Example 1.1   Explicit definitions of sets, that is, where each element is listed, are:
A = {a, b, c}
B = {3, 4, 6, 7, 8, 9}
C = {Linda, Raka, Sue, Joe, Nigel, Mary}
a ∈ A means a is an element of A or a belongs to A; therefore in the above examples:
3 ∈ B
Linda ∈ C

The universal set is the set of all objects we are interested in and will depend on the problem under consideration. It is represented by E .

The empty set (or null set) is the set with no elements. It is represented by ∅ or {}.

Sets can be represented diagrammatically – generally as circular shapes. The universal set is represented as a rectangle. These are called Venn diagrams.
                           
Example 1.2
E = {a, b, c, d, e, f, g},  A = {a, b, c},  B = {d, e} This can be shown as in Figure 1.2.

We shall mainly be concerned with sets of numbers as these are more often used as inputs to functions. Some important sets of numbers are (where ‘. . .’ means continue in the same manner):
  • The set of natural numbers N = {1, 2, 3, 4, 5, . . .}
  • The set of integers Z = {. . . −3, −2, −1, 0, 1, 2, 3 . . .}
  • The set of rationals (which includes fractional numbers) Q
  • The set of reals (all the numbers necessary to represent points on a line) R
Sets can also be defined using some rule, instead of explicitly.                           

Example 1.3
Define the set A explicitly where E= N and A = {x | x < 3}.

Solution
The A = {x | x < 3} is read as A is the set of elements x, such that x is less than 3. Therefore, as the universal set is the set of natural numbers, A = {1, 2}
                             
Example 1.4 
E = days of the week and A = {x | x is after Thursday and before Sunday}.

Solution  
Then A = {Friday, Saturday}.


Subsets
We may wish to refer to only a part of some set. This is said to be a subset of the original set. A ⊆ B is read as A is a subset of B and it means that every element of A is an element of B.

Example 1.5
E =N
A = {1, 2, 3},    B = {1, 2, 3, 4, 5}
Then A ⊆ B

Note the following points:
  • All sets must be subsets of the universal set, that is, A ⊆ E and B⊆E
  • A set is a subset of itself, that is, A ⊆ A
  • If A ⊆ B and B ⊆ A, then A = B

Proper subsets
A ⊂ B is read as A is a proper subset of B and means that A is a subset of B but A is not equal to B. Hence, A ⊂ B and simultaneously B ⊂ A are impossible.

A proper subset can be shown on a Venn diagram as in Figure 1.3.



Operations on sets 
Sets can be combined in various ways using set operations. Sets and their operations form a Boolean Algebra. The most important set operations are as given in this section (particularly its application to digital design).

Complement


A(covered with a line up) or A' represents the complement of the set A. The complement of A is the set of everything in the universal set which is not in A, this is pictured in Figure 1.4.

Example 1.6
E =N
A = {x | x > 5}
then A' = {1, 2, 3, 4, 5}

Example 1.7
The universal set is the set of real numbers represented by a real number line. If A is the set of numbers less than 5, A = {x | x < 5} then A' is the set of numbers greater than or equal to 5. A' = {x | x >= 5}. These sets are shown in Figure 1.5.



Intersection
A ∩ B represents the intersection of the sets A and B. The intersection contains
those elements that are in A and also in B, this can be represented as in Figure 1.6 and examples are given in Figures 1.7–1.10. Note the following important points:
  • If A ⊆ B then A ∩ B = A. This is the situation in the example given in Figure 1.8.
  • If A and B have no elements in common then A ∩ B = ∅ and they are called disjoint. This is the situation given in the example in Figure 1.9. Two sets which are known to be disjoint can be shown  on the Venn diagram as in Figure 1.10.

Union
A ∪ B represents the union of A and B, that is, the set containing elements which are in A or B or in both A and B. On a Venn diagram, the union can be shown as in Figure 1.11 and examples are given in Figures 1.12–1.15. Note the following important points:
  • If A ⊆ B, then A ∪ B = B. This is the situation in the example given in Figure 1.13.
  • The union of any set with its complement gives the universal set, that is, A ∪ A' = E , the universal set. This is pictured in Figure 1.15.


Cardinality of a finite set
The number of elements in a set is called the cardinality of the set and is written as n(A) or |A|.

Example 1.8
n(∅) = 0,    n({2}) = 1,    n({a, b}) = 2
For finite sets, the cardinality must be a natural number (|A| ∈ N).

Example 1.9
In a survey, 100 people were students and 720 owned a video recorder; 794 people owned a video recorder or were students. How many students owned a video recorder?

Solution
  1. E = {x | x is a person included in the survey}
  2. Setting S = {x | x is a student} and 
  3. V = {x | x owns a video recorder},  
We can solve this problem using a Venn diagram as in Figure 1.16.From the diagram we get (x is the number of students who own a video recorder)
100 − x + x + 720 − x = 794  ⇔  820 − x = 794⇔ x = 26
Therefore, 26 students own a video recorder.

Relations and functions

Relations
A relation is a way of pairing up members of two sets. This is just like the idea of
family relations. For instance, a child can be paired with its mother, brothers can be paired with sisters, etc. A relation is such that it may not always be possible to find a suitable partner for each element in the first set whereas sometimes there will be more than one. For instance, if we try to pair every boy with his sister there will be some boys who have no sisters and some boys who have several. This is pictured in Figure 1.17.


Functions
Functions are relations where the pairing is always possible. Functions are like
mathematical machines. For each input value there is always exactly one output value. Calculators output function values. For instance, input 2 into a calculator, press 1/x and the calculator will display the number 0.5. The output value is called the image of the input value. The set of input values is called the domain and the set containing all the images is called the codomain.

The function y = 1/x is displayed in Figure 1.18 using arrows to link input values with output values.                 

Functions can be represented by letters. If the function of the above example is given the letter f to represent it then we can write                                 
                        f :x → 1/x
This can be read as f is the function which when input a value for x gives the output value 1/x . Another way of giving the same information is:                    
                        f (x) = 1/x   or   y=1/x
f (x) represents the image of x under the function f and is read as f of x. It does not mean the same as f times x. f (x) = 1/x means the image of x under the function f is given by 1/x but is usually read as f of x equals 1/x. Even more simply, we usually use the letter y to represent the output value, the image, and x to represent the input value. The function is therefore summed up by y = 1/x.

x is a variable because it can take any value from the set of values in the domain. y is also a variable but its value is fixed once x is known. So x is called the 

 independent variable and y is called the dependent variable. A function is a relation which expresses how the value of one quantity, the dependent variable, depends on the value of another, the independent variable (y, which may be in a completely different set of numbers respect of x).


The letters used to define a function are not important. y = 1/x is the same as z =
1/t is the same as p = 1/q provided that the same input values (for x, t, or q) are allowed in each case.                      
More examples of functions are given in arrow diagrams in Figures 1.19(a) and 1.20(a). Functions are more usually drawn using a graph, rather than by using an arrow diagram. To get the graph the codomain is moved to be at right angles to the domain and input and output values are marked by a point at the position (x, y). Graphs are given in Figures 1.19(b) and 1.20(b).

Example
Suppose x = n is a non-zero integer, then the reciprocal function is defined by:
 y = f (x) = f (n) = 1/n       n=0
and y can be a rational number of magnitude less than one. The important point about a function is that it must have a single unique value, y, for every value, x, for which the function is defined.
x is also called the argument of the function f (x). The set X of all values for which the function f is defined is called its domain. The set of all corresponding values of y = f (x), Y , is called the range of f (x).
We sometimes express a function as a mapping between the sets X, Y denoted f : X → Y . The value of a particular function for a particular value of x, say x = a, is called the image of a under f , denoted f (a).


Continuous functions and discrete functions applied to signals
Functions of particular interest to engineers are either functions of a real number or functions of an integer. The function given in Figure 1.19 is an example of a real function and the function given in Figure 1.20 is an example of a function of an integer, also called a discrete function.

Often, we are concerned with functions of time. A variable voltage source can be described by giving the voltage as it depends on time, as also can the current. Other examples are: the position of a moving robot arm, the extension or compression of car shock absorbers and the heat emission of a thermostatically controlled heating system.

A voltage or current varying with time can be used to control instrumentation or to convey information. For this reason it is called a signal. Telecommunication signals may be radio waves or voltages along a transmission line or light signals along an optical fibre.

Time, t, can be represented by a real number, usually non-negative. Time is
usually taken to be positive because it is measured from some reference instant, for example, when a circuit switch is closed. If time is used to describe relative events then it can make sense to refer to negative time. If lightning is seen 1 s before a thunderclap is heard then this can be described by saying the lightning happened at −1 s or alternatively that the thunderclap was heard at 1 s. In the two cases, the time origin has been chosen differently. If time is taken to be continuous and represented by a real variable then functions of time will be continuous or piecewise continuous. Examples of graphs of such functions are given in Figure 1.21.

  • A continuous function is one whose graph can be drawn without taking your pen off the paper. 
  • A piecewise continuous function has continuous bits with a limited number of jumps. 
In Figure 1.21, (a) and (b) are continuous functions and (c) is a piecewise continuous function. If we have a digital signal, then its values are only known at discrete moments of time. Digital signals can be obtained by using an analog to digital (A/D) convertor on an originally continuous signal. Digital signals are represented by discrete functions as in Figure 1.22(a)–(c)

A digital signal has a sampling interval, T , which is the length of time between successive values. A digital function is represented by a discrete function. For example, in Figure 1.22(a) the digital ramp can be represented by the numbers 0, 1, 2, 3, 4, 5, . . .  If the sample interval T is different from 1 then the values would be 0, T, 2T, 3T, 4T, 5T, . . . This is a discrete function also called a sequence. It can be represented by the expression f (t) = t, where t = 0, 1, 2, 3, 4, 5, 6, . . . or using the sampling interval, T , g(n) = nT , where n = 0, 1, 2, 3, 4, 5, 6, . . .

Yet another common way of representing a sequence is by using a subscript on the letter representing the image, giving
fn = n, where n = 0, 1, 2, 3, 4, 5, . . .
or, using the letter a for the image values,
an = n, where n = 0, 1, 2, 3, 4, 5, . . .
Substituting some values for n into the above gives a0 = 0, a1 = 1, a2 = 2, a3 = 3, . . .

As a sequence is a function of the natural numbers and zero (or if negative input values are allowed, the integers) there is no need to specify the input values and it is possible merely to list the output values in order. Hence the ramp function can be expressed by 0, 1, 2, 3, 4, 5, 6, . . .

Time sequences are often referred to as series. This terminology is not usual in mathematics books, however, as the description series is reserved for describing the sum of a sequence.
                
Example 1.10 
Plot the following analog signals over the values of t given (t real):
              
 (a)     x = t^3       t>= 0

           0       t <=3
 (b)      y = t −3      3<=5
           2       t >5
          
(c)       z =
1/t^2        t >0
          
Solution    In each case, choose some values of t and calculate the function values at those points. Plot the points and join them.


Example 1.11 
Plot the following discrete signals over the values of t given (t an integer):
            
(a) x =
1/( t −1)           t >2
         
        
0              t <4
(b)     y = 1/t − 0.25          4 < t < 10
         −0.15          t >=10
    
(c)
       z = 4t − 2     t >0

Solution In each case, choose successive values of t and calculate the function values at those points. Mark the points with a dot.




Undefined function values
Some functions have undefined values, that is, numbers that cannot be input into them successfully. For instance input 0 on a calculator and try getting the value of 1/x. The calculator complains (usually displaying ‘-E-’) indicating that an error has occurred. The reason that this is an error is that we are trying to find the value of 1/0 that is 1 divided by 0. So the number 0 cannot be included in the domain of the function f (x) = 1/x. This can be expressed by saying f (x) = 1/x,     where x ∈ R and x <>0 which is read as f of x equals 1/x, where x is a real number not equal to 0. Often, we assume that we are considering functions of a real variable and only need to indicate the values that are not allowed as inputs for the function. So we may write f (x) = 1/x where x <> 0. Things to look out for as values that are not allowed as function inputs are :

  1. Numbers that would lead to an attempt to divide by zero 
  2. Numbers that would lead to negative square roots
  3. Numbers that would lead to negative inputs to a logarithm.
Examples 1.12(a) and (b) require solutions to inequalities which we shall discuss in greater detail later. Here, we shall only look at simple examples and use the same rules as used for solving equations. We can find equivalent inequalities by doing the same thing to both sides, with the extra rule that, for the moment, we avoid multiplication or division by a negative number.
 

Example 1.12 
Find the values that cannot be input to the following functions, where the independent variable (x or r) is real:
(a) y = 3 √(x − 2)  + 5  (b) y = 3 log10 (2 − 4x)  (c) R =(r + 1000)/1000(r − 2)

Solution
         
(a) y = 3
(x − 2)  + 5 

Here x − 2 cannot be negative as we need to take the square root of it.
(x−2) >= 0 ⇔ x>= 2
therefore, the function is
 
y = 3 √(x − 2)  + 5             where x>= 2
 

(b) y = 3 log10 (2 − 4x)
Here 2 − 4x cannot be 0 or negative else we could not take the logarithm.
2 − 4x > 0 ⇔ 2 > 4x ⇔ 2/4 > x ⇔ x < 1/2

So the function is
y = 3 log10 (2 − 4x)     where x < 0.5
          
(c) R =
(r + 1000)/1000(r − 2)
Here 1000(r − 2) cannot be 0, else we would be trying to divide by 0. Solve the equation for the values that r cannot take 1000(r − 2) = 0

r −2=0 r=2
The function is

R= (r + 1000)/1000(r − 2)    where r <> 2

Example 1.13 

Find the values that can be input to the following discrete functions where the independent variable is an integer:
(a)   y=1/(k−4)   where k ∈ Z           

(b)   f (k) =1/[(k − 3)(k − 2.2)]    where k ∈ Z               
(c)   an = n^2    where n ∈ Z   


Solution
            

(a)   y=1/(k−4)
Here k − 4 cannot be 0 else there would be an attempt to divide by 0. We get k − 4 = 0 when k = 4 so the function is:

y=1/(k−4)     where k <> 4 and k ∈ Z
                                 


(b)  f (k) =1/[(k − 3)(k − 2.2)]       where k ∈ Z
Solve for (k − 3)(k − 2.2) = 0 giving k = 3 or k = 2.2. As 2.2 is not an integer then there is not need to specifically exclude it from the function input values, so the function is 
f (k) =1/[(k − 3)(k − 2.2)]    where k <> 3 and k ∈ Z
            

(c)   an = n^2 ,   n∈Z
Here there are no problems with the function as any integer can be squared. There are no excluded values from the input of the function. 


Using a recurrence relation to define a discrete function 
Values in a discrete function can also be described in terms of its values for preceeding integers.





Example 1.14 
Find a table of values for the function defined by the recurrence relation:
f (n) = f (n − 1) + 2           where f (0) = 0                                    (1.1)
Solution 

Assuming that the function is defined for n = 0, 1, 2, . . . then we can take successive values of n and find the values taken by the function. n = 0 gives f (0) = 0 as given.
   

Substituting n = 1 into Equation (1.1) gives
f (1) = f (1 − 1) + 2  ⇔  f (1) = f (0) + 2 = 0 + 2 = 2 (using f (0) = 0)
hence, f (1) = 2.
 


Substituting n = 2 into Equation (1.1) gives
f (2) = f (2 − 1) + 2  ⇔  f (2) = f (1) + 2 = 2 + 2 = 4 (using f (1) = 2)

hence, f (2) = 4.
   


Substituting n = 3 into Equation (1.1) gives
f (3) = f (3 − 1) + 2  ⇔  f (3) = f (2) + 2 = 4 + 2 (using f (2) = 4)
hence, f (3) = 6.
   


Continuing in the same manner gives the following table:

       n 0 1 2 3 4   5   6   7   8   9 10 · · · · n · · ·
       f  0 2 4 6 8 10 12 14 16 18 20 . . . 2n · · ·
Notice we have filled in the general term f (n) = 2n. This was found in this case by simple guess work.


Combining functions



The sum, difference, product, and quotient of two functions, f and g
Two functions with R as their domain and codomain can be combined using arithmetic operations. We can define the sum of f and g by
(f + g) : x → f (x) + g(x)
The other operations are defined as follows:
(f − g) : x → f (x) − g(x)      difference,
(f × g) : x → f (x) × g(x)      product,
(f / g) : x → f (x) / g(x)         quotient.



Example 1.15 
Find the sum, difference, product, and quotient of the  functions:
f : x → x^2 and g : x → x^6

Solution                          
                           (f + g) : x → x^2 + x^6
                           (f − g) : x → x^2 − x^6
                           (f × g) : x → x^2 × x^6 = x^8
                           (f  /  g) : x → x^2 / x^6 = x^−4              

The specification of the domain of the quotient is not straightforward. This is because of the difficulty which occurs when g(x) = 0. When g(x) = 0 the quotient function is undefined and we must remove such elements from its domain. The domain of f /g is R with the values where g(x) = 0 omitted.


Composition of functions
This method of combining functions is fundamentally different from the arithmetical combinations of the previous section. The composition of two functions is the action of performing one function followed by the other, that is, a function of a function.

Example 1.16
A post office worker has a scale expressed in kilograms which gives the cost of a parcel depending on its weight. He also has an approximate formula for conversion from pounds (lbs) to kilograms. He wishes to find out the cost of a parcel which weighs 3 lb. The two functions involved are:
a : kilograms → money and c : lbs → kilograms
a is defined by Figure 1.25 and the function c is given by
c : x → x/2.2
Solution
The composition ‘a ◦ c’ will be a function from lbs to money. Hence, 3 lb after the function c gives 1.364 and 1.364 after the function a gives € 1.90 and therefore
(a ◦ c)(3) = €1.90.

Example 1.17
Supposing f (x) = 2x + 1 and g(x) = x^2 , then we can combine the functions in two ways.
  1.  A composite function can be formed by performing f first and then g, that is, g ◦ f . To describe this function, we want to find what happens to x under the function g ◦ f . Another way of saying that is we need to find g(f (x)). To do this call f (x) a new letter, say y.
































    y = f (x) = 2x + 1
    Rewrite g as a function of y
































    g(y) = y^2
    Now substitute y = 2x + 1 giving
































    g(2x + 1) = (2x + 1)^2
    Hence,
































    g(f (x)) = (2x + 1)^2  => (g ◦ f )(x) = (2x + 1)^2 .
  2. A composite function can be formed by performing g first and then f , that is, f ◦ g. To describe this function, we want to find what happens to x under the function f ◦ g. Another way of saying that is we need to find f (g(x)). To do this call g(x) a new letter, say y.
























































































    y = g(x) = x^2
    Rewrite f as a function of y
























































































    f (y) = 2y + 1
    Now substitute y = x^2 giving
























































































    f (x^2 ) = 2x^2 + 1
    Hence,
























































































    f (g(x)) = 2x^2 + 1
    (f ◦ g)(x) = 2x^2 + 1.

























































Example 1.18
Supposing u(t) = 1/(t − 2) and v(t) = 3 − t then, again, we can combine the functions in two ways.
  1.       A composite function can be formed by performing u first and then
    v, that is, v ◦ u. To describe this function, we want to find what happens
    to t under the function v ◦ u. Another way of saying that is we need to
    find v(u(t)). To do this call u(t) a new letter, say y.               
























































































    y = u(t) = 1/(t −2)             
    Rewrite v as a function of y
























































































    v(y) = 3 − y                     
    Now substitute y = 1/(t − 2) giving
























































































    v( ( 1 / (t −2) ) = 3− ( ( 1 / (t −2) ) = [3(t − 2) − 1] / (t −2) =
    (rewriting the expression over a common denominator)                        
























































































    = (3t − 6 − 1) / ( t −2)  = (3t − 7) / ( t −2)            
     Hence,
























































































    v(u(t)) = (3t − 7) / ( t −2)   or    (v ◦ u)(t) = (3t − 7) / ( t −2)
     























































  2. A composite function can be formed by performing v first and then u, that is u ◦ v. To describe this function, we want to find what happens to t under the function u ◦ v. Another way of saying that is we need to find u(v(t)). To find this call v(t) a new letter, say y.
























































































    y = v(t) = 3 − t
    Rewrite u as a function of y                                
























































































    u(y) = 1/ (y−2)
    Now substitute y = 3 − t giving
                                                       
























































































    v(3 − t) = 1 / [(3 − t) − 2 ]  =  1 / (1−t)            
    Hence,                                   
























































































    u(v(t)) = 1 / (1−t)  or    (u ◦ v)(t) = 1 / (1−t)
                         
























































Decomposing functions
In order to calculate the value of a function, either by hand or using a calculator, we need to understand how it decomposes. That is we need to understand to order of the operations in the function expression

Example 1.19
Calculate y = (2x + 1)^3 when x = 2
                              
Solution
The operations are performed in the following order:
Start with x = 2 then (2x + 1)^3 = 125. So, there are three operations involved
  1. multiply by 2,
  2. add on 1, 
  3. take the cube.
This way of breaking down functions can be pictured using boxes to represent each operation that makes up the function. The whole function can be thought of as a machine, represented by a box. For each value x, from the domain of the function that enters the machine, there is a resulting image, y, which comes out of it. This is pictured in Figure 1.26. Inside of the box, we can write the name of
the functions or the expression which gives the function rule. A composite function box can be broken into different stages, each represented by its own box.

The function y = (2x + 1)^3 breaks down as in Figure 1.27. y = (3x − 4)4 can be
broken down as in Figure 1.28.


The inverse of a function
The inverse of a function is a function which will take the image under the function back to its original value. If f^−1 (x) is the inverse of f (x) then
f ^−1 (f (x)) = x
(f^−1 ◦ f ) : x → x

Example 1.20                               
 f (x) = 2x + 1
 f^−1 (x) = (x−1)/ 2                                           
To show this is true, look at the combined function f^−1 (f (x)) = (2x + 1 − 1)/2 = x.


Finding the inverse of a linear function
One simple way of finding the inverse of a linear function is to:
  1. Decompose the operations of the function.
  2. Combine the inverse operations (performed in the reverse order) to give the inverse function.
This is a method similar to that used to solve linear equations

Example 1.21
Find the inverse of the function f (x) = 5x − 2. The method of solution is given in Figure 1.29.

The inverse operations give that x = (y + 2)/5. Here y is the input value into the inverse function and x is the output value. To use x and y in the more usual way, where x is the input and y the output, swap the letters giving the inverse function as  y=(x+2) / 5

This result can be achieved more quickly by rearranging the expression so that x is the subject of the formula and then swap x and y.

Example 1.22 
Find the inverse of f (x) = 5x − 2.
                               
y = 5x − 2  ⇔  y + 2 = 5x  ⇔ (y+2) / 5 =x ⇔ x= (y+2) / 5
                                                     
Now swap x and y to give y = (x + 2)/5. Therefore, f^−1 (x) = (x + 2)/5.
                                                          

Example 1.23 
Find the inverse of  g(x) = 1 / (2−x)   where x = 2
          
Set  y= 1 / (2−x)  ⇔  y(2 − x) = 1  ⇔  2y − xy = 1  ⇔  2y = 1 + xy  ⇔  2y − 1 = xy  ⇔  x= (2y − 1) / y    where y <> 0  ⇔  x =2− 1/y

Swap x and y to give y = 2 − (1/x)
  
             
So g^−1 (x) = 2 − 1/x      where x <> 0
            
To check, try a couple of values of x. Try x = 4,

             
g(x) =1 / (2−x) =  1 / (2−4) = − 1 / 2
          

Perform g^−1 on the output value −(1/2). Substitute g(4) = −(1/2) into g^−1 (x):

g^−1(− 1/2) =2−(-2) = 2 + 2 = 4.

The function followed by its inverse has given us the original value of x.


The range of a function
When combining functions, for example, f (g(x)), we have to ensure that g(x) will only output values that are allowed to be input to f . The set of images of g(x) becomes an important consideration. The set of images of a function is called its range. The range of a function is a subset of its codomain.
                                                 

Summary
  1. Functions are used to express relationships between physical quantities.
  2. The allowed inputs to a function are grouped into a set, called the domain of the function. The set including all the outputs is called the codomain.
  3. A set is a collection of objects called elements.
  4. E is the universal set, the set of all objects we are interested in.
  5. ∅ is the empty set, the set with no elements.
  6. The three most important operations on sets are:
      (a) intersection: A ∩ B is the set containing every element in both  A and B;
      (b) union: A ∪ B is the set of elements in A or in B or both;
      (c) complement: A is the set of everything, in the universal set, not in A.
  7. A relation is a way of pairing members of two sets.
  8. Functions are a special type of relation which can be thought of as mathematical machines. For each input value there is exactly one output value.
  9. Many functions of interest are functions of time, used to represent signals. Analogue signals can be represented by functions of a real variable and digital signals by functions of an integer (discrete functions). Functions of an integer are also called sequences and can be defined using a recurrence relation. 
  10. To find the domain of a real or discrete function exclude values that could lead to a division by zero, negative square roots, or negative logarithms or other undefined values.
  11. Functions can be combined in various ways including sum, difference, product, and quotient. A special operation of functions is composition. A composite function is found by performing a second function on the result of the first.
  12. The inverse of a function is a function which will take the image under the function back to its original value.

Functions and their graphs

Intro                                        
The ability to produce a picture of a problem is an important step towards solving it. From the graph of a function, y = f (x), we are able to predict such things as
  • the number of solutions to the equation f (x) = 0, 
  • regions over which it is increasing or decreasing, and 
  • the points where it is not defined.
Recognizing the shape of functions is an important and useful skill. Oscilloscopes give a graphical representation of voltage against time, from which we may be able to predict an expression for the voltage. The increasing use of signal processing means that many problems involve analysing how functions of time are effected by passing through some mechanical or electrical system. In order to draw graphs of a large number of functions, we need only remember a few key graphs and appreciate simple ideas about transformations. A sketch of a graph is one which is not necessarily drawn strictly to scale but shows its important features. We shall start by looking at special properties of the straight line (linear function) and the quadratic. Then we look at the graphs of y = x, y = x^2 , y = 1/x, y = a^x and how to transform these graphs to get graphs of functions like y = 4x − 2, y = (x − 2)2 , y = 3/x, and y = a −x .
                                                   

The straight line y = mx + c 
y = mx + c is called a linear function because its graph is a straight line. Notice that there are only two terms in the function; the x term, mx, where m is called the coefficient of x and c which is the constant term. m and c have special significance. m is the gradient, or the slope, of the line and c is the value of y when x = 0, that is, when the graph crosses the y-axis. This graph is shown in Figure 2.1(a) and two particular examples shown in Figure 2.1(b) and (c).



The gradient of a straight line
The gradient gives an idea of how steep the climb is as we travel along the line of the graph.
  • If the gradient is positive then we are travelling uphill as we move from left to right and 
  • if the gradient is negative then we are travelling downhill. 
  • If the gradient is zero then we are on flat ground.
The gradient gives the amount that y increases when x increases by 1 unit. A straight line always has the same slope at whatever point it is measured. To show that in the expression y = mx + c, m is the gradient, we begin with a couple of examples as in Figure 2.1(b) and (c)

In Figure 2.1(b), we have the graph of y = 2x + 3. Take any two values of x which differ by 1 unit, for example, x = 0 and x = 1. When x = 0, y = 2 × 0 + 3 = 3 and when x = 1, y = 2 × 1 + 3 = 5. The increase in y is 5 − 3 = 2, and this is the same as the coefficient of x in the function expression.

In Figure 2.1(c), we see the graph of y = −x + 2. Take any two values of x which differ by 1 unit, for example, x = 1 and x = 2. When x = 1, y = −(1) + 2 = 1 and when x = 2, y = −(2) + 2 = 0. The increase in y is 0 − 1 = −1 and this is the same as the coefficient of x in the function expression.

In the general case, y = mx + c, take any two values of x which differ by 1 unit, for example, x = x0 and x = x0 +1. When x = x0 , y = mx0 +c and when x = x0 + 1, y = m(x + 1) + c = mx + m + c. The increase in y is mx + m + c − (mx + c) = m. We know that every time x increases by 1 unit y increases by m. However, we do not need to always consider an increase of exactly 1 unit in x. The gradient gives the ratio of the increase in y to the increase in x. 

Therefore, if we only have a graph and we need to find the gradient then we can use any two points that lie on the line. To find the gradient of the line take any two points on the line (x1 , y1 ) and (x2 , y2 ).
                      
The gradient = (change in y)/(change in x)  = (y2 − y1) / (x2 − x1)
                    
Example 2.1
Find the gradient of the lines given in Figure 2.2(a)–(c) and the equation for the line in each case.

Solution
(a)   We are given the coordinates of two points that lie on the straight line in Figure 2.2(a) as (0,3) and (2,5),                       
gradient = (change in y)/(change in x)  = (5−3)/(2−0) = 2/2 = 1.
To find the constant term in the expression y = mx + c, we find the value of y when the line crosses the y-axis. From the graph this is 3, so the equation is y = mx + c where m = 1 and c = 3, giving  y =x+3
     
(b)  Two points that lie on the line in Figure 2.2(b) are (−1, −3) and (−2, −6). These are found by measuring the x and y values for some points on the line.
 gradient = (change in y)/(change in x) = (−6 − (−3))/(−2 − (−1) ) = −3/−1= 3.
To find the constant term in the expression y = mx + c, we find the value of y when the line crosses the y-axis. From the graph this is 0, so the equation is y = mx + c where m = 3 and c = 0 giving y = 3x

(c)  Two points that lie on the line in Figure 2.2(c) are (0,2) and (3,3.5).              
gradient = (change in y)/(change in x) = (3.5 − 2)/(3−0) = 1.5/ 3 = 0.5
To find the constant term in the expression y = mx + c, we find the value of y when the line crosses the y-axis. From the graph this is 2, so the equation is y = mx + c where m = 0.5 and c = 2 giving  y = 0.5x + 2


Finding the gradient from the equation for the line
To find the gradient from the equation of the line we look for the value of m, the number multiplying x in the equation. The constant term gives the value of y when the graph crosses the y-axis, that is, when x = 0.

Example 2.2
Find the gradient and the value of y when x = 0 for the following lines:
(a) y = 2x + 3, (b) 3x − 4y = 2, (c) x − 2y = 4, (d)  (x−1)/2 =1− y/3
Solution
(a) In the equation y = 2x + 3, the value of m, the gradient, is 2 as this is the coefficient of x. c = 3 which is the value of y when the graph crosses the y-axis, that is, when x = 0.
(b) In the equation 3x − 4y = 2, we rewrite the equation with y as the subject of the formula in order to find the value of m and c.
3x − 4y = 2  ⇔  3x = 2 + 4y  ⇔  3x − 2 = 4y  ⇔  3x/4 - 2/4 = y  ⇔  y=3x/4 -1/4
We can see, by comparing the expression with y = mx + c, that m, the gradient, is 3/4 and c = −1/2.
(c) Write y as the subject of the formula:
      x − 2y = 4      ⇔     x = 4 + 2y
                      ⇔     x − 4 = 2y
                      ⇔     2y = x − 4
                                  x
                      ⇔     y = −2
                                  2
      We can see, by comparing the expression with y = mx + c, that m,
      the gradient, is 1/2 and c = −2.
(d) Write y as the subject of the formula
(x−1)/2 =  1− y/3  ⇔  x/2 -1/2 = 1− y/3  ⇔   3x/2 - 3/2 = 3 - y  ⇔  y =3− (3x/2 - 3/2)
We can see, by comparing the expression with y = mx + c, that m, the gradient, is −3/2 and c = 9/2.


Finding the equation of a line which goes through two points
Supposing we have been given two points, (x1 , y1 ) and (x2 , y2 ), which lie on a line and we want to find the equation of that line. We already found that the gradient of the line is given by:
The gradient = (change in y) / (change in x ) = ( y2 − y1) / (x2 − x 1)
We know that the equation of a line is of the form y = mx + c, but we would like to express the equation just in terms of the two variables, x

Example 2.4
Sketch the graph of y = 4x − 2.

(a) To find where the graph crosses the y-axis, substitute x = 0 into the equation of the line:
    y = 4(0) − 2 = −2.
This means that the graph passes through the point (0,−2). To find where the graph crosses the x-axis, substitute y = 0, that is,
4x − 2 = 0  ⇔  4x = 2  ⇔  x= 2/4 = 0.5.
Therefore, the graph passes through (0.5, 0). Mark the points (0,2) and (0.5,0), on the x- and y-axes and join the two points. This is done in Figure 2.3(a).

(b) Sketch the graph of y = −4x When x = 0 we get y = 0, that is the graph goes through the point (0,0). In this case, as the graph passes through the origin, we need to choose a different value for x for the second point. Taking x = 2 gives y = −8, so another point is (2, −8). These points on marked on the graph and joined to give the graph as in Figure 2.3(b).


The quadratic function: y = ax^2 + bx + c 
y = ax 2 + bx + c is a general way of writing a function in which the highest power of x is a squared term. This is called the quadratic function and its graph is called a parabola as shown in Figure 2.4. All the graphs, in this figure, cross the y-axis at (0, c). To find where they cross the x-axis can be more difficult. These values, where f (x) = 0, are called the roots of the equation. There is a quick way to discover whether the function crosses the x-axis, only touches the x-axis, or does not cross or touch it. In the latter case there are no solutions to the equation f (x) = 0. The three possibilities are given in Figure 2.4.

Crossing the x -axis
The function y = ax 2 + bx + c crosses the x-axis when y = 0, that is, when ax^2+bx +c = 0. The solutions to ax^2 +bx +c = 0 are given by the formula
 x=(−b ± √(b2 − 4ac)) / 2a
From the graph, we can see there are three possibilities:
  1. In Figure 2.4(a) where there are two solutions, that is, the graph crosses the x-axis for two values of x. For this to happen, the square root part of the formula above must be greater than zero: b2 − 4ac > 0 Examples are given in Figure 2.5.
  2. Only one unique solution, as in Figure 2.4(b). The graph touches the x-axis in one place only. For this to happen, the square root part of the formula must be exactly 0. Examples of this are given in Figure 2.6.
  3. No real solutions, that is, the graph does not cross the x-axis. Examples of these are given in Figure 2.7.



The function y = 1/x (x <> 0)
The function y = 1/x has the graph as in Figure 2.8. This is called a hyperbola. Notice that the domain of f (x) = 1/x does not include  x=0. The graph does not cross the x-axis so there are no solutions to 1/x = 0.





The functions y = a^x
Graphs of exponential functions, y = a^x , are shown in Figure 2.9. The functions have the same shape for all a > 1. Notice that the function is always positive and the graph does not cross the x-axis so there are no solutions to the equation a^x = 0.






Graph  sketching using simple 
transformations 
One way of sketching graphs is to remember the graphs of simple functions and to translate, reflect or scale those graphs to get graphs of other functions. We begin with the graphs below as given in Figure 2.10.


The translation x → x + a
If we have the graph of y = f (x), then the graph of y = f (x + a) is found by translating the graph of y = f (x) a units to the left. Examples  are given in Figure 2.11.


The translation f (x ) → (x ) + A
Adding A on to the function value leads to a translation of A units upwards.
Examples are given in Figure 2.12. Reflection about the y -axis, x → −x Replacing x by −x in the function has the effect of reflecting the graph in the y-axis – that is, as though a mirror has been placed along the axis and only the reflection can be seen. Examples are given in Figure 2.13.


Reflection about the x axis, f (x ) → −f (x )
To find the graph of y = −f (x), reflect the graph of y = f (x) about the
x-axis. Examples are given in Figure 2.14.


Scaling along the x -axis, x → ax
Multiplying the values of x by a number, a, has the effect of: squashing the graph horizontally if a > 1 or stretching the graph horizontally if
0 < a < 1. Examples are given in Figure 2.15.


Scaling along the y -axis, f (x ) → Af (x )
Multiplying the function value by a number A has the effect of stretching the graph vertically if A > 1, or squashing the graph vertically if 0 < 1. Examples are given in Figure 2.16. 


Reflecting in the line y = x 
If the graph of a function y = f (x) is reflected in the line y = x, then it will give the graph of the inverse relation. Examples are given in  Figure 2.17. We just defined the inverse function as taking any image back to its original value. Check this with the graph of y = 2x in Figure 2.17(a): x = 1 gives y = 2. In the inverse function, y = log2 (x), substitute 2, which gives the result of 1, which is back to the original value.                                 

However, the inverse of y = x^2 , y ± √x, shown in Figure 2.17(b), is not a function as there is more than one y value for a single value of x. To understand this problem more fully, perform the following experiment. On a calculator enter −2 and square it (x 2 ) giving 4. Now take the square root. This gives the answer 2, which is not the number we first started with, and hence we can see that the square root is not a true inverse of squaring. However, we get away with calling it the inverse because it works if only positive values of x are considered. To test if the inverse of any function exists, draw a line along any value of y = constant. If, wherever the line is drawn, there is ever more than one x value which gives the same value of y then the function has no inverse function. In this situation, the function is called a ‘many-to-one’ function. Only ‘one-to-one’ functions have inverses. Figure 2.18 has examples of functions with an explanation of whether they are ‘one-to-one’ or ‘many-to-one’.

Resources

Mathematics for Electrical Engineering and Computing
by Mary Attenborough  2003
ISBN 0 7506 5855 X
Understanding Engineering Mathematics
by Bill Cox 2001

ISBN 0 7506 5098 2
CAS :  [wxMaxima([Maxima)] (math-blog)  + tutorial  + other tuts  (press SHIFT-ENTER to evaluate an expression, or CTRL-R to evaluate all cells --at once-- of a wxmaxima document)