# Mathematics for Chemistry/Some Useful Aspects of Calculus

## Limits[edit | edit source]

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.

As for small this expression is .

Similarly for

This is equal to .

## Numerical differentiation[edit | edit source]

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 apart you get an approximation to by constructing a triangle and the gradient is the tangent. There is a forward triangle and a backward triangle depending on the sign of . These are the forward and backward differentiation approximations.

If however you have a central value with a 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 giving high accuracy compared with drawing a tangent. It is possible to derive this formula by fitting a quadratic and differentiating it to give:

HCl r-0.02 sigma (iso) 32.606716 142.905788 -110.299071 HCl r-0.01 sigma (iso) 32.427188 142.364814 -109.937626 HCl r0 Total shielding: paramagnetic : diamagnetic sigma (iso) 32.249753 141.827855 -109.578102 HCl r+0.01 sigma (iso) 32.074384 141.294870 -109.220487 HCl r+0.02 sigma (iso) 31.901050 140.765819 -108.864769

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 and using a step of 0.01 and also with 0.02. Use 0.01 to calculate and

## Numerical integration[edit | edit source]

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.