Prerna Bansal Maths in Chemistry
Prerna Bansal Maths in Chemistry
Prerna Bansal Maths in Chemistry
Maths in Chemistry
Also of Interest
Molecular Symmetry and Group Theory.
Approaches in Spectroscopy and Chemical Reactions
R. C. Maurya, J.M. Mir,
ISBN ----, e-ISBN ----
Elemental Analysis.
An Introduction to Modern Spectrometric Techniques
Gerhard Schlemmer, Lieve Balcaen, José Luis Todolí, Michael
W. Hinds,
ISBN ----, e-ISBN ----
Applied Electrochemistry
Krystyna Jackowska, Paweł Krysiński,
ISBN ----, e-ISBN ----
Organic Chemistry.
Fundamentals and Concepts
John M. McIntosh,
ISBN ----, e-ISBN ----
Prerna Bansal
Maths in
Chemistry
ISBN 978-3-11-069531-1
e-ISBN (PDF) 978-3-11-069532-8
e-ISBN (EPUB) 978-3-11-069548-9
www.degruyter.com
Dedicated
To
My Parents
Acknowledgement
I owe this book to all those who encouraged me in some way or another to write
this book. The source of inspiration for writing this book came from my students.
I entirely dedicate this book to my beloved Parents who love me immensely and
unconditionally and without whom I would have not been able to start writing a
book in the first place. They have been a source of constant strength, support and
love in difficult times. I am highly indebted for their constant patience for bearing
with me while I was writing this book.
I would also like to express my heartfelt gratitude to my brother Mayank for
putting up with me when I used to make odd asks. I also owe a special thanks to
my two lovelies Divit and Ishaani for their beautiful smiles and laughters which
used to melt my stress in a blink. This acknowledgement would have been incom-
plete without mentioning my beautiful sister Sonia for her excellent advice at all
times when when she was busy with her Ph.D work.
I express my gratitude to all my students who believed in me and kept asking
me to write a book which can provide all the mentioned topics under a single wing.
I would also like to express my sincere gratitude to all my teachers who taught me
and inspired me to be the one.
I also express a sincere word of thanks to my Husband Anup Goel who kept
boosting my morale during the final stages of this manuscript completion for when
I met him first. I really owe him for his constant support and encouragement during
the entire process of its proof reading.
I also owe a word of thanks to my new family including my Father-in-law,
Mother-in-law and my Brother-in-law for their support during the proof reading of
this book.
I express my sincere thanks to the publisher De Gruyter’s for their cooperation
and processing of this manuscript. I also want to express a special word of thanks
to Emma Svensson, Ute Skambraks and Dipti Dange for their constant help and
support.
Above all, I would like to say thanks to Thakurji for providing me courage, mo-
tivation, strength and above all, his grace for giving me enough courage for writing
this book.
July 2020
https://doi.org/10.1515/9783110695328-202
Contents
Acknowledgement VII
Chapter 1
Units and measurements 1
1.1 Introduction 1
1.2 Basic arithmetic operations 1
1.3 Hierarchy of operations 2
1.4 Classification of unit system 3
1.4.1 Metric system of units 3
1.4.2 Classification of metric system of units 4
1.5 Definition of base units 5
1.6 Interconversion of units 8
1.7 Significant figures 9
1.8 Rules for performing arithmetic operations 10
1.8.1 Addition and subtraction 10
1.8.2 Multiplication and division 11
1.8.3 Mixed mathematical operations 12
1.9 Rounding off significant figures 13
1.10 Problems for practice 14
Chapter 2
Uncertainties and errors 17
2.1 Introduction 17
2.2 Absolute and relative uncertainty 20
2.3 Propagation of uncertainty 21
2.4 Rounding off uncertainties 28
2.5 Classification of errors 28
2.6 Problems for practice 29
Chapter 3
Some mathematical functions 31
3.1 Introduction 31
3.2 Classification of functions 31
3.2.1 Linear function 31
3.2.2 Exponential 32
3.2.3 Logarithmic function 34
3.2.4 Polynomials 36
3.2.5 Power function 37
3.2.6 Circle 37
3.2.7 Rational number 38
X Contents
Chapter 4
Descriptive statistics 49
4.1 Introduction 50
4.2 Mean 50
4.2.1 Arithmetic mean 51
4.2.2 Weighted mean 51
4.2.3 Geometric mean 51
4.2.4 Harmonic mean 52
4.3 Median 52
4.4 Mode 53
4.5 Standard deviation 53
4.6 Variance 54
4.7 Coefficient of variation 54
4.8 Data analysis 57
4.8.1 Q-test 57
4.8.2 Confidence limit 59
4.8.3 t-Test 59
4.8.4 F-test 62
4.9 Distribution of errors 65
4.9.1 Gaussian distribution 65
4.9.2 Binomial distribution 66
4.9.3 Poisson’s distribution 67
4.10 Statistical tools using spreadsheets 67
4.11 Problems for practice 70
Chapter 5
Numerical curve fitting 71
5.1 Introduction 71
5.2 Correlation 71
5.2.1 Pearson correlation coefficient 72
5.2.2 Spearman’s rank correlation coefficient 72
5.3 Regression 73
Contents XI
Chapter 6
Numerical integration 97
6.1 Introduction 97
6.2 Newton–Cotes formula 97
6.2.1 Riemann sum 98
6.2.2 Trapezoidal rule 100
6.2.2.1 Error of trapezoidal rule 105
6.2.3 Simpson’s 1/3rd rule 106
6.2.3.1 Composite integral Simpson’s rule 108
6.2.4 Simpson’s 3/8 rule 109
6.2.5 Boole’s rule 110
6.3 Exercises for practice 115
Chapter 7
Differential equations 117
7.1 Introduction 117
7.2 Euler’s method 118
7.3 Runge–Kutta method 121
7.3.1 RK 2 or predictor–corrector method 121
7.3.2 RK3 124
7.3.3 RK4 124
7.4 Problems for practice 129
Chapter 8
Numerical differentiation 131
8.1 Introduction 131
8.2 Derivatives using Newton’s forward interpolation polynomial 134
8.3 Derivatives using Newton’s backward interpolating polynomial 137
8.4 Derivatives using Stirling interpolating polynomial 139
8.5 Newton’s divided difference polynomial 142
8.6 Lagrange’s polynomial 144
8.7 Richardson’s extrapolation 147
8.8 Problems for practice 149
XII Contents
Chapter 9
Numerical root-finding methods 151
9.1 Introduction 151
9.2 Newton–Raphson method 151
9.3 Iteration method 156
9.4 Binary bisection method 162
9.5 Secant method 165
9.6 Regula-Falsi method 169
9.7 Problems for practice 174
Appendix A 175
Index 181
Chapter 1
Units and measurements
1.1 Introduction
p = nRT=V (1:1)
Division A A B
A B or ≠
B B A
https://doi.org/10.1515/9783110695328-001
2 Chapter 1 Units and measurements
Some of the equations used in physical chemistry involving these operations are
listed below:
Before performing arithmetic operations, there are some set of rules that should be
followed. In conventional mathematics, BODMAS rule is used. They are also called
operator precedence or rules of precedence or order of operations. A general
method of remembering them is used in different places. For example, “PEMDAS”
is the acronym used in the United States. The order of operations is as follows:
(1) Parentheses
(2) Exponential
(3) Multiplication
(4) Division
(5) Addition
(6) Subtraction
a. 2 × 3 + 4 = 6 + 4 = 10
But 2 × ð3 + 4Þ = 2 × 7 = 14
b. 5 + 41=2 = 5 + 2 = 7
But ð5 + 4Þ1=2 = 3
c. ð4 × 8Þ2 = 322 = 16. But ð4 × 62Þ = 242 = 12
1.4 Classification of unit system 3
Index rule
According to the index rule, index denotes the times a number has to be multiplied by itself, where
index is a number which is raised to a power. The rule can be illustrated below.
(a) ax × ay = ax + y e.g. 23 × 25 = 28
(b) ax = ay = ax − y e.g. 25 =23 = 22
(c) ðax Þy = ðay Þx = axy e.g. ð23 Þ2 = 64
(d) a − x = 1=ax e.g. ð2Þ − 1 = 1=2 = 0.5
(e) ðabÞx = ax × bx e.g. ð2 × 3Þ4 = 24 × 34 = 1296
ax ax 24 24
(f) b = bx e.g. 3 = 34
(g) ða + bÞ ≠ a + bn e.g. ð2 + 3Þ4 = 625 while 24 + 34 = 97. Hence, both are not equal.
n n
The history of unit systems begins with the British Imperial System of units, fol-
lowed by US Customary and International System of Units (metric system). Of all,
the metric system of units was a more coherent system of units since it was easy to
use and one may not use extra conversion factors that are not available in the
equation.
The metric system is the most common and internationally accepted decimalized
system of measurement also known as SI unit system. It is classified in terms of
base units (fundamental) and derived units. These units can be used to define any
other physical quantities. The metric system of units is easy to use with the help of
multiples and fractions. In fact, the earlier used US Customary unit system and
British Imperial unit system are defined using the metric unit system.
The very idea of introducing the metric system was to have a unit system derivable
from an unchanging phenomenon but practical limitations made the use of artefacts
(prototype for metre and kilogram) indispensable. The multiples and submultiples of
metric units in terms of powers of ten make them conveniently useful with prefixes in
the names. Metric system exists in various forms with the option of choosing different
base units. CGS (centimetre–gram–second) and MKS (metre–kilogram–second) are
also known as metric system. FPS (foot–pound–second) is known as British System. SI
unit system is more precise form of MKS system. Metric units are widely used and ac-
cepted system of units in science.
4 Chapter 1 Units and measurements
All physical quantities can be expressed in terms of these seven base quantities.
Table 1.2 lists the seven base units along with their standard definition and Table 1.3
represents some derived units using base units.
Table 1.2: Base units for seven physical quantities with SI units.
Length L Metre m
Mass M Kilogram kg
Time t Second s
Temperature T Kelvin K
The base units are defined in terms of constants like speed of light in vacuum (c),
charge of the electron or those that can be measured accurately. The new redefined
units have replaced the artefact unit system with more coherent units of measure-
ments. The earlier used prototype of weight (platinum–iridium alloy) did not al-
ways weigh the same. Even when the piece was inside three bell jars, it gets dirty
and rusty. Cleaning the dust would change the mass of the prototype. Hence, it was
not accurate. The redefined system allows to measure mass directly at any scale
and will prove to be a boon to the scientists.
The following physical constants have been redefined in SI unit system:
(1) The Planck’s constant
(2) The Avogadro’s constant (NA)
(3) The Boltzmann’s constant (k)
(4) The elementary electric charge (e)
(5) The speed of light (c)
(6) The luminous efficacy of a defined visible radiation (Kcd)
(7) The caesium hyperfine frequency (Δνcs)
6 Chapter 1 Units and measurements
In November 2018, the changes in the units for four units were approved by General
Conference on Weights and Measurements. In May 2019, four of the seven SI base
units were redefined, which are kilogram, ampere, kelvin and mole by setting the
exact value to the Planck’s constant (h), Avogadro’s constant (NA), Boltzmann’s
constant (k) and the elementary electric charge (e), respectively. The other three
units, that is, second, metre and candela, were already defined by the physical con-
stants. All the seven base units that are redefined can be explained further.
(1) Length: Its base unit is metre. Earlier, the definition of metre was based on
wavelength of spectral line of krypton-86 and was defined as the distance trav-
elled by light in a vacuum over a time interval of 1/299,792,458 of a second. The
current definition is based on taking fixed numerical value of speed of light, c,
in vacuum to be 299,792,458 m s−1.
(2) Mass: The base unit of mass is kilogram (kg). Earlier, it was defined as the mass
of the shiny piece of platinum–iridium alloy held in Bureau International des
Poids et Mesures in France. It used to be the international prototype or artefact of
the kilogram. The new definition of kilogram involves accurate weighing ma-
chines called “kibble balance” that uses Planck’s constant to measure mass pre-
cisely by using electromagnetic force. The Planck’s constant which has been
measured in recent years with precision is 6.62607015 × 10–34 kg m2 s−1.
This new SI system will bring more accuracy in many fields, including bio-
technology, manufacturing, trade and human health.
(3) Time: The base unit for time is second. A second is defined as the duration of
9,192,631,770 periods of the radiation corresponding to the transition between
two hyperfine levels of the ground state of the caesium-133 atom. In the im-
proved definition, the numerical value of the caesium frequency Δνcs is fixed.
(4) Current: The base unit for current is ampere. Ampere is defined as the amount
of electric charge passing through an electric circuit per unit time but the pre-
vailing definition defined it as the flow of 1/1.602176634 × 10−19 times the ele-
mentary charge, e, per second.
(5) Temperature: The base unit of temperature is Kelvin. The previous definition
of kelvin was defined as the fraction 1/273.16 of the thermodynamic tempera-
ture of the triple point of water, that is, 0.01 °C or 273.16 K while the current
definition involves fixing the numerical value of Boltzmann’s constant, k, to be
1.38 × 10−23 J K−1 making sure that the triple point of water temperature remains
the same. One kelvin is equal to change in temperature T that results in thermal
energy kT by 1.380649 × 10−23 JK-1 where J K−1 = kg m2 s−2 K−1 where kilogram,
metre and second are defined according to the improved definition. Now, since
kelvin is derived from physical constant rather than experimental condition
(triple point of water), it is more reliable and stable.
1.5 Definition of base units 7
(6) Amount of substance: The base unit of amount is mole. It was defined as the
number of atoms in 12 g of carbon 12C (the isotope of carbon with relative
atomic mass 12 Da). The revised definition is the amount of substance of exactly
6.02214076 × 1023 elementary particles (atoms, molecules or ions).
(7) Luminous intensity: Its base unit is candela (cd). It is defined as the luminous
intensity or electromagnetic field of frequency 540 × 1012 Hz or 540 terahertz
emitted by a source in a specified direction with 1/683 watt per steradian.
Luminous intensity measures the visual intensity of any light source and is the
only unit that a human eye can measure. It reflects the brightness or intensity
of the light and its direction. Since earlier times, candles were used to be the
source of light; hence, the name is derived from the candle, so candela being
the unit of luminous intensity.
Some physical quantities are dimensionless since they have the ratio of quantities
with same dimension. For example, mole fraction, relative pressure, relative mass
and so on. Practically, there is no considerable effect on daily life measurement. It
will only matter if the measurements are below 1 kg or while measuring very small
mass. The only advantage now is that the scientist would now be able to measure
them at any place, time or scale. Hence, more accurate measurements would be
made.
There are some experiments where the measurement of the physical quantity in one
type of unit is more preferable than in other. The process of conversion depends on
the situation and intent of purpose for which conversion is required. For instance,
the SI unit for potential difference is volt, but while performing potentiometric titra-
tions, the preferred unit is mV since the amount of potential difference is very
small. In such cases, one needs to carry out the interconversion of unit into more
accepted form, that is, SI unit. Similarly, if one wants to measure the length of a
pencil, then some measurements if made in metre (SI unit) would introduce more
error and approximation, rather if the measurement is made in cm (CGS unit), then
converting into metre would give more accurate result. There are many multiples
and submultiples of metre, some are millimetre, micrometre, centimetre, kilometre
and so on. They have prefixes attached to the SI units (Appendix A1). On the basis
of utility, one may use the conversion factor to convert the measured unit into more
preferred unit. A conversion also depends on the precision and accuracy of mea-
surement with which comes certain amount of associated uncertainty of measure-
ment. Conversion should neither increase nor decrease the precision of the first
measurement. A table of different relationships and conversion factors for some
units is given at the end of the book (Appendix A1). The conversion from one unit
form to another unit form can be done by simple method called factor label
method. Factor label method is an elementary method used to convert a quantity
measured in one unit to another unit system by multiplying the conversion factor.
0.07912m = 79.12mm
When the physical quantity is multiplied by the conversion factor ratio, then one unit in the
denominator is cancelled out by unit in numerator leaving only one unit.
1.7 Significant figures 9
While making measurements, the instrument measures the physical quantity which
is accurate up to a certain limit. The digits in the measurement up to which the
measurement is certain are called significant figures. The number of digits implies
the certainty or confidence up to which a measurement is made. More significant
digits imply greater precision.
Certain rules to be followed to determine the significant figure in any measure-
ments are listed as follows.
1. All non-zeroes in a measurement are significant.
For example, mass of a metal piece is 3.15 g. Here, there are three significant
figures.
2. All the zeroes between two non-zero digits are significant.
For example, in numbers 0.00000208, 0.2008 and 208.00, there are three, four
and five significant numbers, respectively.
3. A measurement which is less than one, all zeros to the right of a decimal
point and to the left of a non-zero digit are never significant.
For example, in 0.0234 g, number of zero after decimal and before 2 is not sig-
nificant. There are three significant digits: 2, 3 and 4.
10 Chapter 1 Units and measurements
4. (a) All zeroes on the right of the last non-zero digit with the decimal point
are significant.
For example, in a number “2350.”, there are four significant digits.
(b) All zeroes on the right of the last non-zero digit with no decimal point
are insignificant.
For example, in the number 2350, there are three significant figures.
(c) The trailing zeroes to the right of a decimal point are significant, if they
are not followed by a non-zero digit.
For example, in number 53.00, there are four significant digits (5, 3, 0 and 0)
5. The exact numbers have infinite number of significant figures.
For example, 3 m = 3.00 m = 3.0000 m = 3.00000000000 m
6. When the number is written in scientific notation as a × bn, then the num-
ber of significant figures are counted in a.
For example, we have the number 0.000521, which we can write in scientific no-
tation as 5.21 × 10−4. Therefore, here the number of significant digit is three (5, 2
and 1). The 10 and –4 do not hold any place in significant figures. Changing any
number to scientific notation may vary with the number of significant figures.
For example: 3600
3600 = 2 s.f.
3600. = 4 s.f.
3.60 × 103 = 3 s.f.
Atlantic–Pacific rule
If a number has a decimal point, then the trailing zeroes on the Pacific/left side are insignificant,
and if the number does not have a decimal point, then the zeroes to the Atlantic/right side are
insignificant (since Pacific ocean is on left and Atlantic is on right side of the United States).
For example, 0.00837 has 3 s.f. (8, 3 and 7) while 3500 has 2 s.f. (3 and 5).
The significant figure while performing addition and subtraction depends on the
number of decimal places as the number with least precise value.
For example, 63.152 + 5.6 = 68.752
Instead, one should write the answer as 68.7, since the least precise value (5.6)
has one decimal place.
1.8 Rules for performing arithmetic operations 11
Example 6: 0.241 g of NaOH is dissolved in 142.0 g of water. What is the mass of the solution?
Solution: We can find the mass of solution as 142.0 g + 0.241 g = 142.241 g.
Since the least precise measurement has 1 decimal place (i.e. 142.0), then the answer should be
142.2 g (by rounding off).
The same rule applies while performing multiplication and division, that is, the
number of significant figures in the result would be the same as the least precise
number in the calculation.
Example 10: 19.3 mL of 0.05721 N NaOH was used to neutralize the given 20.0 mL HCl solution.
Calculate the normality of HCl solution used.
Solution: Here the normality of NaOH has 4 s.f. but the other volume values have 3 s.f., so the final
answer should also have least number of s.f., that is, 3. We know that N1V1 = N2V2 so
While calculating the logarithm, the mantissa of the logarithm should contain the
same number of significant digits as there are in the number for which the loga-
rithm is calculated.
12 Chapter 1 Units and measurements
For example, log(2.00 × 105) = 5.3010299956. Since the number 2.00 × 105 has
3 s.f., the mantissa should also have 3 s.f. Hence, the answer should be 5.301.
For example, log(2 × 104) = 4.3010299956. Here, 2 × 104 has 1 s.f. so answer
should be 4.3.
Example 11: The rate constant at two temperatures 289 and 333 K are 5.03 × 10−2 and 6.71 mol−1dm3 s−1,
respectively. Calculate the value of activation energy using the expression
k333 Ea 1 1
ln = − (1:8)
k298 R 289 333
Solution: Both the constants have 3 s.f., so the ratio of k2/k1 should also have 3 s.f. as k2/k1 =
133.39. Since the rule says that the mantissa should have as much s.f. as in the number itself for
which the logarithm is calculated so the number of s.f. should be 3 in mantissa as ln k = 4.893,
which gives Ea = 88, 982.709 Jmol − 1
While calculating antilog of a number, the result should have the same number of
s.f. as the mantissa in the logarithm.
For example, antilog(0.477) = 2.99916251, which should be rounded off to 3.00
For example, antilog(0.47) = 2.951209226, which should be rounded off to 3.0
ln k = ln A − Ea =RT (1:9)
When mixed operations are involved, calculation should be done using more number
of significant figures than will be significant to arrive at a value. Then, go back and
retrace each step for how many significant figures should have been left up to the
final result based on the standard convention. Successive rounding can magnify the
inaccuracies. Hence, when doing rounding at each step, it is always advisable to re-
tain one extra insignificant figure than can be justified to avoid error. The final an-
swer is then rounded off to the desired number of significant figures. For instance,
X = 0.14931016
First, 4.354 + 0.0026 = 4.357 (since the least precise value has accuracy of 3 decimal
places so should be in the answer (instead of 4.3566)).
Second, 4.357/28.5 = 0.153 (since the least precise number has 3 significant fig-
ures instead of 0.152877192).
Lastly, 0.153 – 0.003553 = 0.149 (since in subtraction, the least precise number
has three decimal places, that is, 0.153 (instead of 0.149447)).
The value obtained while keeping all figures was 0.14931016 which if rounded
off to have three significant figures is 0.150 or 1.50 × 10−1, which is the final answer.
Rounding off the numbers is done to remove insignificant figures by replacing them
with insignificant zeroes. If the insignificant digit is 0, 1, 2, 3 and 4, then while
rounding off, one must underestimate the value. The value of the last significant
figure remains unchanged. If it is 5, 6, 7, 8 and 9, then overestimation is done and 1
is added to the last significant digit.
2.1 Introduction
The physical quantity measurements are always accompanied by error since nothing
can ever be measured with certainty. This uncertainty is referred to as Error. Error is a
mathematical representation of the uncertainty. Error should not be confused with mis-
take. Mistake can be corrected (like mistake during calculation or solution preparation
or wrong reading of the value, etc.). Error analysis facilitates the identification, quantifi-
cation and elimination of error and makes the methods of experiment more refined and
robust. During approximation or rounding off, a large amount of error is introduced.
Hence, knowing the nature of error as well as the quantification of error helps to inter-
pret the method in a more robust manner. Moreover, if the errors are more than allowed
limits, then we would know whether to keep or get rid of the particular method or ob-
servations. This error analysis is more important when we talk about numerical methods
and computational calculations that require more accuracy and precision.
Errors are broadly classified into two categories as systematic errors (determi-
nate errors) and random errors (indeterminate errors). Systematic errors can be
identified and corrected while random errors cannot be eliminated.
Uncertainty refers to the doubt around the measurement. Even with well-calibrated
instruments (thermometer, rulers, clocks, etc.), when measurements are taken, there is
always a margin of doubt. Uncertainty is the range of possible values that any physical
quantity can take during measurement. When experimental results are reported, the
true value is not reported but a range of values are reported and then we should find if
the accepted value falls under the range of uncertainty values.
There are many factors that influence the measurements including tempera-
ture, pressure, humidity and calibration. When multiple measurements are made
for the same physical quantity, then a slightly different measurement value is ob-
tained each time. In fact, uncertainty adds reliability to the results in a particular
range. To quantify the doubt, one must know two terms, namely, the interval and
the confidence limit. The interval depicts the width of margin or doubt, while confi-
dence level indicates how sure the true value is within that interval or margin. The
best way to show the uncertainty is
For instance, a copper wire is 3 m long with an uncertainty of 15 cm (0.15 m), which
can be represented as
https://doi.org/10.1515/9783110695328-002
18 Chapter 2 Uncertainties and errors
Here the length of copper wire is reported as 3 ± 0.15 m at the 95% confidence
level. It implies that there is 95% certainty that copper wire is between 2.85 and
3.15 m long. In fact when in laboratory, the students take the readings, they do not
calculate the percent error, but the percent uncertainty. The error is calculated
when the true value is known and it is almost next to impossible to know the actual
true value.
Uncertainty is important as one wants to improve the quality of measurements.
This is why while making calibration or performing a test, the uncertainty must be
mentioned as a measure of success or failure. To avoid uncertainty in measurements,
the measurement should be taken at least thrice. So, the error that would have gone
unnoticed in the first measurement may be noticed in the next two measurements.
To further corroborate the authenticity of measurements, statistical calculations
may be carried out on the measurements to account for the error and uncertainty in
the data. So, if a set of measurements is taken, then average of all the measure-
ments will give the estimate of true value. More number of readings will give better
average, which would be more close to the true value. When the repeated measure-
ments are different, there is a lot of uncertainty involved for that physical quantity,
(the spread is large) but there is a possibility that average of all the measurement
will give a best estimate of the true value. A large spread implies that there is a
huge difference between the set of readings for the same experiment. The standard
way to quantify spread is standard deviation. It tells how an observation deviates
from the average or mean value. Standard deviation is often greater than average
deviation and is mostly used by statisticians and scientists.
Consider weighing a piece of copper alloy, where the weighing was repeated
thrice and each time a different mass was obtained, for example, 1.213, 1.275 and
1.165 g, respectively. The average for the above measurements is 1.217:
Hence,
0.038
Percent average deviation = × 100 = 3.12% (2:6)
1.217
Hence, 3.12% is the percent average deviation but often standard deviation is used
to depict uncertainties. As standard deviation is
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Pn 2
i = 1 ðxi − xÞ
s= (2:7)
n−1
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
ð0.004Þ2 + ð0.058Þ2 + ð0.052Þ2
s= (2:8)
3−1
s = 0.055
Therefore, 5.5% is the percent standard deviation, which is a more standard and
common practice to denote deviations.
Systematic errors
Systematic errors are the errors that can be identified for their source and, hence, can be eliminated.
Systematic errors often lead to measured value, either very high or very low. They are also called
“zero error”, which may be positive or negative. Further, they can be classified into four types:
(1) Instrumental error: This type of error originates due to poor calibration, faulty part of instru-
ment or electricity fluctuation. A poorly calibrated instrument may show zero error due to envi-
ronmental factor which can be corrected by calibrating the instrument. For example, a poorly
calibrated thermometer when immersed in boiling water reads 103 °C. Different pipettes and
volumetric flasks hold different volumes. Hence, such type of error will only magnify the error
in further readings.
(2) Observational error or personal error: These types of errors arise due to personal drawback of
observation. These errors may include mishandling of experimental apparatus, improper and
careless weighing, vagueness in taking readings, poor judgement or prejudice or color ambi-
guity including parallax in reading a metre scale, reading upper or lower meniscus. It can be
corrected by proper training and experience.
(3) Theoretical error: For the sake of simplification, if one approximates a condition in the model
system, then such error arises. For example, if one assumes atmospheric pressure does not
change the readings of temperature, then it will definitely introduce the error in the readings.
(4) Methodic error: This kind of error originates when the system, either chemical or physical,
behaves erratically. For example, the occurrence of side reaction (e.g. co-precipitation), vola-
tility, insolubility of precipitates, decomposition of species, unexpected rate of reaction (slow
or fast), instability of reaction species and so on. It is the most serious of all errors. It can be
corrected by developing proper methods.
All the above systematic errors once identified can be eliminated and the results will improve.
Random errors
Random errors are also called as indeterminate errors They may occur due to sudden change in
experimental conditions like change in temperature, humidity, current and so on.The sources of
20 Chapter 2 Uncertainties and errors
such errors are unidentified and, hence, they are difficult or impossible to eliminate. They may also
occur due to the inability of analyst to reproduce the same readings. Random errors follow
Gaussian distribution. For example, if we have measured the weight of a ball four times using the
same measuring scale and it turns out to be 20.23, 20.25, 20.27 and 20.26 g. So, to avoid this error,
more number of readings could be taken and then an average of all observation is calculated.
Here, it should be pointed out that accuracy is not the same as certainty. While ac-
curacy is qualitative, uncertainty is quantitative. The plus–minus sign is used when
discussing errors and uncertainties.
Likewise, error should not be confused with uncertainty. While error is the difference
between the true value and measured value, uncertainty is the quantification of
doubt around the measurement. Any error due to known sources could be corrected
but when the source, is unknown, such errors are said to be uncertainty. One may
never make a perfect measurement which gives a true value of a physical quantity;
hence, measurements are often estimates of true value. Therefore, what scientists are
interested in experiments is uncertainty.
2.3 Propagation of uncertainty 21
Systematic errors can be corrected if one knows the source while random errors can-
not be corrected. Since calculations involve numbers (of physical quantity) that have
certain degree of uncertainty (random error) associated with them, the uncertainties
can also be combined if they have the same units. For example, while measuring
mass, the uncertainty should also be mentioned in units of mass. This procedure of
calculating one quantity using multiple quantities is also called data reduction. These
calculations involve basic arithmetic operations like addition, subtraction, division
and multiplication. This uncertainty may then be carried forward to the final result of
the calculations and hence is called propagation of uncertainty. These are also called
combining uncertainties.
The propagation of uncertainties involving arithmetic operations follow these
simple rules.
Example 1: The three values of a, b and c are given as 2.16 ± 0.02, 1.46 ± 0.15 and 4.67 ± 0.04, re-
spectively. Evaluate variable d which is given as
e = 0.15
This is known as absolute uncertainty. Hence, the final result would be d = 5.07 ± 0.15.
Likewise, percent uncertainty can be calculated as
0.15
Percent uncertainty = × 100 (2:12)
5.07
Percent uncertainty = 3.0%
Example 2: The initial and final readings of a burette during a titration are 16.85(±0.03) mL and
0.03(±0.03) mL, respectively. What is the uncertainty in the volume delivered?
Solution: As volume delivered is the difference between final reading and initial reading, the vol-
ume transferred is
e = 0.042
Here, although the uncertainty associated with each reading is 0.03, the resultant uncertainty in
delivering the volume is 0.04.
(b) Also, the experimental measurements are round off to the same decimal place as the uncer-
tainty. For example
(c) The measurement uncertainties should overlap. Only if the difference is not very large, the
measurements are considered real; else, they are considered to be sloppy observations.
For example, the measurements 0.56 ± 0.02 and 0.68 ± 0.02 do not agree since their spread
does not overlap at all (maximum values and minimum values for two measurements are (0.58 &
0.54) and (0.70 & 0.66), respectively), while the measurements 0.56 ± 0.06 and 0.68 ± 0.07 do
overlap. Here the second set measurement is real and acceptable.
(d) The result should have same number of significant figures as that of the quantity which is less
precise. For instance, area of circle is given by A = πr2, where π has many number of significant
figures since its value is known up to 3.1415927. . ., while r is 2.5 cm; hence, the result would de-
pend on less precise quantity, which is r having only 3 s.f.
Example 3: Evaluate
3.36 ± 0.04
d= (2:16)
1.07 ± 0.02
Solution: The above operation may be written in terms of percent uncertainty as
3.36 ± 1.2%
d= (2:17)
1.07 ± 1.8%
d = ð3.36=1.07Þ ± e (2:18)
d = 3.14 ± e (2:19)
where
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
e= ð%e1 Þ2 + ð%e2 Þ2 (2:20)
or
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
ffi
Δe Δe1 2 Δe2 2
= + (2:21)
e e1 e2
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
e = ð1.2Þ2 + ð1.8Þ2 (2:22)
e = 2.1%
Hence,
d = 3.14 ± 2.1% (in percent uncertainty)
To convert back into absolute uncertainty, multiply percent uncertainty with the result as 3.14 ×
2.1% = 0.065 ≈ 0.07
d = 3.14 ± 0.07 (in absolute uncertainty)
Example 3: Calculate d, where a = 3.76 ± 0.02, b = 1.42 ± 0.01 and c = 2.03 ± 0.04
a−b
d= (2:23)
c
Solution: Accordingly, d should be
where
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
e= ð0.02Þ2 + ð0.01Þ2 (2:25)
So, now
2.34 ± 0.02
d= (2:26)
2.03 ± 0.04
2.34 ± 0.9%
d= (2:27)
2.03 ± 2.0%
d = 1.15 ± e
where
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
e= ð0.9Þ2 + ð2.0Þ2 (2:28)
d = 1.15 ± 2.19%
d = 1.15 ± 0.025
Since the uncertainty is from 0.01 decimal places, the result should also be rounded off to 0.01
decimal place.
z = xm yn (2:29)
If one uses the quadrature (root of sum of squares), then one may write as
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Δz mΔx 2 nΔy 2
= + + (2:31)
z x y
Example 4: Evaluate d, when a = 2.61 ± 0.2, b = 3.7 ± 0.36 and c = 1.8 ± 0.65, if
ab3
d = pffiffiffi (2:32)
c
Solution: The arithmetic operation result would give
d = 98.539 ± e
2.3 Propagation of uncertainty 25
where e would be
e 0.2 0.36 0.65
= + 3 + 0.5 (2:33)
98.539 2.61 3.7 1.8
which on solving gives
e = 54.105
Hence, d = 98 ± 54.
Since the uncertainty is very large, only two significant figures are kept and the terms after decimal
point are ignored.
If the uncertainty in X2 is to be considered, then it may be argued as X × X and rule of multiplica-
tion should be used but instead rule for powers of exponents is used. Since for multiplication rule,
the variable should be independent of each other while measurements like X and Y, but in case of
X2, both are same.
Example 5: Calculate uncertainty associated with the perimeter of the square if the uncertainty in
the side of square is 4.0 ± 0.3 cm.
Solution: As perimeter = 4 × side, and considering the above-mentioned rule, the perimeter should
be 16 ± 1.2 cm.
z = ab + c3 (2:34)
3
Solution: In this case, first the quantity ab is calculated with the errors, then c . These two quanti-
ties are then added separately with their errors.
ab is calculated first as
ab = 3.9 ± 1.5
c3 = 140.6 ± 0.93
Hence, z = 144.5 ± 1.8
Function Uncertainty
ex
y = ln x ey = (.)
x
ey
y = x = ln 10ex ≈ 2.3026ex (.)
y
ey
y = ex = ex (.)
y
pffiffiffi
Example 7: In the function y = 3 x , what is the uncertainty in y if the uncertainty in x is 3%.
Solution: Using eq. (2.35), the uncertainty in y would be
1
%ey = ð3%Þ = 1%
3
Example 8: Using the pH value of 4.18 ± 0.03, calculate the uncertainty in [H+]
if
pH = − log½H+ (2:40)
Solution: One may write eq. (2.40) as
Summation of quadrature
Combining uncertainties using standard deviation, one can express function f which is a function
of x, y, z, . . . as f (x, y, z, . . .), then the uncertainity in f can be written by taking partial derivative of f
with respect to each variable. Then the total differential is
∂f ∂f ∂f
df ðx, y, z, . . .Þ = dx + dy + dz + . . ..
∂x ∂y ∂z
We may write dx, dy, dz as the error in x, y, z,. . ., that is, Δx, Δy, Δz,. . .
df df df
Δf ðx, y, z, . . .Þ = Δx + Δy + Δz + . . .
dx dy dz
If we restrict ourselves to x and y only, then we can write
2 2
df df df df
Δf 2 = Δx 2 + Δy 2 + 2ΔxΔy
dx dy dx dy
Since ΔxΔy are very small, we can write
2 2
df df
Δf 2 = Δx 2 + Δy 2
dx dy
If the standard deviations are small changes in x and y, then one may write the above equation as
(standard deviation approach):
2
df 2 2 df
σ2f = σx + σ2y
dx dy
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
2 2 ffi
df df
σf = σx +
2 σ 2y
dx dy
Hence, to sum up, in terms of standard deviation, the uncertainties are defined as
(1) When performing addition and subtraction, the resultant uncertainty σr can be written as
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
σr = σ 2x + σ 2y + σ2z
where σx, σy and σz are the standard deviations associated with the variables.
(2) Similarly, when multiplication and division is involved, one may write the uncertainty as
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
σr
σ 2 σ 2
σ 2
x y z
= + +
r x y z
(3) Exponents r = xy as
σr
σ
x
=y
r x
(4) Logarithmic function r = log(x) as
σ
x
σ r = 0.434
x
(5) Antilog r = antilog(x) as
σr
= 2.303σ x
r
28 Chapter 2 Uncertainties and errors
Different calculators and spreadsheets may give answers to the calculation up to many
decimal places. Sometimes the calculations are made simpler by rounding off the num-
ber up to some decimal places. If the uncertainty is in the first decimal place, then the
measurement should also be reported in the first decimal place. For example,
It is always advisable to make the calculations to at least one more significant fig-
ure than we require. Rounding off should be carried out at the end of the calcula-
tions to avoid rounding errors. If the rounding off is carried out at each step, then
the rounding errors would magnify at the end in the calculations.
As mentioned earlier, there is a whole range of values for a physical quantity
with measurement due to uncertainty. Mostly, the measurement values are distrib-
uted around the average value in the well-known bell-shaped curve also called nor-
mal (Gaussian) distribution in which there is a probability that the measured value
lies close to average (mean) than at the extremes of the curve. This can be proved
by the standard deviation concept in statistics.
Example 10: Round off the quantity t = 5.42 × 106 s, where its uncertainty Δt = 3 × 104 s.
Solution: Since the quantity as well as its uncertainty is given in scientific notation, it may be writ-
ten as (5.42 ± 0.03) × 106.
The representation should have the quantity and uncertainty in the same power of 10.
x−a
Erel =
a
They are usually expressed as either percent (×100%), fractions, parts per thou-
sand (×103) or parts per million (×106).
Example 11: Demonstrate the absolute and relative errors in the approximation of numerical con-
stant e(e = 2.71828).
Solution: Eabs = j2.71 − ej = 0.00828
j2.71 − ej
Erel = = 0.003
jej
Note: When the absolute errors are indeterminate error, they are followed by “ ±,” if they are with
the determinate, then the original sign follows.
3.1 Introduction
y = f ð xÞ (3:1)
Although there are many classes of classification, here, only the elementary classifi-
cation of functions is mentioned.
The linear function is the simplest function of all the mathematical functions. It is
represented as
y = mx + c (3:2)
When this function is plotted then a straight line is obtained, where c is the inter-
cept and m is the slope of the line (Figure 3.1). If intercept is zero (no intercept),
then the line passes through the origin (y = mx) and if the slope is zero then the line
is horizontal, that is, y = c.
Slope could be positive or negative. Figure 3.1(a) and (b) represents negative
and positive slopes, respectively. Since the function is linearly changing with x,
they are also called first-degree polynomial. Slope of any straight line can be found
out by taking two random points on the line. For example, if two points (x1,y1) and
(x2,y2) are considered which if written in the mathematical form are
y1 = mx1 + c (3:3)
https://doi.org/10.1515/9783110695328-003
32 Chapter 3 Some mathematical functions
Figure 3.1: Equation of line showing negative slope (a) and positive slope (b).
y2 = mx2 + c (3:4)
then
Δy = y2 − y1 = mðx2 − x1 Þ (3:5)
y2 − y1
m= (3:6)
x2 − x1
where m is the slope of the line joining (x1, y1) and (x2, y2).
3.2.2 Exponential
Mostly the term exponential is used to indicate the fast pace of increasing or decreas-
ing. In the exponential function, the independent variable is given as exponent to
some other constant or base (b in this case). It can be represented as
y = bx (3:7)
y = ex (3:8)
If x = 0, y = 1; y = ∞ if x ! ∞ and y = 0 if x ! − ∞
where x is an independent variable (can range from entire range of real num-
bers) and y is a dependent variable (on x). Figure 3.2 shows the exponential graph
for y = ex (a) and y = e−x (b).
3.2 Classification of functions 33
7 7
y = f(x)
f(x) = e–x
y=f(x)
(a) f(x) = e x (b)
6 6
5 5
4 4
3 3
2 2
1 1
0 0
0 100 200 300 400 x 500 0 0.2 0.4 0.6 0.8 1 1.2 x
If b = 2, then the function is f(x) = y = 2x (Figure 3.3(a)) and if b = 0.5, then the
function f(x) = y = 0.5x (Figure 3.3(b)).
140 1.2
(a) f(x) = 2x (b) f(x) = 0.5x
120 1
100
0.8
80
0.6
60
0.4
40
20 0.2
0 0
0 2 4 6 8 0 2 4 6 8
Consider the example of 10x, which is used to represent decimal number where x is
an integer. By using calculus, it can be found that the natural choice for base b in
sciences turns out to be an irrational number as e = 2.718281828459045. Hence, it
can be written as f(x) = y = ex or more generally as y = ekx. It is also known as Euler’s
number (e), which is defined as the infinite series as
1 1 1 1
e=1+ + + + + (3:9)
1! 2! 3! 4!
e = 2.718281828459045 (3:10)
34 Chapter 3 Some mathematical functions
λ = λ0 expð − kT Þ (3:13)
The logarithm is the inverse of exponential. It tells how many times a number
should be multiplied to itself to get a particular answer. The base of the log is the
main basis of classification. One may write the base as either 10 or e.
pH = − log10 ½H + (3:14)
pH = − log½H + (3:15)
When no base is mentioned, then it is usually understood that base (a) = 10.
1
f(x) = log10x
y = f(x)
0
0 x 0.5 1 1.5 2
–1
f(x) = ln x
–2
–3
Figure 3.4: f(x) = ln x (dotted line) and f(x) = log10x (solid line).
y = ex (3:17)
Then
x = lnðyÞ (3:18)
lnðe Þ = x
x
(3:19)
or,
elnðxÞ = x (3:20)
For example, log216 implies 2 (base value) should be multiplied itself 4 times to get
answer 16. The more general form is
where a is the base of the logarithm. The logarithm is the inverse of exponential, so
they both can be cancelled if the base is same.
Example 1: Simplify
f ð x Þ = log10 102x + 5 (3:22)
Solution: Since both exponents and logarithm have the same base 10, they cancel out each other:
f ð x Þ = 2x + 5 (3:23)
Example 2: Simplify
Example 3: Solve
2 Þ + 6x
f ð x Þ = aloga ð2x (3:27)
Solution: The above function can be written as
2
f ð x Þ = aloga ð2x Þ · a6x (3:28)
2 6x
f ð x Þ = 2x · a (3:29)
*If the base and exponent are different, then they both will not cancel each other.
36 Chapter 3 Some mathematical functions
3.2.4 Polynomials
f ðxÞ = a0 + a1 x + a2 x2 + + an xn (3:30)
Or in general,
X
n
f ðxÞ = ai x i (3:31)
i=0
f ðxÞ = a0 + a1 x (3:32)
y = mx + c (3:33)
f ðxÞ = x2 + 5x + 6 (3:36)
pffiffiffiffi
This quadratic equation can be solved for the value of x as x = − b ± D 2a ,
where D = b2−4ac. If n = 3 and n = 4, then it is called cubic function and quartic
function, respectively.
A cubic equation may be represented graphically (Figure 3.5) and mathemati-
cally as
300
f (x) = x3 – 5x2 + 2x + 8
200
y = f (x)
100
0
–6 –4 –2 0 2 4 6 8 x 10
–100
–200
–300
A power function may be represented as y = xn, where n is a constant. The linear, qua-
dratic, cubic and quartic functions are examples of power functions. Reciprocal func-
tions and root functions are sometimes considered as separate class, but they can also
pffiffiffi
be clubbed under the category of power function as y = x1, since y = x − 1 ,y = x since
p ffiffi
ffi
y = x1=2 , y = 3 x and so on. They are represented in the graphical form (Figure 3.6).
30 1.5
(a) (b)
y = f(x)
y = f(x)
25 1
20 0.5
15 0
–6 -4 –2 0 2 4 6
10 –0.5
5 –1
0 –1.5
–6 –4 –2 0 2 4 x6 x
2.5 2
y = f(x)
(c) (d)
y = f(x)
1.5
2
1
1.5 0.5
0
1 –6 –4 –2 0 2 4 6
–0.5
–1
0.5
–1.5
0 –2
0 1 2 3 4 5 x6 x
pffiffiffi pffiffiffi
Figure 3.6: Graphical representation of (a) y = x2; (b) y = 1/x; (c)y = x ; and (d) y = 3 x .
3.2.6 Circle
where (h, k) is the centre and r is the radius of the circle (Figure 3.7).
If the centre is the origin (0,0), then the equation becomes
x2 + y2 = r 2 (3:39)
38 Chapter 3 Some mathematical functions
x, y
r
h, k x
AðxÞ = a0 + a1 x + a2 x2 + + an xn (3:40)
BðxÞ = b0 + b1 x + b2 x2 + + bm xm (3:41)
For example,
2x − 3 x2 + 3x − 10 1 x−2
, , , 2 (3:43)–(3:46)
x−5 x+1 x x + 2x − 3
Let us take f(x) = y =x1, as can be seen from the graph (Figure 3.8) when x ! 0, then
y ! ∞.
Similarly, when x ! 0 from the minus side, y ! ∞. This point of x = 0 is called
point of singularity, where curve approaches the y-axis. The y-axis, that is, x = 0 is
called the asymptote to the curve or one may say that the curve approaches the line
x = 0 asymptotically. All rational functions have at least one point of singularity. It
can also be said that as x ! ∞ from either side, the curve approaches y-axis but
does not cross it. So here y = 0 is an asymptote to the curve.
Also, if the degree of polynomial in the numerator is greater than in the denom-
inator, it is called an improper rational function and if it is smaller than in the de-
nominator, it is called proper rational function.
3.2 Classification of functions 39
1.5
f(x) = 1/x
0.5
0 x
–10 –8 –6 4 –2 0 2 4 6 8 10
y = f(x)
–0.5
–1
–1.5
x+5 A B
= + (3:47)
ðx − 2Þðx + 3Þ x − 2 x + 3
x+5 Aðx + 3Þ + Bðx − 2Þ
= (3:48)
ðx − 2Þðx + 3Þ ðx − 2Þðx + 3Þ
There are three principal trigonometric functions namely sine (sin), cosine (cos)
and tangent (tan). The other trigonometric functions are secant (sec), cosecant
(cosec) and cotangent (cot) are derived functions, where
40 Chapter 3 Some mathematical functions
1 1 1
cosecθ = , sec θ = and cot θ = (3:50–3:52)
sin θ cos θ tan θ
sin x
1
1
2̅
0 x
–2π 3π –π π π π 3π 2π
–— – ̅ —
2 2 2̅ 2
1
– ̅
2
–1
cos x
1
1
2̅
0 x
–2π 3π –π π π π 3π 2π
–— – ̅ —
2 2 2̅ 2
1
– ̅
2
–1
tan x
4
0 x
–2π 3π –π π π π 3π 2π
–— – ̅ —
2 2 2̅ 2
–2
–4
Figure 3.9: Some trigonometric functions (sin, cos and tan functions).
Both degree and radian are often used as a unit of angle. Radian is the SI unit of
angle (SI symbol rad). In terms of circle, one radian is the angle (θ) subtended by an
arc (of length s), which is equal in length to the radius (r) of the circle (Figure 3.10).
More precisely, it is equal to the ratio of arc length to the radius of the circle,
that is,
s = rΘ
Θ
r
s
θ= (3:60)
r
Since the arc is proportional to the angle, the whole arc of circumference 2πr will
subtend angle of 360°. So 360° is equal to 2π radians. Hence,
360o
1rad = (3:61)
2π
180
1rad = degrees (3:62)
2π
3π
For example, angle 270° is radians.
2
42 Chapter 3 Some mathematical functions
ex − e − x
sinh = (3:65)
2
ex + e − x
cosh = (3:66)
2
where f'(x) and f'(x) are the first and second derivatives of f(a) with respect to x and
h = x–a. To represent the function f(x) in terms of a polynomial, it should be defined
in regions near x = a and when the function f(x) is differentiable as many times, it
gives a good approximation of the function in the region near x = a.
According to Taylor’s theorem, if function fulfils some predefined conditions
then it may be expressed as Taylor’s series. If a = 0, then the Taylor’s expansion be-
comes the Maclaurin series.
3.2 Classification of functions 43
x2 x4 x6 X∞
ð − 1Þn 2n
cos x = 1 − + − + = x (3:70)
2! 4! 6! n=0
ð2nÞ!
x2 x3 x4 X∞ n
x
ex = 1 + x + + + + = (3:71)
2! 3! 4! n=0
n!
Coordinate system uses real numbers to describe the position of points or other geo-
metric elements in the space (two dimensional or three dimensional).
x
x, y
x = r cos θ (3:72)
y = r sin θ (3:73)
x
r, θ
r y
θ
z = r cos θ (3:74)
(r, θ, φ)
y
φ
There are many ways to represent a number like whole numbers and real numbers.
In context of computers, there is a different sort of classification of numbers which is
(a) Decimal
(b) Binary
(c) Octal
(d) Hexadecimal
They can be interconverted conveniently without any loss to the numeric value.
Table 3.1: Position and bits for conversion of binary to decimal number.
Position
Bit
=1 × 26 + 0 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20
= 64 + 4 + 1
=ð69Þ10 .
Likewise a decimal number can also be converted into a binary number system by
dividing it by 2 until the quotient is 0. The remainder is noted each time and taken
in reverse order.
2 69
2 34 1
2 17 0
2 8 1
2 4 0
2 2 0
2 1 0
0 1
69 = (1000101)2
0.875 × 2
1 .750 × 2
1 .500 × 2
1 .000
8 2065
8 258 1
8 32 2
4 0
= 4 × 83 + 0 × 82 + 2 × 81 + 1 × 80
= 2, 048 + 16 + 1
= 2, 065.
A
B
C
48 Chapter 3 Some mathematical functions
D
E
F
2x + 7y = 23 and 5x − 8y = − 19
(3) Constitute an equation for a circle whose centre lies at (2,3) and its radius is
5 cm.
(4) Arrange the van der Waal’s equation of state in the cubic equation in V
n2 a
p + 2 ðV − nbÞ = nRT
V
(5) Express c as an explicit function of Λm , where Kohlrausch’s law for molar con-
ductivity Λm of a strong electrolyte at low concentration (c) (where Λ∞ m is the
molar conductivity at infinite dilution and b is the constant) is given as
pffiffiffi
Λm = Λ∞m −b c
Chapter 4
Descriptive statistics
4.1 Introduction
Descriptive statistics are tools in statistics that summarizes the data into some de-
fined coefficients that could be a representation of the model or results of an experi-
ment. Descriptive statistics are broken down into measures of central tendency and
measures of variability (spread). They are used to predict or infer outcomes of a sys-
tem. It characterizes the system using the data. Sometimes the term “number
crunching” is used to describe these features. In science, an enormous amount of
data is generated which needs to be organized and interpreted logically and in a
meaningful way, in such cases descriptive statistics come to the rescue by quantify-
ing the data into useful coefficients.
A measure of central tendency in statistics indicates the attempt to find the cen-
tral position of the data set or distribution. They are sometimes also called the meas-
ures of central location or summary statistics. These measures depict where the most
values of a data set or distribution lies or which is called the central location of distri-
bution. This central value is the representative of the whole distribution. So, by the
definition, the mean or average should be representative of measure of central ten-
dency but there are other representatives as well, namely, median and mode, since
mean often is not sufficient or even sometimes misleading. Hence, under different
conditions and different types of data, different types of measures of central tendency
are used. The central value is a single value which gives the idea of approximation of
normality. The measures of dispersion of data are quantified by standard deviation
and variance, while the minimum and maximum values of the data are explained
using skewness and kurtosis.
These descriptors are useful especially in research where they can meaningfully
interpret any experiment. Also, they reduce the bulkiness of data and organize
them better. One usually prefers to analyse data and reduce the error, but reducing
the data and then analysing the error sounds more intelligent way. One cannot al-
ways end the error, but can reduce it by improvising the sources of error. But some-
times the error is reduced by interpreting the data in a different way.
Instead of taking 10 observation values for an experiment, mean of those values
is preferred (having more significant numbers), thereby reducing the data, and
hence also minimizing the error. Hence, these statistical parameters are a way of
data reduction.
Some of the frequently used descriptors of statistics are described here.
https://doi.org/10.1515/9783110695328-004
50 Chapter 4 Descriptive statistics
4.2 Mean
The mean or the average is the most common measure of central tendency. It is
equal to sum of all the values in the data set divided by the number of observations.
So, the mean can be written as
x1 + x2 + x3 + + xn
x= (4:1)
n
or
Pn
i = 1 xn
x= (4:2)
n
where x is the mean, x1, x2, x3,. . ., xn are the observations or the data points and n is
the total number of data points, and ∑ (the Greek letter sigma) refers to the summa-
tion. The mean can be calculated for both continuous and discrete data. The above
mean is called sample mean (x) while population mean is represented by μ as
Pn
X
μ = i=1 (4:3)
n
In statistics, sample and population holds different meaning although they both
are calculated in the same manner. The mean includes all values in the data set
which may or may not be outliers; hence, there is often the possibility of error.
In Table 4.1, we have considered the weight of 10 persons (A to J) having differ-
ent weights. The mean comes out to be 60 kg, which is not the correct interpretation
of the overall weights since in the raw data the smallest weight is as small as 25 kg,
while the highest weight is as large as 94 kg. So in that case the mean is a mediocre
value that is not a real reflection of the data, hence, not an appropriate way to de-
pict the typical weight. Therefore, in this case, data is skewed. Therefore, more ro-
bust measures of central tendency are used like median. It minimizes the error in
prediction of any one value in the data set since it includes all data points in calcu-
lation. There are two more types of mean.
Person A B C D E F G H I J
Weight (kg)
4.2 Mean 51
Arithmetic mean is simply mean average. It is obtained by adding all the values of
data points divided by the number of observations. If we are given raw data of n
number of observations, then
P
X
X= (4:4)
n
Sometimes the data is given with the frequency, that is, the number of times a data
point is repeated in the data set. The mean in such cases is given by
P
fX
X= P (4:5)
f
where f is the frequency, X is the midpoint of the class interval and n is the number
of observations. The mean calculated from raw data is different from mean calcu-
lated from continuous data with frequency. The mean is not suitable when the data
is skewed or when the data set is small since mean resists the fluctuations between
different samples.
Weighted mean is calculated when some data points carry more weightage (impor-
tance) than other. For that the term wi is assigned to the data value xi. So the
weighted mean is given as
P
wx
Weighted mean = P (4:6)
w
Geometric mean is defined as the arithmetic mean of data points on a log scale. It is
useful for the data that has more utility when interpreted as a product of the num-
bers and not as sum (unlike arithmetic mean). It is also expressed as the nth root of
the product of an observation
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
GM = n ðx1 Þðx2 Þ...ðxn Þ (4:7)
P
log x
logðGMÞ = (4:8)
n
*GM cannot be used if the data points involve any zero or negative value.
52 Chapter 4 Descriptive statistics
The HM is used when the reciprocal of observations hold more importance than the
observation itself. It is particularly useful to estimate the average sample size of
groups, each having different sample size.
4.3 Median
Median is the central or middle value in the distribution data when arranged in as-
cending or descending order of its magnitude. It divides the distribution data in half.
In case of odd number of observations, the middle value is the median, while in case
of even number of observations, the average of two middle values is taken as median.
Unlike mean, median is less vulnerable to outliers and skewed data. It is a preferred
measure of central tendency especially when the data is not symmetrical.
Consider the following data of temperature (in °C) for a set of an experiment
arranged in descending order as
105, 96, 86, 79, 76, 71, 68, 67, 63, 57, 50
that is, the average of two middle observations is taken, where (N/2)th and ((N + 1)/2)th
are the positions of the observations. So, the median in the above case would be
76 + 71
Median =
2
Median = 73.5 C
4.5 Standard deviation 53
4.4 Mode
The mode is the most frequently occurring observation in the data set. The advan-
tage of using mode as measure of central tendency is that it can be used for both
numerical and non-numerical (categorical) data. It is mostly used for categorical
data. Graphically, a histogram is used to represent a data set where the highest bar
represents mode. But sometimes, there may be two values/variables that have the
same frequency (they repeat a number of times); in such cases, mode is not useful.
Sometimes, mode lies way beyond the central tendency or region and hence
does not give the accurate idea of the data set.
In Figure 4.1, it shows the number of students voting for their favourite subject.
One can clearly see that the popular choice of students is Physical Chemistry than
Inorganic Chemistry (since most of the students voted for it). The least preferred
choice is Nanochemistry.
Mode
14
15
Number of students
11
9
10
6
5
5 3
When a set of observations are taken for the same measurement then the measured
values are grouped around the central value (called mean). Standard deviation de-
scribes the deviation of observations from the mean value or how widely the obser-
vations are spread on either side of mean. Larger standard deviation implies more
widely spread data. Usually, there is a population of N data points where each data
point is known for which the standard deviation (σ) is defined as
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Pn 2
i = 1 ðxi − μÞ
σ= (4:12)
N
54 Chapter 4 Descriptive statistics
where N refers to the total number of data points or observations in the population,
xi is the ith observation and μ is the population mean of the N observations. But
sometimes it is difficult to access population data; hence, a sample is taken (part or
subset of population) which is considered as an approximation of the population
parameter. There is a difference between the standard deviation of sample as com-
pared to that of population. For the sample, the standard deviation(s) is defined as
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Pn 2
i = 1 ðxi − xÞ
s= (4:13)
n−1
where x refers to the sample mean for n number of observations. As the n→N, the
sample standard deviation approaches population standard deviation, that is, s→σ.
4.6 Variance
Variance measures dispersion around mean. It is the squared deviation from the
mean. It may be defined by squaring the standard deviation. For a given population
having N data points, the variance is
Pn
i=1 ðxi − μÞ2
σ =
2
(4:14)
N
There is one more parameter similar to variance called co-variance. Co-variance
tells how the two variables vary together. It measures the strength of correlation
between two variables where
PN
i=1 ðxi − xÞðyi − yÞ
Covðx, yÞ = (4:15)
N −1
The coefficient of variation is defined as the ratio of standard deviation to the mean.
It represents the extent of variability with respect to the mean of the population or
sample. Also known as the relative standard deviation, it is useful in comparing the
spread of a distribution. Coefficient of variation often finds its applications in analyti-
cal chemistry.
σ
CV = (4:16)
μ
Larger the value of CV, greater is the dispersion of data around the mean. Smaller
the CV, more exact is the distribution.
4.7 Coefficient of variation 55
For example, there are two sets of data (A and B) given as follows:
CV Std dev.
As evident from Table 4.2, although both sets have same standard deviation from
their mean value, their coefficient of variation (53% and 6%, respectively) is differ-
ent since their individual means are different.
Example 1: A sample of hematite was analysed for iron percentage in the sample. The measurements
were taken repeatedly to ensure true value, which are
42.62, 42.73, 42.75, 42.78, 42.79, 42.83, 42.84, 42.87, 42.92, 42.94
Calculate the mean value, spread, median, average deviation, standard deviation and coefficient
of variation.
Solution: The data is arranged, first, into ascending order
42.62, 42.73, 42.75, 42.78, 42.79, 42.83, 42.84, 42.87, 42.92, 42.94
To calculate mean,
42.62 + 42.73 + 42.75 + 42.78 + 42.79 + 42.83 + 42.84 + 42.87 + 42.92 + 42.94
Mean =
10
Mean = 42.80
Spread is the difference between the highest and lowest values in the observations:
xi xi − x ðxi − xÞ2
0.73
Hence, average deviation = = 0.073
10
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Pn ffi
2
Standard deviation s = i = 1 ðxi − xÞ
n−1
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
0.0817
s= = 0.095
9
s2 = 0.009
0.095
CV = = 0.0021 = 0.21%
42.8
Skewness
Skewness indicates the asymmetric distribution. It is given by g as
Pn
− xÞ3
i = 1 ðxi
g= (A:1)
ðn − 1Þs3
If the distribution is Gaussian (symmetrical), then g = 0. If g is negative, then left tail of distribution
is longer than the right and vice versa.
Kurtosis
Kurtosis represents the pointedness of data’s distribution. It is given by k as
Pn
i=1 ðxi − xÞ4
k= (A:2)
ðn − 1Þs4
High k implies that most of the standard deviations are caused by extreme deviations from the
mean while smaller k implies that deviations are nearer the mean and the distribution is rounded.
4.8 Data analysis 57
All the descriptors mentioned earlier are the most frequently used parameters for
analysis of data. Also, the sampling of data is one of the most important practices.
There are a set of tests that helps in identifying the anomaly in the data. It will help
to know whether to keep a data value or remove the discordant data. The frequently
used tests in data sampling are discussed below.
4.8.1 Q-test
Also known as the Dixon’s test, the Q-test is a simple and widely used statistical
tool for finding whether a given data point or result should be retained or rejected.
It involves examining the total scattered data and finding the outliers or discordant
value. An outlier is a deviant value that may be generated from a different set of
sample or distribution.
Keeping an outlier in the data set affects the calculations of mean and standard
deviation. Hence, outliers are needed to be removed. For running Q-test calcula-
tions, the data must be normally distributed (arranged in ascending order), where
Q is given by
jxq − xn j
Q= (4:17)
w
where w is the spread of the observations, that is, the difference between the small-
est and highest value in the data, while xq is the suspected value and xn is the near-
est value to the suspected value when the data is arranged in either ascending or
descending order.
This ratio is then compared with critical values Qc (critical value of Q) corre-
sponding to a particular confidence level (CL = 95% usually). If Q is greater than Qc,
the questionable result can be rejected with the indicated degree of confidence.
Table 4.4 contains the Q values at various confidence intervals.
The Q-test does not give satisfactory results for data set having more than 10 points
(N > 10). Based on the Q-result, more than one data point could be tested for erratic
behaviour but only one value is discarded. Hence, suspected data points (outliers)
are legitimately rejected by using this test.
Example 2: The density of aluminium metal was measured by taking replicate measurements which
are 2.61, 2.74, 3.4, 2.91, 2.21 g cm−3. On the basis of Q-test, should any of the data point be
rejected?
Solution: The first step in detecting an outlier by using Q-test is arranging the data in ascending
order as
2.21, 2.61, 2.74, 2.91, 3.4
The data point 3.4 looks anomalous when compared with the other values so it is the suspected
value. Hence, looking at the values, 2.21 is the smallest value, 3.4 being the highest. The closest
value to the suspect value is 2.91, which gives
j3.4 − 2.91j
Q=
3.4 − 2.21
Q = 0.30. Now, one should look for Qcrit or Qc, if the calculated value exceeds or is well below the
Qc. Since here N = 5 and Qc = 0.71 at 95% confidence level (Table 4.3), this data point may be in-
cluded based on Q-test.
The Q-test cannot be performed if there are more than one identical suspected data points.
Example 3: The analysis of calcite sample yielded CaO percentages of 55.95, 56.00, 56.04, 56.08
and 56.23. The last value appears anomalous; should it be retained or rejected at 95% confidence
level?
Solution: Arranging the data in ascending order as
55.95, 56.00, 56.04, 56.08, 56.23
Here, the difference between the highest (56.23) and lowest values (55.95) is 0.28 which is the
spread of the data.
The suspected value and its nearest values are 56.23 and 56.08, respectively, which gives
j56.23 − 56.08j
Q= = 0.53
0.28
For N = 5, Qc at 95% confidence level is 0.71. Since 0.54 < 0.71, this data point should be retained.
4.8 Data analysis 59
The experimental mean x may or may not be close to true mean μ. There is an entire
range under which the true mean lie which is defined by experimental mean and
standard deviation. This range is called the confidence interval and its limits are
called the confidence limit. The probability that the true value lies within the range
is called confidence level, usually given by
ts
Confidence limit = x ± pffiffiffiffi (4:18)
N
where t is a statistical factor that depends on the number of degrees of freedom and
the confidence level desired and s is the standard deviation. The number of degrees
of freedom (ν) is one less than the number of measurements (N).
Example 4: A sample was analysed for its wt% in triplicate with the following result 82.5, 82.56 and
82.41 wt% of X. There is 95% confidence that true value lies in a range. What range is that?
Solution: Mean and standard deviation for the given three values are 82.49 and 0.075, respec-
tively. Here N = 3, so degrees of freedom ν = N–1 = 2.
Using eq. (4.18)
ts
Confidence limit = x ± pffiffiffiffi
N
4.303 × 0.075
= 82.49 ± pffiffiffi
3
= 82.49 ± 0.18
Hence, there is 95% confidence that the true value lies between 82.67 and 82.31 in the absence of
any determinate error.
4.8.3 t-Test
Also called Student’s t-test, it is often used by analyst to analyse the statistics be-
tween the results of two different methods. t-test helps to reflect if there is any sub-
stantial difference between the two methods or if they measure the same thing.
There are three types of t-test based on the utility which are explained.
(a) When an accepted value of data is given, there is a set of data that needs com-
paring. In such cases, t-test is given as
ts
μ = x ± pffiffiffiffi (4:19)
N
60 Chapter 4 Descriptive statistics
Example 5: A method was analysed for determining the amount of aluminium in a drug using ther-
mogravimetric analysis. Five replicate measurements were made with the same concentration and
the mean of the result was found to be 9.6 ppm with the standard deviation of ± 0.7. The literature
reference is 10.5 ppm. Is the method statistically correct in reference to the true value at 95% confi-
dence level?
Solution: Using t-test (eq. (4.20))
pffiffiffi
5
t = ð9.6 − 10.5Þ
0.7
t = 2.9
At N = 5, the tabulated t value (Table 4.7) is 2.77 at 95% confidence level. Since tcalc > ttab, there is
95% confidence that the procedure is providing statistically different results from the true value
(reference value).
(b) There are one more type of t-tests where the two sets of data compared have
different variances. Such data sets may have different degrees pffiffiffi
of freedom as
well. They also use the same above formula except for them, sN is replaced by
qffiffiffiffiffiffiffiffiffiffiffi
N1 N2
N1 + N2 =sp , where
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
P P P P
ðxi1 − x1 Þ2 + ðxi2 − x2 Þ2 + ðxi3 − x3 Þ2 + + ðxik − xk Þ2
sp = (4:21)
N−k
Hence,
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
x1 − x2 N1 N2
±t= (4:22)
sp N1 + N2
Example 6: The analysis of iron sample was carried out using two different analytical methods for
which replicate measurements were made for each method (A and B) and their data measurements
are given as:
The tabulated t is 2.262 for 9 degrees of freedom (N1 + N2–2) at 95% confidence limit;
hence tcalc < ttab. Therefore, there is not much difference between two methods of
analysis as tcalc is well below the ttab value.
c) Paired t-Test
There are some data sets that need to be compared with other sets of accepted data
sets to establish their genuineness. In such cases, each data point is cross validated
with the accepted data point for deviation and the t value is given as
D pffiffiffiffi
t= N (4:23)
sd
where
sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
P 2
ðDi − DÞ
sd = (4:24)
N−1
62 Chapter 4 Descriptive statistics
Example 7: Given are the two sets of data taken for a set of samples by two different methods.
Determine if there is a considerable difference between two methods.
Sample A B C D E F
Method X . . . . . .
Solution: Using eq. (4.23) for paired t-test, the results may be tabulated for various parameters as
(Table 4.6):
1.7
D= = 0.28
6
rffiffiffiffiffiffiffiffiffiffi
0.87
sd = = 0.42
6−1
0.28 pffiffiffi
t= × 6 = 1.63
0.42
The tabulated value of t at 95% confidence limit is 2.571 and since tcalc < ttab, there is not much con-
siderable difference between two methods.
4.8.4 F-test
It is often desirable to compare the result of one method with those of accepted
methods (standard method) to design more robust method of analysis. To deter-
mine if one set of results is significantly different from another depends not only on
the difference in means but also on the amount of data available and spread. F-test
4.8 Data analysis 63
Table 4.7: Values of t for v(N−1) degrees of freedom for various confidence levels*.
Confidence level
evaluates the difference between spread of results. Hence, this test is designed to
indicate whether there is a significant difference between two methods based on
their standard deviation. It is used to compare two variances.
F is defined in terms of the variances of the two methods (variance is the square
of the standard deviation)
s21
F= (4:25)
s22
where s 1 > s2 .
There are two different degrees of freedom v1 and v2, where degrees of freedom are
defined as N–1 for each case.
If the calculated F value from the equation exceeds a tabulated value at the se-
lected confidence level, then there is a significant difference between the variances
of the two methods. To carry out an F-test, a null and alternate hypothesis is cre-
ated to determine the significance level. Also the degrees of freedom in both numer-
ator and denominator are found out. The calculated value is evaluated for a given
64 Chapter 4 Descriptive statistics
confidence limit to either discard the null hypotheses or vice versa. While evaluat-
ing F-test value, the greater variance should be kept in the numerator.
The null hypotheses assume that σ21 = σ22 , while according to the alternate hy-
potheses σ21 ≠σ22 . If Fcal > Fcrit, the null hypotheses is rejected where Fcrit is the value
of F at the required level of confidence or significance. Table 4.8 lists F-values at
95% confidence limit with different degrees of freedom.
v = v =
. . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Example 8: A sample was analysed by two different methods and replicate results were taken from
these two methods. On the basis of F-test, compare the given results of two methods (Table 4.9).
Solution: To compare the two methods, F-test is often used by comparing the variances of two
methods. The variance of the two methods is calculated as
Pn
i = 1 ðxi1− xÞ2 58
s21 = = = 14.5
N1 − 1 5−1
Pn
i = 1 ðxi2− xÞ2 26.8
s22 = = = 6.7
N2 − 1 5−1
s21
F= = 2.164
s22
4.9 Distribution of errors 65
The tabulated result (for ν1 = 4 and ν2 = 4) is 6.39. Hence, the F-values for methods that are com-
pared are way lower than the tabulated allowed results; hence, the two methods A and B are
equally established procedures on the basis of their variances.
Often the events and errors follow some trend in the experiment. The various types
of distribution that are seen can be summarized as
(1) Gaussian distribution
(2) Binomial distribution
(3) Poisson distribution
In statistics, the Gaussian distribution (also called the normal distribution) is the
continuous distribution whose probability density function is
1 2 2
ρðxÞ = pffiffiffiffiffi e − ðx − μÞ =2σ (4:26)
σ 2π
n!∞
for all values of x, where μ and σ are mean and standard deviation, respectively. It
was introduced by Gauss and it governs a variety of phenomenon. The Gaussian
distribution in a normalized form can be written as
+ð∞ +ð∞
1 2 =2σ2
f ðxÞ = ρðxÞdx = pffiffiffiffiffi e − ðx − μÞ dx = 1 (4:27)
σ 2π
−∞ −∞
0.1
σ=5
σ=7
σ = 10
ðb
1 2
f ðxÞ = pffiffiffiffiffi e − x =2 dx (4:28)
2π
a
It describes the distribution of random discrete binary data from a finite sample ei-
ther success or failure, hence the name binary distribution. According to formula, it
shows the probability of getting x events out of n trials. It is most suited when num-
ber of outcomes are small usually a success and a failure:
PðxÞ = n Cx px qn − x (4:29)
where n is the number of trials, x is the number of successes from n trials, p is the
probability for success and q is the probability of failure, (n–x) refers to the number
of failures:
pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi pffiffiffiffiffiffiffiffi
σ = npð1 − pÞ = npq (4:30)
where
μ = np (4:31)
If a dice is rolled 30 times, what is the probability of getting 3 on the dice 8 times?
Here N = 30, p = 1/6 and r = 8. For large n, binomial distribution approximates to
Gaussian distribution.
4.10 Statistical tools using spreadsheets 67
e − λ λx
PðxÞ = (4:32)
x!
where x = 0, 1, 2, 3 . . .
Above is the probability of observing exactly x events (successes) and λ is the aver-
age number of events or successes. It is a limiting form of binomial distribution
pffiffiffi
when n tends to infinity. In Poisson process, mean = variance (σ = μ).
For example, the average number of event in a year is 5 at some place. What is
the probability of having 3 events at the same place?
Here, average λ = 5, x = 3:
e − 5 .53
So Pðx = 3Þ = 3! = 0.1404
Hence, 14% is the probability that event may occur at the same place. According to
Poisson distribution, an event may occur at any point of time and one event is inde-
pendent of the occurrence of another event. It describes the distribution of binary
data from an infinite sample. It shows the probability of getting r events from a pop-
ulation (infinite sample).
(1) Average
To find the mean of a sample or population, the function AVERAGE is used. The
data is first entered into the columns and then the AVERAGE function is used as
shown. Its syntax is AVERAGE(Array1)
(2) Mode
To find the mode for the given data, MODE function is used. Its syntax is MODE
(Array1) as shown in Figure 4.3.
68 Chapter 4 Descriptive statistics
A B
1 x values
2 2.1
3 2.5
4 2.3
5 2.5
6 =AVERAGE(A1:A5) =MODE(A1:A5)
7
Figure 4.3: Mean and mode in spreadsheet.
The different types of distribution parameters can also be calculated using spread-
sheet. They are explained as follows:
A B
1 Number 40
2 Mean 45
3 Std dev 47.609
4 =NORMDIST(B1,B2,B3,FALSE)
5
6
7 Figure 4.4: Normal distribution in
spreadsheet.
This gives answer 0.008333 in accordance with the normal distribution function.
Similarly binomial distribution and Poisson’s distribution can also be used. The
syntax is =BINOMDIST(number’s, trials, probability’s, returns the cumulative distri-
bution function) = POISSON(number, arithmetic mean, returns the cumulative dis-
tribution function).
(4) F-test
F-test in EXCEL can be carried out by using data analysis tab→F-test two-sample for
variances (Figure 4.5). Select the data arrays and output cell, where the result will
be published.
4.10 Statistical tools using spreadsheets 69
The result obtained is displayed in Figure 4.6. In the picture, df refers to the
degrees of freedom which is N–1, while F is the value of F-test.
Variable 1 Variable 2
Mean 10.41666667 10.3875
Variance 0.333666667 0.932678571
Observations 6 8
df 5 7
F 0.357750973
P(F<=f ) one-tail 0.137760942
F Critical one-tail 0.205091533
(5) t-Test
The t-test mentioned earlier can be performed in spreadsheets for three different op-
tions as shown, which complies with three types of test we discussed under t-test
(Figure 4.7).
1. For the given data, calculate mean, average deviation, standard deviation and
spread of the distribution
7.146, 7.098, 6.942, 7.256, 6.593
2. The following measurements of a given variable have been obtained: 23.2, 24.5,
23.8, 23.2, 23.9, 23.5 and 24.0. Apply the Q-test to see if the data point 23.9 is an
outlier at 95% confidence level.
3. Calculate the confidence limit for a data set for which mean is 56.06, standard
deviation of 0.2% and t-value for 90% confidence limit is 1.833.
4. The analysis of a sample was carried out repeatedly for its % composition in a
sample and obtained 2.98, 3.16, 3.02, 2.99 and 3.07. If the true value was 3.03,
is the method statistically correct in reference to the true value at 90% confi-
dence level?
. .
. .
. .
. .
. .
.
.
.
Mean = . Mean = .
Chapter 5
Numerical curve fitting
5.1 Introduction
5.2 Correlation
https://doi.org/10.1515/9783110695328-005
72 Chapter 5 Numerical curve fitting
It evaluates the linear relationship between two continuous variables as the change
in one variable produces a proportionate change in another variable. In statistics,
the general formula for correlation is given as
P Pn Pn
n ni= 1 xy − i=1 x i=1 y
r = rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
P
P (5:1)
P 2 P n 2
n ni= 1 x2 − n
i=1 x n n
i=1 y 2−
i=1 y
Usually a scatter plot is drawn to check for linearity. For evaluating the Pearson co-
efficient, the variables should be normally distributed apart from having a linear
relationship between them. It is a widely used statistical parameter when the data
is linear.
Essentially there are two types of correlation coefficient, namely, population
correlation coefficient (ρxy) and sample correlation coefficient (rxy) which can be
represented as
ssxy
rxy = (5:2)
ssxx ssyy
σxy
ρxy = (5:3)
σxx σyy
where (sn,sy) and sxy refer to sample standard deviation and co-variance while
(σxx,σyy) and σxy are population standard deviation and co-variance.
It is a nonparametric test which is carried out when there is ordinal data (data is
arranged in order of ranking or preference) or there is monotonic relationship be-
tween data instead of any linear data.
5.3 Regression 73
Pearson’s coefficient gives the strength and direction of linear relationship be-
tween the variables while Spearman’s coefficient gives the same for monotonic
relationship.
5.3 Regression
Regression predicts the value of dependent (y) variable on the basis of known inde-
pendent (x) variable value using the mathematical relationship between them. The
value of y depends upon the value of x; hence, y is a dependent variable while x is
independent. If they are related as
y = a + bx (5:5)
then a and b are regression parameters and b is the regression coefficient. It esti-
mates the value of random variable on the basis of fixed variable value. It also in-
volves establishing mathematical relationship between two variables (dependent
and independent). A model or relationship is constructed and is then tested for its
goodness. If the goodness is good enough, then this model can be used to predict
the values of dependent variable for the given independent variable. When a plot of
expected value of the dependent variables and independent variable is plotted, the
line obtained is called regression line (Figure 5.1). This is called least square curve
(LSC) fitting since it fits the given data keeping the square of the error minimum.
The mathematical relationship for regression (R2 or r2) is given as
ssres
R2 = 1 − (5:6)
sstotal
and
The t-test and F-tests are often used to test the validity of regression models.
Here R2 implies how well the curve fits the data points, also what we know as
goodness of fit. Its value ranges from 0 to 1. A value close to 1 implies a good model
hence the curve (mathematical function) fits well in data points and vice versa. As
the value of R2 drifts away from 1, the quality of the model falls. Hence a curve is said
74 Chapter 5 Numerical curve fitting
to have a goodness of fit when its R2 value approaches 1. The more it recedes away
from 1, less is the co-variance between two variables.
Interpolation is the technique to find the value of variables in between the existing
data points. In interpolation, a curve is constructed through the given data points
assuming the data points to be accurate. Interpolation aims to find a function that
approximates the given data and determine new data points in between. Curve fit-
ting is applied to scattered data that might not be accurate. Hence a smooth curve
is needed in curve fitting that approximates the given data point that might or
might not pass through all the data points while in case of interpolation the func-
tion passes through original data points. This can be illustrated in Figure 5.1.
Y
16
y = 1.9643x + 2.25
14 e5
R2 = 0.9745
12
e4
10
e3
8
e2
6 e1 Interpolation
4
0 x
0 1 2 3 4 5 6 7
The interpolation of points is nothing but connecting the data points together while
the other straight line is the curve fitting where a line or a curve has been drawn
which best suits the data points that passes through the maximum number of
points and depicts some mathematical function (shown by the equation).
The method of LSC fitting implies constructing a line or a curve that passes through
the maximum number of data points and a mathematical relationship which best
describes the data points. There are inevitable errors in every experiment or sets of
5.5 Least square curve fitting 75
observations. The best we can do is to minimize the error by using LSC. It is applica-
ble for a single curve that represents the general trend of data.
Y
16
14
e5
12
10
e3 e4
8
e1 e2
6
0 x
0 1 2 3 4 5 6 7
(1) As can be seen from Figure 5.2, the solid dots represent the actual data while the
dotted line is the best possible curve that can be drawn to fit the given experimental
data minimizing the error. Here error is the distance between the data point and the
best fit line. For a best fit curve, the error should be minimized (also called vertical and
perpendicular deviations). This method is also called the LSC method because it aims to
minimize the sum of error (also called residual). In the figure, the data is fit into a linear
relationship, but regression can also be applied to other functions as well including
parabola, polynomial of nth order, exponential and logarithmic function to name a few.
The coefficients a and b in the earlier equations are the values that can be
found which best fits the given data into the mathematical model. LSC finds a curve
or a mathematical equation that aptly describes the behaviour of the data. Consider
the function f(x) written as y
y = f ð xÞ (5:9)
so if there is a point x1, then the expected value of y is f(x1) rather it is found to be y1.
So one can define the error in the value of y (also called residual) as
e1 = y1 − f ðx1 Þ (5:10)
e2 = y2 − f ðx2 Þ (5:11)
e3 = y3 − f ðx3 Þ (5:12)
en = yn − f ðxn Þ (5:13)
76 Chapter 5 Numerical curve fitting
The best fitting curve is the one which has minimum sum of square of offsets (resid-
uals). These residuals can be positive or negative, hence to minimize the error at
any point xi, the square of ei’s is taken as
X
n
E= e2i (5:14)
i=1
This E should be minimized in such a way that the sum of squares of residuals is min-
imum or least (hence the name least square curve method) by minimizing the square
of error. The best line must have minimum error between line and data points.
A straight line is the simplest way of fitting the data by using LSC method using the
simple equation y = a + bx, where a and b are constants. The number of constants
equals the number of equations that needs solving. These equations are called nor-
mal equations. Starting from the function
y = a + bx (5:5)
ei is the error or residual between the expected value and measured value.
ei = ymeasured − yexpected = yi − ða + bxi Þ (5:15)
Here some differences may be positive and some may be negative. Hence the error
is squared which is minimized
To minimize the error, differentiate the square of the error with respect to a, b and c
and put it equal to zero. In regression, one minimizes the sum of squared residuals (Sr).
dSr dSr
= =0 (5:17)
da db
dSr X n
= ½ − 2ðyi − ða + bxi ÞÞ = 0 (5:18)
da i=1
dSr X n
= ½ − 2xðyi − ða + bxi ÞÞ = 0 (5:19)
db i=1
which gives
X
n X
n
na + bxi = yi (5:20)
i=1 i=1
5.5 Least square curve fitting 77
X
n X
n X
n
axi + bxi2 = xi yi (5:21)
i=1 i=1 i=1
The earlier equation is also called normal equation. These simultaneous equations
are often solved by using them in matrix form as
2 Pn 3 2 Pn 3
n xi " a # yi
6 i=1 7 6 i=1 7
4P n Pn 5 =4Pn 5 (5:22)
xi 2
xi b xi yi
i=1 i=1 i=1
2 P n 32 P
n 3− 1
" # yi n xi
a 6 i = 1 76 i=1 7
=4Pn 5 4 P
n P
n 5 (5:23)
b xi yi xi x2i
i=1 i=1 i=1
where
1X n
x= xi (5:26)
n i=1
and
1X n
y= yi (5:27)
n i=1
These expressions can be rewritten in the form of sum of squares. Sum of squares
or sum of square deviations is a measure of variation of data set. They describe the
difference of the predicted and mean of the variable:
X
n
ssxx = ðxi − xÞ2 (5:31)
i=1
X
n
ssxx = x2i − nx2 (5:32)
i=1
Pn 2
X
n
i = 1 xi
ssxx = x2i − (5:33)
i=1
n
X
n
ssyy = ðyi − yÞ2 (5:34)
i=1
X
n
ssyy = yi − ny2
2
(5:35)
i=1
X
n
ssxy = ðxi − xÞðyi − yÞ (5:36)
i=1
X
n Pn Pn
i = 1 xi i = 1 yi
ssxy = xi yi − (5:37)
i=1
n
X
n X
n X
n
ssxy = n xi yi − xi yi (5:38)
i=1 i=1 i=1
ss2xy covðx, yÞ
r2 = = (5:42)
ssxx ssyy ssxx ssyy
Example 1: Using LSC fitting, find an equation of the straight line (y = a + bx) with the given data
x y
Solution: To find the equation for the given data, the result for constructing normal equations are
tabulated in Table 5.1.
x y x xy
5a + 10b = 91 (5:43)
10a + 30b = 270 (5:44)
which gives a = 3/5 and b = 44/5.
Therefore the equation would be
40
Y
y = 0.6+8.8x
35
30
25
20
15
10
5
X
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
y = axb or y = ae bx (5:46)
then the function is first linearized as in the earlier example by taking logarithm on
both sides as
Y = A + bX (5:48)
Similarly
y = ae bx (5:49)
Y = A + BX (5:51)
Example 2: Using the LSC method, fit the following data into the form y = ax b .
x y
.
.
.
.
.
.
Solution: The earlier data (n = 6) is tabulated in Table 5.2 and graphically depicted in Figure 5.4.
x y Y X XY X
40
Y
35 y = 3.6139x1.253
30
25
20
15
10
0
0 1 2 3 X 4 5 6 7
this gives
that gives
A = 0.558
B = 1.253 = b
a = antilog A = 3.614
Hence
y = 3.614x1.253 (5:54)
t (°C)
Δvap Hm 1
lnðp=kPaÞ = − +I (5:55)
R T
Determine the value of change in enthalpy, that is, ΔvapHm.
Solution: Since in the data, temperature is given in ° C, convert it to K, T = (t °C + 273)K. Using linear
relation Y = A + BX, the results are tabulated (Table 5.3), where I represents the intercept a.
I = 3.1831208.
Example 4: The following data were obtained for decomposition of di-tertiarybutyl peroxide at con-
stant volume:
t (min)
3p − p
Using the LSC fitting technique for the equation y = a + bx where y = logðpt =TorrÞ with pt = 02
and x = t (min). Determine the rate constant, if b = –k/2.303.
Solution: For using the normal equations for the linear regression these results are as follows
(Table 5.4).
t=x p pt Y xy x
which gives
Example 5: Find the value of standard half electrode potential E0 of Ag|AgCl using the following
equation and data (Table 5.5):
pffiffiffiffi
m . . . . . . .
E+ 2RT
F In m . . . . . . .
y = a + bx
0.236
y = 0.0309x + 0.2244
0.234
R 2 = 0.9723
0.232
0.23
0.228
0.226
0.224
0.222
–0.1 –0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
pffiffiffiffi
Figure 5.5: Variation of E + 2RT
F ln m versus m.
where intercept a = E0, b = 2.303RT/F and the data is plotted (Figure 5.5) which on extrapolation to
− jAgCljAg = 0.2244 V.
0
y-axis gives ECl
5.5 Least square curve fitting 85
Multiple linear regression (MLR) method is used when there are more than one vari-
able is involved in influencing the dependent variable y. It may be represented as
where x1 and x2 are the two independent variables while y is a dependent variable,
b and c are the slopes or coefficients associated with x1 and x2 and a is a constant.
The following example will clearly demonstrate the MLR.
Example 6: Using the method of MLR, find out the order and rate of reaction using the given kinet-
ics data:
Rateðr Þ = k½COm ½Cl2 n (5:62)
Rate (mol L− s−) [CO] (mol L−) [Cl] (mol L−)
Solution: Since this equation is not linearized and it needs to be linearized by taking log both
sides as (Table 5.6)
Here instead of using manual calculations, one may use spreadsheets to ease the calculation by using
the LINEST function (explained in subsequent section). Upon solving,
K = log k = 0.57329
− 3=2 − 1
antilog ð0.57329Þ = k = 3.743 mol L − 1 s
Example 7: The absorbance values of a mixture of unknown concentration of KMnO4 and K2Cr2O7
using colorimetry at two different wavelengths 372 and 290 nm were found to be 0.732 and 0.5888,
respectively. Using the method of MLR, find the unknown concentrations of the two samples.
Solution: Using Lambert–Beer’s law, we know A = Ɛcl.
Since both the components are non-interacting with each other, their absorbance are additive.
Also if the path length of the cell is taken as unity, then
At 372 nm,
0.732 = εKMnO4 372 CKMnO4 + εK2 Cr2 O7 372 CK2 Cr2 O7 (5:66)
At 290 nm,
0.588 = εKMnO4 290 CKMnO4 + εK2 Cr2 O7 290 CK2 Cr2 O7 (5:67)
These two equations are of the form y = ax1 + bx2 + c. In the above case, c = 0, which can be solved
analytically (Table 5.7)
Absorbance (Y) X X
and on solving using the LINEST function gives CK2Cr2O7 = 2.76 × 10–4 M,CKMnO4 = 3.41 × 10–4 M.
5.5 Least square curve fitting 87
The curve fitting for second-order polynomial (e.g., equation of a parabola) is like
solving three simultaneous linear equations. For instance, a second-order polyno-
mial is given as
y = a + bx + cx2 (5:70)
To minimize the error, differentiate the square of the error with respect to a, b and c
and equal it to zero:
dSr X n
= ½ − 2xðyi − ða + bx + cx2 ÞÞ = 0 (5:75)
db i=1
dSr X n
= ½ − 2x2 ðyi − ða + bx + cx2 ÞÞ = 0 (5:76)
dc i=1
which gives
X
n X
n X
n
na + xi b + xi2 c = yi (5:77)
i=1 i=1 i=1
X
n X
n X
n X
n
xi a + xi2 b + xi c = xi yi (5:78)
i=1 i=1 i=1 i=1
X
n X
n X
n X
n
xi2 a + xi3 b + xi4 c = x2i y (5:79)
i=1 i=1 i=1 i=1
2 P P 32 3 2 P 3
n xi x2ia yi
6P P P 3 76 7 6 P 7
4 xi xi2 xi 54 b 5 = 4 xi yi 5 (5:80)
P 2 P P 4 P 2
xi xi3 xi c xi yi
These normal equations can now be solved for the coefficients a, b and c using ma-
trices. Similarly higher order polynomials can also be used to fit the given data
points into the equation.
88 Chapter 5 Numerical curve fitting
Using the LSC fitting method as per equation y = a + bx + cx2 where y = ∏/ρ, x = ρ and a = RT/M,
calculate M.
Solution: The given equation is for the the van’t Hoff equation for a polymer for which the normal
equations 5.77–5.79 may be written
X
n X
n X
n
na + xi b + xi2 c = yi (5:77)
i=1 i=1 i=1
X
n Xn X
n Xn
xi a + xi2 b + xi c = x i yi (5:78)
i=1 i=1 i=1 i=1
Xn Xn Xn X n
xi2 a + xi3 b + xi4 c = xi2 y (5:79)
i=1 i=1 i=1 i=1
0.7
y = 416.73x 2 + 16.554x + 0.0906
0.6 R 2 = 0.994
0.5
0.4
0.3
0.2
0.1
0
–0.005 0 0.005 0.01 0.015 0.02 0.025
The limiting value of ∏/ρ at infinite dilution can be determined by plotting ∏/ρ versus ρ and deter-
mining the intercept when ρ→0 (Figure 5.6). Therefore, M = ð=ρÞ RT . Tabulating the required data
ρ!0
in Table 5.8 as
that gives
Table 5.8: Linear regression data.
LSC fitting helps in trend analysis if one extrapolates the curve to predict what
should be the behaviour or value of observable at any random point of interest. It
compares the given measured data with the standard mathematical models (equa-
tions). It is a standard tool that is used in spreadsheets in terms of trendline that is
derived from the LSC fitting itself.
Spreadsheets uses a set of statistical models and parameters called analysis of vari-
ance (ANOVA) to calculate statistical parameters including correlation and regres-
sion by using some keywords stored in the spreadsheets.
(1) To find the correlation one may enter the data in the two tables for which the
relationship is to be determined, then in any blank cell, type CORREL (Array1,
Array2) and press enter (Table 5.9).
A B
Concentration Absorbance
. .
. .
. .
. .
. .
= CORREL(A:A,B:B)
5.6 Regression and correlation in EXCEL 91
The result obtained is 0.9945 which is identical when using the Pearson correla-
tion formula for which the keyword is PEARSON (Array1, Array2). The square of
correlation coefficient is nothing but regression coefficient which can be verified
either graphically or using LSC fitting since A = εcl, linear relationship exists be-
tween absorbance and concentration having a slope of εl, with no intercept.
(2) To find the slope and intercept between the data points having linear relation-
ship, LINEST function is used which uses the LSC method only.
A B
Concentration Absorbance
. .
. .
. .
. .
. .
=INTERCEPT(B:B,A:A) =SLOPE(B:B,A:A)
=SLOPE(B2:B6,A2:A6)
=INDEX(LINEST(B2:B6,A2:A6),1)
The 1 and 2 status in the syntax refers to the slope and intercept. The LINEST func-
tion returns the statistics for a line by using the method of LSC. It calculates the
value of slope and intercept that best fits the given data. Not only LINEST function
but SLOPE as well as the INTERCEPT function can also be used to evaluate slope
and intercept, respectively. The results obtained are same as obtained by solving
the equation used earlier.
92 Chapter 5 Numerical curve fitting
LINEST function is most useful when there are two or more independent vari-
able, also called MLR (Table 5.11). In such cases, the data is fed in the reverse order
of the independent variable. For example, there are two independent variable x1
and x2 and one dependent variable (y), then after the data is fed, select three cells
continuously in a row (A8,B8,C8) and enter the formula in the formula bar above
and press Ctrl + Shift + Enter.
Its syntax is LINEST(y’s, x’s(reverse order))
A B C
x x Y
Hence by plugging the slope and intercept values, the equation may be written as
TREND(known_y's,known_x's) or
TREND(known_y's,known_x's, unknown x’s value
5.6 Regression and correlation in EXCEL 93
FORECAST is similar to TREND function except that syntax is a bit different. While
FORECAST can take only one predictor while TREND can do multiple predictors.
These function can also be reached using the data analysis tab add ins.
(3) To find the regression, one may use data analysis and select regression (Figure 5.7).
A new window would appear asking to select the data range (Figure 5.8).
Once the data range is selected and the range of output is selected in a spreadsheet,
the output would be displayed as shown in Figure 5.9.
SUMMARY OUTPUT
Regression statistics
Multiple R 1
R square 1
Adjusted R square 1
Standard error 2.77556E–16
Observations 4
ANOVA
df ss Ms F Significance F
Regression 2 0.292913593 0.146457 1.9E+30 5.1284E–16
Residual 1 7.70372E–32 7.7E–32
Total 3 0.292913593
Coefficients Standard error t stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0%
Intercept 0.573290316 1.5066E–15 3.81E+14 1.67E–15 0.57329032 0.5732903 0.57329032 0.57329032
X Variable 1 1.49410907 9.2202E–16 1.62E+15 3.93E–16 1.49410907 1.4941091 1.49410907 1.49410907
X Variable 2 1 9.2202E–16 1.08E+15 5.87E–16 1 1 1 1
This analysis is based on ANOVA, which is a very powerful tool that may disburse a
lot of information on statistical parameters and helps in constructing useful statisti-
cal model if the range of data is correct.
t(°C)
Determine the activation energy using LSC method as per the equation
lnðη=η0 Þ = lnðA=η0 Þ + E
RT
2. Using the LSC fitting, fit the following molar heat capacity for oxygen according
to the equation y = a + bðT=K Þ + cðT=K Þ2
3. Using the given data for decomposition of NO2 (g), fit the data using LSC
method for the equation y = a + bx where y = log ½NO2 =moldm − 3 and x = t (s).
If b = –k/2.303, find the rate constant k.
4. The following data was obtained for the optical activity of a solution:
Using the LSC fitting method of the form y = a + bx, find the rate constant k,
where b = –k/2.303, where y = logfðθα − θt Þ=ðθα − θ0 Þg and x = t (min).
6. Calculate Kd for the distribution of I2 between CCl4 and water (using LSC) for
the given data.
Corg (mol dm−) . × − . × − . × − × − . × −
Caq (mol dm−) × − . × − × − . × − × −
Chapter 6
Numerical integration
6.1 Introduction
y
y = F (x)
f (x)
a b
Figure 6.1: Definite integral of a function is the area under the curve.
https://doi.org/10.1515/9783110695328-006
98 Chapter 6 Numerical integration
While trapezoidal rule approximates the integral using a straight line, Simpson’s
rule uses a curve or polynomial (Figure 6.2). Each method gets better by using bet-
ter approximations of higher degree polynomial.
f (x) f (x)
a b x a b t
(a) (b)
Figure 6.2: Approximating integral by a straight line (a) and a curve (polynomial) (b).
In order to calculate the area under the curve between the interval a and b
(Figure 6.3), the interval [a, b] is divided into n sub-intervals of width h as
b−a
h= (6:1)
n
f(x5)
f(x0)
a = x0 x1 x2 x3 x4 b = x5
Figure 6.3: Riemann sum (underestimating the area under the curve).
The area under the curve can be approximated by adding the area of all the rectan-
gles inside the curve as
Area = f ðx0 Þðx1 − x0 Þ + f ðx1 Þðx2 − x1 Þ + f ðx2 Þðx3 − x2 Þ + f ðx3 Þðx4 − x3 Þ + f ðx4 Þðx5 − x4 Þ
(6:2)
Area = ff ðx0 Þ + f ðx1 Þ + f ðx2 Þ + f ðx3 Þ + f ðx4 ÞgΔx (6:3)
X
4
Area = f ðxi ÞΔ x (6:4)
i=0
X
n−1
Area = f ðxi ÞΔ x (6:5)
i=0
nð
−1
f(x5)
f(x0)
a = x0 x1 x2 x3 x4 b = x5
The formula and the method remains the same but this way the area under the
curve is overestimated. Hence, Riemann’s sum is a very vague method to find the
integral. Clearly, this method seems to either underestimates or overestimates the
integral. Hence, to account for better area, trapezoidal rule was introduced.
y1 y2 y3 y4 y5 y6
y0
a Δ𝑥 Δ𝑥 Δ𝑥 Δ𝑥 Δ𝑥 Δ𝑥 b
If the area under the curve is divided into n number of trapezium (number of
intervals) then according to the figure area (Figure 6.5)
1 1 1 1
Area = ðy0 + y1 ÞΔ x + ðy1 + y2 ÞΔ x + ðy2 + y3 ÞΔ x + + ðyn − 1 + yn ÞΔ x (6:7)
2 2 2 2
If we are given a function f(x) which is continuous between the intervals a and b,
then the interval is divided into n sub-intervals, so we can write
y0 = f ðaÞ (6:9)
y1 = f ða + ΔxÞ (6:10)
y2 = f ða + 2ΔxÞ (6:11)
yn − 1 = f ða + iΔxÞ (6:12)
yn = f ðbÞ (6:13)
ðb n
y + y o
0 n
Area = f ðxÞ ≈ Δ x + ðy1 + y2 + + yn − 1 Þ (6:15)
2
a
102 Chapter 6 Numerical integration
ðb
f ðaÞ + f ðbÞ
Area = I = f ðxÞ ≈ h + ðf ða + ihÞÞ (6:16)
2
a
It is evident that as the number of intervals (n) is increased, the width of the interval
decreases (Figure 6.6). This increases the accuracy of approximation. The trapezoidal
rule results can be improvised by increasing the number of intervals and decreasing the
step size (h) but it adds to the overall round off error. To evade this situation, Simpson’s
rule was devised by using higher order polynomial to approximate the function.
1 1 1
0 0 0
0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1
Ð Ð1
Example 1: Using trapezoidal rule (Table 6.1), find the value of f ðxÞdx = 0 ð5x − 2x 2 Þdx using 10
intervals.
Solution: Here the limits of the integral a and b are given as 0 and 1, respectively, n = 10
b−a 1−0
h= = = 0.1
n 10
x x x x x x x x x x x
x . . . . . . . . . .
f(x) . . . . . . . . . .
ðb
1 dN M 3=2 − Mu2 2
= 4π exp u du (6:18)
N du 2πRT 2RT
a
for O2 gas with du = (b–a)/N where a = 0, b = 1,500, N = 15 using all the three methods.
Solution: The given equation is Maxwell–Boltzmann’s equation for distribution of speeds (Figure 6.7),
for which the area under the curve represents the probability of finding the fraction of molecules having
the said range of speeds which is always equal to 1. The same can also be verified using trapezoidal
rule as well. For each molecular speed sub-interval, the ratio N1 dN
du is tabulated (Table 6.2) and then inte-
grating the area under the curve gives the probability of finding the molecule having that speed.
0.0025
0.0015
0.001
0.0005
0
0 200 400 600 800 1,000 1,200 1,400 1,600
Molecular speed (u)
.
h
I= ½f ðaÞ + f ðbÞ + 2ðf ða + ðn − 1ÞhÞ (6:19)
2
Since h = ð1500 − 0Þ=15 = 100
Example 3: Calculate the change in entropy of nitrogen heated at constant pressure from 298 to
373 K where temperature variation of Cp,m is given by the expression
0.1
CP V S T
0.095
0.09
Cp
0.085
0.08
0.075
0.07
298 304 310 316 322 328 334 340 346 352 358 364 370 376
Temperature (T )
While solving the integral by the conventional way of using limits, the change in entropy is found
to be 6.75 J K−1. Hence the results from trapezoidal rule is quite satisfactory because the number of
intervals are large.
ðb − aÞ3 ′′
E= − f ðxÞ (6:25)
12
where a < x < b.
where f"(x) is the second derivative of f(x) over the interval [a,b]. Hence, E is propor-
tional to h3.
106 Chapter 6 Numerical integration
Simpson’s rule is the second type of Newton–Cotes method of second order for ap-
proximating the integral of function f(x) using polynomial (e.g. parabolic arcs in-
stead of the straight line used in trapezoidal rule). The Simpson’s rule was named
after Thomas Simpson to approximate the area under the curve and to account for
the inaccuracy in Trapezoidal rule. While the trapezoidal rule works better for linear
functions, Simpson’s rule works very well for curves and polynomials. This method
is more accurate than other numerical method of integration (Figure 6.9).
f ( x3)
y = f (x)
p(x)
f ( x1)
f (x2)
h h
x
x1 = a x2 x3 = b
In Simpson’s 1/3rd rule, a parabola is used to approximate each part of the curve.
The area is divided into n equal segments of width Δx. Simpson’s rule can be de-
rived by approximating the Lagrange’s polynomial. Here Pi(x) is the polynomial of
degree ≤ n–1 that passes through n points (x1, y1), (x2,y2), . . . , (xn,yn) and is given by
X
n
PðxÞ = Pi ðxÞ (6:26)
i=1
x − xk
PðxÞ = yi Πnk = 1 (6:27)
xi − xk
x − xk
li ðxÞ = Πnk = 1 (6:28)
xi − xk
where
x − x0 x − x1 x − xi − 1 x − xi + 1 x − xn
li ðxÞ = (6:29)
xi − x0 xi − x1 xi − xi − 1 xi − xi + 1 xi − xn
Here the basic assumption made is that the area under the curve is divided into three
equal parts as shown (Figure 6.10). This method involves approximating Lagrange’s
6.2 Newton–Cotes formula 107
f0 f(x)
f1 g(x)
f2
x0 x1 x2
h h
x0 = 0 x1 = h x2 = 2h coordinate shift
second-order polynomial where the interval is divided between x0 and x2 which gives
the width of spacing between two intervals as
x2 − x0
h= (6:30)
2
PðxÞ = f0 L0 ðxÞ + f1 L1 ðxÞ + f2 L2 ðxÞ (6:31)
where
x − x1 x − x2
L0 ðxÞ = (6:32)
x0 − x1 x0 − x2
x2 − 3hx + 2h2
L0 ðxÞ = (6:33)
2h2
x − x0 x − x2
L1 ðxÞ = (6:34)
x1 − x0 x1 − x2
4hx + 2x2
L1 ðxÞ = (6:35)
2h2
x − x0 x − x1
L2 ðxÞ = (6:36)
x2 − x0 x2 − x1
x2 − hx
L2 ðxÞ = (6:37)
2h2
We know we can integrate function f(x) as
xð2
I= f ðxÞdx (6:38)
x0
108 Chapter 6 Numerical integration
Hence
2xð2 2
x − 3hx + 2h2 4hx + 2x2 x − hx
I= f0 + f1 + f2 dx (6:39)
2h2 2h2 2h2
x0
3 3 2h
1 x 3hx2 4hx2 2x3 x hx2
I = 2 f0 − + 2xh2 + f1 − + f2 − +E (6:40)
2h 3 2 2 3 3 2 0
3 3 2h
1 8h 12h3 16h3 8h 4h3
I = 2 f0 − + 4h − 0 + f1 8h −
3 3
+ f2 − +E (6:41)
2h 3 2 2 3 2 0
h
I= ½f0 + 4f1 + f2 + E (6:42)
3
Since the final expression has a factor of 1/3, it is also called Simpson’s 1/3 rule.
f(x) fN
f(x)
f0
f1 f4
f2 f3
x
h h
a b
Sub- Sub-
int. 1 int. 2
h
I= ½ðf0 + 4f1 + f2 Þ + ðf2 + 4f3 + f4 Þ + ðf4 + 4f5 + f6 Þ + + ðfN − 4 + 4fN − 3 + fN − 2 Þ
3 (6:43)
+ ðfN − 2 + 4fN − 1 + fN Þ + E
6.2 Newton–Cotes formula 109
h
I= ½ðf0 + 4f1 + 2f2 + 4f3 + 2f4 + 4f5 + + 2fN − 2 + + 4fN − 1 + fN Þ + E (6:44)
3
X
N −1 X
N −2
h
I= f ðaÞ + f ðbÞ + 4 f ða + ihÞ + 2 f ða + ihÞ + E (6:45)
3 i = 1, 2 i = 2, 2
Here it is important to note that there are even number of intervals N while there are
N + 1 integration points which are odd. The Simpson’s rule gives more accurate re-
sults than trapezoidal rule. Simpson’s rule uses quadratic function to approximate
the function over the given interval. The Simpson’s rule demands a condition that N
should be even and h must be a constant. Even if N is odd, h still must be constant.
The truncation error in the expression is given by
− 1 5 ′′′′
E= h f ðxÞ (6:46)
90
− ðb − aÞ5 ′′′′
E= f ðxÞ (6:47)
2880
where f""(x) is the fourth derivative of the function at a point in between [a, b].
Just like Simpson’s 1/3 rule is based on quadratic approximation of the polynomial,
when the polynomial is approximated by cubic interpolation, it is known as Simpson’s
3/8 rule (Figure 6.12)
y
y = f (x)
f (x4)
f ( x3)
p(x)
f ( x1)
f ( x2)
h h h
x
x1=a x2 x3 x4=b
xð3
3h
I= f ðxÞdx = ½f ðx0 Þ + 3f ðx1 Þ + 3f ðx2 Þ + f ðx3 Þ + E (6:48)
8
x0
− 3h5 ð4Þ
E= f ðξÞ (6:49)
80
When the integration is carried over by integrating the interval over five equally
spaced sub-intervals, it is called Boole’s rule which is given as
xð4
2
f ðxÞdx = hð7f0 + 32f1 + 12f2 + 32f3 + 7f4 Þ + E (6:50)
45
x0
Example 4: Using the same data used in Example 2 for Maxwell distribution of speeds, calculate
the area under the curve using Simpson’s rule.
Solution: Use the Simpson’s composite rule for more accurate result since there are large number
of intervals and also there is marked difference between f(x) values, hence
hh X X i
I= f ð0Þ + f ð1, 500Þ + 4 f ðodd intÞ + 2 f ðeven intÞ (6:52)
3
h = (1500–0)/15 = 100
100
I= ½0 + 4.0771 × 10 − 8 + 4ð0.004999958Þ + 2ð0.004999994Þ (6:53)
3
I = 0.9999953 ≈ 1
Calculate ΔS for heating of 1.00 mol of solid zinc from 20.0 to 300.0 K from the given data using
both trapezoidal rule and Simpson’s rule and compare the results.
6.2 Newton–Cotes formula 111
.
.
Solution: In this problem, we are given the temperature and the heat capacity at that temperature.
According to the integral, we need to calculate Cp/T as y function which is tabulated (Table 6.4)
and depicted graphically (Figure 6.13).
.
. .
. .
. .
1.2
CP/T VS T
1
Cp/T
0.8
0.6
0.4
0.2
0
20 40 60 80 100 120 140 160 180 200 220 240 260 280 300
Temperature (T )
Figure 6.13: Variation of Cp/T with T (area under the curve gives entropy).
I = 266.9565 2 JK − 1 mol − 1
Using Simpson’s rule
300 − 20
I= ½f ð20Þ + f ð300Þ + 4ð6.728525Þ + 2ð5.6948Þ (6:56)
14 × 3
I = 267.70025 J K − 1 mol − 1
When solving the function analytically, ΔS is found to be 253.9297 J K–1 mol–1.
Example 6: What is the work done for a real gas if 1.00 mol of Cl2 expands reversibly from 1 dm3 to
49 dm3 at 273 K where a = 0.655 MPa dm6 mol−2 and b = 0.055 dm3 mol−1 and R = 8.314 J K–1 mol–1.
Solution: We know that for real gases, van der Waal’s equation of state for 1 mol of gas is given as
RT a
p= − (6:57)
V − b V2
and the work done is given by
ð ð
RT a
w= − pdV = − − 2 dV (6:58)
V −b V
6.2 Newton–Cotes formula 113
. .
2,500
pV work
2,000
1,500
f (x)
1,000
500
0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
Volume (V)
w = − 8.687 kJ mol − 1
Using Simpson’s composite rule,
1 49 − 1
w= × ½1.7929 + 4ð1.9567Þ + 2ð1.4905Þ (6:61)
3 24
w = − 8.400 kJ mol − 1
The equation when solved analytically, work done is −8.319 kJ mol−1.
Mid-Point formula
This rule doesn’t use the end points rather use the mid point of the interval. The formula involves
calculation of function at a single point i.e. at the mid point of the interval. Hence integral
ðb
f ðxÞdx ≈ ðb − aÞf ðxm Þ
a
where xm is the mid-point,
a+b
xm =
2
Two-point formula
The two-point formula uses two sub-intervals rather the original intervals. When the function f(x) is
continuous between the interval [a,b] then using the two-point formula, hence integral is
ðb
b−a
f ðxÞdx ≈ ðf ðx1 Þ + f ðx2 ÞÞ
2
a
6.3 Exercises for practice 115
Three-point formula
In this method, the interval is divided into four sub-intervals such that
b−a
h=
4
ðb
4h
f ðxÞdx = ð2f ðx1 Þ − f ðx2 Þ + 2f ðx3 ÞÞ
3
a
ðb
b−a
f ðxÞdx = ð2f ðx1 Þ − f ðx2 Þ + 2f ðx3 ÞÞ
3
a
where
3a + b a+b 3b + a
x1 = , x2 = , x3 =
4 2 4
5. Calculate the increase in enthalpy from 300 to 1,100 K using numerical integra-
tion given the following data
7.1 Introduction
https://doi.org/10.1515/9783110695328-007
118 Chapter 7 Differential equations
h dy h2 d2 y h3 d3 y
f ðx + hÞ = f ðxÞ + + + + (7:2)
1! dx 2! dx2 3! dx3
or
h ′ h2 h3
yðx + hÞ = yðxÞ + y ðxÞ + y′′ðxÞ + y′′′ðxÞ + (7:3)
1! 2! 3!
where h is the difference between two successive points like x and x + h. If the inter-
val between different x values is small, i.e. h is small, then Euler’s method approx-
imates the expansion term in Taylor’s series so the earlier expansion can be
approximated as (ignoring higher order terms because they are very small)
where f ðx, yÞ is the derivative of y at (x0, y0), x0 is the initial value of x and y0 is the
value of y at x = x0 (i.e. the initial condition). In general, one may write
yn + 1 = yn + hf ðxn , yn Þ (7:5)
yn +1 is the next estimated value, yn is the current value, h is the interval size and
f(xn,yn) is the derivative at [xn,yn]. Since Euler’s method retains only first-order de-
rivative terms from the Taylor’s series expansion of the function, it is also called
RK’s method of first order.
A first-order differential equation may be considered as a derivative or slope of
the function:
dy
= f ðx, yÞ (7:6)
dx
The Euler’s method uses the basis of initial value problem which suggests that as
we calculate the next value of y1 from initial y0 value, this calculated value becomes
the initial value for the next higher value of y2.
Example 1: Using the Euler’s method, solve the following differential equation:
dy y
=5−3 (7:7)
dx x
Given y(3) = 1 and h = 0.1.
7.2 Euler’s method 119
Solution: The initial conditions are given as y(3) = 1, that is, at x = 3, y = 1. Using eq. (7.7), dy/dx is
calculated as
dy 1
f ðx, yÞ = =5−3 =4 (7:8)
dx 3
Since
xn + 1 = xn + h = 3.1
likewise
yn + 1 = yn + hf ðx, yÞ, which gives yn + 1 = 1 + ð0.1Þð4Þ = 1.4
The remaining results are tabulated in Table 7.1 and depicted graphically in Figure 7.1. One may
calculate the data points using the earlier differential equation.
x y dy/dx
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
4.0
y
1.0 3, 1.0
0.5
0.0
2.9 3.1 3.3 x 3.5 3.7 3.9
Example 2: Using the solution of differential equation for first-order kinetics y’ = –ky ( i.e. [At] = –k[A] )
with the initial condition of [A0] = 0.25 mol dm–3, determine the concentration [A] at t = 200, 400, 600,
800, 100 and 1,200 s where k = 0.000622 s−1.
Solution: Here a first-order differential equation, Euler’s method would be used as
d½A
= − k½A (7:9)
dt
where initial condition is [A](t = 0) = [A0] = 0.25, h = 200 s
x y dy/dx
. −.
. −.
. −.
. −.
. −.E–
, . −.E–
, . −.E–
0.3
0.25 0, 0.25
200, 0.218
0.2 400, 0.191
y
600, 0.167
0.15 800, 0.146
1,000, 0.128
1,200, 0.112
0.1
0.05
0
0 200 400 600 x 800 1,000 1,200 1,400
lny = − kx + C (7:12)
where C = ln 0.25 which gives the same results as found out by Euler’s method while the general
solution is
ln½A = C − kt (7:15)
As compared to Euler’s method which requires very small intervals to give accurate
results, RK method produces better results in lesser steps. It is a numerical method to
integrate a differential equation. RK methods are robust method which gives good
numerical solution of differential equations if the step size is taken intelligently. RKs
fourth-order algorithm is more popular due to their accuracy in the results.
The aim of RK method is same as of Euler’s method, that is, to find the value of
y at any other value of x if the initial values are given. Euler’s method will be exact
when the solution is a line while RK methods will be accurate if the solution is a
polynomial of higher order. (Euler’s method is same as RK1 method.) RK methods
for higher order polynomial are more accurate and involve multi-stage calculations
involving calculations at various slope values (e.g. RK3 and RK4 methods).
RK method provides good approximation to a function without having to differ-
entiate the equation unlike Taylor’s series (only if the point of interest is close
enough). Taylor’s method differentiates the function for each new term one intends
to calculate. RK method aims to simulate as many steps of Taylor’s series while
evaluating the original function. RK method order 4 formula, also called RK4, is
widely used in the fields of mechanics, climate models, aerodynamics, environmen-
tal studies models, drug delivery, ecosystem study and many other sub-branches of
physics, chemistry and biology.
dy
= f ðx, yÞ (7:6)
dx
It involves calculating the intermediate value and then use this value to calculate
the final value. We know by Euler’s method that
yn + 1 = yn + hf ðxn , yn Þ (7:16)
where the symbols have their usual meaning as described in the earlier methods.
The Taylor’s series is given as
h ′ h2 h3
yðx + hÞ = yðxÞ + y ðxÞ + y′′ðxÞ + y′′′ðxÞ + (7:17)
1! 2! 3!
If the first two terms of the Taylor’s series are retained then it is nothing but Euler’s
method or RK’s first-order method. But if the first three terms are retained, then the ap-
proximation would look like
h2 ′
yn + 1 = yn + hf ðxn , yn Þ + f ðxn , yn Þ (7:18)
2!
And is called RK second-order method where f ′(xn, yn) is the double derivative of
function at point xn,yn. This implies that second-order derivative is to be calculated
which is very difficult to calculate using the differential equation. Instead RK wrote
second-order method as
k1 k2
yn + 1 = yn + + h (7:19)
2 2
h2 h3
E= f ðxn , yn Þ + f ′ðxn , yn Þ + (7:20)
2! 3!
which is nothing but the remaining terms of the Taylor’s expansion series.
Example 3: Using the solution of second-order RK method of differential equation for kinetics, as
dy/dx = −ky2 with the initial condition of y(t = 0) = 632 mol dm–3 at t = 3,6, 9,12, 15 and 18 min
where k = 1.78 × 10−5 dm3 min–1.
Solution: Here the initial condition is given as x = 0 and y = 632
dy
= − ky 2 (7:21)
dx
Using the second-order RK method of differential equation we have
7.3 Runge–Kutta method 123
k1 k2
yn + 1 = yn + + h (7:19)
2 2
where k1 = f (xn, yn) and k2 = f (xn + h, yn + k1 h)
dy
k1 = f ðx, yÞ = = − 1.78 × 10 − 5 ð632Þ2 = − 7.109 (7:22)
dx
Similarly xn + h = 0 + 3 = 3 and yn + k1 h = 632 + ð− 7.10Þ3 = 610.67
x y k k x+h y + k h
650
Y
630 0, 632
610 3, 611.38
590 6, 592.06
9, 573.92
570
12, 556.86
550
15, 540.79
530 18, 525.62
510 21, 511.27
490
470
450
0 5 10 X 15 20 25
1
y= (7:25)
kt + ð1=632Þ
which gives the same results.
7.3.2 RK3
RK3 is also known as RK method of order 3. In RK3 method, one more Taylor series
term is included as compared to RK2 method. RK3 is comparatively more accurate
than RK2 but less precise than RK4
1
yn + 1 = yn + ðk1 + 2k2 + k3 Þh (7:26)
6
7.3.3 RK4
Also known as RK method of order 4 is the most popular method to solve first-order
differential equations. Apart from being the most accurate, it requires less computa-
tion time. In general, the RK formula for any y(x + h) point can be written as
1
yn + 1 = yn + ðk1 + 2k2 + 2k3 + k4 Þ (7:27)
6
k
where k1 = hf ðx, yÞ, k2 = hf x + h2 , y + k21 , k3 = hf x + h2 , y + 22 , and k4 = hf ðx + h, y + k3 Þ
Originally the RK method was derived analytically rather from geometric mean
point of view since from the formula, it is clear that it takes into account the geo-
metric weight of ki.
Example 4: Using RK method of order 4, solve the following differential equation using step size h = 0.1:
dy
ð1 + x 2 Þ + xy = 0 (7:28)
dx
y ð0Þ = 2, h = 0.1
Solution: On rearranging, we have
dy − xy
= (7:29)
dx 1 + x 2
Using initial value problem, we have y(0) = 2, that is, at x = 0, y = 2,
7.3 Runge–Kutta method 125
. . . . . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
. . −. −. . . −. . −. . . −.
2.500
2.000
1.500
y
1.000
0.500
0.000
0.000 0.200 0.400 0.600 0.800 1.000 1.200 1.400
x
Second-order differential equations can also be solved using the earlier numerical
methods for solving differential equation. One such example of such equation is vi-
brating springs where an object of mass is held at the end of a spring (Hooke’s law).
According to the latter, the restoring force is given as F = −kx, where k is the spring
constant. Also using Newton’s law, F = ma where m is the mass of the object held to
the spring where acceleration can be written in terms of derivative of displacement of
the spring from the equilibrium position. This gives a second-order differential equa-
tion as
d2 x
m = − kx (7:30)
dt2
and the general solution is given by
where
rffiffiffiffi
k
ω=
m
For such second-order differential equations
d2 y dy
m +n + ky = 0 (7:32)
dx2 dx
The equations can be written as two simultaneous coupled first-order equations by
defining a new variable z as
dy
= z = f ðx, y, zÞ (7:33)
dx
d2 y dz
= = gðx, y, zÞ (7:34)
dx2 dx
Hence the earlier equation can be rewritten as
dz
m + nz + ky = 0 (7:35)
dx
This equation can also be solved using either Euler’s method or RK4 method. For
RK4 method, different coefficients are given as
k0 = hf ðx0 , y0 , z0 Þ, l0 = hgðx0 , y0 , z0 Þ
k l k l
k1 = hf x0 + h2 , y0 + 20 , z0 + 20 , l1 = hg x0 + h2 , y0 + 20 , z0 + 20
k2 = hf x0 + h2 , y0 + k21 , z0 + l21 , l2 = hg x0 + h2 , y0 + k21 , z0 + l21
k3 = hf ðx0 + h, y0 + k2 , z0 + l2 Þ, l3 = hgðx0 + h, y0 + k2 , z0 + l2 Þ
1
y1 = y0 + 61 ðk0 + 2k1 + 2k2 + k3 Þ, z1 = z0 + ðl0 + 2l1 + 2l2 + l3 Þ
6
7.3 Runge–Kutta method 127
Example 5: A spring of 2 kg is stretched to length 0.7 m with a force of 25.6 N, which had the equi-
librium length of 0.5 m then released with the initial velocity of zero. Find the position of mass at
0.7 s (Figure 7.5).
m Equilibrium 0
position
x m
Solution: As we have learnt, the solution of the above type of second-order differential equation is
given by
d2 x
m = − kx (7:30)
dt 2
According to Hooke’s law
kð0.2Þ = 25.6
k = 128
Substituting the values of mass and spring constant as
d2 x
2 + 128 x = 0 (7:36)
dt 2
when solved analytically, the general solution is
x y z k k k k l l l l
. . . −. −. −. −. −. −. −.
. . −. −. −. −. −. −. −. −. .
. −. −. −. −. −. −. . . . .
. −. −. −. −. −. . . . . .
. −. . . . . . . . . .
. −. . . . . . . . . −.
. . . . . . . −. −. −. −.
. . . . . . −. −. −. −. −.
. . −. −. −. −. −. −. −. −. −.
Chapter 7 Differential equations
7.4 Problems for practice 129
x ðt Þ = 0.2cos8t (7:40)
To find displacement at t = 0.7 s, x(0.7) = 0.1551. Likewise, the equation can be solved using the RK’s
method for solving differential equations (Figure 7.6) as shown in Table 7.5 using the above methodology.
Using the RK method, we got almost the same answer as 0.1514. Since they are approximate
methods, one may not always get the same exact answer as that of analytical solution but quite
close solution depending on the stability of the algorithm for the given problem.
Harmonic oscillator
0.25
0.20
0.15
0.10
Displacement (x)
0.05
0.00
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6
(0.05)
(0.10)
(0.15)
(0.20)
(0.25)
Time(s)
dy 8y
2. = 30x2 − , yð0Þ = 0, h = 0.1
dx 3
dy
3. = sinðx + yÞ − ex , yð0Þ = 3, h = 0.1
dx
d2 y dy
4. + − 6y = 0 given yð0Þ = 3 and y′ð0Þ = 1
dx2 dx
d2 y dy
5. + 20 + 64y = 0 yð0Þ = 0 and y′ð0Þ = 0.6
dx2 dx
Chapter 8
Numerical differentiation
8.1 Introduction
For a given point on the curve, the slope of the tangent to the curve gives the deriv-
ative of that function (curve). Numerical differentiation refers to calculating the de-
rivative of an unknown function at some assigned point when the discrete data
points are given. If we are given the set of data points for which the function is not
given but only the data, then we can use those points to determine derivatives
at those points. Numerical differentiation is the way of finding numerical value of
derivative of a given function at a given point. In general, the derivative can be ex-
pressed as
f ðx + hÞ − f ðxÞ
f 'ðxÞ = (8:1)
h
x2,y2
x1,y1
x0,y0
x–1,y–1
x–2,y–2
The derivative is the slope of the line that is made by connecting the data points
(Figure 8.1). The derivative (f'(x)) at the point x0 is
dy f ðx1 Þ − f ðx0 Þ y1 − y0
= f 'ðx0 Þ = = (8:2)
dx x1 − x0 x1 − x0
In general,
dy f ðxi + 1 Þ − f ðxi Þ yi + 1 − yi
= f 'ðxi Þ = = (8:3)
dx xi + 1 − xi xi + 1 − xi
https://doi.org/10.1515/9783110695328-008
132 Chapter 8 Numerical differentiation
This is also called forward difference formula (FDF). Similarly, if the two points are
x0, y0 and x–1, y–1, that is backward points are considered, then
dy f ðx0 Þ − f ðx − 1 Þ y0 − y − 1
= f 'ðx0 Þ = = (8:4)
dx x0 − x − 1 x0 − x − 1
dy f ðxi Þ − f ðxi − 1 Þ yi − yi − 1
= f 'ðxi Þ = = (8:5)
dx xi − xi − 1 xi − xi − 1
dy f ðxi + 1 Þ − f ðxi − 1 Þ yi + 1 − yi − 1
= f 'ðxi Þ = = (8:6)
dx xi + 1 − xi − 1 xi + 1 − xi − 1
This is called central difference formula (CDF). This formula can also be derived
using Taylor’s series expansion. These FDF, BDF and CDF are the simplest approach
to find derivative in case of a straight line case. But one does not have a straight
line always, in such cases interpolating polynomial is used to find the derivative.
f ðx + hÞ − f ðxÞ
f 'ðxÞ ≈ + ΔE (A:2)
h
where ΔE is the error. This formula is the general “finite difference formula” for first derivative. If
we want to estimate the error ΔE, we should consider the Taylor’s series expansion of x+h around
the neighbourhood x as
h2 h3 h4 iv
f ðx + hÞ = f ðxÞ + hf 'ðxÞ + f ''ðxÞ + f '''ðxÞ + f ðxÞ + . . . (A:3)
2! 3! 4!
which can also be rewritten as
f ðx + hÞ − f ðxÞ h2 h3 h4 iv
f 'ðxÞ = − f ''ðxÞ − f '''ðxÞ − f ðxÞ − . . . (A:4)
h 2! 3! 4!
Equation (A.2) was obtained by truncating all the terms but first two terms in eq. (A.4). Since the
approximation of the derivative of x above is based on the the values of x and x and x+h, this is
called forward difference formula. Here ΔE as can be seen as a function of h, can be reduced to
eq. (A.1) by truncating ΔE term, hence ΔE is also called truncation error. so
h
ΔE = f ''ðxÞ (A:5)
2
8.1 Introduction 133
Similarly if the Taylor’s series expansion (eq. (A.3)) is written in the neighbourhood of x–h then we
have
h2 h3 h4 iv
f ðx − hÞ = f ðxÞ − hf 'ðxÞ + f ''ðxÞ − f '''ðxÞ + f ðxÞ + . . . (A:6)
2! 3! 4!
which can be rewritten as
f ðxÞ − f ðx − hÞ h2 h3 h4 iv
f 'ðxÞ = + f ''ðxÞ − f '''ðxÞ + f ðxÞ + . . . (A:7)
h 2! 3! 4!
Again retaining only first two terms we get,
f ðxÞ − f ðx − hÞ h2
f 'ðxÞ = + f ''ðxÞ (A:8)
h 2!
which is of the form
f ðxÞ − f ðx − hÞ
f 'ðxÞ = + ΔE (A:9)
h
Where ΔE is the truncation error.
f ðxÞ − f ðx − hÞ
f 'ðxÞ = (A:10)
h
Equation (A.10) is known as the BDF and ΔE is its truncation error which is same as in eq. (A.5). So
far we have assumed that f’(x) is continuous, now assume that f’’(x) is also continuous. A three
term Taylor’s series expansion of f(x) about the point x+h and x–h, respectively, is as follows
h2 h3
f ðx + hÞ = f ðxÞ + hf 'ðxÞ + f ''ðxÞ + f '''ðxÞ (A:11)
2! 3!
h2 h3
f ðx − hÞ = f ðxÞ − hf 'ðxÞ + f ''ðxÞ − f '''ðxÞ (A:12)
2! 3!
Subtracting (A.12) from (A.11)
h3
f ðx + hÞ − f ðx − hÞ = 2hf 'ðxÞ + ½f '''ðξ 2 Þ + f '''ðξ 3 Þ (A:13)
3!
which on rearranging gives
f ðx + hÞ − f ðx − hÞ h2
f 'ðxÞ = − ½f '''ðξ 2 Þ + f '''ðξ 3 Þ (A:14)
2h 12
So the truncation error in eq. (A.14) is
h2
ΔE = − ½f '''ðξ 2 Þ + f '''ðξ 3 Þ (A:15)
12
Also according to the intermediate theorem
1
f '''ðξÞ = ½f '''ðξ 2 Þ + f '''ðξ 3 Þ (A:16)
2
So
h2
ΔE = − f '''ðξÞ (A:17)
6
134 Chapter 8 Numerical differentiation
ΔE is the truncation error for two points CDF. Hence, eq. (A.14) becomes
f ðx + hÞ − f ðx − hÞ h2
f 'ðxÞ = − f '''ðξÞ (A:18)
2h 6
Hence, eq. (A.18) is a second-order approximation of first derivative. Likewise, other higher order
approximations of derivative can be derived using Taylor’s series expansion:
f ðx + hÞ − f ðx − hÞ
f 'ðxÞ = (A:19)
2h
Formula (A.19) is known as CDF.
Interpolating polynomials are the general expression of polynomials that are used to
approximate the function f(x) which is then used to find the derivative by differentiat-
ing the polynomial directly. There are many ways to estimate derivative using interpo-
lation polynomial. Interpolation can thus also be used to estimate the value between
a set of data. For this, first determine the appropriate interpolating polynomial for
the given data. To carry out numerical differentiation, three types of interpolating
polynomials, namely, Newton’s interpolating polynomial, Stirling’s polynomial
and Lagrange’s polynomial are used.
(a) When the data points are equidistant then
(1) Newton’s forward interpolation formula is used to find the derivative (near
the beginning of the table).
(2) Newton’s backward interpolation polynomial is used to find the derivative
(near the end of the table)
(3) Stirling’s formula is used to find the derivative (near the centre of the table).
While if the data points are very far from each other, then Richardson extrapolation
is used to find the derivative.
x−x
where p = h 0 , y0 is the first value of the data set. Δy0 is the difference between two
consecutive y values while Δ2y0 is the difference between two Δy0 values and so on.
To find the derivative, the function y is differentiated with respect to p:
dy dy dp
= (8:9)
dx dp dx
dp 1
Since =
dx h
dy 1 2p − 1 2 3p2 − 6p + 2 3 4p3 − 18p2 + 22p − 6 4
= Δy0 + Δ y0 + Δ y0 + Δ y0 + . . . (8:10)
dx h 2! 3! 4!
At x = x0, p = 0
dy 1 Δ2 y0 Δ3 y0 Δ4 y0
= Δy0 − + − + ... (8:11)
dx x = x0 h 2! 3! 4!
Similarly
d2 y d dy d dy dp
= = . (8:12)
dx2 dx dx dp dx dx
d2 y 1 11 4 5 5
= Δ y0 − Δ y0 + Δ y0 − Δ y0 + ...
2 3
(8:13)
dx2 x = x0 h2 12 6
dy
For finding the maxima and minima of a function, dx = 0.
1/h ≠ 0, hence ignoring the higher order terms in eq. (8.10), a quadratic equa-
tion is obtained of the form
a + bp + cp2 = 0 (8:14)
Solving for p gives the maxima/minima of the function y = f(x) where x = x0 + ph.
Example 1: Find the derivative dy/dx at x = 2 using the given data points.
x
y −
Solution: Since the data points are equidistant (equally spaced x’s value) and the derivative is to
be found at the beginning of the table (at x = 1), Newton’s forward interpolating polynomial is used.
The given data points may be further tabulated in Table 8.1.
136 Chapter 8 Numerical differentiation
0 −7
5
1 −2 2
7 0
2 5 2 0
9 0
3 14 2 0
11 0
4 25 2 0
13 0
5 38 2
15
6 53
dy 1 Δ2 y0 Δ3 y0 Δ4 y0
= Δy0 − + − + ...
dx x = x0 h 2! 3! 4!
dy 1 2 0
= 7− +
dx x = 1 1 2! 3!
dy
=6
dx x = 1
One may also interpolate the given data and using curve fitting technique, and the general polyno-
mial equation for this data is y = x 2 + 4x − 7 for which the derivative is y' = 2x + 4, hence, the solution.
½At
ln = − kt (8:15)
½A0
Slope can give the rate constant when a graph between ln[A] versus t is plotted. Since the derivative
is to be found out at the start of the observation table (t = 200 s), the Newton’s forward interpolation
formula for derivative is used and the Newton’s forward difference construction table is constructed
(Table 8.2).
8.3 Derivatives using Newton’s backward interpolating polynomial 137
0 0.25 −1.386
−0.114
200 0.223 −1.500 −0.004
−0.118 −0.005
400 0.198 −1.619 −0.010 0.010
−0.129 0.004 −0.0007
0.174 600 −1.748 −0.005 0.010 −0.0200
−0.135 0.015 −0.0192
0.152 800 −1.883 0.009 −0.008
−0.126 0.006
0.134 1,000 −2.009 0.015
−0.110
0.12 1,200 −2.120
dy 1 ð − 0.010Þ 0.004 0.010 ð − 0.01929Þ
= − 0.118 − + − +
dx t = 200 200 2 6 24 60
dy
= − 0.0005689
dx t = 200
If the data point is to be estimated near the end of the data table, then Newton’s back-
ward interpolating polynomial is used which is
At x = x0 , p = 0
#
dy 1 Δ2 y0 Δ3 y0 Δ4 y0
= Δy0 + + + + ... (8:18)
dx h 2 3 4
x = x0
d2 y d dy d dy dp
= = . (8:12)
dx2 dx dx dp dx dx
Similarly
d2 y 1 11 4 5 5
= Δ2
y 0 + Δ 3
y0 + Δ y0 + Δ y0 + . . . (8:19)
dx2 x = x0 h2 12 6
Example 3: Calculate the derivative dy/dx at x = 1.5 from the following data:
Solution: Since the derivative needs to be calculated at the end of the table, Newton’s backward
difference polynomial (Table 8.3) for calculating derivative is used (eq. (8.18)).
Table 8.3: Newton’s backward difference interpolation formula for calculating derivative.
1 7.989
0.414
1.1 8.403 −0.036
0.378 0.006
1.2 8.781 −0.03 −0.002
0.348 0.004 0.001
1.3 9.129 −0.026 −0.001 0.002
0.322 0.003 0.003
1.4 9.451 −0.023 0.002
0.299 0.005
1.5 9.75 −0.018
0.281
1.6 10.031
dy 1 Δ2 y0 Δ3 y0 Δ4 y0
= Δy0 + + + + ...
dx x = x0 h 2! 3! 4!
dy 1 ð − 0.023Þ 0.03 ð − 0.001Þ 0.001
= 0.299 + + + +
dx x = 1.5 0.1 2 3 4 5
dy
= 2.884
dx x = 1.5
8.4 Derivatives using Stirling interpolating polynomial 139
dy 1 0.009 0.015 0.010 ð0.0007Þ
= − 0.126 + + + +
dx t = 1, 000 200 2 3 4 5
dy
= − 0.0005680
dx t = 1, 000
The Stirling formula computes the average of values obtained by Gauss forward
and backward interpolation. The condition for using Stirling’s formula is −1/2 < p <
1/2. The formula is given as
Δy0 + Δy − 1 p2 pðp2 − 1Þ Δ3 y − 1 + Δ3 y − 2
y ≡ y0 + p + Δ2 y − 1 +
2 2! 3! 2
5 (8:20)
p ðp − 1Þ 4
2 2
pðp − 1Þðp − 2 Þ Δ y − 3 + Δ y − 2
2 2 2 5
+ Δ y−2 + + ...
4! 5! 2
x − x0
where p =
h
140 Chapter 8 Numerical differentiation
Therefore, we get
dy 1 Δy0 +Δy − 1 3p2 −1 Δ3 y − 1 +Δ3 y −2 4p3 −2p 4
= + pΔ2 y − 1 + + Δ y −2 + ... (8:22)
dx h 2 3! 2 4!
At x = x0, p = 0
dy 1 Δy0 + Δy − 1 1 Δ3 y − 1 + Δ3 y − 2 1 Δ5 y − 2 + Δ5 y − 3
= − + − . . . (8:23)
dx x = x0 h 2 6 2 30 2
Similarly
d2 y 1 1 4 1 6
= Δ2
y −1 − Δ y −2 + Δ y −3 − . . . (8:24)
dx2 x = x0 h2 12 90
.
. . −.
−. −.E–
. . −. .E–
−. .E– −.E–
. . −. .E–
−. .E– −.E–
. . −. −.E–
8.4 Derivatives using Stirling interpolating polynomial 141
−. −.E–
. . −.
−.
. .
dy 1 Δy0 + Δy − 1 1 Δ3 y − 1 + Δ3 y − 2 1 Δ5 y − 2 + Δ5 y − 3
= − + − ...
dx h 2 6 2 30 2
− 16
dy 1 − 0.1 + ð − 0.172Þ 1 4.440 × 10 + 4.440 × 10 − 16
= −
dx x = 0.3 0.1 2 6 2
1 − 1.77 × 10 − 15 + ð8.88 × 10 − 16 Þ
+
30 2
dy
= − 1.36
dx x = 0.3
A !B
The rate of change of A is as follows:
Time (h) ∞
Time (h) ∞
As no particular data point is given to calculate the derivative, it is calculated at the middle inter-
val. Calculating the derivative at the interval of 2 h using Stirling’s polynomial method of derivative
(Table 8.7), we may depict the same as h = 1 h:
dy 1 Δy0 + Δy − 1 1 Δ3 y − 1 + Δ3 y − 2
= − + ...
dx
t = 2h h 2 6 2
dy 1 − 0.4605 + ð − 0.5409Þ 1 − 0.1191 + 0.1267
= −
dx t = 2h 1 2 6 2
dy
= − 0.5013
dx t = 2h
.
−.
−. .
−. −.
−. −. .
−. .
−. .
−.
−.
Higher order derivatives can be found out by subsequently differentiating the previ-
ous derivatives. Numerical differentiation using Stirling’s polynomial is more accu-
rate as compared to Newton’s polynomial. When the points are usually unequally
spaced, Newton’s divided difference polynomial and Lagrange’s polynomial is used.
When the intervals are unequispaced, then Newton’s divided difference interpola-
tion formula is used which is
f ðxÞ = f ðx0 Þ + ðx − x0 Þ f ½x0 , x1 + ðx − x0 Þðx − x1 Þ f ½x0 , x1 , x2
(8:25)
+ ðx − x0 Þðx − x1 Þðx − x2 Þ f ½x0 , x1 , x2 , x3 + . . .
8.5 Newton’s divided difference polynomial 143
y1 − y0
where f ½x0 , x1 =
x1 − x0
Δy2 − Δy0
similarly f ½x0 , x1 , x2 =
x2 − x0
The earlier equation is then differentiated with respect to x to find the derivative at the
particular point. Apart from Newton’s divided difference polynomial, Lagrange’s poly-
nomial is also used for interpolation of data points which are at unequal intervals.
X
Solution: Since data points are not equally spaced, the table for Newton’s divided difference table
(Table 8.8) for interpolation is constructed.
26 − 4
= 11
2−0
32 − 11
=7
3−0
58 − 26 11 − 7
= 32 =1
3−2 4−0
54 − 32
= 11
4−2
112 − 58 16 − 11
= 54 =1
4−3 7−2
118 − 54
= 16
7−3
466 − 112 22 − 16
= 118 =1
7−4 9−3
278 − 118
= 22
9−4
922 − 466
= 278
9−7
f ðxÞ = x 3 + 2x 2 + 3x + 4
f 'ðxÞ = 3x 2 + 4x + 3
f 'ðxÞx = 6 = 108 + 24 + 3 = 135
144 Chapter 8 Numerical differentiation
For the given data points x1, x2, x3, . . ., xn where they are not at equidistant, the
Lagrange’s interpolating polynomial for the points (x1,y1), (x2,y2), (x3,y3),. . ., (xn,yn)
is given by
The derivative of the function is the derivative of the Lagrange’s polynomial itself;
hence, we can write
− 3f ðxÞ + 4f ðx + hÞ − f ðx + 2hÞ
f 'ðx1 Þ ≈ (8:32)
2h
The above is the three-point FDF to find derivative in ith position. If we take the four
points x0, x1, x2, x3, then similarly the second derivative can also be found out as
2½ðx − x1 Þ + ðx − x2 Þ + ðx − x3 Þ 2½ðx − x0 Þ + ðx − x2 Þ + ðx − x3 Þ
f ''ðxÞ ≈ L''ðxÞ = f ðx0 Þ + f ðx1 Þ
ðx0 − x1 Þðx0 − x2 Þðx0 − x3 Þ ðx1 − x0 Þðx1 − x2 Þðx1 − x3 Þ
2½ðx − x0 Þ + ðx − x1 Þ + ðx − x3 Þ 2½ðx − x0 Þ + ðx − x1 Þ + ðx − x2 Þ
+ f ðx2 Þ + f ðx3 Þ (8:34)
ðx2 − x0 Þðx2 − x1 Þðx2 − x3 Þ ðx3 − x0 Þðx3 − x1 Þðx3 − x2 Þ
8.6 Lagrange’s polynomial 145
x0 = x, x1 = x + h, x2 = x + 2h and x3 = x + 3h we get
Example 8: Using the given data, find the derivative using Lagrange’s polynomial (Table 8.9).
Table 8.9: Lagrange’s polynomial for interpolation for unequispaced data points.
N
xn −
yn = f(xn) −
P2 ðxÞ = L0 ðxÞf ðx0 Þ + L1 ðxÞf ðx1 Þ + L2 ðxÞf ðx2 Þ + L3 ðxÞf ðx3 Þ (8:36)
where
ðx − x1 Þðx − x2 Þðx − x3 Þ −1 3
L0 ðxÞ = = ðx − 12x 2 + 39x − 28Þ
ðx0 − x1 Þðx0 − x2 Þðx0 − x3 Þ 80
ðx − x0 Þðx − x2 Þðx − x3 Þ 1 3
L1 ðxÞ = = ðx − 10x 2 + 17x + 28Þ
ðx1 − x0 Þðx1 − x2 Þðx0 − x3 Þ 36
ðx − x0 Þðx − x1 Þðx − x3 Þ −1 3
L2 ðxÞ = = ðx − 7x 2 − x + 7Þ
ðx2 − x0 Þðx2 − x1 Þðx2 − x3 Þ 45
ðx − x0 Þðx − x1 Þðx − x2 Þ 1
L3 ðxÞ = = ðx 3 − 4x 2 − x + 4Þ
ðx3 − x0 Þðx3 − x1 Þðx3 − x2 Þ 144
Substituting the values of (xn,yn), one may write
−1 3 1 3
P3 ðxÞ = ðx − 12x 2 + 39x − 28Þð − 2Þ + ðx − 10x 2 + 17x + 28Þð0Þ +
80 36
−1 3 1
ðx − 7x 2 − x + 7Þð63Þ + ðx 3 − 4x 2 − x + 4Þð342Þ (8:37)
45 144
P3 ðxÞ = x 3 − 1 (8:38)
P3 0 ðxÞ = 3x 2 (8:39)
P3 ð5Þ = 75
146 Chapter 8 Numerical differentiation
Example 9: Find the derivative dP/dV using the given data for van der Waal’s gas.
x x x x
x
Solution: Here the points are not equidistant; hence, the derivative can be found out using either
Newton divided difference formula or Lagrange’s polynomial. Hence, using the Newton divided dif-
ference formula as (Table 8.10)
dP=dV = − 1452.9303
It means that pressure decreases with increase in volume which is nothing but Boyle’s law.
Similarly using the Lagrange’s polynomial for interpolation for unequal spaces as
Both the methods give the same answer. When solved analytically using the Van der Waal’s
equation derivative, the answer is −1975.83. Being approximate methods, again the answer ob-
tained numerically will most of the times differ from conventional answer.
Sometimes when we use the data points that are not very close (Figure 8.2), for ex-
ample, xi and xi +1 and try to find the derivative or slope we get large amount of
error. It is so because the difference between the interval (h) of x is very large.
xi+1, yi+1
xi, yi
xi xi+1
Figure 8.2: Richardson’s extrapolation when data points are very far from each other.
If we reduce the h value, the slope value will improve like Figure 8.3.
xi+1,yi+1
xi,yi
xi+2,yi+2
xi xi+2 xi+1
Now we can see that when the interval was reduced the slope of the line improves
and one gets less error. Hence one can say that the accuracy of the method for esti-
mating the derivative or integral of the function f(x) depends on the spacing between
points at which the integral is evaluated. The approximation tends to improve as the
spacing tends to zero.
With h being the uniform spacing, the data points may be approximated by the
expression as
f ðxi + h Þ − f ðxi − h Þ h2
DðhÞ = f 'ðxi Þ = − f ''ðxÞ + Oðh4 Þ (8:40)
2h 6
D(h) is the approximated value by using CDF with step size h. Similarly we can
write the formula when the interval is h/2 as
f ðxi + h=2 Þ − f ðxi − h=2 Þ h2
Dðh=2Þ = f 'ðxi Þ = − f ''ðxÞ + Oðh4 Þ (8:41)
2ðh=2Þ 64
D(h/2) is the approximated value by using CDF with step size h/2, solving the earlier
two equations we get
4Dðh=2Þ − DðhÞ
D= (8:42)
3
D is the improved estimate or true value. This process of extrapolation from D(h)
and D(h/2) to approximate D with a higher order accuracy is called Richardson’s
extrapolation. The earlier formula explains the computation of approximation that
is fourth-order accurate. This method is further extended to achieve greater accu-
racy up to order of O(h6), O(h8) and so on. The general formula for orders O(h6) or
higher than that is
4k Dk − 1 ðh=2Þ − Dk − 1 ðhÞ
Dk ðhÞ = (8:43)
4k − 1
Example 10: Using the following data (Table 8.11), calculate derivative f'(x2) where h = 2.
n
xn
yn
8.8 Problems for practice 149
1
DðhÞ = f 'ðx2 Þ = ½f ðx2 + hÞ − f ðx2 − hÞ
2h
1
DðhÞ = f 'ðx2 Þ = ½f ð5Þ − f ð1Þ
4
1
DðhÞ = f 'ðx2 Þ = ½32 − 2 = 7.5
4
Similarly calculating D(h/2)
1 h h
Dðh=2Þ = f 'ðx2 Þ = h
f x2 + − f x2 −
22 2 2
1
Dðh=2Þ = f 'ðx2 Þ = ½f ð4Þ − f ð2Þ
2
1
Dðh=2Þ = f 'ðx2 Þ = ½16 − 4 = 6
2
Hence using eq. (8.41),
4Dðh=2Þ − DðhÞ
D=
3
4 × 6 − 7.5 16.5
D= = ≈ 5.5
3 3
The actual function is y = 2x, whose derivative y' = 2x lnj2j ≈ 5.5443.
This formula was to obtain an accuracy of fourth order. One may also achieve accuracy of higher
order.
x
y −
2. Using the Stirling’s polynomial for interpolating derivatives, find the most
probable speed in Maxwell’s distribution curve here:
1, ð
200
m 3=2
1 dN − Mu2
= 4πu 2
exp
N du 2πRT 2RT
0
150 Chapter 8 Numerical differentiation
x
x
y
Chapter 9
Numerical root-finding methods
9.1 Introduction
https://doi.org/10.1515/9783110695328-009
152 Chapter 9 Numerical root-finding methods
For N-R method, function f(x) can be written using a Taylor’s expansion as
h2
f ðx0 + hÞ = f ðx0 Þ + hf 'ðx0 Þ + f ''ðx0 Þ + = 0 (9:1)
2!
where f’(x0) and f’’(x0) are the first and second derivatives of f(x0) with respect to
x and h = x–x0. Since h⋘1, h2 can be neglected; hence, one may write
which gives
f ðx0 Þ
h= (9:3)
f 'ðx0 Þ
Therefore,
f ðx0 Þ
x = x0 − (9:4)
f 'ðx0 Þ
f ðxn Þ
xn + 1 = xn − (9:5)
f 'ðxn Þ
This equation is nothing but the equation of the tangent to the function f(x) at x = xn
which is extrapolated to x-axis to get xn +1 (first approximate root). Consider the
function f(x) which is continuous such that f’(x) ≠ 0.
Slope = f ′ (xn)
f (xn)
z xn+1 xn
This method assumes that functions that have continuous derivatives and look like
straight lines when looked closely can be approximated by a tangent to it. Assuming
9.2 Newton–Raphson method 153
f(x) has a continuous derivative, f ’(x) can be computed. Since f ’(x) ≠ 0, it implies that
any point on the f(x) curve will be a straight line. The function at (xn, f(xn)) can be
approximated by a straight line that is tangent to the curve at that point (Figure 9.1).
The slope of the line is f ’(x) which passes through (xn, f(xn)). Therefore, the equation
of the tangent line is
y − y1 = mðx − x1 Þ (9:6)
f ðxn Þ
xn + 1 = xn − (9:5)
f 'ðxn Þ
which is same as obtained earlier. Hence, the first approximation xn has improved
to xn +1, which is much nearer to the real root z. This approximation may then be
used to find another approximation until the real root (z) is reached. N-R greatly
depends upon the initial guess value, so the starting guess value should be chosen
carefully such that x0 is close to the original root z.
When the difference between the successive iterates is small enough to follow
|xn +1 – xn| < εabs, then xn +1 is the approximate root of the equation. Also if f(xn +1) is
sufficiently small enough such that |f(xn +1)| ≈ 0, then xn +1 is the approximation to
the root.
Example 1: Using N-R method, find the approximate root for the following function f(x):
f ð x Þ = x 2 + 5x − 3 = 0 (9:9)
Solution: The above function can be solved graphically (Figure 9.2) as well as numerically. The
roots are those which cut the x-axis, where f(x) = 0. The order of polynomial refers to the number of
roots the function has, which is two here. Graphically, it may be pointed that root lies between
[0,2] and another root between [–4,–6]. For the above function f(x), its derivative f’(x) = 2x + 5.
We can find both roots by employing N-R method using two different guesses. Taking the initial
guess x0 = 2, the results are tabulated in Table 9.1.
154 Chapter 9 Numerical root-finding methods
50
f (x)
f(x) = x2 + 5x – 3
40
30
20
10
0
–8 –6 –4 –2 0 x 2 4 6
–10
–20
. .
As evident from the table, f(x) becomes zero at the fifth iteration. Also at fifth iteration, difference be-
tween (xn +1−xn) = 0, so one of the roots is 0.5413812651. The difference between two roots is less than
0.000001(εabs) or even becomes zero on successive iterations. Similarly, when another guess is taken
which is close enough to another root, the another root is found to be −5.541381265 (Table 9.2).
Table 9.2: N-R method to find root using another guess value for f(x) = x2 + 5x–3.
− − − −
Although N-R is a very good method for approximating the roots, there are
some limitations. N-R method may fail if
(1) The approximation initial value (guess) is very far from the real root.
(2) The derivative of function is bit complicated. For example
pffiffiffi
Example 2: Find an approximation of 7 to 10 decimal places.
pffiffiffi pffiffiffi
Solution: 7 is an irrational number, hence, sequence of decimals will be non-stop. z = 7 is the
zero of the equation f(x) = x −7 on the interval [2,3].
2
So, here, using the N-R method having n approximation, the formula used is
f ðx0 Þ
x = x0 −
f 'ðx0 Þ
With the initial guess value be x0 = 2, the approximation is tabulated (Table 9.3).
N xn xn + f(x) f’(x)
. −
pffiffiffi
The correct approximation for 7 when deduced analytically is also found to be same.
156 Chapter 9 Numerical root-finding methods
Example 3: The inversion temperature of van der Waal’s gas can be calculated using the equation
appearing in the Joule–Thomson coefficient as
2a 3abp
− −b=0 (9:10)
RTi R2 Ti2
Calculate the inversion temperature at p = 10.133 MPa for N2 gas for which a = 0.141 MPa dm6 mol−2
and b = 0.0392 dm3 mol−1, R = 0.008314 dm3 MPa K−1 mol−1.
Solution: After rearranging the above equation we get,
So here, the above equation looks like a quadratic equation for which N-R method can be conve-
niently used where Ti is a variable like x and the other acts as coefficients (Table 9.4).
So, the temperature is 78.8 K. Similarly, giving another guess value gives 786.4 K since there are
two values of T for each value of p.
Iteration method is also known as the fixed point iteration method. It is one of the
most common and popular methods to find the real roots of a nonlinear equation or
function. It is an open, simple and cyclic type of process to find roots of nonlinear
equations by successive approximation. This method is used to find solution of arith-
metic series, geometric series, Taylor series and many other infinite series. Also known
9.3 Iteration method 157
with the name of an open bracket method or simple enclosure method, this method is
somewhat slower and converges linearly like binary bisection method. But it gives
quite good accuracy. It is a slow method and falls under the open method category
since its convergence is not guaranteed. Its algorithm requires only one guess value
and the equation is solved by the assumed approximation. It is a mathematical proce-
dure that generates approximate solutions for a given problem in which one approxi-
mate solution is derived from the previous one. The iterations are modified at each
successive level with the previous one. Iterative method provides quite accurate ap-
proximations as compared to other methods.
To find the root of nonlinear equation f(x) = 0 by fixed point iteration method,
equation f(x) = 0 is written in the form of x = ϕ(x), that is, a new function is designed
by rearranging the original function in such a manner that the highest order varia-
bles is made to be the dependent variable of x where
where a and b are the intervals in which the root might lie.
Iteration method is valid and converges around the root in the interval which
may be smaller than the interval in which | ϕ’(x)| < 1. The convergence will take place
only for a certain range of x. If the guess value is outside this range then the root will
not converge. When the difference between two successive iteration is sufficiently
small, iterations are stopped, that is, |xn +1−xn| < εabs or until |f(xn +1)–f(xn)| ≈ 0.
f ðxÞ = x 3 − x − 1 = 0 (9:13)
Solution: Since no guess values are given here, random numbers are put in the function f(x) in such
way that f(a)×f(b) < 0
f ð xÞ = x3 + x − 1
100
f(x) = x3–x–1
f(x)
50
0
–6 –4 –2 0 2 4 6
x
–50
–100
For iteration method only a single guess value is required which is close to the original root.
Either of the guess values can be chosen from the interval in which the root lies. The results are
tabulated (Table 9.5) until the function becomes zero.
N xn xn + εabs
. .
As can be seen from Table 9.5, the root is found to be 1.32471, which is accurate up to fifth decimal
place in 8 iterations.
Example 5: Using eq. (9.10) used in Example 3, calculate the inversion temperature using iteration
method at p = 200 atm for N2 gas for which a = 141 kPa dm6 mol−2 and b = 0.0392 dm3 mol−1
9.3 Iteration method 159
Using the iteration method for a guess value of 200 K (Table 9.6)
N Tn Tn + ΔT = Tn +−Tn
Hence in 16 iterations, the convergence has been achieved up to one decimal place and the inver-
sion temperature is found to be 863.8 K
Example 6: Using iterative method, find the temperature at which o-toluidine has a vapour pressure
of 400 mm Hg where an empirical relationship between pressure (p) and temperature (T) is given by
3480.3
log p = 23.8296 − − 5.081 logT (9:15)
T
Solution: At 400 mm Hg, the above equation becomes the function of temperature only.
3480.3
21.22754 − − 5.081logT = 0 (9:16)
T
160 Chapter 9 Numerical root-finding methods
3480.3
F ðT Þ = =0 (9:17)
21.22754 − 5.081 log T
As evident from Table 9.7, the root converges at eighth iteration to give T = 456.9 K
N T F
.
. .
. .
. .
. .
. .
. .
. .
Example 7: Suppose a nuclei undergoes a radioactive decay and form a daughter nuclei which also
starts undergoing radioactive decay as
λA λB
A ! B ! C (9:18)
where λA and λB are the decay constants of nuclei A and B. The half-lives of A and B are given as
8 days and 2 days, respectively. The starting concentration of A(NA) and B(NB) are 1020 and zero.
The variation of B with time is given by
λA N0A
NE = ðe − λA t − e − λB t Þ (9:19)
λB − λE
Find out the time at which the concentration of B is 1019 using Newton–Raphson method.
Solution: Since the half-life and decay constants are related by the relationship is (Figure 9.4)
ln 2
τ= (9:20)
λ
which gives λA and λB as 0.0866434 and 0.346574 day−1.
9.3 Iteration method 161
0.5
e(–λAt) –e(–λBt)
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0 5 10 15 20 25 30 35
time (t)
λA N0A
NB = ðe − λA t − e − λB t Þ (9:21)
λB − λA
e − λA t − e − λB t = 0.3000 (9:22)
f 'ðtÞ = − λA e − λA t + λB e − λB t = 0 (9:24)
Plotting the function e − λA t − e − λB t with time (t) shows that there are two values of time t at which
the function e − λA t − e − λB t has the value 0.3000 which are 1.6 and 13.5 days (Figure 9.4) which is
also confirmed by the Newton–Raphson method (Table 9.8 and 9.9).
162 Chapter 9 Numerical root-finding methods
N t t’ f(t) f’(t)
N t t’ f(t) f’(t)
The binary bisection method (also called interval halving method) is a simple and ro-
bust root-finding algorithm that bisects an interval repeatedly in which a root is ex-
pected to lie. Hence, this method is also called bracketing. This method requires the
prior knowledge of an approximate interval between which the real root lies. This
method is based on the intermediate value theorem (also called Bolzano’s theorem) ac-
cording to which if f(x) is a continuous function in the interval a and b (a and b are real
numbers) such that f(a)×f(b) < 0, then there is definitely a root that lies between a and b.
Let us say there is a function f(x) (f(x) is an algebraic or transcendental equa-
tion) which is continuous and lies in the interval a and b that has the real root,
such that f(a)×f(b) < 0, then at the root, that is f(x) = 0 (where x is the root of the
equation). It is also called the zero of the function f(x). In this algorithm, an interval
[a,b] is bisected in two (binary) and then a subinterval c is selected in which the
root lies. It is halved to find a subinterval c as
a+b
c= (9:25)
2
where c 2 ða, bÞ
Now, find f(c),
1) If f(c) = 0, then c is the root of the equation, else
9.4 Binary bisection method 163
2) If f(a)×f(c) < 0, then the root lies between a and c, so a and c becomes the new inter-
val, hence b = c and a = a. Again, the sub-interval c is found using the new intervals.
3) If f(b)×f(c) < 0, then root lies between b and c, therefore b and c becomes the
new interval, b=b and a=c, calculate c again.
This method repeatedly bisects the new intervals based on the signs of function f(x).
This procedure is continued until the zero is obtained or the intervals are sufficiently
small. Its convergence criteria is same as that of Newton–Raphson method and itera-
tion method that when f(a) or f(b) or f(c) ≈ 0 or ja − bj < ϵabs the iterations are stopped.
The advantage of binary bisection method is that it always converges howsoever long
it takes, but it may not be able to deduce more than one root at one time in a given
interval. It also converges slowly as compared to other algorithms. Moreover, the inter-
val in which we assume our root lies should be certain, else even if the interval is not
true, the method converges to give some value of root which may not be true.
Example 8: Find the roots of the equation f(x) using binary bisection method with εabs = 0.01 in the
interval [1,2].
f ðxÞ = x 2 − 3 (9:26)
Solution: Here, the interval given is [1,3], that is a = 1, b = 3. Graphically, the function may be de-
picted as in Figure 9.5
f ð1Þ = − 2, f ð3Þ = 6
c = ð1 + 3Þ=2 = 2
f(c) = 1, hence now a = a while b = c since f (a)×f (c) < 0
50
f (x) = x2–3
40
f(x)
30
20
10
0
‒8 ‒6 ‒4 ‒2 0 2 4 6 x 8
‒10
Hence, in the 16th iteration, the root converges to 1.7320 which is correct up to fourth decimal
place.
As the name suggests, secant implies a line which passes through two points of the
curve. It is an algorithm for finding the roots of scalar-valued function of a single
variable x when no information of derivative is given. Secant method is an algo-
rithm used to find the roots of nonlinear functions. Let x0 and x1 be the two initial
guesses for the root of f(x) = 0, then f(x0) and f(x1), respectively, are their function
values. A line is drawn between the two guess approximations and the point where
it crosses the x-axis (Figure 9.6) will be the approximate root of f(x) using approxi-
mate guesses (x0 and x1). Secant method assumes that the equation or function is
approximately linear in the region of interest.
f(x)
x0 x2 x1
So, in the above figure, it can be seen that the line between the two guess values
touches x-axis at x2, so here, value of y = 0 (root is the value of a variable where the
function becomes zero); therefore
Hence, x2 is the approximate root yet not the original root. A root for the function f(x)
is approximated which is not really a root but is quite near to the original root.
f(x)
x3 x0 x2 x1
To do the same, a new secant would be drawn (Figure 9.7). Since x2 is closer to the
original root than x0 (also f(x1)*f(x2) < 0), the new secant would be drawn between
new intervals, that is [x1,f(x1)] and [x2, f(x2)] where x3 is the new point of intersection
to x-axis. Using the same procedure as above, it can be written that
x2 − x1
x3 = x2 − f ðx2 Þ (9:31)
f ðx2 Þ − f ðx1 Þ
This cycle will continue to take place until the difference between |xn-1−xn-2| < εabs.
Hence, the general expression for secant method may be written as
xn − 1 − xn − 2
xn = xn − 1 − f ðxn − 1 Þ (9:32)
f ðxn − 1 Þ − f ðxn − 2 Þ
In above procedure, the iterations are used to bring the two guess values close to
the original root. The most important point to remember is that the initial guess
value should be close to the original root else secant method will not converge.
There may not be a proper way of knowing how close the guess value may be but if
the function f(x) is differentiable and f’(x0) = 0 on that interval then the secant
method would not converge. Thus, it adopts the possibility of being faster but may
not be converging due to non-root bracketing.
As compared to N-R method and iteration method, binary bisection method and
secant method uses two guess values (interval in which root lies). As compared to N-R
method, where f(x) and f’(x) both are calculated, secant method should be faster since
it has to compute only one f(x), but in reality N-R method is found to be faster as
9.5 Secant method 167
compared to secant method since f(x) and f’(x) are computed simultaneously as it iter-
ates at each step. Secant method may not necessarily always converge.
Example 9: Using secant method, find roots of the following equation up to three decimal places
f ðxÞ = x 3 + x − 1 (9:13)
Solution: Using Example 4, the roots lies between 0 and 1, hence using secant formula (9.32), the
first iteration be N = 1
xn − 1 − xn − 2
xn = xn − 1 − f ðxn − 1 Þ (9:32)
f ðxn − 1 Þ − f ðxn − 2 Þ
1−0
x1 = 1 − 1
1 − ð − 1Þ
x1 = 0.5.
− .
The root is found to be 0.6823278 which is exact up to not only three decimal place but up to fifth
decimal places. At seventh iteration, we can see that |xn–xn–1| < 10−6 which is less than the prede-
fined tolerance limit.
Example 10: Find the root of the nonlinear equation 3x + sin x–ex = 0
Solution: When analysed graphically, both the root lies between [0, 2]. So, using the secant for-
mula as (Figure 9.8)
xn − 1 − xn − 2
xn = xn − 1 − f ðxn − 1 Þ (9:32)
f ðxn − 1 Þ − f ðxn − 2 Þ
168 Chapter 9 Numerical root-finding methods
1.5
f(x) = 3x + sin(x) – exp(x)
f(x)
1
0.5
0
0 0.5 1 1.5 2 x 2.5
–0.5
–1
–1.5
− . .
So here, after six iterations, the root is found to be 0.3604, which is exact up to four decimal places.
The iterations can be continued until a convergence criteria is reached which is |xn + 1 – xn| < εstep, that
is, the difference between successive iterates is sufficiently small. If the denominator is zero, then divi-
sion by zero fails the iteration. Hence there is a need for new initial approximation. If after a given
number of iterations, convergence is not reached, then it is possible that solution (root) does not exist.
9.6 Regula-Falsi method 169
y = f(x)
a, f(a)
f(x)
x a x4 x3 x2 x1 b
b, f(b)
This method alike other methods also assumes that the function f(x) be continu-
ous. Regula-Falsi method begins with a and b interval (such that a < z < b where z
is the root of the f(x)) such that f(a)×f(b) < 0, then to find the root a new approxi-
mate root x1 is calculated which is not a real root but it is a false root as suggested
by the name and proceed to find an approximate root in the interval chosen and
then carefully selecting which roots should be taken forward for the next iteration
(either a and x1 or x1 and b) depending upon the sign of f(x1), f(a) and f(b). This is
called root bracketing, implying finding root within the interval chosen. For this,
170 Chapter 9 Numerical root-finding methods
a line is drawn between (a,f(a)) and (b,f(b)) which is known as interpolation line.
The new false root is checked for its magnitude of the function, that is f(x1).
There may be three possibilities:
1) If f(x1) = 0, then x1 is the root but this usually does not happen.
2) If f(a)×f(x1) < 0, then x1 becomes the new b, that is, b = x1, so now an interpola-
tion line is drawn between a,f(a) and x1,f(x1).
3) If f(b)×f(x1) < 0 then x1 becomes the new a, that is, a = x1 and a new interpolation
line is drawn between x1,f(x1) and b,f(b) (Figure 9.9).
When a chord is drawn between [a,f(a)] and [b,f(b)], the general equation for the
line is
y − y1 y2 − y1
= (9:33)
x − x1 x2 − x1
y − f ðaÞ f ðbÞ − f ðaÞ
= (9:34)
x−a b−a
At x = x1 , y = 0
Here x1 is the first approximated root, since it is still not the original root. Check if
f(a)×f(x1) < 0, then b = x1 else a = x1 (f(b)×f(x1)). Here f(a)× f(x1) < 0 so, a new chord
is drawn between (a, f(a)) and (x1,f(x1)) and the same equation of line is written as
At x = x2, y = 0
This above procedure is repeated (x2, x3, x4, . . ., xn) until f(xn) = 0 or ≈ εabs (also
called tolerance limit or degree of accuracy).
Regula-Falsi methods resemble the secant method in the formula used and two
starting initial approximations, except secant method. Except, secant method may
not necessarily find the approximated root in the starting interval (x0 and x1).
9.6 Regula-Falsi method 171
Hence roots are not bracketed in the secant method so it may not always converge
but Regula-Falsi method always converge.
Example 11: Find the roots of the function f(x) using Regula-Falsi method in the interval [0,2]. Given
εabs = 0.0001
f ðxÞ = x 3 + 3x − 5 (9:40)
Solution: Graphically, the function f(x) is depicted in Figure 9.10. For approximating the first order,
we will use eq. (9.36)
af ðbÞ − bf ðaÞ
x1 = (9:36)
f ðbÞ − f ðaÞ
f ðaÞ = f ð0Þ = − 5, f ðbÞ = f ð2Þ = 9
0f ð2Þ − 2f ð0Þ
x1 = (9:37)
f ð2Þ − f ð0Þ
5
x1 = = 0.7142
7
Now f(x1) = –2.492, since f(b)×f(x1) < 0, hence a = x1, the further results are tabulated in Table 9.13.
40
f(x)
30
f(x) = x3 + 3x–5
20
10
0
x
–4 –3 –2 –1 0 1 2 3 4
–10
–20
–30
–40
–50
From the tabulated results it is clear that at the 12th iteration, the root (1.15416) is stable up to 5th
decimal place. Also at 12th iteration f(x1) ≈ 10−5
Example 12: Determine the volume of 0.5 mol of the van der Waal’s gas CO2 at 2226 kPa and 298 K.
Given a = 363.76 kPa dm6 mol−2 and b = 42.67 cm3 mol−1.
Solution: The guess value for volume is taken using ideal gas equation for volume as V = nRT/p
n2 a
p+ 2
ðV − nbÞ = nRT (9:38)
V
N x f(x) f’(x) xn
0.4998 dm3 is the volume of CO2 obtained for the given condition. It is important to note that the order
of polynomial is always equal to the number of roots of that polynomial. Here, since the order of V is 3,
it implies that should be three roots but it is not possible that at a single pressure, that is, 2,226 kPa,
there would be three volumes, hence only one of them is true. In this case, one may obtain two more
volumes (using different guess values) which would not be true solution to the equation.
Example 13: The concentration of [H+] in a dilute solution of HCl having concentration 10−6 M is
given by the expression
½H + 2 − ½HCl½H + − kw = 0 (9:41)
Solution: The equation given above is a quadratic equation of the type ax2 +bx +c =0. The equation
can be solved using iteration method by rearranging the equation as
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
½H + = ½HCl½H + + kw (9:42)
Taking the initial guess of the acid as 10–7, the results are tabulated in Table 9.15.
N xn xn + Eabs
pH = − log10 ½H + (9:43)
−7
pH = − log10 ½9.9 × 10 (9:44)
pH = 6.00
1. Using the Newton–Raphson method, find the root of the equation accurate to
within 10−7
(a) 5sinx2 − 8cos5 x = 0 for [−1,2] (b) x4−x–10 = 0 for [1,2]
4. Using the iteration method, calculate [H+] in 10−4 M solution of weak acid with
ka = 1.7 × 10−10 M at 25 °C. Given the equation as
½H + 3 + ½H + 2 ka − ½H + fkw + ka ½HA0 g − ka kw = 0
Find the root of the equation x3 – 3 with the bisection method with the interval
[1, 2] using εstep = 0.1 and εabs = 0.1
5. Using binary bisection method, find the roots of the following function.
(a) cos(x)–xex = 0 (b) x4–x–10 = 0 (c) x–e-x = 0
7. Find the root of the function f ðxÞ = 5sin2 x − 8cos5 x = 0 in the interval [0.5,1.5]
8. Find root of the equation x4-x-10 = 0 using secant method in the interval [1,2]
Conversion factors between metric, US customary and British Imperial unit system.
US or imperial Metric
cu inch (in ) . cm
US or imperial Metric
mile in . km
US or imperial Metric
stone lb . kg
https://doi.org/10.1515/9783110695328-010
176 Appendix A
US or imperial Metric
sq inch (in ) . cm
mL . L
cL . L
dL . L
gal . L
ft . L
Appendix A 177
mm . m
cm . m
dm . m
dam m
km , m
Amstrong − m
fermi − m
mile . m
mg . g
cg . g
dg . g
dag g
hg g
kg , g
stone ,. g
lb . g
oz . g
min s
h min/, s
day h
week days
erg − J
hectare m
barn − m
Appendix B Answers to the problems for practice
Unit 1
Unit 2
1. (a) 23.06 0.03 (b) 0.0137 0.0024 (c) 11.27 0.04 (d) (9 3) × 10–33
2. (a) 3.1417 is more precise while π is more accurate
(b) 2.7182820135423 is more precise while 2.718281828 is more accurate
Unit 3
π
1. ðaÞ log2 60 ðbÞ log log 2 ðcÞ − 5 log3 5
2. x = 1, y = 3
3. ðx − 2Þ2 + ðy − 3Þ2 = 25
n2 a n3 ab
4. f ðVÞ = V 3 − ðnb + nRT p ÞV + p V − p = 0
2
∞ 2
5. f ðΛm Þ = c = b12 ðΛm − Λm Þ = 0
Unit 4
Unit 5
1. 6.5 kJ mol–1
2. a = 26.694, b = 0.0094, c = −10−6
https://doi.org/10.1515/9783110695328-011
180 Appendix B Answers to the problems for practice
3. 6.90 × 10−4
4. 0.0112 min−1
5. y = x2
6. 0.0111
Unit 6
Unit 8
d2 y
1. dy
dx = 14 and dx2
= 10
2. 400 m s−1
3. 5.687
4. 3.208
Unit 9
https://doi.org/10.1515/9783110695328-012
182 Index