Analytical Numerics
Analytical Numerics
deg from the following table, x 45 deg, 50 deg, 55 deg, 60 deg, y=sinx 0.7071, 0.7660,
0.8192, 0.8660
Sure, here's how to use the Newton-Gregory forward interpolation formula to approximate the
value of sin 52 degrees using the provided table:
First, we need to calculate the forward difference table using the values from the table provided.
The forward difference table is a table of differences between consecutive y-values in the table.
Here's how to calculate it:
55 0.8192 0.0296
60 0.8660 0.
To calculate the first differences (Δy1), we subtract each y-value from the next y-value in the
table. For example, Δy1 for x=45 is 0.7660 - 0.7071 = 0.0589.
To calculate the second differences (Δy2), we subtract each Δy1 value from the next Δy1 value in
the table. For example, Δy2 for x=45 is 0.0502 - 0.0589 = -0.0087.
To calculate the third differences (Δy3), we subtract each Δy2 value from the next Δy2 value in the
table. For example, Δy3 for x=45 is -0.0117 - (-0.0087) = -0.003.
where u = (x-x0) / h, x0 is the first x-value in the table (45 degrees), h is the step size (5 degrees
in this case), and y0 is the first y-value in the table (0.7071).
To find the value of sin 52 degrees, we need to evaluate the interpolation polynomial at x=52. So
we can plug in the values from the table and solve for P(52):
P(52) = 0.7071 + 0.0589 * 1.4 + (-0.0087) * 1.4 * (1.4-1) / 2! + (-0.003) * 1.4 * (1.4-1) * (1.4-2) / 3! =
0.7779
Therefore, the approximate value of sin 52 degrees using Newton-Gregory forward interpolation
is 0.7779.
Q: Apply Lagrages interpolation formula to find a cubic polynomeal that approximates the
following data, x: -2,-1,2,3, Y: -12, -8,5,7
To find a cubic polynomial that approximates the given data using Lagrange interpolation, we
need to follow these steps:
The Lagrange interpolation formula for a set of data points (x1,y1), (x2,y2), ..., (xn,yn) is:
We need to calculate the four Lagrange basis polynomials, L1(x), L2(x), L3(x), and L4(x), using the
formula:
L1(x) = (x - (-1))(x - 2)(x - 3) / ((-2 - (-1))(-2 - 2)(-2 - 3)) = (1/60)(x^3 - 3x^2 - 14x + 12) L2(x) = (x -
(-2))(x - 2)(x - 3) / ((-1 - (-2))(-1 - 2)(-1 - 3)) = (-1/20)(x^3 + 3x^2 - 4x - 12) L3(x) = (x - (-2))(x - (-
1))(x - 3) / ((2 - (-2))(2 - (-1))(2 - 3)) = (1/24)(x^3 - 2x^2 - 11x + 6) L4(x) = (x - (-2))(x - (-1))(x - 2) /
((3 - (-2))(3 - (-1))(3 - 2)) = (-1/40)(x^3 - x^2 - 22x + 24)
Using the Lagrange interpolation formula, we can now find the cubic polynomial that
approximates the given data:
where y1 = -12, y2 = -8, y3 = 5, and y4 = 7. Substituting these values and simplifying, we get:
Therefore, the cubic polynomial that approximates the given data is f(x) = (-1/5)*x^3 - (1/10)*x^2
+ (1/6)*x - 2.
To find the value of F(4) using the given data, we can use the Lagrange interpolation formula.
The Lagrange interpolation formula for a set of data points (x1,y1), (x2,y2), ..., (xn,yn) is:
We need to calculate the four Lagrange basis polynomials, L1(x), L2(x), L3(x), and L4(x), using the
formula:
L1(x) = (x - 1)(x - 2)(x - 5) / ((0 - 1)(0 - 2)(0 - 5)) = -1/30*(x^3 - 8x^2 + 17x - 10)
L2(x) = (x - 0)(x - 2)(x - 5) / ((1 - 0)(1 - 2)(1 - 5)) = 1/12*(x^3 - 7x^2 + 10x)
L3(x) = (x - 0)(x - 1)(x - 5) / ((2 - 0)(2 - 1)(2 - 5)) = -1/12*(x^3 - 6x^2 + 5x)
L4(x) = (x - 0)(x - 1)(x - 2) / ((5 - 0)(5 - 1)(5 - 2)) = 1/30*(x^3 - 3x^2 + 2x)
Using the Lagrange interpolation formula, we can now find the value of F(4):
where y1 = 2, y2 = 5, y3 = 7, and y4 = 8.
F(4) = 0.6
a) f(x) = x^2+4sinx=0
we can use numerical methods to approximate the real root of the equation to four
decimal places
we can approximate the root of the equation f(x) = x^2 + 4sin(x) = 0 to four decimal places as
follows:
b. f(x) = x^4-523+20x^2-40x+60=0
1. First, we need to choose an initial guess for the root. By inspecting the
function or using some other method, we can make an educated guess for
a root. For example, we can see that the function has a real root somewhere
between 8 and 9. Let's choose x0 = 8.5 as our initial guess.
2. Next, we use the formula:
xn+1 = xn - f(xn)/f'(xn)
where f(x) is the given function and f'(x) is its derivative.
In this case, we have:
f(x) = x^4 - 523 + 20x^2 - 40x + 60 f'(x) = 4x^3 + 40x - 40
So, we can calculate:
x1 = x0 - f(x0)/f'(x0) = 8.5 - ((8.5)^4 - 523 + 20(8.5)^2 - 40(8.5) +
60)/(4(8.5)^3 + 40(8.5) - 40) = 8.4764
3. We repeat this process, using xn+1 as our new guess and calculating the
next iteration using the same formula:
xn+1 = xn - f(xn)/f'(xn)
We continue this process until the values of xn+1 and xn are very close to
each other (i.e., the difference between them is less than some desired
degree of accuracy).
Using this method, we can approximate one of the roots of the equation
f(x) = x^4 - 523 + 20x^2 - 40x + 60 = 0 to a high degree of accuracy. For
example, after ten iterations starting with an initial guess of x0 = 8.5, we
get:
x10 = 8.4951
This means that the root of the equation to four decimal places is
approximately x = 8.4951.
In this case, we have a = 1, b = 2, and c = -2. Substituting these values into the
quadratic formula, we get:
x = -1 ± sqrt(3)
x1 = -1 + sqrt(3) x2 = -1 - sqrt(3)
8x-3y+2z=23
4x+11y-z=33
2x+y+4z=12
[ 8 -3 2 | 23 ] [ 4 11 -1 | 33 ] [ 2 1 4 | 12 ]
To transform this matrix into row echelon form, we'll use elementary row
operations to create zeros below the pivot elements in each column. We'll
start with the first column:
Use the first row to eliminate the first column in the second and third rows:
Use the second row to eliminate the second column in the third row:
This matrix is now in row echelon form. To find the values of x, y, and z,
we'll use back-substitution starting with the last row:
z = 61/86
y - (9/35)*(61/86) = 17/35
Simplifying:
y = 204/215
Simplifying:
x = 239/215
We can use these equations to iteratively solve for x, y, and z. We start with initial guesses for
each variable, then use the equations to compute new values for each variable until the values
converge to a solution.
Let's start with the initial guesses x=0, y=0, and z=0.
First iteration:
x = (17 - 0 + 2(0)) / 20 = 0.85 y = (-18 - 3(0) + 0) / 20 = -0.9 z = (25 - 2(0) + 3(0.9)) / 20 = 1.125
Second iteration:
x = (17 - (-0.9) + 2(1.125)) / 20 = 0.899 y = (-18 - 3(0.85) + 1.125) / 20 = -0.92725 z = (25 -
2(0.899) + 3(-0.92725)) / 20 = 1.08008
x = 0.9 y = -1 z = 1
x = 0.9 y = -1 z = 1
We can start with some initial guesses for x, y, and z, and then use these equations to iteratively
update the values until the solutions converge. Let's start with x = y = z = 0 as our initial guess.
x = (85 - 6(0) + 0)/27 = 85/27 y = (72 - 6(85/27) - 2(0))/15 = -3.7407 z = (110 - 85/27 - (-
3.7407))/54 = 2.0556
So the solutions to the system of equations are x = 4.0000, y = 2.0000, and z = 2.0000.