Professional Documents
Culture Documents
and Probability
YU SHENG LOH
Functions and
Introduction to Calculus
What is a Function
A function is a mapping of one element of a set to another
If X is mapped to Y then for each X, there can only be one Y
◦ E.g. 𝑦 = 𝑥 + 1
Notations of functions of 𝑥
◦ Normally written as 𝑓 𝑥 , 𝑔 𝑥 , ℎ 𝑥
◦ 𝑓 𝑥 = 𝑥, 𝑔 𝑥 = 𝑥 2 , ℎ 𝑥 = 𝑥 2 + 𝑥
Types of Functions
Linear
◦ 𝑓 𝑥 = 3𝑥 + 4
Exponential
◦ 𝑓 𝑥 = 2𝑥 3 , 𝑔 𝑥 = 𝑒 𝑥
Logarithmic
◦ 𝑓 𝑥 = ln(𝑥), ℎ 𝑥 = log(𝑥)
Trigonometric
◦ 𝑓 𝑥 = sin(𝑥), 𝑔 𝑥 = cos(𝑥), ℎ 𝑥 = tan(𝑥)
Polynomial
◦ 𝑓 𝑥 = 2𝑥 2 + 3𝑥 + 4, g 𝑥 = 𝑥 3 + 3𝑥 2 + 𝑥 − 2
Function of a Function
Written as 𝑓 𝑓 𝑥 = 𝑓 2 (𝑥)
◦ Not to be confused with 𝑓(𝑥) 2
𝑓 𝑥 =𝑥+2
𝑔 𝑥 = 2𝑥 2 + 3𝑥 + 4
𝑓2 𝑥 = 𝑓 𝑥 + 2 𝑔 𝑓 𝑥 = 𝑔(𝑥 + 2)
= 𝑥+2 +2=𝑥+4 = 2(𝑥 + 2)2 + 3 𝑥 + 2 + 4
𝑓(𝑥) 2 = (𝑥 + 2)2 = 2 𝑥 2 + 4𝑥 + 4 + 3𝑥 + 6 + 4
= 𝑥 2 +4𝑥 + 4 = 2𝑥 2 + 8𝑥 + 8 + 3𝑥 + 10
= 2𝑥 2 + 11𝑥 + 18
Inverse of a Function
Written as 𝑓 −1 (𝑥)
1
◦ Not to be confused with 𝑓(𝑥)
For 𝑓 𝑥 = 3𝑥 + 2 𝑓 −1 𝑓 𝑥 = 𝑓 𝑓 −1 𝑥 =𝑥
𝑥−2 3𝑥+2 −2
𝑦 = 3𝑥 + 2 𝑓 𝑓 −1 𝑥 =3 +2 𝑓 −1 𝑓 𝑥 =
3 3
3𝑥
𝑦 − 2 = 3𝑥 =𝑥−2+2 =
3
𝑦−2
=𝑥 =𝑥 =𝑥
3
𝑥−2
𝑓 −1 𝑥 =
3
Linear Interpolation
Approximation of 𝑓(𝑥 + ℎ1 ), given values of 𝑥, ℎ1 , ℎ2 , 𝑓(𝑥), and 𝑓(𝑥 + ℎ2 ), where ℎ1 < ℎ2
Assumes linear relationship
𝑦 = 𝑓(𝑥)
𝑓 𝑥 + ℎ1 − 𝑓(𝑥) 𝑓 𝑥 + ℎ2 − 𝑓(𝑥)
=
𝑥 + ℎ1 − 𝑥 𝑥 + ℎ2 − 𝑥
𝑓 𝑥 + ℎ1 − 𝑓(𝑥) 𝑓 𝑥 + ℎ2 − 𝑓(𝑥)
=
ℎ1 ℎ2
ℎ2 𝑓 𝑥 + ℎ1 − 𝑓 𝑥 = ℎ1 (𝑓 𝑥 + ℎ2 − 𝑓(𝑥))
ℎ2 𝑓 𝑥 + ℎ1 = ℎ1 𝑓 𝑥 + ℎ2 + ℎ2 − ℎ1 𝑓(𝑥)
𝑥 𝑥 + ℎ1 𝑥 + ℎ2
Linear interpolation
Given 𝑓 𝑥 = 𝑥 2 + 2𝑥, 𝑓 2 = 8, and 𝑓 2.5 = 11.25, find 𝑓(2.2)
h1 = cherche-petit
h2 = Grand - petit
ℎ1 𝑓 𝑥+ℎ2 + ℎ2 −ℎ1 𝑓(𝑥)
𝑓 𝑥 + ℎ1 = 𝑓 2.2 = 2.22 + 2(2.2)
ℎ2
0.2 11.25 +0.3(8)
𝑓 2.2 = = 9.24
0.5
= 9.3
Example in Finance
Bond
◦ Financial instrument that provides
◦ Stream of regular payments
◦ Final payment upon maturity
◦ For an initial investment
+𝑃𝑎𝑟
Example in Finance
Time value of money
◦ $1 in the future is not worth the same as $1 worth today
◦ We have to take into account interest rates
◦ To do so, we discount a future cash flow by an interest rate
121
◦ E.g. if interest rates are 10% per annum, then $121 in two years would be worth $100 today 1.1 2
𝑥 𝑥 + ℎ1 𝑥 + ℎ2
Introduction to Calculus
Differentiation
◦ Rate of change of a function 𝑦 = 𝑓(𝑥)
◦ What is the change from 𝑓(𝑥) to 𝑓 𝑥 + ℎ1
◦ Where ℎ1 is infinitesimally small
◦ Finding the slope of the curve at one point
𝑑𝑓(𝑥) 𝑑𝑦
◦ Written as , ,
𝑑𝑥 𝑑𝑥
or 𝑓 ′ (𝑥)
E.g.
◦ Rate at which distance changes over time is speed
◦ Rate at which speed changes over time is acceleration 𝑥
Indefinite integral
◦ 𝑥𝑑 𝑥 𝑓
Definite integral 𝑥
𝑏
◦ 𝑥𝑑 𝑥 𝑓 𝑎
Taylor Series
Provides an approximation of a function 𝑓(𝑥) around a given point 𝑎
′ 𝑓′′ 𝑎 2 𝑓′′′ 𝑎
𝑓 𝑥 =𝑓 𝑎 +𝑓 𝑎 𝑥−𝑎 + (𝑥 − 𝑎) + (𝑥 − 𝑎)3 + ⋯
2! 3!
∞ 𝑓 𝑛 (𝑎)
= σ𝑛=0 (𝑥 − 𝑎)𝑛
𝑛!
∞ 𝑓 𝑛 (0) 𝑛
= σ𝑛=0 𝑥
𝑛!
Taylor Series
Calculate 𝑒 0.1
𝑑𝑒 𝑥
= 𝑒 𝑥 , 𝑒0 = 1
𝑑𝑥
1
%∆𝑃 = −𝑀𝑜𝑑𝑖𝑓𝑖𝑒𝑑 𝐷𝑢𝑟𝑎𝑡𝑖𝑜𝑛 ∗ ∆𝑟 + 𝐶𝑜𝑛𝑣𝑒𝑥𝑖𝑡𝑦 ∗ (∆𝑟)2
2
Practice Questions
1
1. Find the inverse of 𝑓 𝑥 =
(𝑥+3)
3. What is the rate of return of a 3 year 7% coupon bond with $1,000 par value priced at $955?