Question on a math equation

blaxis10

New Member
Joined
Oct 28, 2006
Messages
3
hello everyone,

While I was searching the net for my math problem, I found this site. If anyone can help me it is very appriciated. Also I have searched through this site but found nothing. I am taking numerical anaylsis lecture and I have a homework. and I am in trouble in some parts.

I got a general formula. it depends on the given x and y variables.
I am writing an example question so everybody can understand.

ex1; use langrange interpolation polynomial that approximate f(x)=x^3
a-)find the linear interpolation polynominal p1(x) using x0=1 and x1=2
b-)quadratic p2(x) x0=0, x1=1, x2=2

answer:
a-) langrange formula for p1:(there are 2 points given)
p1(x)=(y0*((x-x1)/(x0-x1)))+(y1*((x-x0)/(x1-x0)))

so if x0=1 y0=1^3=1(put x0 into f(x), so we find y0) and after that we have;
x0=1,y0=1
x1=2,y1=8
so when we replace the x and y varaibles into langrange;
p1(x)=(1*((x-2)/(1-2)))+(8*((x-1)/(2-1)))=(2-x)+8x-8=7x-6

p1(x)=7x-6 , SO this is answer. I found an approximation formula.

b-)langrange formula for p2:(there are 3 points given)
p2(x)=(y0*(((x-x1)*(x-x2))/((x0-x1)*(x0-x2))))+(y1*(((x-x0)*(x-x2))/((x1-x0)*(x1-x2))))+(y2*(((x-x0)*(x-x1))/((x2-x0)*(x2-x1))))

so if x0=0 y0=0^3=0 (put x0 into f(x), so we find y0) and after that we have;
x0=0,y0=0
x1=1,y1=1
x2=2,y2=8
so when we replace the x and y varaibles into langrange;
p2(x)=(0*(((x-1)*(x-2))/((0-1)*(0-2))))+(1*(((x-0)*(x-2))/((1-0)*(1-2))))+(8*(((x-0)*(x-1))/((2-0)*(2-1))))
p2(x)=(((x^2)-2x)/-1)+(((8x^2)-8x)/2)=2x-(x^2)+(4x^2)-8x=2x-(x^2)+(4x^2)-4x=(3x^2)-2x

p2(x)=(3x^2)-2x , SO this is answer. I found an approximation formula.

how can I calculate something like that in excel? and think that if we have 5 or 6 x variables how can we calculate also?

the general langrange formula is:


if anyone can solve this (developing a macro I think is the only way but I dont know anything about macros) It will very useful for me.

I got;
x0=-2, y0=-9,2
x1=-1, y1=-2,7
x2=0, y2=-1,5
x3=1, y3=0,4
x4=2, y4=7,2
x5=3, y5=26,1

thanks for every help.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Nobody knows how to solve?
please at least tell me how can I do a calculation like that?
(2x^2+3)*(3X^3+5x-2)=?
Please tell me a way to solve it.
thanks
 
Upvote 0
Seems to me that you'd be much better off using a program like Matlab or Maple for this. Both of those are likely available at your university's computer lab, and simple Google queries (if not your textbook itself) should be able to provide specific instructions for how to use Matlab or Maple to perform the interpolation.
 
Upvote 0
thanks for your answer. I will try the MATLAB. but do you know can I do a calculation like (2x^2+3)*(3X^3+5x-2)=? in excel? and if so, how can I find related documents? I dont know how to search it through google. thanks again for your answer.
 
Upvote 0
do you know can I do a calculation like (2x^2+3)*(3X^3+5x-2)=? in excel?

What do you mean "do a calculation like..."? Excel can't do symbolic manipulation. You'd have to assign a value to X (presumably in a cell) and have your formula calculate =(2*(A1^2)+3)*(3*(A1^3)+5*A1-2) or similar
 
Upvote 0

Forum statistics

Threads
1,225,136
Messages
6,183,067
Members
453,147
Latest member
Lacey D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top