# Chem 302 - Math 252 Chapter 4 Differentiation & Integration.

## Presentation on theme: "Chem 302 - Math 252 Chapter 4 Differentiation & Integration."— Presentation transcript:

Chem 302 - Math 252 Chapter 4 Differentiation & Integration

Differentiation & Integration Experimental data at discrete points Need to know the rate of change of the dependent variable with respect to the independent variable Need to know area under curve Need to integrate an analytic function that is too complicated to do analytically Can do interpolation/curvefitting to get an analytic function

Linear Differentiation

Eqn (1)Eqn (2) xx % error Exact value4.481689 0.14.7134345.04.4891620.17 0.014.5041720.504.4817641.7×10 -3 0.0014.4839315.0×10 -2 4.4816901.7×10 -5 1×10 -4 4.4819135.0×10 -3 4.4816891.7×10 -7 1×10 -5 4.4817115.0×10 -4 4.4816892.2×10 -9 1×10 -6 4.4816915.0×10 -5 4.4816895.8×10 -9 1×10 -7 4.4816895.2×10 -6 4.4816896.4×10 -8 1×10 -8 4.4816891.3×10 -7 4.4816891.1×10 -6 1×10 -9 4.4816901.4×10 -5 4.4816893.8×10 -6 1×10 -10 4.4816951.3×10 -4 4.4816913.4×10 -5 1×10 -11 4.4817481.3×10 -3 4.4817043.3×10 -4 1×10 -12 4.4826362.1×10 -2 4.4821921.1×10 -2 1×10 -13 4.4853018.1×10 -2 4.4808601.8×10 -2 1×10 -14 4.5297101.14.4853018.1×10 -2 1×10 -15 5.329071194.8849819.0 Linear Differentiation Smaller spacing not necessarily better

3 point Differentiation Linear differentiation ignores actual point Make exact for

Multi-point Differentiation Formulae only derived for equal spacing Non equal spacing solve equations numerically

Multi-point Differentiation Coefficient Demominator-4h-3h-2h-h-h0h2h2h3h3h4h4hExact to 1 st derivative 2h2h01Quadratic 12h1-808Quartic 60h9-45045-916 th order 840h3-32168-6720672-16832-38 th order

Multi-point Differentiation Coefficient Demominator-4h-3h-2h-h-h0h2h2h3h3h4h4hExact to 2 nd derivative h2h2 121Quadratic 12h 2 16-3016Quartic 540h 2 6-81810-1470810-8166 th order 5040h 2 -9128-10088064-143508086-1008128-98 th order

Multi-point Differentiation Coefficient Demominator-4h-3h-2h-h-h0h2h2h3h3h4h4hExact to 3 rd derivative 2h32h3 20-21Quartic 48h 3 6-48780-7848-66 th order 240h 3 -772-3384880-488338-7278 th order

Technique % error 3-point-0.356352220.001-0.189668260.0004 5-point-0.356355660-0.1896690700.206890020.002 7-point-0.356355660-0.1896690700.206893650 9-point-0.356355660-0.1896690700.206893650 Exact value-0.35635566-0.189669070.20689365 Example

Numerical Integration

Midpoint Formula Uses value of function and slope at midpoint of interval Determine w 1 & w 2

Composite Midpoint Formula n subintervals (equal spacing)

Trapezoidal Integration Approximate f(x) by a linear function over interval [a,b]

Trapezoidal Integration Alternate derivation Linear combination of endpoints that give best estimate of integral Determine w 1 & w 2

Composite Trapezoidal Integration n subintervals (equal spacing)

Simpson’s Rule Combines Trapezoidal and Midpoint Also referred to as 3 - point Determine w 1 w 2 & w 3

Composite Simpson’s Rule 2n subintervals (equal spacing)

Newton-Cotes Formula Generalization to use more than 3 points –Trapezoidal exact up to linear – (1 st order NC) –Simpson’s exact up to quadratic (by definition but turns out to be exact for up to cubic) – (2 nd order NC) –Equivalent to integration of Lagrangian interpolation functions –3 rd order NC Use 4 points and functions up to cubic –Higher orders can give larger errors

Newton-Cotes Formula

Gaussian Quadratures So far evaluated function at fixed points & optimized coefficients Optimize locations also Optimize w i & z i

Gaussian Quadratures 1-point Need two equations Make exact for  (z) = 1, &  (z) = z

Gaussian Quadratures 2-point Need four equations Make exact for  (z) = 1,  (z) = z,  (z) = z 2,  (z) = z 3 Does not give unique solution Make symmetric about 0

Roots (z i )Weight Factors (w i ) Two-Point Formula ±0.57735 02691 896261.00000 00000 00000 Three-Point Formula 00.88888 88888 88889 ±0.77459 66692 414830.55555 55555 55556 Four-Point Formula ±0.33998 10435 848560.65214 51548 62546 ±0.86113 63115 940530.34785 48451 37454

Gaussian Quadratures Roots (z i )Weight Factors (w i ) Five-Point Formula 0 ±0.53846 93101 05683 ±0.90617 98459 38664 0.56888 88888 88889 0.47862 86704 99366 0.23692 68850 56189 Six-Point Formula ±0.23861 91860 83197 ±0.66120 93864 66265 ±0.93246 95142 03152 0.46791 39345 72691 0.36076 15730 48139 0.17132 44923 79170

Gaussian Quadratures Roots (z i )Weight Factors (w i ) Ten-Point Formula ±0.14887 43389 81631 ±0.43339 53941 29247 ±0.67940 95682 99024 ±0.86506 33666 88985 ±0.97390 65285 17172 0.29552 42247 14753 0.26926 67193 09996 0.21908 63625 15982 0.14945 13491 50581 0.06667 13443 08688 Fifteen-Point Formula 0 ±0.20119 40939 97435 ±0.39415 13470 77563 ±0.57097 21726 08539 ±0.72441 77313 60170 ±0.84820 65834 10427 ±0.93727 33924 00706 ±0.98799 25180 20485 0.20257 82419 25561 0.19843 14853 27111 0.18616 10001 15562 0.16626 92058 16994 0.13957 06779 26154 0.10715 92204 67172 0.07036 60474 88108 0.03075 32419 96117