# Table of contents

* Introduction
* Number theory
* Functions
* Units and dimensions
* Statistics
* Plotting graphs
* Complex numbers
* Trigonometry
* Vectors
* Matrices and determinants
* Differentiation
* Integration
* Some useful aspects of calculus
* Enzyme kinetics
* Some mathematical examples applied to chemistry
* Tests and exams
* Further reading

# Introduction

* This book was initially derived from a set of notes used in a university chemistry course. It is hoped it will evolve into something useful and develop a set of open access problems as well as pedagogical material.
For many universities the days when admission to a Chemistry, Chemical Engineering, Materials Science or even Physics course could require the equivalent of A-levels in Chemistry, Physics and Mathematics are probably over for ever. The broadening out of school curricula has had several effects, including student entry with a more diverse educational background and has also resulted in the subject areas Chemistry, Physics and Mathematics becoming disjoint so that there is no co-requisite material between them. This means that, for instance, physics cannot have any advanced, or even any very significant mathematics in it. This is to allow the subject to be studied without any of the maths which might be first studied by the A-level maths group at the ages of 17 and 18. Thus physics at school has become considerably more descriptive and visual than it was 20 years ago. The same applies to a lesser extent to chemistry.
This means there must be an essentially remedial component of university chemistry to teach just the Mathematics and Physics which is needed and not too much, if any more, as it is time consuming and perhaps not what the student of Chemistry is most focused on. There is therefore also a need for a book Physics for Chemistry.

## Quantitative methods in chemistry

There are several reasons why numerical (quantitative) methods are useful in chemistry:
* Chemists need numerical information concerning reactions, such as how much of a substance is consumed, how long does this take, how likely is the reaction to take place.
* Chemists work with a variety of different units, with wildly different ranges, which one must be able to use and convert with ease.
* Measurements taken during experiments are not perfect, so evaluation and combination of errors is required.
* Predictions are often desired, and relationships represented as equations are manipulated and evaluated in order to obtain information.

# Numbers

* Numbers
    For more details on this topic, see Number Theory.
Real numbers come in several varieties and forms;
* Natural numbers are integers that are greater than or equal to zero.
* Integers are whole numbers used for counting indivisible objects, together with negative equivalents and zero, e.g. 42, -7, 0
* Rational numbers can always be expressed as fractions, e.g. 4.673 = 4673/1000.
* Irrational numbers, unlike rational numbers, cannot be expressed as a fraction or as a definite decimal, e.g. $\pi$ and ${\sqrt {2}}$
It is also worth noting that the imaginary unit and therefore complex numbers are used in chemistry, especially when dealing with equations concerning waves.

### Surds

The origin of surds goes back to the Greek philosophers. It is relatively simple to prove that the square root of 2 cannot be a ratio of two integers, no matter how large the integers may become. In a rather Pythonesque incident the inventor of this proof was put to death for heresy by the other philosophers because they could not believe such a pure number as the root of 2 could have this impure property.
(The original use of quadratic equations is very old, Babylon many centuries BC.) This was to allocate land to farmers in the same quantity as traditionally held after the great floods on the Tigris and Euphrates had reshaped the fields. The mathematical technology became used for the same purpose in the Nile delta.
When you do trigonometry later you will see that surds are in the trigonometric functions of the important symmetrical angles, e.g. $\sin 60^{\circ }={\frac {\sqrt {3}}{2}}$ and so they appear frequently in mathematical expressions regarding 3 dimensional space.

### Notation

The notation used for recording numbers in chemistry is the same as for other scientific disciplines, and appropriately called scientific notation, or standard form. It is a way of writing both very large and very small numbers in a shortened form compared to decimal notation. An example of a number written in scientific notation is
$4.65\times 10^{6}$
with $.65$ being a coefficient termed the significand or the mantissa, and $6$ being an integer exponent. When written in decimal notation, the number becomes
$4650000$.
Numbers written in scientific notation are usually normalised, such that only one digit precedes the decimal point. This is to make order of magnitude comparisons easier, by simply comparing the exponents of two numbers written in scientific notation, but also to minimise transcription errors, as the decimal point has an assumed position after the first digit. In computing and on calculators, it is common for the $\times 10$ ("times ten to the power of") to be replaced with "E" (capital e). It is important not to confuse this "E" with the mathematical constant e.
Engineering notation is a special restriction of scientific notation where the exponent must be divisible by three. Therefore, engineering notation is not normalised, but can easily use SI prefixes for magnitude.
Remember that in SI, numbers do not have commas between the thousands, instead there are spaces, e.g. $18~617~132$, (an integer) or $1.861~713~2{\rm {x}}10^{7}$. Commas are used as decimal points in many countries.

### Exponents

Consider a number $x^{n}$, where $x$ is the base and $n$ is the exponent. This is generally read as “$x$ to the $n$” or “$x$ to the power of $n$”. If $n=2$ then it is common to say “$x$ squared”, and if $n=3$ then “$x$ cubed”. Comparing powers (exponentiation) to multiplication for positive integer values of n $(n=1,2,3\dots )$, it can be demonstrated that
$4x=x+x+x+x$, i.e. four lots of $x$ added together
$x^{4}=x\times x\times x\times x$, i.e. $x$ multiplied by itself four times.
For $x^{1}$, the result is simply $x$. For $x^{0}$ the result is $1$.
$x^{n}$ can be reduced to multiplication like this if $n$ is an integer: $x^{n}=\underbrace {x\times \cdots \times x} _{n}.$

### Order of operations

When an expression contains different operations, they must be evaluated in a certain order. Exponents are evaluated first. Then, multiplication and division are evaluated from left to right. Last, addition and subtraction are evaluated left to right. Parentheses or brackets take precedence over all operations. Anything within parentheses must be calculated first. A common acronym used to remember the order of operations is PEMDAS, for "Parentheses, Exponents, Multiplication, Division, Addition, Subtraction". Another way to remember this acronym is "Please Excuse My Dear Aunt Sally".
Keep in mind that negation is usually considered multiplication. So in the case of $-x^{2}$, the exponent would be evaluated first, then negated, resulting in a negative number.
Take note of this example:
$3+x\times 2,{\text{ let }}x=5.$
If evaluated incorrectly (left-to-right, with no order of operations), the result would be 16. Three plus five gives eight, times two is 16. The correct answer should be 13. Five times two gives ten, plus three gives 13. This is because multiplication is solved before addition.

## Partial fractions

Partial fractions are used in a few derivations in thermodynamics and they are good for practicing algebra and factorisation.
It is possible to express quotients in more than one way. Of practical use is that they can be collected into one term or generated as several terms by the method of partial fractions. Integration of a complex single term quotient is often difficult, whereas by splitting it up into a sum, a sum of standard integrals is obtained. This is the principal chemical application of partial fractions.
An example is
${\frac {x-2}{(x+1)(x-1)}}={\frac {A(x-1)+B(x+1)}{(x+1)(x-1)}}={\frac {A}{(x+1)}}+{\frac {B}{(x-1)}}$
In the above $x-2$ must equal $A(x-1)+B(x+1)$ since the denominators are equal. So we set $x$ first to +1 giving $-1=2B$. Therefore B = -1/2. If we set $x=-1$ instead $-3=-2A$, therefore $A=3/2$. So
${\frac {x-2}{(x+1)(x-1)}}={\frac {3}{2(x+1)}}-{\frac {1}{2(x-1)}}$
We can reverse this process by use of a common denominator.
${\frac {3}{2(x+1)}}-{\frac {1}{2(x-1)}}={\frac {3(x-1)-(x+1)}{2(x+1)(x-1)}}$
The numerator is $2x-4$, so it becomes
${\frac {(x-2)}{(x+1)(x-1)}}$
which is what we started from.
So we can generate a single term by multiplying by the denominators to create a common denominator and then add up the numerator to simplify. A typical application might be to convert a term to partial fractions, do some calculus on the terms, and then regather into one quotient for display purposes. In a factorised single quotient it will be easier to see where numerators go to zero, giving solutions to $f(x)=0$, and where denominators go to zero giving infinities.
A typical example of a meaningful infinity in chemistry might be an expression such as
${\frac {A}{{(E-E_{a})}^{2}}}$
The variable is the energy E, so this function is small everywhere, except near $E_{a}$. Near $E_{a}$ a resonance occurs and the expression becomes infinite when the two energies are precisely the same. A molecule which can be electronically excited by light has several of these resonances.
Here is another example. If we had to integrate the following expression we would first convert to partial fractions:
${\frac {3x}{2x^{2}-2x-4}}={\frac {3x}{2(x+1)(x-2)}}={\frac {A}{x+1}}+{\frac {B}{x-2}}$
so
${\frac {3}{2}}x=A(x-2)+B(x-1)$
let $x=2$ then $3=B$
let $x=1$ then ${\frac {3}{2}}=-A$
therefore the expression becomes
${\frac {3}{x-2}}-{\frac {3}{2(x+1)}}$
Later you will learn that these expressions integrate to give simple expressions in terms of the natural logarithm.

### Problems

${\rm {(1)~~~~~~}}{\frac {3}{x^{2}-1}}{~~~~~~~~~~~~{\rm {(2)~~~~~~}}}{\frac {4x-2}{x^{2}+2x}}$
${\rm {(3)~~~~~~}}{\frac {4}{(2x+1)(x-3)}}{~~~~~~~~~~~~{\rm {(4)~~~~~~}}}{\frac {7x+6}{x^{2}+3x+2}}$
${~~~~~~{\rm {(5)~~~~~~}}}{\frac {x+1}{2x^{2}-6x+4}}$

### Answers

${~~~~~~{\rm {(1)~~~~~~}}}{\frac {3}{2(x-1)}}-{\frac {3}{2(x+1)}}{~~~~~~~~~~~~{\rm {(2)~~~~~~}}}{\frac {5}{(x+2)}}-{\frac {1}{x}}$
${~{\rm {(3)~~~~~~}}}{\frac {4}{7(x-3)}}-{\frac {8}{7(2x+1)}}{~~~~~~~~~~~~{\rm {(4)~~~~~~}}}{\frac {8}{x+2}}-{\frac {1}{x+1}}$
${~~{\rm {(5)~~~~~~}}}{\frac {3}{2(x-2)}}-{\frac {2}{2(x-1)}}$

## Polynomial division

This is related to partial fractions in that its principal use is to facilitate integration.
Divide out
${\frac {3x^{2}-4x-6}{1+x}}$
like this
So our equation becomes $3x-7+{\frac {1}{1+x}}$
This can be easily differentiated, and integrated. If this is differentiated with the quotient formula it is considerably harder to reduce to the same form. The same procedure can be applied to partial fractions.

## Substitutions and expansions

You can see the value of changing the variable by simplifying
${\frac {{\left({\frac {J(J+1)}{\epsilon }}\right)}^{3}+2{\left({\frac {J(J+1)}{\epsilon }}\right)}+1}{{\left({\frac {J(J+1)}{\epsilon }}\right)}^{2}-9}}-{\frac {{\left({\frac {J(J+1)}{\epsilon }}\right)}^{2}-2{\left({\frac {J(J+1)}{\epsilon }}\right)}+1}{{\left({\frac {J(J+1)}{\epsilon }}\right)}^{2}+9}}$
to
${\frac {x^{3}+2x+1}{x^{2}-9}}-{\frac {x^{2}-2x+1}{x^{2}+9}}$
where
$x={\frac {J(J+1)}{\epsilon }}$
This is an example of simplification. It would actually be possible to differentiate this with respect to either $J$ or $\epsilon$ using only the techniques you have been shown. The algebraic manipulation involves differentiation of a quotient and the chain rule.
Evaluating ${\frac {{\rm {d}}y}{{\rm {d}}x}}$ gives
${\frac {3x^{2}+2}{x^{2}-9}}-2{\frac {(x^{3}+2x+1)x}{(x^{2}-9)^{2}}}-{\frac {2x-2}{x^{2}+9}}+2{\frac {(x^{2}-2x+1)x}{(x^{2}+9)^{2}}}$
Expanding this out to the $J$s and $\epsilon$s would look ridiculous.
Substitutions like this are continually made for the purpose of having new, simpler expressions, to which the rules of calculus or identities are applied.

# Functions

* A reader has identified this chapter as an undeveloped draft or outline. You can help to develop the work, or you can ask for assistance in the project room.

## Functions as tools in chemistry
### The quadratic formula

In order to find the solutions to the general form of a quadratic equation,
$ax^{2}+bx+c=0$
there is a formula
$x={\frac {-b\pm {\sqrt {(b^{2}-4ac)}}}{2a}}$
(Notice the line over the square root has the same priority as a bracket. Of course we all know by now that ${\sqrt {a+b}}$ is not equal to ${\sqrt {a}}+{\sqrt {b}}$ but errors of priority are among the most common algebra errors in practice).
There is a formula for a cubic equation but it is rather complicated and unlikely to be required for undergraduate-level study of chemistry. Cubic and higher equations occur often in chemistry, but if they do not factorise they are usually solved by computer.
Solve:
$2x^{2}-14x+9$
$1.56(x^{2}+3.67x+0.014)$
Notice the scope or range of the bracket.
$2x^{2}-4x+2$
$-45.1(1.2[A]^{2}-57.9[A]+4.193)$
Notice here that the variable is a concentration, not the ubiquitous $x$.

# Units and dimensions

* Units, multipliers and prefixes
It is usually necessary in chemistry to be familiar with at least three systems of units, Le Système International d'Unités (SI), atomic units as used in theoretical calculations and the unit system used by the experimentalists. Thus if we are dealing with the ionization energy, the units involved will be the Joule (J), the Hartree (E$_h$, the atomic unit of energy), and the electron volt (eV).
These units all have their own advantages;
* The SI unit should be understood by all scientists regardless of their field.
* The atomic unit system is the natural unit for theory as most of the fundamental constants are unity and equations can be cast in dimensionless forms.
* The electron volt comes from the operation of the ionization apparatus where individual electrons are accelerated between plates which have a potential difference in Volts.
An advantage of the SI system is that the dimensionality of each term is made clear as the fundamental constants have structure. This is a complicated way of saying that if you know the dimensionality of all the things you are working with you know an awful lot about the mathematics and properties such as scaling with size of your system. Also, the same system of units can describe both the output of a large power station (gigaJoules), or the interaction of two inert gas atoms, (a few kJ per mole or a very small number of Joules per molecule when it has been divided by Avogadro's number).
In SI the symbols for units are lower case unless derived from a person's name, e.g. ampere is A and kelvin is K.
SI base units :
| Name | Symbol | Quantity |
| metre | m | length |
| kilogram | kg | mass |
| second | s | time |
| ampere | A | electric current |
| kelvin | K | thermodynamic temperature |
| candela | cd | luminous intensity |
| mole | mol | amount of substance |
Derived units used in chemistry :
| Quantity | Unit | Name | Symbol |
| Area | m$^2$ | | |
| Volume | m$^3$ | | |
| Velocity | m s$^{-1}$ | | |
| Acceleration | m s$^{-2}$ | | |
| Density | kg m$^{-3}$ | | |
| Entropy | J mol$^{-1}$ K$^{-1}$ | | |
| Force | kg m s$^{-2}$ | newton | N |
| Energy | N m | joule | J |
| Pressure | N m$^{-2}$ | pascal | Pa |
| Frequency | s$^{-1}$ | hertz | Hz |
Approved prefixes for SI units :
| Prefix | Factor | Symbol |
| atto | 10$^{-18}$ | a |
| femto | 10$^{-15}$ | f |
| pico | 10$^{-12}$ | p |
| nano | 10$^{-9}$ | n |
| micro | 10$^{-6}$ | μ |
| milli | 10$^{-3}$ | m |
| centi | 10$^{-2}$ | c |
| deci | 10$^{-1}$ | d |
| kilo | 10$^3$ | k |
| mega | 10$^6$ | M |
| giga | 10$^9$ | G |
| tera | 10$^{12}$ | T |
| peta | 10$^{15}$ | P |
| exa | 10$^{18}$ | E |
Note the use of capitals and lower case and the increment on the exponent being factors of 3. Notice also centi and deci are supposed to disappear with time leaving only the powers of 1000.

## Conversion factors

The ${\hat}$, (sometimes call caret or hat), sign is another notation for to the power of. E means times 10 to the power of, and is used a great deal in computer program output.

### Energy

An approximation of how much of a chemical bond each energy corresponds to is placed next to each one. This indicates that light of energy 4 eV can break chemical bonds and possibly be dangerous to life, whereas infrared radiation of a few cm$^{-1}$ is harmless.
* 1 eV = 96.48530891 kJ mol$^{-1}$ (Near infrared), approximately 0.26 chemical bonds
* 1 kcal mol$^{-1}$ = 4.184000000 kJ mol$^{-1}$ (Near infrared), approximately 0.01 chemical bonds
* 1 MHz = 0.399031E-06 kJ mol$^{-1}$ (Radio waves), approximately 0.00 chemical bonds
* 1 cm$^{-1}$ = 0.01196265819 kJ mol$^{-1}$ (Far infrared), approximately 0.00 chemical bonds
Wavelength, generally measure in nanometres and used in UV spectroscopy is defined as an inverse and so has a reciprocal relationship.

### Length

There is the metre, the Angstrom (10$^{-10}$ m), the micron (10$^{-6}$ m), the astronomical unit (AU)and many old units such as feet, inches and light years.

### Angles

The radian to degree conversion is 57.2957795130824, (i.e. a little bit less than 60, remember your equilateral triangle and radian sector).

### Dipole moment

1 Debye = 3.335640035 Cm x 10$^{-30}$ (coulomb metre)

### Magnetic Susceptibility

1 cm$^3$ mol$^{-1}$ = 16.60540984 JT$^{-2}$ x 10$^{30}$ (joule tesla$^2$)

### Old units

Occasionally, knowledge of older units may be required. Imperial units, or convert energies from BTUs in a thermodynamics project, etc.
In university laboratory classes you would probably be given material on the Quantity Calculus notation and methodology which is to be highly recommended for scientific work.
A good reference for units, quantity calculus and SI is: I. Mills, T. Cuitas, K. Homann, N. Kallay, K. Kuchitsu, Quantities, units and symbols in physical chemistry, 2nd edition, (Oxford:Blackwell Scientific Publications,1993).

## Unit labels

The labelling of tables and axes of graphs should be done so that the numbers are dimensionless, e.g. temperature is $T/K$,
$\ln(k/k_{0})$ and energy mol / kJ etc.
This can look a little strange at first. Examine good text books like Atkins Physical Chemistry which follow SI carefully to see this in action.
The hardest thing with conversion factors is to get them the right way round. A common error is to divide when you should be multiplying, also another common error is to fail to raise a conversion factor to a power.
${\text{Conversion factor}}={\frac {\text{Units required}}{\text{Units given}}}$
1 eV = 96.48530891 kJ mol$^{-1}$
1 cm$^{-1}$ = 0.01196265819 kJ mol$^{-1}$
To convert eV to cm$^{-1}$, first convert to kJ per mole by multiplying by 96.48530891 / 1. Then convert to cm$^{-1}$ by multiplying by 1 / 0.01196265819 giving 8065.540901. If we tried to go directly to the conversion factor in 1 step it is easy to get it upside down. However, common sense tell us that there are a lot of cm$^{-1}$s in an eV so it should be obviously wrong.
1 inch = 2.54 centimetres. If there is a surface of nickel electrode of 2 * 1.5 square inches it must be 2 * 1.5 * 2.54$^2$ square centimetres.
To convert to square metres, the SI unit we must divide this by 100 * 100 not just 100.

### Dimensional analysis

The technique of adding unit labels to numbers is especially useful, in that analysis of the units in an equation can be used to double-check the answer.

## An aside on scaling

One of the reasons powers of variables are so important is because they relate to the way quantities scale. Physicists in particular are interested in the way variables scale in the limit of very large values. Take cooking the turkey for Christmas dinner. The amount of turkey you can afford is linear, (power 1), in your income. The size of an individual serving is quadratic, (power 2), in the radius of the plates being used. The cooking time will be something like cubic in the diameter of the turkey as it can be presumed to be linear in the mass.
(In the limit of a very large turkey, say one the diameter of the earth being heated up by a nearby star, the internal conductivity of the turkey would limit the cooking time and the time taken would be exponential. No power can go faster / steeper than exponential in the limit. The series expansion of $e^{x}$ goes on forever even though $1/n!$ gets very small.)
Another example of this is why dinosaurs had fatter legs than modern lizards. If dinosaurs had legs in proportion to small lizards the mass to be supported rises as length to the power 3 but the strength of the legs only rises as the area of the cross section, power 2. Therefore the bigger the animal the more enormous the legs must become, which is why a rhino is a very chunky looking version of a pig.
There is a very good article on this in Cooper, Necia Grant; West, Geoffrey B., Particle Physics: A Los Alamos Primer, ISBN 0521347807

## Making tables
# Statistics

* A reader has identified this chapter as an undeveloped draft or outline. You can help to develop the work, or you can ask for assistance in the project room.

## Definition of errors

For a quantity $x$ the error is defined as $\Delta x$. Consider a burette which can be read to ±0.05 cm$^3$ where the volume is measured at 50 cm$^3$.
* The absolute error is $\pm \Delta x,\pm 0.05~{\text{cm}}^{3}$
* The fractional error is $\pm {\frac {\Delta x}{x}}$, $\pm {\frac {0.05}{50}}=\pm 0.001$
* The percentage error is $\pm 100\times {\frac {\Delta x}{x}}=\pm 0.1$%

## Combination of uncertainties

In an experimental situation, values with errors are often combined to give a resultant value. Therefore, it is necessary to understand how to combine the errors at each stage of the calculation.

### Addition or subtraction

Assuming that $\Delta x$ and $\Delta y$ are the errors in measuring $x$ and $y$, and that the two variables are combined by addition or subtraction, the uncertainty (absolute error) may be obtained by calculating
${\sqrt {(\Delta x)^{2}+(\Delta y)^{2}}}$
which can the be expressed as a relative or percentage error if necessary.

### Multiplication or division

Assuming that $\Delta x$ and $\Delta y$ are the errors in measuring $x$ and $y$, and that the two variables are combined by multiplication or division, the fractional error may be obtained by calculating
${\sqrt {({\frac {\Delta x}{x}})^{2}+({\frac {\Delta y}{y}})^{2}}}$

# Plotting graphs

* A reader has identified this chapter as an undeveloped draft or outline. You can help to develop the work, or you can ask for assistance in the project room.

## The properties of graphs

The most basic relationship between two variables $x$ and $y$ is a straight line, a linear relationship.
$y={\rm {m}}x+{\rm {c}}$
The variable $m$ is the gradient and $c$ is a constant which gives the intercept. The equations can be more complex than this including higher powers of $x$, such as
$y={\rm {a}}x^{2}+{\rm {b}}x+{\rm {c}}$
This is called a quadratic equation and it follows a shape called a parabola. High powers of $x$ can occur giving cubic, quartic and quintic equations. In general, as the power is increased, the line mapping the variables wiggles more, often cutting the $x$-axis several times.

### Practice

Plot $x^{2}-1$ between -3 and +2 in units of 1.
Plot $x^{2}+3x$ between -4 and +1 in units of 1.
Plot $2x^{3}-5x^{2}-12x$ between -5 and +4 in units of 1.

# Complex numbers

* Introduction to complex numbers
The equation:
$x^{2}+6x+13=0$
Does not factorise
$x=-3\pm {\sqrt {9-13}}$
${\sqrt {-4}}$ without complex numbers does not exist. However the number $i={\sqrt {-1}}$ behaves exactly like any other number in algebra without any anomalies, allowing us to solve this problem.
The solutions are $-3\pm 2i$.
$2i$ is an imaginary number. $-3-2i$ is a complex number.
Two complex numbers $(a,b)=a+ib$ are added by $(a,b)+(c,d)=(a+c,b+d)$ $=a+c+i(b+d)$.
Subtraction is obvious: $(a,b)-(c,d)=(a-c,b-d)$.
$(a,b).(c,d)=ac+i(ad+bc)-bd$
Division can be worked out as an exercise. It requires$(c+id)(c-id)$ as a common denominator. This is $c^{2}-(id)^{2}$, (difference of two squares), and is $c^{2}+d^{2}$.
This means
${\frac {(a,b)}{(c,d)}}={\frac {ac+bd+i(cb-ad)}{c^{2}+d^{2}}}$
In practice complex numbers allow one to simplify the mathematics of magnetism and angular momentum as well as completing the number system.
There is an apparent one to one correspondence between the Cartesian $x-y$ plane and the complex numbers, $x+iy$. This is called an Argand diagram. The correspondence is illusory however, because say for example you raise the square root of $i$ to a series of ascending powers. Rather than getting larger it goes round and round in circles around the origin. This is not a property of ordinary numbers and is one of the fundamental features of behaviour in the complex plane.
Plot on the same Argand diagram $2-i,~~~~3i-1,~~~~-2-2i$
Solve
$x^{2}+4x+29=0$
$4x^{2}-12x+25=0$
$x^{2}+2ix+1=0$
(Answers -2 plus or minus 5i, 3/2 plus or minus 2i, i(-1 plus or minus root 2)
2 important equations to be familiar with, Euler's equation:
$e^{i\theta }=\cos \theta +i\sin \theta$
and de Moivre's theorem:
${(\cos \theta +i\sin \theta )}^{n}=\cos n\theta +i\sin n\theta$
Euler's equation is obvious from looking at the Maclaurin expansion of $e^{i\theta }$.
To find the square root of $i$ we use de Moivre's theorem.
$e^{i{\frac {\pi }{2}}}=0+1i$
so de Moivre's theorem gives ${\sqrt {e^{i{\frac {\pi }{2}}}}}=\cos {\frac {\pi }{2.2}}+i\sin {\frac {\pi }{2.2}}$
$={\frac {1}{\sqrt {2}}}+{\frac {1}{\sqrt {2}}}i$
Check this by squaring up to give $i$.
The other root comes from:
${\frac {5\pi }{4}}+i\sin {\frac {5\pi }{4}}=-{\frac {1}{\sqrt {2}}}-{\frac {1}{\sqrt {2}}}i$
de Moivre's theorem can be used to find the three cube roots of unity by
$1=\cos \theta +i\sin \theta$
where $\theta$ can be $0\pm 2\pi /n$.
Put $n=1/3$, $\cos \theta =-1/2$ and $\sin \theta =\pm {\sqrt {3}}/2$
${\left(-{\frac {1}{2}}+{\frac {\sqrt {3}}{2}}i\right)}^{3}=\left({\frac {1}{4}}-{\frac {3}{4}}-{\frac {\sqrt {3}}{2}}i\right)\left(-{\frac {1}{2}}+{\frac {\sqrt {3}}{2}}i\right)$
$=\left(-{\frac {1}{2}}-{\frac {\sqrt {3}}{2}}i\right)\left(-{\frac {1}{2}}+{\frac {\sqrt {3}}{2}}i\right)$
This is the difference of two squares so
${\left({\frac {1}{2}}\right)}^{2}-{\frac {3}{4}}i^{2}~~=~~~{\frac {1}{4}}+{\frac {3}{4}}$
Similarly any collection of $n$th roots of 1 can be obtained this way.
Another example is to get the expressions for $\cos 4\theta$ and $\sin 4\theta$ without expanding $\cos(2\theta +2\theta )$.
$\cos 4\theta +i\sin 4\theta ={(\cos \theta +i\sin \theta )}^{4}$
Remember Pascal's Triangle
$=\cos ^{4}\theta +4\cos ^{3}\theta i\sin \theta +6\cos ^{2}\theta i^{2}\sin ^{2}\theta +4\cos \theta i^{3}\sin ^{3}\theta +i^{4}\sin ^{4}\theta$
$=\cos ^{4}\theta -6\cos ^{2}\theta \sin ^{2}\theta +\sin ^{4}\theta +i(4\cos ^{3}\theta \sin \theta -4\cos \theta \sin ^{3}\theta )$
Separating the real and imaginary parts gives the two expressions. This is a lot easier than
$\cos(2\theta +2\theta )$
Use the same procedure to get
$\cos 6\theta$ and $\sin 6\theta$.

# Trigonometry

* Trigonometry - the sin and cosine rules
In the following trigonometric identities, $a$, $b$ and $c$ are the lengths of sides in a triangle, opposite the corresponding angles $A$, $B$ and $C$.
* The sin rule ${\frac {a}{\sin A}}={\frac {b}{\sin B}}={\frac {c}{\sin C}}$
* The cosine rule $c^{2}=a^{2}+b^{2}-2ab\cos C$
* The ratio identity $\tan A={\frac {\sin A}{\cos A}}$

## Trigonometric identities

$\cos ^{2}\theta +\sin ^{2}\theta =1$
Remember this is a consequence of Pythagoras' theorem where the length of the hypotenuse is 1.
$\sin(\theta +\phi )=\sin \theta \cos \phi +\cos \theta \sin \phi$
$\cos(\theta +\phi )=\cos \theta \cos \phi -\sin \theta \sin \phi$
The difference of two angles can easily be generated by putting $\phi =-\phi$ and remembering $\sin -\phi =-\sin \phi$ and $\cos -\phi =\cos \phi$. Similarly, the double angle formulae are generated by induction. $\tan(\theta +\phi )$ is a little more complicated but can be generated if you can handle the fractions! The proofs are in many textbooks but as a chemist it is not necessary to know them, only the results.

## Identities and equations

Identities and equations look very similar, two things connected by an equals sign. An identity however is a memory aid of a mathematical equivalence and can be proved. An equation represents new information about a situation and can be solved.
For instance,
$\cos ^{2}\theta +\sin ^{2}\theta =1$
is an identity. It cannot be solved for $\theta$; it is valid for all $\theta$. However,
$\cos ^{2}\theta =1$
is an equation where $\theta =\arccos \pm 1$.
If you try and solve an identity as an equation you will go round and round in circles getting nowhere, but it would be possible to dress up $\cos ^{2}\theta +\sin ^{2}\theta =1$ into a very complicated expression which you could mistake for an equation.

## Some observations on triangles

Check you are familiar with your elementary geometry. Remember from your GCSE maths the properties of equilateral and iscoceles triangles. If you have an iscoceles triangle you can always dispense with the sin and cosine rules, drop a perpendicular down to the base and use trig directly. Remember that the bisector of a side or an angle to a vertex cuts the triangle in two by area, angle and length. This can be demonstrated by drawing an obtuse triangle and seeing that the areas are ${\frac {1}{2}}{\frac {1}{2}}.R.h$.

## The interior angles of a polygon

Remember that the interior angles of a $n$-sided polygon are $180(n-2)$(in degrees) or ($n\pi -2\pi$) (in radians)
For benzene there are six equilateral triangles if the centre of the ring is used as a vertex, each of which having an interior angle of 120 degrees. Work out the angles in azulene, (a hydrocarbon with a five and a seven membered ring), assuming all the C-C bond lengths are equal, (this is only approximately true).

# Vectors

* Free Web Based Material from HEFCE
There is a DVD on vectors at Math Tutor.

## Vectors

Imagine you make a rail journey from Doncaster to Bristol, from where you travel up the West of the country to Manchester. Here you stay a day, travelling the next morning to Glasgow, then across to Edinburgh. At the end of a day's work you return to Doncaster. Mathematically this journey could be represented by vectors, (in 2 dimensions because we are flat earthers on this scale). At the end of the 2nd journey (D-B) + (B-M) you are only a short distance from Doncaster, 50 miles at 9.15 on the clockface. Adding two more vectors, (journeys) takes you to Edinburgh, (about 250 miles at 12.00). Completing the journey leaves you at a zero vector away from Doncaster, i.e. all the vectors in this closed path add to zero.
Mathematically we usually use 3 dimensional vectors over the 3 Cartesian axes $x$, $y$ and $z$.
It is best always to use the conventional right handed axes even though the other way round is equally valid if used consistently. The wrong handed coordinates can occasionally be found erroneously in published research papers and text books. The memory trick is to think of a sheet of graph paper, $x$ is across as usual and $y$ up the paper. Positive $z$ then comes out of the paper.
A unit vector is a vector normalised, i.e. multiplied by a constant so that its value is 1. We have the unit vectors in the 3 dimensions:
${\hat {\mathbf {i} }}+{\hat {\mathbf {j} }}+{\hat {\mathbf {k} }}$
so that
${\mathbf {v} }=A_{x}{\hat {\mathbf {i} }}+A_{y}{\hat {\mathbf {j} }}+A_{z}{\hat {\mathbf {k} }}$
The hat on the i, j, k signifies that it is a unit vector. This is usually omitted.
Our geographical analogy allows us to see the meaning of vector addition and subtraction. Vector products are less obvious and there are two definitions the scalar product and the vector product. These are different kinds of mathematical animal and have very different applications. A scalar product is an area and is therefore an ordinary number, a scalar. This has many useful trigonometrical features.
The vector product seems at first to be defined rather strangely but this definition maps onto nature as a very elegant way of describing angular momentum. The structure of Maxwell's Equations is such that this definition simplifies all kinds of mathematical descriptions of atomic / molecular structure and electricity and magnetism.

## A summary of vectors

The unit vectors in the 3 Cartesian dimensions:
${\hat {\mathbf {i} }}+{\hat {\mathbf {j} }}+{\hat {\mathbf {k} }}$
a vector ${\mathbf {v} }$ is:
${\mathbf {v} }=A_{x}{\hat {\mathbf {i} }}+A_{y}{\hat {\mathbf {j} }}+A_{z}{\hat {\mathbf {k} }}$
The hat on the i, j, k signifies that it is a unit vector.

### Vector magnitude

$V_{mag}={\sqrt {{A_{x}}^{2}+{A_{y}}^{2}+{A_{z}}^{2}}}$

### A constant times a vector

${\mathbf {v} _{new}}=cA_{x}{\hat {\mathbf {i} }}+cA_{y}{\hat {\mathbf {j} }}+cA_{z}{\hat {\mathbf {k} }}$

### Vector addition

${\mathbf {A} }+{\mathbf {B} }=(A_{x}+B_{x}){\hat {\mathbf {i} }}+(A_{y}+B_{y}){\hat {\mathbf {j} }}+(A_{z}+B_{z}){\hat {\mathbf {k} }}$
Notice ${\mathbf {B} }+{\mathbf {A} }={\mathbf {A} }+{\mathbf {B} }$

### Vector subtraction

${\mathbf {A} }-{\mathbf {B} }=(A_{x}-B_{x}){\hat {\mathbf {i} }}+(A_{y}-B_{y}){\hat {\mathbf {j} }}+(A_{z}-B_{z}){\hat {\mathbf {k} }}$
Notice ${\mathbf {A} }-{\mathbf {B} }=-(-{\mathbf {A} }+{\mathbf {B} })$

### Scalar Product

${\mathbf {A} }.{\mathbf {B} }=A_{x}.B_{x}+A_{y}.B_{y}+A_{z}.B_{z}$
Notice ${\mathbf {B} }.{\mathbf {A} }={\mathbf {A} }.{\mathbf {B} }$
Notice that if ${\mathbf {A} }={\mathbf {B} }$ this reduces to a square.
If A and B have no common non-zero components in $x$, $y$ and $z$ the value is zero corresponding to orthogonality, i.e. they are at right angles. (This can also occur by sign combinations making ${\mathbf {A} }.{\mathbf {B} }$ zero. corresponding to non axis-hugging right angles.)

### Vector product

${\mathbf {A} }{\rm {x}}{\mathbf {B} }=(A_{y}B_{z}-A_{z}B_{y}){\hat {\mathbf {i} }}-(A_{x}B_{z}-A_{z}B_{x}){\hat {\mathbf {j} }}+(A_{x}B_{y}-A_{y}B_{x}){\hat {\mathbf {k} }}$
Notice ${\mathbf {B} }{\rm {x}}{\mathbf {A} }=-{\mathbf {A} }{\rm {x}}{\mathbf {B} }$
The minus sign on the middle term comes from the definition of the determinant, explained in the lecture. Determinants are defined that way so they correspond to right handed rotation. (If you remember our picture of $\cos ^{2}+\sin ^{2}=1$ going round the circle, as one coordinate goes up, i.e. more positive, another must go down. Therefore rotation formulae must have both negative and positive terms.) Determinants are related to rotations and the solution of simultaneous equations. The solution of $n$ simultaneous equations can be recast in graphical form as a rotation to a unit vector in $n$-dimensional space so therefore the same mathematical structures apply to both space and simultaneous equations.

# Matrices and determinants

* Simultaneous linear equations
If we have 2 equations of the form $y={\rm {m}}x+{\rm {c}}$ we may have a set of simultaneous equations. Suppose two rounds of drinks are bought in a cafe, one round is 4 halves of orange juice and 4 packets of crisps. This comes to 4 pounds 20. The thirstier drinkers at another table buy 4 pints of orange juice and only 1 packet of crisps and this comes to 6 pounds 30. So we have:
$4.20=2x+4y$
and
$6.30=4x+y$
i.e. $y={\frac {4.20}{4}}-{\frac {2}{4}}x~~~~~~~~~~~~~{\rm {and}}~~~~~~~~~~~y=6.30-4x$
If you plot these equations they will be simultaneously true at $x=1.5$ and $y=0.30$.
Notice that if the two rounds of drinks are 2 pints and 2 packets of crisps and 3 pints and 3 packets of crisps we cannot solve for the prices! This corresponds to two parallel straight lines which never intersect.
If we have the equations:
$3x+4y=4$
$3x+2y=1$
If these are simultaneously true we can find a unique solution for both $x$ and $y$.
By subtracting the 2 equations a new equation is created where $x$ has disappeared and the system is solved.
$2y=3$
Substituting back $y=1.5$ gives us $x$.
This was especially easy because $x$ had the same coefficient in both equations. We can always multiply one equation throughout by a constant to make the coefficients the same.
If the equations were:
$3x+4y=4$
and
$6x+8y=8$
things would go horribly wrong when you tried to solve them because they are two copies of the same equation and therefore not simultaneous. We will come to this later, but in the meantime notice that 3 times 8 = 4 times 6. If our equations were:
$3x+4y+9z=4$
$3x+2y-4z=1$
$9x+2y-2z=1$
we can still solve them but would require a lot of algebra to reduce it to three (2x2) problems which we know we can solve. This leads on to the subject of matrices and determinants.
Simultaneous equations have applications throughout the physical sciences and range in size from (2x2)s to sets of equations over 1 million by 1 million.

## Practice simultaneous equations

Solve:
$x-2y=1$
$x+4y=8$
and
$x+5y=10$
$7x-4y=10$
Notice that you can solve:
$3x+4y+9z=4$
$3x+2y-4z=1$
$0x+0y-2z=1$
because it breaks down into a (2x2) and is not truly a (3x3). (In the case of the benzene molecular orbitals, which are (6x6), this same scheme applies. It becomes two direct solutions and two (2x2) problems which can be solved as above.)

## Matrices

The multiplication of matrices has been explained in the lecture.
$A={\begin{pmatrix}0&1&2\\0&-1&-2\\\end{pmatrix}}~~~~~~~~B={\begin{pmatrix}3&-3\\4&-4\\5&-5\\\end{pmatrix}}~~~~~~~~~~AB={\begin{pmatrix}14&-14\\-14&14\\\end{pmatrix}}$
$BA={\begin{pmatrix}0&6&12\\0&8&16\\0&10&20\\\end{pmatrix}}$
${\rm {if}}A={\begin{pmatrix}1&2&3\\\end{pmatrix}}~~~~~~~{\rm {and}}~~~~~B={\begin{pmatrix}4&5\\6&7\\8&9\\\end{pmatrix}}~~~~~~~AB={\begin{pmatrix}40&60\\\end{pmatrix}}$
but $BA$ cannot exist. To be multiplied two matrices must have the 1st matrix with the same number of elements in a row as the 2nd matrix has elements in its columns.
$a_{ij}=\Sigma _{k}a_{ik}b_{kj}$
where the $a_{ij}$s are the elements of $A$.
${\begin{pmatrix}a_{11}&a_{12}&a_{13}\\a_{21}&a_{22}&a_{23}\\a_{31}&a_{32}&a_{33}\\\end{pmatrix}}$
Look at our picture of $\cos$ and $\sin$ as represented by a unit vector in a circle. The rotation of the unit vector ${\hat {j}}$ about the $z$-axis can be represented by the following mathematical construct.
${\begin{pmatrix}\cos(\theta )&\sin(\theta )&0\\-\sin(\theta )&\cos(\theta )&0\\0&0&1\\\end{pmatrix}}$
${\begin{pmatrix}0\\1\\0\\\end{pmatrix}}={\begin{pmatrix}\sin(\theta )\\\cos(\theta )\\0\\\end{pmatrix}}$
In two dimensions we will rotate the vector at 45 degrees between $x$ and $y$:
${\begin{pmatrix}\cos(\theta )&\sin(\theta )\\-\sin(\theta )&\cos(\theta )\\\end{pmatrix}}{\begin{pmatrix}{\frac {r}{\sqrt {2}}}\\{\frac {r}{\sqrt {2}}}\\\end{pmatrix}}={\begin{pmatrix}{\frac {r\cos \theta }{\sqrt {2}}}+{\frac {r\sin \theta }{\sqrt {2}}}\\{\frac {-r\sin \theta }{\sqrt {2}}}+{\frac {r\cos \theta }{\sqrt {2}}}\\\end{pmatrix}}={\begin{pmatrix}r\\0\\\end{pmatrix}}$
This is if we rotate by +45 degrees. For $\theta =-45^{o}$ $\cos(-45)=\cos 45$ and $\sin(-45)=-\sin 45$. So the rotation flips over to give $(01)$. The minus sign is necessary for the correct mathematics of rotation and is in the lower left element to give a right handed sense to the rotational sign convention.
As discussed earlier the solving of simultaneous equations is equivalent in some deeper sense to rotation in $n$-dimensions.

## Matrix multiply practice

i) Multiply the following (2x2) matrices.
${\begin{pmatrix}3&5\\6&4\\\end{pmatrix}}$ ${\begin{pmatrix}1&2\\3&4\\\end{pmatrix}}$ = ${\begin{pmatrix}3{\rm {x}}1+5{\rm {x}}3&3{\rm {x}}2+5{\rm {x}}4\\6{\rm {x}}1+4{\rm {x}}3&6{\rm {x}}2+4{\rm {x}}4\\\end{pmatrix}}$
ii) Multiply the following (3x3) matrices.
${\begin{pmatrix}38.15&-42.17&4.02\\4.69&0.76&-5.35\\-9.94&8.20&2.74\\\end{pmatrix}}$ ${\begin{pmatrix}0.205&0.665&1\\0.181&0.647&1\\0.207&0.476&1\\\end{pmatrix}}$
You will notice that this gives a unit matrix as its product.
${\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\\\end{pmatrix}}$
The first matrix is the inverse of the 2nd. Computers use the inverse of a matrix to solve simultaneous equations.
If we have ${\begin{pmatrix}y_{1}=a_{11}x_{1}+a_{12}x_{2}+a_{13}x_{3}.....+a_{1n}x_{n}\\y_{2}=a_{21}x_{2}+a_{22}x_{2}+a_{23}x_{3}.....+a_{2n}x_{n}\\.....\\.....\\y_{n}=a_{n1}x_{n}+a_{n2}x_{n}+a_{n3}x_{3}.....+a_{nn}x_{n}\\\end{pmatrix}}$
In matrix form this is....
$Y=AX$
$A^{-1}Y=X$
In terms of work this is equivalent to the elimination method you have already employed for small equations but can be performed by computers for $10~000$ simultaneous equations.
(Examples of large systems of equations are the fitting of reference data to 200 references molecules, dimension 200, or the calculation of the quantum mechanical gradient of the energy where there is an equation for every way of exciting 1 electron from an occupied orbital to an excited, (called virtual, orbital, (typically $10~000$ equations.)

## Finding the inverse

How do you find the inverse... You use Maple or Matlab on your PC but if the matrix is small you can use the formula...
$A^{-1}={\frac {1}{DetA}}AdjA$
Here Adj A is the adjoint matrix, the transposed matrix of cofactors. These strange objects are best described by example.....
${\begin{vmatrix}1&-1&2\\2&1&1\\3&-1&1\\\end{vmatrix}}$
This determinant is equal to: 1 ( 1 x 1 - 1 x (-1)) - (-1) ( 2 x 1 - 1 x 3) + 2 ( 2 x (-1) - ( 1 x 3) each of these terms is called a cofactor.
${\begin{vmatrix}a_{11}&a_{12}&a_{13}\\a_{21}&a_{22}&a_{23}\\a_{31}&a_{32}&a_{33}\\\end{vmatrix}}$
$DetA=-1^{i+j-1}{\begin{pmatrix}a_{11}(a_{22}a_{33}-a_{23}a_{32})\\+-1^{i+j-1}a_{12}(a_{21}a_{33}-a_{23}a_{31})\\+-1^{i+j-1}a_{13}(a_{21}a_{32}-a_{22}a_{31})\\\end{pmatrix}}$
This $-1^{i+j-1}$ thing gives the sign alternation in a form mathematicians like even though it is incomprehensible.
Use the determinant
${\begin{vmatrix}1&-1&2\\2&1&1\\3&-1&1\\\end{vmatrix}}$
to solve the simultaneous equations on page 47 by the matrix inverse method. The matrix corresponding to the equations on p47.2 is:
This takes a long time to get all the signs right. Elimination by subtracting equations is MUCH easier. However as the computer cannot make sign mistakes it is not a problem when done by computer program.
The following determinant corresponds to an equation which is repeated three times giving an unsolvable set of simultaneous equations.
${\begin{vmatrix}1&2&3\\-1&-2&-3\\2&4&6\\\end{vmatrix}}$
Matrix multiplication is not necessarily commutative, which in English means $AB$ does not equal $BA$ all the time. Multiplication may not even be possible in the case of rectangular rather than square matrices.
I will put a list of the properties and definitions of matrices in an appendix for reference through the later years of the course.

## Determinants and the Eigenvalue problem

In 2nd year quantum chemistry you will come across this object: ${\begin{vmatrix}\alpha -E&\beta &0&0\\\beta &\alpha -E&\beta &0\\0&\beta &\alpha -E&\beta \\0&0&\beta &\alpha -E\\\end{vmatrix}}=0$
You divide by $\beta$ and set $(\alpha -E)/\beta$ to equal $x$ to get:
${\begin{vmatrix}x&1&0&0\\1&x&1&0\\0&1&x&1\\0&0&1&x\\\end{vmatrix}}=0$
Expand this out and factorise it into two quadratic equations to give:
$(x^{2}+x-1)(x^{2}-x-1)=0$
which can be solved using $x=-b\pm etc.$

### Simultaneous equations as linear algebra

The above determinant is a special case of simultaneous equations which occurs all the time in chemistry, physics and engineering which looks like this:
${\begin{pmatrix}(a_{11}-\lambda )x_{1}+a_{12}x_{2}+a_{13}x_{3}.....+a_{1n}x_{n}=0\\a_{21}x_{2}+(a_{22}-\lambda )x_{1}+a_{23}x_{3}.....+a_{2n}x_{n}=0\\.....\\.....\\a_{1n}x_{n}+a_{2n}x_{n}+a_{n3}x_{3}.....+(a_{11}-\lambda )x_{1}=0\\\end{pmatrix}}$
This equation in matrix form is $({\mathbf {A} }-\lambda {\mathbf {1} }){\mathbf {x} }=0$ and the solution is ${\rm {Det}}({\mathbf {A} }-\lambda {\mathbf {1} })=0$.
This is a polynomial equation like the quartic above. As you know polynomial equations have as many solutions as the highest power of $x$ i.e. in this case $n$. These solutions can be degenerate for example the $\pi$ orbitals in benzene are a degenerate pair because of the factorisation of the $x^{6}$ polynomial from the 6 Carbon-pz orbitals. In the 2nd year you may do a lab exercise where you make the benzene determinant and see that the polynomial is
$(x^{2}-4)(x^{2}-1)(x^{2}-1)=0$
from which the 6 solutions and the orbital picture are immediately obvious.
The use of matrix equations to solve arbitrarily large problems leads to a field of mathematics called linear algebra.

## Matrices with complex numbers in them

Work out the quadratic equation from the 3 determinants
${\begin{vmatrix}x&i\\-i&x\\\end{vmatrix}}~~~~~~~{\begin{vmatrix}x&1\\1&x\\\end{vmatrix}}~~~~~~~{\begin{vmatrix}x&{\frac {1}{\sqrt {2}}}+{\frac {i}{\sqrt {2}}}\\{\frac {1}{\sqrt {2}}}-{\frac {i}{\sqrt {2}}}&x\\\end{vmatrix}}$
They are all the same! This exemplifies a deeper property of matrices which we will ignore for now other than to say that complex numbers allow you to calculate the same thing in different ways as well as being the only neat way to formulate some problems.

# Differentiation

* Free web-based material from HEFCE
There is a DVD on differentiation at Math Tutor.

## The basic polynomial

The most basic kind of differentiation is:
$f(x)=x^{n}$
$f^{'}(x)=nx^{n-1}$
There are two simple rules:
* The derivative of a function times a constant is just the same constant times the derivative.
* The derivative of a sum of functions is just the sum of the two derivatives.
To get higher derivatives such as the second derivative keep applying the same rules.
One of the big uses of differentiation is to find the stationary points of functions, the maxima and minima. If the function is smooth, (unlike a saw-tooth), these are easily located by solving equations where the first derivative is zero.

## The chain rule

${\frac {dy}{dx}}={\frac {dy}{dw}}.{\frac {dw}{dx}}$
This is best illustrated by example: find ${\frac {dy}{dx}}$ given $y={(x^{4}+1)}^{9}$
Let $y=u^{9}$ and $u=x^{4}+1$.
Now ${\frac {dy}{du}}=9u^{8}$ and ${\frac {du}{dx}}=4x^{3}$
So using the chain rule we have $9{(x^{4}+1)}^{8}.4x^{3}=36x^{3}{(x^{4}+1)}^{8}$

## Differentiating a product

${\frac {d(u.v)}{dx}}=v{\frac {du}{dx}}+u{\frac {dv}{dx}}$
Notice when differentiating a product one generates two terms. (Terms are mathematical expression connected by a plus or minus.) An important point is that terms which represent physical quantities must have the same units and dimensions or must be pure dimensionless numbers. You cannot add 3 oranges to 2 pears to get 5 orangopears. Integration by parts also generates an extra term each time it is applied.

## Differentiating a quotient

You use this to differentiate $\tan$.
${\frac {d}{dx}}\left({\frac {u}{v}}\right)={\frac {v{\frac {du}{dx}}-u{\frac {dv}{dx}}}{v^{2}}}$

### Problems

Differentiate with respect to $x$
$3x^{2}-x(1+x)(1-x)$
Notice we have $(a^{2}-b^{2})$. $4x^{7}-3x^{2}$
${(3x+2)}2+e^{x}$
$8x^{6}-12{\sqrt {x}}$
$x{(x+3)}2$
$x^{2}(3x-(2+x)(2-x))$
Evaluate the inner brackets first.
Evaluate
${\frac {\rm {d}}{{\rm {d}}z}}\left(e^{z}-{\frac {z^{9}}{18}}-{\frac {3}{z^{2}}}\right)$
${\frac {\rm {d}}{{\rm {d}}c}}\left({\sqrt {c^{5}}}\right)$
${\frac {\rm {d}}{{\rm {d}}\omega }}\left({\frac {1}{\omega }}-{\frac {1}{\omega ^{2}}}-{\frac {1}{\omega ^{3}}}\right)$
${\frac {\rm {d}}{{\rm {d}}\phi }}\left(e^{\phi }-\left({\frac {1}{\phi ^{2}}}+{\frac {3}{2}}\phi ^{2}\right)\right)$
${\frac {\rm {d}}{{\rm {d}}r}}\left(e^{5r}-\left({\frac {a}{r^{3}}}+{\frac {b}{r^{6}}}+{\frac {c}{r^{9}}}\right)\right)$
a, b and c are constants. Differentiate with respect to $r$.
$3re^{-3r}$
${\frac {\rm {d}}{{\rm {d}}x}}\left(x^{6}e^{x}\right)$

### Answers

$3x^{2}+6x-1$
$28x^{6}-6x$
$e^{x}+18x+12$
$48x^{5}-{\frac {6}{\sqrt {x}}}$
$3x^{2}+12x+9$
$4x^{3}+9x^{2}-8x$
$e^{z}+{\frac {z^{8}}{2}}+{\frac {6}{z^{3}}}$
${\frac {5}{2}}c^{3/2}{\rm {or}}{\frac {5}{2}}{\sqrt {c^{3}}}$
$-{\frac {1}{\omega ^{2}}}+{\frac {2}{\omega ^{3}}}+{\frac {3}{\omega ^{4}}}$
$e^{\phi }+{\frac {2}{\phi ^{3}}}-3\phi$
$5e^{5r}+{\frac {3a}{r^{4}}}+{\frac {6b}{r^{7}}}+{\frac {9c}{r^{10}}}$
$e^{-3r}(3-9r)$
$x^{5}e^{x}(x+6)$

### Harder differentiation problems

Differentiate with respect to $x$:
$x^{4}{(x+9)}^{5}$
$5x^{2}{(x^{2}-7x+9)}^{5}$
Differentiate with respect to $r$
${(r^{2}+3r-1)}^{3}e^{-4r}$
Differentiate with respect to $\omega$
${\frac {1}{{\omega }^{4}}}\left({{\omega }^{2}-3\omega -19}\right)$
${\frac {e^{\omega }}{{\omega }^{4}}}$
Evaluate
${\frac {\rm {d}}{{\rm {d}}z}}\left(e^{-4z}\left({z-1}^{2}\right)\right)$
${\frac {\rm {d}}{{\rm {d}}\phi }}\left(\phi ^{2}e^{-2\phi }\left(1-{\frac {1}{{\phi }^{2}}}\right)\right)$

## Using differentiation to check turning points

${\frac {dy}{dx}}$ is the tangent or gradient. At a minimum ${\frac {dy}{dx}}$ is zero. This is also true at a maximum or an inflection point. The second gradient gives us the nature of the point. If ${\frac {d^{2}y}{dx^{2}}}$ is positive the turning point is a minimum and if it is negative a maximum. Most of the time we are interested in minima except in transition state theory.
If the equation of $y=x^{3}$ is plotted, is is possible to see that at $x=0$ there is a third kind of point, an inflection point, where both ${\frac {dy}{dx}}$ and ${\frac {d^{2}y}{dx^{2}}}$ are zero.
$y=f(x){\frac {dy}{dx}}=f^{'}(x){\frac {d^{2}y}{dx^{2}}}=f^{''}(x)$
Plot $x^{3}+x^{2}-6x$ between -4 and +3, in units of 1. (It will speed things up if you factorise it first. Then you will see there are 3 places where $f(x)=0$ so you only need calculate 5 points.) By factorising you can see that this equation has 3 roots. Find the 2 turning points. (Differentiate once and find the roots of the quadratic equation using $x=-b\dots$. This gives the position of the 2 turning points either side of zero. As the equation is only in $x^{3}$ it has 3 roots and 2 maxima / minima at the most therefore we have solved everything. Differentiate your quadratic again to get ${\frac {d^{2}y}{dx^{2}}}$. Notice that the turning point to the left of zero is a maximum i.e. ${\frac {d^{2}y}{dx^{2}}}=-ve$ and the other is a minimum i.e. ${\frac {d^{2}y}{dx^{2}}}=+ve$.
What is the solution and the turning point of $y=x^{3}$.
Solve $x^{3}-x=0$, by factorisation.
(The 3 roots are -3,0 and +2. ${\frac {{\rm {d}}y}{{\rm {d}}x}}=f^{'}(x)=3x^{2}+2x-6$
Solutions are $1/3({\sqrt {19}}-1)$ and $-1/3({\sqrt {19}}+1)$, i.e. -1.7863 and 1.1196.
${\frac {d^{2}y}{dx^{2}}}=f^{''}(x)=6x+2$
There are 3 coincident solutions at $x=0$, ${\frac {d^{2}y}{dx^{2}}}=0$, at 0 so this is an inflection point.
The roots are 0, 1 and -1.

# Integration

* Free Web Based Material from HEFCE
There is a DVD on integration at Math Tutor.

### The basic polynomial

$f(x)=x^{n}$
$\int {f(x)}dx={\frac {x^{n+1}}{n+1}}+c$
This works fine for all powers except -1, for instance the integral of
${\frac {1}{x^{7}}}$
is just
$-{\frac {1}{6x^{6}}}+c$
-1 is clearly going to be a special case because it involves an infinity when $x=0$ and goes to a steep spike as $x$ gets small. As you have learned earlier this integral is the natural logarithm of $x$ and the infinity exists because the log of zero is minus infinity and that of negative numbers is undefined.

### The integration and differentiation of positive and negative powers

Here I, H, G and F are more complicated functions involving $\ln x$.
You will be able to work them out easily when you have done more integration. The thing to notice is that the calculus of negative and positive powers is not symmetrical, essentially caused by the pole or singularity for ${\frac {1}{x^{n}}}$ at $x=0$.

## Logarithms

Logarithms were invented by Napier, a Scottish Laird, in the 17th-century. He made many inventions but his most enduring came from the necessity of doing the many long divisions and trigonometric calculations used in astronomy. The Royal Navy in later years devoted great time and expense to developing logarithm technology for the purposes of navigation, leading to the commissioning of the first mechanical stored program computer, which was theoretically sound but could not be made by Charles Babbage between 1833 and 1871.
The heart of the system is the observation of the properties of powers:
${\frac {e^{a}}{e^{b}}}=e^{a-b}$
This means that if we have the inverse function of $e^{x}$ we can change a long division into a subtraction by looking up the exponents in a set of tables. Before the advent of calculators this was the way many calculations were done.
$y=e^{x}$
$\ln y=x$
Napier initially used logs to the base $e$ for his calculations, but after a year or so he was visited by Briggs who suggested it would be more practical to use base 10. However base $e$ is necessary for the purposes of calculus and thermodynamics.

## Integrating 1/x

$x=e^{y}~~~~~~~~~{\frac {{\rm {d}}x}{{\rm {d}}y}}=e^{y}~~~~~{\rm {also}}=x$
This is true because $e^{y}$ is our function which reduces or grows at the rate of its own quantity.
$y=\ln x$
This is our definition of a logarithm.
${\frac {{\rm {d}}x}{{\rm {d}}y}}={\frac {1}{\frac {{\rm {d}}y}{{\rm {d}}x}}}~~~~~~{\rm {also}}=x$
therefore
${\frac {{\rm {d}}y}{{\rm {d}}x}}={\frac {1}{x}}$
$\int {\frac {dy}{dx}}dx=y$
therefore
$\int {\frac {1}{x}}dx=\ln x$

## Integrating 1/x like things

Just as
${\frac {\rm {d}}{{\rm {d}}x}}\ln x={\frac {1}{x}}$
so
${\frac {\rm {d}}{{\rm {d}}x}}\ln u={\frac {1}{u}}{\frac {{\rm {d}}u}{{\rm {d}}x}}$
therefore by the chain rule
${\frac {\rm {d}}{{\rm {d}}x}}\ln f(x)={\frac {f^{'}(x)}{f(x)}}$
therefore
$\int {\frac {f^{'}(x)}{f(x)}}{\rm {d}}x=\ln |f(x)|+c$
Examples of this are:
$\int {\frac {\cos \phi }{1+\sin \phi }}{\rm {d}}\phi =\ln(1+\sin \phi )+c$
or
$\int {\frac {\sin \phi }{1+\cos \phi }}{\rm {d}}\phi =-\ln(1+\cos \phi )+c$
and
$\int {\frac {e^{y}}{e^{y}+2}}{\rm {d}}y=\ln(e^{y}+2)+c$
As the integral of $1/x$ is $\ln$ so the differential of $\ln$ is $1/x$ so
${\frac {\rm {d}}{{\rm {d}}x}}\ln 5x^{3}=\ln 5+\ln x^{3}=\ln 5+3\ln x$
$\ln 5$ is just a constant so ${\frac {\rm {d}}{{\rm {d}}x}}=0$ so
${\frac {\rm {d}}{{\rm {d}}x}}\ln 5x^{3}={\frac {3}{x}}$
This can also be done by the chain rule
${\frac {\rm {d}}{{\rm {d}}x}}\ln 5x^{3}={\frac {1}{5x^{3}}}.{\frac {{\rm {d}}(5x^{3})}{{\rm {d}}x}}={\frac {15x^{2}}{5x^{3}}}={\frac {3}{x}}$
What is interesting here is that the 5 has disappeared completely. The gradient of the log function is unaffected by a multiplier! This is a fundamental property of logs.

## Some observations on infinity

Obviously ${\frac {1}{0}}$ is $\infty$.
${\frac {0}{0}}$nd ${\frac {\infty }{\infty }}$ are undefined but sometimes a large number over a large number can have defined values. An example is the $\sin$ of 90 degrees, which you will remember has a large opposite over a large hypotenuse but in the limit of an infinitesimally thin triangle they become equal. Therefore the $\sin$ is 1.

## Definite integrals (limits)

Remember how we do a definite integral
$\int _{0}^{3}{(f(x))}={\left[F(x)\right]}_{0}^{3}=F(3)-F(0)$
where $F$ is the indefinite integral of $f$.
Here is an example where limits are used to calculate the 3 areas cut out by a quartic equation:
$x^{4}-2x^{3}-x^{2}+2x$.
We see that $x=1$ is a solution so we can do a polynomial division:
So the equation is $x(x^{2}-x-2)(x-1)$ which factorises to
$x(x-2)(x+1)(x-1)$.
$\int _{a}^{b}{x^{4}-2x^{3}-x^{2}+2x}={\left[x^{5}/5-x^{4}/2-x^{3}/3+x^{2}\right]}_{a}^{b}$

## Integration by substitution

$\int \sin \theta \cos \theta {\rm {d}}\theta =\int u{\frac {{\rm {d}}u}{{\rm {d}}\theta }}{\rm {d}}\theta$
where $u=\sin \theta$.
$\int \sin \theta \cos \theta {\rm {d}}\theta ={\frac {\sin ^{2}\theta }{2}}+c$
$\int \sin ^{9}\theta \cos \theta {\rm {d}}\theta ~~~~~~~{\rm {similarly}}~~~~~~~~={\frac {\sin ^{10}\theta }{10}}+c$

## Simple integration of trigonometric and exponential Functions

$\int {4e^{2x}}dx$
$\int {-9e^{-3x}}dx$
$\int {\sin 2\theta }d\theta$
$\int {\sin ^{2}\theta +\cos ^{2}\theta }d\theta$
$\int {-\cos \phi }d\phi$

### Answers

$2e^{2x}+c$
$3e^{-3x}+c$
$-{\frac {1}{2}}\cos 2\theta +c$
$\theta +c$
i.e. the integral of $1d\theta$.
$\sin \phi +c$

## Integration by parts

This is done in many textbooks and Wikipedia. Their notation might be different to the one used here, which hopefully is the most clear. You derive the expression by taking the product rule and integrating it. You then make one of the $UV^{'}$ into a product itself to produce the expression.
$\int {UV}=U\int {V}-\int {\left(U^{'}\int {V}\right)}$
(all integration with respect to $x$. Remember by
$\int {UV}=U[{\rm {int}}]-\int {[{\rm {diff}}][{\rm {int}}]}$
($U$ gets differentiated.)
The important thing is that you have to integrate one expression of the product and differentiate the other. In the basic scheme you integrate the most complicated expression and differentiate the simplest. Each time you do this you generate a new term but the function being differentiated goes to zero and the integral is solved. The expression which goes to zero is $U$.
The other common scheme is where the parts formula generates the expression you want on the right of the equals and there are no other integral signs. Then you can rearrange the equation and the integral is solved. This is obviously very useful for trig functions where $\sin \rightarrow \cos \rightarrow -\sin \rightarrow -\cos \rightarrow sin$ ad infinitum.
$e^{x}$ also generates itself and is susceptible to the same treatment.
$\int {e^{-x}\sin x}~dx=(-e^{-x})\sin x-\int {(-e^{-x})\cos x}~dx$
$=-e^{-x}\sin x+\int {e^{-x}\cos x}~dx$
$=-e^{-x}(\sin x+\cos x)-\int {e^{-x}\sin x}~dx+c$
We now have our required integral on both sides of the equation so
$=-{\frac {1}{2}}e^{-x}(\sin x+\cos x)+c$

## Integration Problems

Integrate the following by parts with respect to$x$.
$xe^{x}$
$x^{2}\sin x$
$x\cos x$
$x^{2}e^{x}$
$x^{2}\ln x$
$e^{x}\sin x$
$e^{2x}\cos x$
$x{(1+x)}^{7}$
Actually this one can be done quite elegantly by parts, to give a two term expression. Work this one out. Expanding the original integrand by Pascal's Triangle gives:
The two term integral expands to
So one can see it is correct on a term by term basis.
$3x\sin x$
$2x^{2}\cos 2x$
If you integrate $x^{7}\sin x$ you will have to apply parts 7 times to get $x$ to become 1 thereby generating 8 terms:
Though it looks nasty there is quite a pattern to this, 7, 7x6,7x6x5 ------7! and sin, cos, -sin, -cos, sin, cos etc so it can easily be done by hand.

## Differential equations

First order differential equations are covered in many textbooks. They are solved by integration. (First order equations have ${\frac {dy}{dx}}$, second order equations have ${\frac {dy}{dx}}$ and ${\frac {d^{2}y}{dx^{2}}}$.)
The arbitrary constant means another piece of information is needed for complete solution, as with the Newton's Law of Cooling and Half Life examples.
Provided all the $x$s can be got to one side and the $y$s to another the equation is separable.
$2y{\frac {{\rm {d}}y}{{\rm {d}}x}}=6x^{2}$
$\int 2y{\rm {d}}y=\int 6x^{2}{\rm {d}}x$
$y^{2}=2x^{3}+c$
This is the general solution.
Typical examples are:
$y=x{\frac {{\rm {d}}y}{{\rm {d}}x}}~~~~~~~~~~~~~~~~~~~~~~~~~\int {\frac {{\rm {d}}y}{y}}=\int {\frac {{\rm {d}}x}{x}}$
$\ln y=\ln x+\ln A~~~~~~(constant)~~~~i.e.~~~~~y=Ax$
by definition of logs.
${\frac {{\rm {d}}y}{{\rm {d}}x}}=ky~~~~~~~~~~~~~~$ (1)
${\rm {k}}xy={\frac {{\rm {d}}y}{{\rm {d}}x}}$
$\int {\frac {{\rm {d}}y}{y}}=\int kx{\rm {d}}x~~~~~~~~~~~~~~$ (2)
$~~~~~~~~\ln y={\frac {1}{2}}kx^{2}+A~~~~~~~$ (3)
This corresponds to:
$y=Be^{{\frac {1}{2}}kx^{2}}$
The Schrödinger equation is a 2nd order differential equation e.g. for the particle in a box
${\frac {\hbar ^{2}}{2m}}{\frac {{\rm {d}}^{2}\Psi }{{\rm {d}}x^{2}}}+E\Psi =0$
It has taken many decades of work to produce computationally efficient solutions of this equation for polyatomic molecules. Essentially one expands in coefficients of the atomic orbitals. Then integrates to make a differential equation a set of numbers, integrals, in a matrix. Matrix algebra then finishes the job and finds a solution by solving the resultant simultaneous equations.

## The calculus of trigonometric functions

There are many different ways of expressing the same thing in trig functions and very often successful integration depends on recognising a trig identity.
$\int {\sin 2xdx}=-{\frac {1}{2}}\cos 2x+c$
but could also be
$\sin ^{2}x~~{\rm {or}}~~-\cos ^{2}x$
(each with an integration constant!).
When applying calculus to these functions it is necessary to spot which is the simplest form for the current manipulation. For integration it often contains a product of a function with its derivative like $2\sin x\cos x$ where integration by substitution is possible.
Where a derivative can be spotted on the numerator and its integral below we will get a $\ln$ function. This is how we integrate $tan$.
$\int {\tan xdx}=\int {\frac {\sin x}{\cos x}}dx=-\ln ~(\cos x)+c$
We can see this function goes to infinity at $\pi /2$ as it should do.

## Integration by rearrangement

Take for example:
$\int {\cos ^{2}xdx}$
Here there is no $\sin$ function producted in with the $\cos$ powers so we cannot use substitution. However there are the two trig identities
$\cos ^{2}\theta +\sin ^{2}\theta =1$
and
$\cos ^{2}\theta -\sin ^{2}\theta =\cos 2\theta$
Using these we have
$\int {\cos ^{2}xdx}=\int {{\frac {1}{2}}{(1+\cos 2x)}}dx$
so we have two simple terms which we can integrate.

## The Maclaurin series

We begin by making the assumption that a function can be approximated by an infinite power series in $x$:
$f(x)=a_{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}+a_{4}x^{4}+\dots$
By differentiating and setting $x=0$ one gets
$f(x)=f(0)+f^{'}(0)x+{\frac {f^{''}(0)}{2!}}x^{2}+{\frac {f^{'''}(0)}{3!}}x^{3}+{\frac {f^{''''}(0)}{4!}}x^{4}+\ldots$
Sin, cos and $e^{x}$ can be expressed by this series approximation
$\sin x=x-{\frac {x^{3}}{3!}}+{\frac {x^{5}}{5!}}-{\frac {x^{7}}{7!}}\dots$
$\cos x=1-{\frac {x^{2}}{2!}}+{\frac {x^{4}}{4!}}-{\frac {x^{6}}{6!}}\dots$
$e^{x}=1+x+{\frac {x^{2}}{2!}}+{\frac {x^{3}}{3!}}+{\frac {x^{4}}{4!}}\dots$
Notice $e^{x}$ also works for negative $x$.
When differentiated or integrated $e^{x}$ generates itself!
When differentiated $\sin x$ generates $\cos x$.
By using series we can convert a complex function into a polynomial, and can use $\sin x=x-x^{3}/6$ for small $x$.
In actual fact the kind of approximation used inside computer programs is more like: ${\frac {ax^{2}+bx+c}{Ax^{2}+Bx+C}}$
These have greater range but are much harder to develop and a bit fiddly on the calculator or to estimate by raw brain power.
We cannot expand $\ln x$ this way because $\ln 0$ is
$-\infty$. However $\ln(1+x)$ can be expanded.
Work out the series for $\ln(1+x)$.

### Factorials

The factorials you have seen in series come from repeated differentiation. $n!$ also has a statistical meaning as it is the number of unique ways you can arrange $n$ objects.
$0!$ is 1 by definition, i.e. the number of different ways you can arrange 0 objects is 1.
In statistical thermodynamics you will come across many factorials in expressions such as: $W={\frac {N!}{n_{0}!n_{1}!n_{2}!...}}$
Factorials rapidly get unreasonably large: 6! = 720, 8! = 40320 but 12! = 479001600 so we need to divide them out into reasonable numbers if possible, so for example $8!/6!=7{\rm {x}}8$.

### Stirling's approximation

Also in statistical thermodynamics you will find Stirling's approximation:
$\ln x!\approx x\ln x-x$
This is proved and discussed in Atkins' Physical Chemistry.
How can you use series to estimate $\ln 2$. Notice that the series for
$\ln(1+x)$ converges extremely slowly. $e^{x}$ is much faster because the
$n!$ denominator becomes large quickly.

### Trigonometric power series

Remember that when you use $\sin x=x$ and $\cos x=1-x^{2}/2$
that x must be in radians.....

## Calculus revision
### Problems

integrate x to the power of x with respect to x
* Differentiate $e^{-t}\cos 2t$, with respect to $t$. (Hint - use the chain rule.)
* Differentiate $x^{2}{(3x+1)}^{4}$. (Chain rule and product rule here.)
* Differentiate $\ln ~(7x^{4})$. (Hint - split it into a sum of logs first.)
* Integrate $\ln ~x$. (Hint - use integration by parts and take the expression to be differentiated as 1.)

### Answers

* It is just $e^{-t}.-2\sin 2t-e^{-t}\cos 2t$. Bring a $-e^{-t}$ out of each term to simplify to $-a(b+c)$.
* $2x{(9x+1)}{(3x+1)}^{3}$.
* $\ln ~7+4\ln ~x$ - therefore it is 4 times the derivative of $\ln ~x$.
* You should get $x\ln ~x-x$ by 1 application of parts.

# Some useful aspects of calculus

* Limits
Many textbooks go through the proper theory of differentiation and integration by using limits. As chemists it is possible to live without knowing this so we might well not have it as an examinable topic. However here is how we differentiate sin from 1st principles.
${\frac {{\rm {d}}y}{{\rm {d}}x}}=\left({\frac {{\delta }y}{{\delta }x}}\right)_{{\rm {limit}}~~~~\delta x\rightarrow 0}$
$={\frac {\sin(x+\delta x)-\sin x}{\delta x}}$
$={\frac {\sin x\cos \delta x+\sin \delta x\cos x-\sin x}{\delta x}}$
$={\frac {\sin x}{\delta x}}-{\frac {\sin x}{\delta x}}+{\frac {\sin \delta x}{\delta x}}\cos x$
As $\sin \delta x=\delta x$ for small $x$ this expression is $\cos x$.
Similarly for $\cos \theta$
${\frac {{\rm {d}}y}{{\rm {d}}\theta }}={\frac {\cos(\theta +\delta \theta )-\cos \theta }{\delta \theta }}$
$={\frac {\cos \theta \cos \delta \theta -sin\theta \sin \delta \theta -\cos \theta }{\delta \theta }}$
$={\frac {\cos \theta }{\delta \theta }}-{\frac {\sin \theta ~~\delta \theta }{\delta \theta }}-{\frac {\cos \theta }{\delta \theta }}$
This is equal to $-\sin \theta$.

## Numerical differentiation

You may be aware that you can fit a quadratic to 3 points, a cubic to 4 points, a quartic to 5 etc. If you differentiate a function numerically by having two values of the function $\delta x$ apart you get an approximation to ${\frac {{\rm {d}}y}{{\rm {d}}x}}$ by constructing a triangle and the gradient is the tangent. There is a forward triangle and a backward triangle depending on the sign of $\delta x$. These are the forward and backward differentiation approximations.
If however you have a central value with a $\delta$ either side you get the central difference formula which is equivalent to fitting a quadratic, and so is second order in the small value of $\delta x$ giving high accuracy compared with drawing a tangent. It is possible to derive this formula by fitting a quadratic and differentiating it to give:
${\frac {{\rm {d}}y}{{\rm {d}}x}}={\frac {f^{+}+f^{-}-2f^{0}}{\delta ^{2}}}$
This is calculated data for the shielding in ppm of the proton in HCl when the bondlength is stretched or compressed by 0.01 of an Angstrom (not the approved unit pm). The total shielding is the sum of two parts, the paramagnetic and the diamagnetic. Notice we have retained a lot of significant figures in this data, always necessary when doing numerical differentiation.
Exercise - use numerical differentiation to calculated $d\sigma /dr$and $d^{2}\sigma /dr^{2}$using a step of 0.01 and also with 0.02. Use 0.01 to calculate $d\sigma (para)/dr$ and $d\sigma (dia)/dr$

## Numerical integration

Wikipedia has explanations of the Trapezium rule and Simpson's Rule. Later you will use computer programs which have more sophisticated versions of these rules called Gaussian quadratures inside them. You will only need to know about these if you do a numerical project later in the course. Chebyshev quadratures are another version of this procedure which are specially optimised for integrating noisy data coming from an experimental source. The mathematical derivation averages rather than amplifies the noise in a clever way.

# Enzyme kinetics

* Mathematics for Chemistry/Enzyme kinetics

# Some mathematical examples applied to chemistry

* Variable names
The ubiquitous $x$ is not always the variable as you will all know by now. One problem dealing with real applications is sorting out which symbols are the variables and which are constants. (If you look very carefully at professionally set equations in text books you should find that there are rules that constants are set in Roman type, i.e. straight letters and variables in italics. Do not rely on this as it is often ignored.)
Here are some examples where the variable is conventionally something other than $x$.
* The Euler angles which are used in rotation are conventionally $\alpha ,\beta$ and $\gamma$ not the more usual angle names $\theta$ and $\phi$. The rotation matrix for the final twist in the commonest Euler definition therefore looks like ${\begin{bmatrix}\cos(\gamma )&\sin(\gamma )&0\\-\sin(\gamma )&\cos(\gamma )&0\\0&0&1\\\end{bmatrix}}$
* The energy transitions in the hydrogen atom which give the Balmer series are given by the formula ${\tilde {\nu }}={\rm {R_{H}}}\left({\frac {1}{2^{2}}}-{\frac {1}{n^{2}}}\right)$ ${\tilde {\nu }}$ is just a single variable for the energy the tilde being a convention used by spectroscopists to say it is wavenumbers, (cm$^{-1}$). The H subscript on ${\rm {R_{H}}}$ has no mathematical meaning. It is the Rydberg constant and is therefore in Roman type. ${\rm {R_{H}}}$ is known very accurately as 109,677.581 cm$^{-1}$. It has actually been known for a substantial fraction of the class to make an error putting this fraction over a common denominator in examination conditions.
* In the theory of light $\omega$ is used for frequency and $t$ not surprisingly for time. Light is an oscillating electric and magnetic field therefore the cosine function is a very good way of describing it. You can also see here the use of complex numbers. Using the real axis of the Argand diagram for the electric field and the imaginary axis for the magnetic field is a very natural description mathematically and maps ideally onto the physical reality. Here we are integrating with respect to $t$ and $\omega$, the operating frequency if it is a laser experiment is a constant, therefore it appears on the denominator in the integration. $\int \cos(\omega t)\sin(\omega t)dt=-{\frac {\cos(\omega )^{2}}{2\,\omega }}+c$ In this case we can see a physical interpretation for the integration constant. It will be a phase factor. If we were dealing with sunlight we might well be integrating a different function over $\omega$ in order to calculate all of the phenomenon which has different strengths at the different light frequencies. Our integration limits would either be from zero to infinity or perhaps over the range of energies which correspond to visible light.
* This example is a laser experiment called Second Harmonic Generation. There is an electric field $F$, frequency $\nu$ and a property constant $\chi _{(2)}$. $\epsilon _{0}$ is a fundamental constant. We have an intense monochromatic laser field fluctuating at the frequency $\nu$, (i.e. a strong light beam from a big laser). $F_{v}\sin(2\pi \nu t)$ Therefore the $F^{2}$ term contributes $\epsilon _{0}\chi _{(2)}F_{v}^{2}\sin ^{2}(2\pi \nu t)$ to the polarization. We know from trigonometric identities that $\sin ^{2}$ can be represented as a cosine of the double angle $\cos(2\theta )=1-2\sin ^{2}\theta$ Therefore the polarization is ${\frac {1}{2}}\epsilon _{0}\chi _{(2)}F_{v}^{2}(1-\cos 4\pi \nu t)$ In this forest of subscripts and Greek letters the important point is that there are two terms contributing to the output coming from $(1-\cos 4\pi \nu t)$ which multiplies the rest of the stuff. In summary we have $A\sin ^{2}(t)$ is equal to $B(1-\cos(2t))$ where everything except the trig(t) and trig(2t) are to some extent unimportant for the phenomenon of doubling the frequency. $\sin$ and $\cos$ differ only in a phase shift so they represent the same physical phenomenon, i.e. light, which has phase. (One of the important properties of laser light is that it is coherent, i.e. it all has the same phase. This is fundamentally embedded in our mathematics.)

## van der Waals Energy

The van der Waals energy between two inert gas atoms can be written simply as a function of $r$
$E_{vdw}={\frac {\rm {A}}{r^{12}}}-{\frac {\rm {B}}{r^{6}}}$
Notice that the $r^{12}$ term is positive corresponding to repulsion. The $r^{6}$ term is the attractive term and is negative corresponding to a reduction in energy. A and B are constants fitted to experimental numbers.
This function is very easy to both differentiate and integrate. Work these out. In a gas simulation you would use the derivative to calculate the forces on the atoms and would integrate Newton's equations to find out where the atoms will be next.
Another potential which is used is:
$E_{vdw}={\rm {A}}e^{-{\rm {B}}r}-{\rm {C}}r^{-6}$
This has 1 more fittable constant. Integrate and differentiate this.
The ${\frac {\rm {A}}{r^{12}}}-{\frac {\rm {B}}{r^{6}}}$ is called a Lennard-Jones potential and is often expressed using the 2 parameters of an energy $\epsilon$ and a distance $\sigma$.
$E(r)=4\epsilon \left({{\left({\frac {\sigma }{r}}\right)}^{12}-{\left({\frac {\sigma }{r}}\right)}^{6}}\right)$
$\epsilon$ is an energy. Set the derivative of this to zero and find out where the van der Waals minimum is. Differentiate again and show that the derivative is positive, therefore the well is a minimum, not a turning point.

## A diatomic potential energy surface

In a diatomic molecule the energy is expanded as the bond stretches in a polynomial. We set $x=(r-r_{0})$. At $r_{0}$ the function is a minimum so there is no $dE/dx$ term.
$E={\frac {1}{2}}k_{harm.}{\frac {{\rm {d}}^{2}E}{{\rm {d}}x^{2}}}+{\frac {1}{6}}k_{anharm.}{\frac {{\rm {d}}^{3}E}{{\rm {d}}x^{3}}}$
Whatever function is chosen to provide the energy setting the 1st derivative to zero will be required to calculate $r_{0}$. The 2nd and 3rd derivatives will then need to be evaluated to give the shape of the potential and hence the infra-red spectrum. $E$ is usually modelled by a very complicated function whose differentiation is not entered into lightly.

## A one-dimensional metal

A one-dimensional metal is modelled by an infinite chain of atoms 150 picometres apart. If the metal is lithium each nucleus has charge 3 and its electrons are modelled by the function
$cos^{2}\left\{{\frac {\pi }{2}}{\frac {r}{150}}\right\}$
which repeats every 150 pm. What constant must this function be multiplied by to ensure there are 3 electrons on each atom? (Hint... integrate $cos^{2}$ between either $-{\frac {\pi }{2}}$ and $+{\frac {\pi }{2}}$ or -75pm and +75pm according to your equation. This integral is a dimensionless number equal to the number of electrons, so we will have to multiply by a normalisation constant.)
Here we have modelled the density of electrons. Later in the second year you will see electronic structure more accurately described by functions for each independent electron called orbitals. These are subject to rigorous mathematical requirements which means they are quite fun to calculate.

## Kepler's Laws

Another physics problem but a good example of a log-log plot is the radius and time period relations of the planets.
This data is dimensionless because we have divided by the time / distance of the earth. We can take logs of both.
| | Mercury | Venus | Earth | Mars | Jupiter | Saturn |
| r | 0.3871 | 0.7233 | 1 | 1.524 | 5.203 | 9.539 |
| T | 0.2408 | 0.6152 | 1 | 1.881 | 11.86 | 29.46 |
| | Mercury | Venus | Earth | Mars | Jupiter | Saturn |
| log$_{10}$r | -0.4122 | | 0 | | | 0.9795 |
| log$_{10}$T | -0.6184 | | 0 | | | 1.4692 |
Try a least squares fit on your spreadsheet program. Using the Earth and Saturn data: (which is extremely bad laboratory practice, to usejust two points from a data set!)
$\Delta ({\log }T)/\Delta ({\log }r)=1.5000359$
so ${\log }T=1.5{\log }r={\log }r^{1.5}$
so $T=r^{3/2}$ and $T^{2}=r^{3}$
This is Kepler's 3rd law. If you use either a least squares fit gradient or the mercury to saturn data you get the same powers. We have got away with not using a full data set because the numbers given are unusually accurate and to some extent tautological, (remember the planets go round in ellipses not circles!).

## Newton's law of cooling

$\theta$ is the excess temperature of a cooling body over room temperature (20$^o$C say). The rate of cooling is proportional to the excess temperature.
$-{\frac {{\rm {d}}\theta }{{\rm {d}}t}}=k\theta$
${\rm {using~~~~~}}{\frac {{\rm {d}}x}{{\rm {d}}y}}={\frac {1}{\frac {{\rm {d}}y}{{\rm {d}}x}}}$
${\frac {{\rm {d}}t}{{\rm {d}}\theta }}=-{\frac {1}{k\theta }}$
This is a differential equation which we integrate with respect to $\theta$ to get
$t=-{\frac {1}{k}}\ln \theta +c$
The water is heated to $80^{o}$C and room temperature is $20^{o}$C. At the beginning $t=0$ and $\theta =60$, so
$0=-{\frac {1}{k}}\ln 60+c$
therefore
$c={\frac {\ln 60}{k}}$
$t=-{\frac {1}{k}}\ln \theta +{\frac {1}{k}}\ln 60$
but $\ln 60-\ln \theta =-\ln {\frac {\theta }{60}}$
so $\ln {\frac {\theta }{60}}=-kt$
After 5 minutes the water has cooled to $70^{o}$C.
so $\ln {\frac {50}{60}}=-5k$ so
$k=-{\frac {1}{5}}\ln {\frac {5}{6}}={\frac {1}{5}}\ln {\frac {6}{5}}<math>.So<math>k=0.0365$
$\ln {\frac {\theta }{60}}=-0.0365t$
${\frac {\theta }{60}}=e^{-0.0365t}$
by the definition of logarithms. This gives the plot of an exponential decay between 80 and 20$^o$C.
So after 10 minutes $t=20+60e^{-0.365}=61.6^{o}$C. After 20 minutes $t=20+60e^{-0.73}=49.9^{o}$C. After 30 minutes $t=20+60e^{-1.10}=40.1^{o}$C.

## Bacterial GrowthBacterial Growth

2 grams of an organism grows by 1/10 gram per day per gram.
${\frac {{\rm {d}}m}{{\rm {d}}t}}={\frac {m}{10}}$
This is a differential equation which is solved by integration thus
$\int {\frac {10}{m}}{\rm {d}}m=\int {{\rm {d}}t}$
$10\ln m=t+c$
$\ln m={\frac {t}{10}}+c$
therefore
$m=e^{c}e^{\frac {t}{10}}$
When $t=0$ we have 2 grams so
$m=2e^{t/10}$
For the sample to double in mass
$4=2e^{t/10}$
$2=e^{t/10}$
$\ln 2={\frac {t}{10}}$
$t=10\ln 2=6.9315{\rm {days}}$
Half life calculations are similar but the exponent is negative.

## Partial fractions for the 2nd order rate equationPartial fractions for the 2nd order rate equation

In chemistry work you will probably be doing the 2nd order rate equation which requires partial fractions in order to do the integrals.
If you remember we have something like
${\frac {1}{(2-x)(3-x)}}={\frac {A}{(2-x)}}+{\frac {B}{(3-x)}}$
Put the right-hand side over a common denominator
${\frac {1}{(2-x)(3-x)}}={\frac {A(3-x)+B(2-x)}{(2-x)(3-x)}}$
This gives $1=3A-Ax+2B-Bx$
By setting x to 3 we get 1 = -B (B=-1). Setting x = 0 and B = -1
Therefore
$\int {\frac {1}{(2-x)(3-x)}}dx=\int {\frac {1}{(2-x)}}-\int {\frac {1}{(3-x)}}dx=\ln(2-x)+\ln(3-x)+c$
noting the sign changes on integrating 1/(2-x) not 1/x.

# Tests and exams

* A possible final test with explanatory notes
This test was once used to monitor the broad learning of university chemists at the end of the 1st year and is intended to check, somewhat lightly, a range of skills in only 50 minutes. It contains a mixture of what are perceived to be both easy and difficult questions so as to give the marker a good idea of the student's algebra skills and even whether they can do the infamous integration by parts.
(1) Solve the following equation for $x$
$x^{2}+2x-15=0$
It factorises with 3 and 5 so : $(x+5)(x-3)=0$ therefore the roots are -5 and +3, not 5 and -3!
(2) Solve the following equation for $x$
$2x^{2}-6x-20=0$
Divide by 2 and get $x^{2}-3x-10=0$.
This factorises with 2 and 5 so : $(x-5)(x+2)=0$ therefore the roots are 5 and -2.
(3) Simplify
$\ln w^{6}-4\ln w$
Firstly $6\ln w-4\ln w$ so it becomes $2\ln w$.
(4) What is
$\log _{2}{\frac {1}{64}}$
64 = 8 x 8 so it also equals $2^{3}$x$2^{3}$ i.e. ${\frac {1}{64}}$ is $2^{-6}$, therefore the answer is -6.
(5) Multiply the two complex numbers
$3+5i~~~~{\rm {and}}~~~~3-5i$
These are complex conjugates so they are $3^{2}$ minus $i^{2}$x$5^{2}$ i.e. plus 25 so the total is 34.
(6) Multiply the two complex numbers
$(5,-2)~~~~{\mathrm {a} nd}~~~~(-5,-2)$
The real part is -25 plus the $4i^{2}$. The cross terms make $-10i$ and $+10i$ so the imaginary part disappears.
(7) Differentiate with respect to $x$:
${\frac {1}{3x^{2}}}-3x^{2}$
Answer: $~~~~~~~-{\frac {2}{3x^{3}}}-6x$
(8) ${\frac {6}{x^{4}}}+3x^{3}$
Answer: $~~~~~~~9{x^{2}}-{\frac {24}{x^{5}}}$
(9) ${\frac {2}{\sqrt {x}}}+2{\sqrt {x}}$
Answer: $~~~~~~{\frac {1}{\sqrt {x}}}-{\frac {1}{\sqrt {x^{3}}}}$
(10) $x^{3}(x-(2x+3)(2x-3))$
Expand out the difference of 2 squares first.....collect and multiply....then just differentiate term by term giving: $~~~~20x^{4}-4x^{3}+27x^{2}$
(11) $3x^{3}\cos 3x$
This needs the product rule.... Factor out the $9x^{2}$ .... $9x^{2}(\cos 3x-x\sin 3x)$
(12) $\ln(1-x)^{2}$
This could be a chain rule problem....... ${\frac {1}{(1-x)^{2}}}.2.(-1).(1-x)$
or you could take the power 2 out of the log and go straight to the same answer with a shorter version of the chain rule to:$-{\frac {2}{(1-x)}}$.
(13) Perform the following integrations:
$\int \left(2\cos ^{2}\theta +2\theta \right){\rm {d}}\theta$
$\cos ^{2}$ must be converted to a double angle form as shown many times.... then all 3 bits are integrated giving .......
$\cos \theta \sin \theta +\theta +\theta ^{2}$
(14) $\int \left(8x^{-3}-{\frac {4}{x}}+{\frac {8}{x^{3}}}\right){\rm {d}}x$
Apart from $-{\frac {4}{x}}$, which goes to $\ln$, this is straightforward polynomial integration. Also there is a nasty trap in that two terms can be telescoped to ${\frac {16}{x^{3}}}$.
$-({\frac {8}{x^{2}}}+4\ln x)$
(15) What is the equation corresponding to the determinant:
${\begin{vmatrix}b&{\frac {1}{\sqrt {2}}}&0\\{\frac {1}{\sqrt {2}}}&b&1\\0&1&b\\\end{vmatrix}}=0$
The first term is $b(b^{2}-1)$ the second $-{\frac {1}{\sqrt {2}}}({\frac {b}{\sqrt {2}}}-0)$ and the 3rd term zero. This adds up to $b^{3}-3/2b$.
(16) What is the general solution of the following differential equation:
${\frac {{\rm {d}}\phi }{{\rm {d}}r}}={\frac {\rm {A}}{r}}$
where A is a constant..
$\theta =A\ln r+k$.
(17) Integrate by parts: $\int x\sin x{\rm {d}}x$
Make $x$ the factor to be differentiated and apply the formula, taking care with the signs... $\sin x-x\cos x$.
(18)The Maclaurin series for which function begins with these terms?
$1+x+x^{2}/2!+x^{3}/3!+x^{4}/4!+\dots$
It is $e^{x}$....
(19)Express
${\frac {x-2}{(x-3)(x+4)}}$ as partial fractions.
It is ..... $~~~~~{\frac {1}{7(x-3)}}+{\frac {6}{7(x+4)}}$
(20) What is $2e^{i4\phi }-\cos 4\phi$ in terms of sin and cos
This is just Euler's equation..... $2e^{i4\phi }=2\cos 4\phi -2i\sin 4\phi$
so one $\cos 4\phi$ disappears to give ... $\cos 4\phi -2i\sin 4\phi$.

### 50 Minute Test II

(1) Simplify $2\ln(1/x^{3})+5\ln x$
(2)What is $\log _{10}{\frac {1}{10~000}}$
(3) Solve the following equation for $t$
$t^{2}-3t-4=0$
(4) Solve the following equation for $w$
$w^{2}+4w-12=0$
(5) Multiply the two complex numbers $(-4,3)~~~~{\rm {and}}~~~~~(-5,2)$
(6) Multiply the two complex numbers $3+2i~~~~{\rm {and}}~~~~~~3-2i$
(7) The Maclaurin series for which function begins with these terms?
$x-x^{3}/6+x^{5}/120+\dots$
(8) Differentiate with respect to $x$:
$x^{3}(2-3x)^{2}$
(9) ${\frac {\sqrt {x}}{2}}-{\frac {\sqrt {3}}{2{\sqrt {x}}}}$
(10)$x^{4}-3x^{2}+{\rm {k}}$
where k is a constant.
(11) ${\frac {2}{3x^{4}}}-{\rm {A}}x^{4}$
where A is a constant.
(12) $3x^{3}e^{3x}$
(13) $\ln(2-x)^{3}$
(14) Perform the following integrations:
$\int \left(3w^{4}-2w^{2}+{\frac {6}{5w^{2}}}\right){\rm {d}}w$
(15) $\int \left(3\cos \theta +\theta \right){\rm {d}}\theta$
(16) What is the equation belonging to the determinant \begin{vmatrix} x & 0 & 0\\ 0 & x & i \\ 0 & i & x \\ \end{vmatrix} = 0</math>
(17) What is the general solution of the following differential equation:
${\frac {{\rm {d}}y}{{\rm {d}}x}}=ky$
(18) Integrate by any appropriate method:
$\int \left(\ln x+{\frac {4}{x}}\right){\rm {d}}x$
(19) Express ${\frac {x+1}{(x-2)(x+2)}}$
as partial fractions.
(20) What is $2e^{i2\phi }+2i\sin 2\phi$ in terms of sin and cos.

## 50 Minute Test III

(1) Solve the following equation for $t$
$t^{2}-4t-12=0$
(2) What is $\log _{4}{\frac {1}{16}}$
(3) The Maclaurin series for which function begins with these terms?
$1-x^{2}/2+x^{4}/24+\dots$---- (4) Differentiate with respect to $x$:
${\frac {5}{x^{2}}}-8{x^{4}}$
(5) ${\frac {4}{\sqrt {x}}}-{{\sqrt {2}}x}$
(6) $5{\sqrt {x}}+{\frac {6}{x^{3}}}$
(7) ${\frac {5}{x^{3}}}-5x^{3}$
(8) $x^{2}(2x^{2}-(5+2x)(5-2x))$
(9) $2x^{2}\sin x$
(10) Multiply the two complex numbers $(2,3)~~~~~~{\rm {and}}~~~~~~(2,-3)$
(11) Multiply the two complex numbers $3-i~~~~~{\rm {and}}~~~~-3+i$
(12) Perform the following integrations:
$\int \left({\frac {1}{3x}}+{\frac {1}{3x^{2}}}-5x^{-6}\right){\rm {d}}x$
(13)
$\int \left(6x^{-2}+{\frac {2}{x}}-{\frac {8}{x^{2}}}\right){\rm {d}}x$
(14) $\int \left(\cos ^{2}\theta +\theta \right){\rm {d}}\theta$
(15) $\int \left(\sin ^{3}\theta \cos \theta +2\theta \right){\rm {d}}\theta$
(16) Integrate by parts: $\int 2x\cos x{\rm {d}}x$
(17) What is the equation corresponding to the determinant:
${\begin{vmatrix}x&-1&0\\-1&x&0\\0&0&x\\\end{vmatrix}}=0$
(18) Express ${\frac {x-1}{(x+3)(x-4)}}$ as partial fractions.
(19)What is the general solution of the following differential equation:
${\frac {{\rm {d}}\theta }{{\rm {d}}r}}={\frac {r}{A}}$
(20) What is $e^{i2\phi }-2i\sin 2\phi$ in terms of sin and cos.

# Further reading

* Further reading

### Books

* Paul Monk, Maths for Chemistry: A Chemist's Toolkit of Calculations, (Oxford, 2006), ISBN 978-0199277414.
* Bostock and Chandler, Core Maths for A-level, Third Edition, (Nelson Thornes, 2000), ISBN 978-0748755097.
* M. C. R. Cockett and G. Doggett, Maths for Chemists: Numbers, Functions and Calculus v. 1, (Royal Society of Chemistry, London, 2003), ISBN 978-0854046775
* M. C. R. Cockett and G. Doggett, Maths for Chemists: Power Series Complex Numbers and Linear Algebra v. 2, (Royal Society of Chemistry, London, 2003), ISBN 978-0854044955
* G. Currell and T. Dowman,Mathematics and Statistics for Science, (Wiley, 2005), ISBN 978-0470022290.
* Stephen K. Scott, Beginning Maths for Chemistry, (Oxford, 1995), ISBN 978-0198559306
* Peter Tebbutt, Basic Mathematics for Chemists, 2nd edition, (Wiley, 1994), ISBN 978-0471972839

### Online resources

There is much useful free material relevant to this book, including downloadable DVDs, funded by the HEFCE Fund for the Development of Teaching & Learning and the Gatsby Technical Education Project in association with the Higher Education Academy at Math Tutor.
Discover Maths for Chemists from the Royal Society of Chemistry is a a one-stop site designed by chemists for chemists. This new free-to-use site brings together all the best resources to help you combine maths and chemistry.
Maths for Chemistry is an online resource providing interactive context-based resources which explain how various aspects of maths can be applied to chemistry. There are quizzes and downloadable files to check understanding.