 # Mathematical Modeling Notes

[Last Updated 22 January 2011]

## Taylor Expansions

### PROBLEM Consider a smooth function f(x), and its expansion near x = x0, Si=0∞ f(i)(x0)(x - x0)i / i! and call En(x) the error made by approximating f with its Taylor expansion truncated to order n, En(x) = f(x) - Si=0n f(i)(x0)(x - x0)i / i!. (a) Apply this formula to f(x) = cos(x), with x0 = 0 and n = 5. (b) Find a condition on |x| which ensures that |En(x)| < 0.05. (c) Use a calculator or Matlab to check your answer to the previous question. [from Math 485/585, Mathematical Modeling, Spring 2005, University of Arizona] SOLUTION (a) f(x) = cos x, x0 = 0, n = 5 f(x0) = f(0) = cos 0 = 1 f'(x) = - sin x => f'(x0) = f'(0) = - sin 0 = 0 f"(x) = - cos x => f"(x0) = f"(0) = - cos 0 = - 1 f(3)(x) = sin x => f(3)(x0) = f(3)(0) = sin 0 = 0 f(4)(x) = cos x => f(4)(x0) = f(4)(0) = cos 0 = 1 f(5)(x) = - sin x => f(5)(x0) = f(5)(0) = - sin 0 = 0 Si=0n f(i)(x0)(x - x0)i / i! = Si=05 f(i)(0)xi / i! = f(0) + f'(0)x + f"(0)x2 / 2! + f(3)(0)x3 / 3! + f(4)(0)x4 / 4! + f(5)(0)x5 / 5! = f(0) + f"(0)x2 / 2! + f(4)(0)x4 / 4! = 1 - x2 / 2! + x4 / 4! En(x) = E5(x) = cos x - 1 + x2 / 2! - x4 / 4! (b) The complete Taylor expansion of f(x) = cos x near x = 0 is cos x = 1 - x2 / 2! + x4 / 4! - x6 / 6! + x8 / 8! - ... Thus, E5(x) = - x6 / 6! + x8 / 8! - ... or |E5(x)| = x6 / 6! - x8 / 8! + ... < x6 / 6! |E5(x)| will be < 0.05 if x6 / 6! < 0.05 => |x|6 / 6! <0.05 => |x|6 < (0.05)(6!) = 36 => |x| < 1.817121 (c) To check the result in (b), we first calculate cos(1.817121) = - 0.24384 Then we calculate 1 - (1.817121)2 / 2! + (1.817121)4 / 4! = - 0.19668 This differs from the exact value of cos(1.817121) by - 0.19668 + 0.24384 = 0.047157 < 0.05, so as long as |x| < 1.817121, |E5(x)| will be less than 0.05.

Back to Main Menu

## Fourier Series

### PROBLEM Show that p = Sn=1∞ [4/(2n-1)](-1)3n-1[Hint: Find a Fourier series expansion for the function f(x) = x defined for - p< x <p.] SOLUTION A function f(x) defined in the region - p< x <p can be written as a Fourier series of the form f(x) = a0/2 + Sn=1∞ an cos nx + Sn=1∞ bn sin nx where a0 = (1/p) ∫-pp f(x) dx an = (1/p) ∫-pp f(x) cos nx dx bn = (1/p) ∫-pp f(x) sin nx dx Now suppose we let f(x) = x. Then we have x = a0/2 + Sn=1∞ an cos nx + Sn=1∞ bn sin nx where a0 = (1/p) ∫-pp x dx = 0 because x is an odd function of x an = (1/p) ∫-pp x cos nx dx = 0 because x cos nx is an odd function of x bn = (1/p) ∫-pp x sin nx dx Let u = x and dv = sin nx dx. Then du = dx and v = - (1/n) cos nx, and ∫ x sin nx = - (x/n) cos nx + (1/n) ∫ cos nx dx = - (x/n) cos nx + (1/n2) sin nx => ∫-pp x sin nx = - (2p/n) cos np = - (2p/n)(-1)n=> bn = - (2/n)(-1)n + (2/n)(-1)n+1=> x = Sn=1∞ (2/n)(-1)n+1 sin nx Let x = p/2. Then p/2 = Sn=1∞ (2/n)(-1)n+1 sin np/2 = Sn=1,3,5∞ (2/n)(-1)n+1 sin np/2 = Sn=1,3,5∞ (2/n)(-1)n+1(-1)(n-1)/2 = Sn=1,3,5∞ (2/n)(-1)(3n+1)/2Define m = (n + 1) / 2. Then n = 2m - 1 and p/2 = Sm=1∞ [2/(2m-1)](-1)3m-1 => p = Sn=1∞[4/(2n-1)](-1)3n-1

Back to Main Menu

### PROBLEM Show that Sn=1∞ 1/n2 = p2/6 [Hint: Find a Fourier series expansion for the function f(x) = x2 defined for - p< x <p.] SOLUTION A function f(x) defined in the region - p< x <p can be written as a Fourier series of the form f(x) = a0/2 + Sn=1∞ an cos nx + Sn=1∞ bn sin nx where a0 = (1/p) ∫-pp f(x) dx an = (1/p) ∫-pp f(x) cos nx dx bn = (1/p) ∫-pp f(x) sin nx dx Now suppose we let f(x) = x2. Then we have x2 = a0/2 + Sn=1∞ an cos nx + Sn=1∞ bn sin nx where a0 = (1/p) ∫-pp x2 dx = 2p2/3 an = (1/p) ∫-pp x2 cos nx dx bn = (1/p) ∫-pp x2 sin nx dx = 0 because x2 sin nx is an odd function of x Let u = x2 and dv = cos nx dx. Then du = 2x dx, v = (1/n) sin nx, and ∫ x2 cos nx dx = (x2/n) sin nx - (2/n) ∫ x sin nx dx Let u = x and dv = sin nx dx. Then du = dx, v = - (1/n) cos nx, and ∫ x sin nx = - (x/n) cos nx + (1/n) ∫ cos nx dx = - (x/n) cos nx + (1/n2) sin nx => ∫ x2 cos nx dx = (x2/n) sin nx + (2x/n2) cos nx - (2/n3) sin nx => ∫-pp x2 cos nx dx = (4p/n2) cos np = (4p/n2)(-1)n=> an = (4/n2)(-1)n=> x2 = p2/3 + Sn=1∞ (4/n2)(-1)n cos nx Let x = p. Then p2 = p2/3 + Sn=1∞ (4/n2)(-1)n cos np = p2/3 + Sn=1∞ (4/n2)(-1)n(-1)n = p2/3 + Sn=1∞ (4/n2) => Sn=1∞ (1/n2) = p2/6

Back to Main Menu

### PROBLEM Show that Sn=1∞ 1/n4 = p4/90. [Hint: Find a Fourier series expansion for the function f(x) = x4 defined for - p< x <p.] SOLUTION A function f(x) defined in the interval - p< x <p. It can be written as a Fourier series of the form f(x) = a0/2 + Sn=1∞ an cos nx + Sn=1∞ bn sin nx where a0 = (1/p) ∫-pp f(x) dx an = (1/p) ∫-pp f(x) cos nx dx, n > 1 bn = (1/p) ∫-pp f(x) sin nx dx, n > 1 Now suppose we let f(x) = x4. Then we have a0 = (1/p) ∫-pp x4 dx = (1/p)(x5/5)|-pp = 2p4/5 an = (1/p) ∫-pp x4 cos nx dx bn = (1/p) ∫-pp x4 sin nx dx = 0 because x4 sin nx is an odd function of x Let u = x4 and dv = cos nx dx. Then du = 4x3 dx, v = (1/n) sin nx and ∫ x4 cos nx dx = (1/n) x4 sin nx - (4/n) ∫ x3 sin nx dx Let u = x3 and dv = sin nx dx. Then du = 3x2 dx, v = - (1/n) cos nx, and ∫ x3 sin nx dx = - (1/n) x3 cos nx + (3/n) ∫ x2 cos nx dx Let u = x2 and dv = cos nx dx. Then du = 2x dx, v = (1/n) sin nx, and ∫ x2 cos nx dx = (1/n) x2 sin nx - (2/n) ∫ x sin nx dx Let u = x and dv = sin nx dx. Then du = dx, v = - (1/n) cos nx, and ∫ x sin nx dx = - (1/n) x cos nx + (1/n) ∫ cos nx dx = - (1/n) x cos nx + (1/n2) sin nx => ∫ x2 cos nx dx = (1/n) x2 sin nx + (2/n2) x cos nx - (2/n3) sin nx => ∫ x3 sin nx dx = - (1/n) x3 cos nx + (3/n2) x2 sin nx + (6/n3) x cos nx - (6/n4) sin nx => ∫ x4 cos nx dx = (1/n) x4 sin nx + (4/n2) x3 cos nx - (12/n3) x2 sin nx - (24/n4) x cos nx + (24/n5) sin nx => ∫-pp x4 cos nx dx = (8p3/n2) cos np - (48p/n4) cos np = (8p3/n2)(-1)n - (48p/n4)(-1)n=> an = (8p2/n2)(-1)n - (48/n4)(-1)n=> x4 = p4/5 + 8p2Sn=1∞ (1/n2)(-1)n cos nx - 48 Sn=1∞ (1/n4)(-1)n cos nx Let x = p. Then p4 = p4/5 + 8p2Sn=1∞ (1/n2)(-1)n(-1)n - 48 Sn=1∞ (1/n4)(-1)n(-1)n= p4/5 + 8p2Sn=1∞ 1/n2 - 48 Sn=1∞ 1/n4It can be shown that Sn=1∞ 1/n2 = p2/6 Thus, p4 = p4/5 + 8p4/6 - 48 Sn=1∞ 1/n4 = p4/5 + 4p4/3 - 48 Sn=1∞ 1/n4=> Sn=1∞ 1/n4 = (p4/5 + 4p4/3 - p4)/48 = (1/5 + 4/3 - 1)p4/48 = (1/5 + 1/3)p4/48 = p4/90 => Sn=1∞ 1/n4 = p4/90

Back to Main Menu

## Population of the Earth

### PROBLEM Using the data in the following table, which shows the estimated population of the Earth at various points in time (Haub 1995, Curtin 2007), estimate the total number of people who have ever lived. Year Population 47994 BC1 2 8000 BC 5,000,000 1 300,000,000 1650 500,000,000 1850 1,265,000,000 2002 6,215,000,000 2007 6,500,000,000 150,000 years ago as of the year 2007Curtin, Ciara 2007, "Fact or Fiction? Do Living People Outnumber the Dead?" Scientific American, September 2007, 50. Haub, Carl 1995, "How Many People Have Ever Lived on Earth?" Population Today, February 1995. SOLUTION Let t be the average lifespan of a human being and assume that all human beings live this long and that the population is always evenly distributed in age from 0 to t. Then the fraction of the population which dies each year is 1/t. For example, if t = 70 years, the fraction of the population which dies each year is 1/t = 1/70 = 1.429%. The above table contains seven data points and represents six time intervals. Let Yi be the ith year listed in the table. Let Ei be the number of years which have elapsed between Yi and Yi+1, during the ith time interval. Then Pi and Pi+1 are related by Pi+1 = Pi(1 + Ri)Eiwhere Ri is the average annual population growth rate during the ith time interval. Solving for Ri, we get Ri = [(Pi+1/Pi)(1/Ei)] - 1 The relationship between the annual population growth rate Ri, the annual birth rate Bi, and the annual death rate Di is Ri = Bi - DiFrom above, if t = 70 years, Di = 1/t = 1/70 = 0.01429. For given values of Ri and Di, the annual birth rate is Bi = Ri + DiThus, we can calculate the annual birth rates that are listed in the following table. The annual (birth, death) rate is the number which, when multiplied by the current population at the beginning of a particular year, gives the total number of (births, deaths) that occur during that year. Data Point (i) Year (Yi) Population (Pi) Elapsed Years (Ei) Annual Growth Rate (Ri) Annual Death Rate (Di) Annual Birth Rate (Bi) 1 47994 BC 2 39994 0.000368 0.014286 0.014654 2 8000 BC 5,000,000 8000 0.000512 0.014286 0.014798 3 1 300,000,000 1649 0.000310 0.014286 0.014596 4 1650 500,000,000 200 0.004652 0.014286 0.018938 5 1850 1,265,000,000 152 0.010528 0.014286 0.024814 6 2002 6,215,000,000 5 0.009008 0.014286 0.023293 7 2007 6,500,000,000 - - - - Using the values of Bi for each of the time intervals, the number of births in each year can be calculated. Example: In the year 1850, the population of the world is estimated to be 1.265 x 109. The birth rate during this time interval is 0.024814, so the number of births in 1850 is estimated to be (0.024814)(1.265 x 109) = 31,389,371. If this is done for all the years from 47994 BC to 2007, the total number of births is 34 billion. If we assume different values for the average lifespan t, we get the total number of births shown in the following table. Average Lifespant Total Births 10 197,369,926,000 20 101,964,238,000 30 70,162,341,800 40 54,261,393,700 50 44,720,824,900 60 38,360,445,600 70 33,817,317,600 If we assume t = 20 years, we get a result which is close to the estimate given by Curtin (2007). The results in the table were generated by the program SciAm070824.f.

Back to Main Menu