Numerical Analysis and Integration Techniques

Interpolation and Difference Operators

  • Interpolation Defined:

    • Given a set of values (x0,y0),(x1,y1),(x2,y2)…(xn,yn)(x_0, y_0), (x_1, y_1), (x_2, y_2) \dots (x_n, y_n), where xx is known and the explicit formula for the relation is not provided.
    • The process of estimating the value of yy for a given value of xx within the range of the provided set is known as interpolation.
  • Criteria for Choosing Interpolation Methods:

    1. Newton Forward Interpolation Formula: Used when values of xx are equidistant and the target xx is near the beginning of the table.
    2. Newton Backward Interpolation Formula: Used when values of xx are equidistant and the target xx is near the end of the table.
    3. Lagrange’s Interpolation Formula: Use this when the values of xx are not equidistant; the Newton formulas are not applicable in this case.
  • Forward Difference Operator (Δ\Delta) [Delta]:

    • Defined for sets where xx values are equidistant.
    • First-order differences: Δy0=y1−y0\Delta y_0 = y_1 - y_0, Δy1=y2−y1\Delta y_1 = y_2 - y_1, Δy2=y3−y2\Delta y_2 = y_3 - y_2.
    • Second-order differences: Δ2y0=Δy1−Δy0\Delta^2 y_0 = \Delta y_1 - \Delta y_0, Δ2y1=Δy2−Δy1\Delta^2 y_1 = \Delta y_2 - \Delta y_1.
    • This logic extends to third, fourth, and higher orders.
  • Backward Difference Operator (∇\nabla) [Del]:

    • Defined for equidistant sets of xx.
    • First-order differences: ∇y1=y1−y0\nabla y_1 = y_1 - y_0, ∇y2=y2−y1\nabla y_2 = y_2 - y_1, ∇y3=y3−y2\nabla y_3 = y_3 - y_2.
    • Second-order differences: ∇2y2=∇y2−∇y1\nabla^2 y_2 = \nabla y_2 - \nabla y_1, ∇2y3=∇y3−∇y2\nabla^2 y_3 = \nabla y_3 - \nabla y_2.

Newton’s Interpolation Formulas

  • Newton’s Forward Interpolation Formula (NFIF):

    • Formula: y(x)=y0+uΔy0+u(u−1)2!Δ2y0+u(u−1)(u−2)3!Δ3y0+…y(x) = y_0 + u \Delta y_0 + \frac{u(u-1)}{2!} \Delta^2 y_0 + \frac{u(u-1)(u-2)}{3!} \Delta^3 y_0 + \dots
    • Where u=x−x0hu = \frac{x - x_0}{h}.
    • hh is the common difference between equidistant xx values.
  • NFIF Example 1: Estimate yy at x=1.27x = 1.27.

    • Data: (x=1,y=3.0042)(x=1, y=3.0042), (x=1.3,y=3.6693)(x=1.3, y=3.6693), (x=1.5,y=4.4817)(x=1.5, y=4.4817), (x=1.7,y=5.4739)(x=1.7, y=5.4739).
    • Step 1: Calculate differences: Δy0=0.6651\Delta y_0 = 0.6651, Δ2y0=0.1473\Delta^2 y_0 = 0.1473, Δ3y0=0.0325\Delta^3 y_0 = 0.0325.
    • Step 2: h=0.3h = 0.3; calculation uses u=0.85u = 0.85.
    • Step 3: y(1.27)=3.0042+0.85×0.6651+0.85(0.85−1)2×0.1473+0.85(0.85−1)(0.85−2)6×0.0325y(1.27) = 3.0042 + 0.85 \times 0.6651 + \frac{0.85(0.85-1)}{2} \times 0.1473 + \frac{0.85(0.85-1)(0.85-2)}{6} \times 0.0325.
    • Result: y(1.27)=3.5609y(1.27) = 3.5609.
  • Newton’s Backward Interpolation Formula (NBIF):

    • Formula: y(x)=yn+u∇yn+u(u+1)2!∇2yn+u(u+1)(u+2)3!∇3yn+…y(x) = y_n + u \nabla y_n + \frac{u(u+1)}{2!} \nabla^2 y_n + \frac{u(u+1)(u+2)}{3!} \nabla^3 y_n + \dots
    • Where u=x−xnhu = \frac{x - x_n}{h}.
  • NBIF Example 1: Estimate yy at x=15.2x = 15.2.

    • Data: (10,54)(10, 54), (12,60)(12, 60), (14,72)(14, 72), (16,75)(16, 75).
    • Step 1: xn=16x_n = 16, h=2h = 2, u=15.2−162=−0.4u = \frac{15.2 - 16}{2} = -0.4.
    • Step 2: Calculate backward differences: ∇yn=3\nabla y_n = 3, ∇2yn=9\nabla^2 y_n = 9, ∇3yn=15\nabla^3 y_n = 15.
    • Step 3: y(15.2)=75+(−0.4×3)+−0.4(−0.4+1)2×15…y(15.2) = 75 + (-0.4 \times 3) + \frac{-0.4(-0.4+1)}{2} \times 15 \dots (simplified).
    • Result: y(15.2)=73.84y(15.2) = 73.84.
  • NBIF Example 2: Estimate yy at x=126x = 126.

    • Data: (100,4.6052)(100, 4.6052), (110,4.7005)(110, 4.7005), (120,4.7875)(120, 4.7875), (130,4.8675)(130, 4.8675).
    • Step 1: h=10,u=126−13010=−0.4h = 10, u = \frac{126 - 130}{10} = -0.4.
    • Step 2: ∇yn=0.08,∇2yn=−0.0070,∇3yn=0.0013\nabla y_n = 0.08, \nabla^2 y_n = -0.0070, \nabla^3 y_n = 0.0013.
    • Result: y(126)=4.8363y(126) = 4.8363.

Lagrange’s Interpolation Formula

  • General Formula:

    • For a set of points (x0,y0),(x1,y1)…(xn,yn)(x_0, y_0), (x_1, y_1) \dots (x_n, y_n), the interpolating polynomial is:
    • y(x)=(x−x1)(x−x2)…(x−xn)(x0−x1)(x0−x2)…(x0−xn)y0+(x−x0)(x−x2)…(x−xn)(x1−x0)(x1−x2)…(x1−xn)y1+⋯+(x−x0)(x−x1)…(x−xn−1)(xn−x0)(xn−x1)…(xn−xn−1)yny(x) = \frac{(x-x_1)(x-x_2) \dots (x-x_n)}{(x_0-x_1)(x_0-x_2) \dots (x_0-x_n)} y_0 + \frac{(x-x_0)(x-x_2) \dots (x-x_n)}{(x_1-x_0)(x_1-x_2) \dots (x_1-x_n)} y_1 + \dots + \frac{(x-x_0)(x-x_1) \dots (x-x_{n-1})}{(x_n-x_0)(x_n-x_1) \dots (x_n-x_{n-1})} y_n
  • Lagrange Example 1: Estimate yy at x=19x = 19.

    • Data: (10,14)(10, 14), (12,16)(12, 16), (18,25)(18, 25), (25,27)(25, 27).
    • Calculation: y(19)=(19−12)(19−18)(19−25)(10−12)(10−18)(10−25)(14)+(19−10)(19−18)(19−25)(12−10)(12−18)(12−25)(16)+…y(19) = \frac{(19-12)(19-18)(19-25)}{(10-12)(10-18)(10-25)} (14) + \frac{(19-10)(19-18)(19-25)}{(12-10)(12-18)(12-25)} (16) + \dots
    • Result: y(19)=26.2827y(19) = 26.2827.
  • Lagrange Example 2: Estimate yy at x=59x = 59.

    • Data: (50,0.7660)(50, 0.7660), (55,0.8192)(55, 0.8192), (56,0.8290)(56, 0.8290), (60,0.8660)(60, 0.8660).
    • Result: y(59)=0.857044y(59) = 0.857044.

Solutions of Non-Linear Equations

  • Definitions and Classification:

    • An equation of the form f(x)=0f(x) = 0 is non-linear if the highest power of the variable is greater than 1 or if it contains trigonometric/logarithmic functions.
    • Algebraic Equations: Example: x4−x−10=0x^4 - x - 10 = 0, x2−4x+4=0x^2 - 4x + 4 = 0.
    • Transcendental Equations: Example: xsin⁡(x)−12=0x \sin(x) - 12 = 0, xlog⁡(x)−12=0x \log(x) - 12 = 0.
  • Descartes’ Rule of Sign (Interval Location):

    • If f(a)f(a) and f(b)f(b) are of opposite signs, there exists at least one real root between aa and bb.
  • Bisection Method:

    • Step 1: Find interval [a,b][a, b] such that f(a)⋅f(b)<0f(a) \cdot f(b) < 0.
    • Step 2: Find the first approximation: x1=a+b2x_1 = \frac{a+b}{2}.
    • Step 3: Evaluate f(x1)f(x_1). If f(x1)<0f(x_1) < 0, the root lies in the interval between x1x_1 and the endpoint that yields a positive sign.
    • Example: x4−x−10=0x^4 - x - 10 = 0. f(1)=−10f(1) = -10 (neg), f(2)=4f(2) = 4 (pos). Root in [1,2][1, 2]. Approximations: x1=1.5,x2=1.75,x3=1.875,x4=1.8125x_1 = 1.5, x_2 = 1.75, x_3 = 1.875, x_4 = 1.8125.
  • Newton-Raphson Method:

    • Formula: xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}.
    • Example: x3−x−5=0x^3 - x - 5 = 0. f′(x)=3x2−1f'(x) = 3x^2 - 1. Let x0=1.6x_0 = 1.6. Result: Real root =2.0921= 2.0921.
    • Example: x4−x3−10=0x^4 - x^3 - 10 = 0. f′(x)=4x3−3x2f'(x) = 4x^3 - 3x^2. Let x0=2.5x_0 = 2.5. Result: x1=2.1929x_1 = 2.1929.
  • Regula-Falsi Method (False Position Method):

    • Formula to solve f(x)=0f(x) = 0: x=af(b)−bf(a)f(b)−f(a)x = \frac{a f(b) - b f(a)}{f(b) - f(a)}.
    • Example: x3−x−10=0x^3 - x - 10 = 0 in interval [2,3][2, 3]. Root: 2.30992.3099.
    • Example: xsin⁡(x)+cos⁡(x)=0x \sin(x) + \cos(x) = 0 in interval [2,3][2, 3]. Root: 2.79842.7984.
    • Example: xlog⁡10(x)−1.5=0x \log_{10}(x) - 1.5 = 0. Root: 2.06652.0665.
  • Secant Method:

    • Similar to Regula-Falsi, but it does not require endpoints to have opposite signs at every iteration.
    • Iterative formula: xn+1=xn−1f(xn)−xnf(xn−1)f(xn)−f(xn−1)x_{n+1} = \frac{x_{n-1} f(x_n) - x_n f(x_{n-1})}{f(x_n) - f(x_{n-1})}.

Numerical Integration

  • Trapezoidal Rule:

    • Formula: I=h2[(y0+yn)+2(y1+y2+y3+⋯+yn−1)]I = \frac{h}{2} [ (y_0 + y_n) + 2(y_1 + y_2 + y_3 + \dots + y_{n-1}) ]
    • Applicable for any number of intervals nn.
    • Example: ∫00.714x+5dx\int_0^{0.7} \frac{1}{\sqrt{4x+5}} dx, n=7,h=0.1n = 7, h = 0.1. Result: 0.27840.2784.
  • Simpson’s 1/3 Rule (Simpson’s 3rd Rule):

    • Formula: I=h3[(y0+yn)+2(Even ordinates)+4(Odd ordinates)]I = \frac{h}{3} [ (y_0 + y_n) + 2(\text{Even ordinates}) + 4(\text{Odd ordinates}) ]
    • Formula variant: I=h3[(y0+yn)+2(y2+y4+y6… )+4(y1+y3+y5… )]I = \frac{h}{3} [ (y_0 + y_n) + 2(y_2 + y_4 + y_6 \dots) + 4(y_1 + y_3 + y_5 \dots) ].
    • Applicable only when nn is an even number.
    • Example: ∫0π(sin⁡(x)+cos⁡(x))dx\int_0^\pi (\sin(x) + \cos(x)) dx, n=8n = 8. Result: 2.00032.0003.
  • Simpson’s 3/8 Rule:

    • Formula: I=3h8[(y0+yn)+2(Multiples of 3)+3(Remaining ordinates)]I = \frac{3h}{8} [ (y_0 + y_n) + 2(\text{Multiples of 3}) + 3(\text{Remaining ordinates}) ]
    • Formula variant: I=3h8[(y0+yn)+2(y3+y6+y9… )+3(y1+y2+y4+y5… )]I = \frac{3h}{8} [ (y_0 + y_n) + 2(y_3 + y_6 + y_9 \dots) + 3(y_1 + y_2 + y_4 + y_5 \dots) ].
    • Most appropriate when nn is a multiple of 3.
    • Example: ∫17(x3+4x2+5x+7)dx\int_1^7 (x^3 + 4x^2 + 5x + 7) dx, n=6,h=1n = 6, h = 1.
    • Ordinates: y0=17,y1=41,y2=85,y3=155,y4=257,y5=397,y6=581y_0=17, y_1=41, y_2=85, y_3=155, y_4=257, y_5=397, y_6=581.
    • Result: 12181218.