I'm trying to work out what the new co-efficients for a cubic function would be if it was shifted distance p along the x axis.
I don't know why i can't seem to do it!
I can do it using f(x-p), like y=a(x-p)^3+b(x-p)^2+c(x-p)+d
but i need it so that i just have a single co-efficient for a b c and d, so when i find the roots of that equation, i find the roots=x, not the roots=x-p (i know i can just +p afters, but that doesn't work in the particular application i'm using).
I graphed a few on excel (as it's got the curve fit that displays eqns) but i can't find a relationship, more to the point I perhaps don't know how to go about it when it's more complicated than just x^3.
From what I've done, i can see there must be a standard way of creating co-efficients so that i can shift in x, if anyone can tell me how to get to there, i'd be really greatful.
Thanks!
My bad - I was sitting here doing it while you posted ... but I got different co-efficients, and neither set worked when i plugged them into excel, comparing them to numbers calculated using (x-p)... directly.
My x and y values are something like this ...
0 0 1
0.1 0.181 1.111
0.2 0.328 1.248
0.3 0.447 1.417
x values: 0, 0.1, 0.2, 0.3
(x-p)...: 0, 0.181, 0.328, 0.447
expanded: 1, 1.111, 1.248, 1.417
expanding (x-p)^2:
(x^2 - 2px + p^2)
expanding (x-p)^3:
(x^3 - 2px^2 + p^2x +px^2 - 2p^2x + p^3)
stick in the coefficients and rearrange ...
I get (a)x^3 + (b-3ap)x^2 + (2ap^2 - 2bp +c)x + (d-cp-ap^3+bp^2)
But not the same answers as for (x-p)... directly.
Right
Wrong!expanding (x-p)^3:
(x^3 - 2px^2 + p^2x +px^2 - 2p^2x + p^3)
(x-p)^3 = (x^3 - 2px^2 + p^2x - px^2 + 2p^2x - p^3)
Try again...stick in the coefficients and rearrange ...
I get (a)x^3 + (b-3ap)x^2 + (2ap^2 - 2bp +c)x + (d-cp-ap^3+bp^2)
But not the same answers as for (x-p)... directly.