# Mathematics for Chemistry/Number theory
## 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.