This is probably more of a maths question than a programming one, but I can't find a more suitable category.

I'm drawing best fit lines on graphs, and using the information here:

http://misc.connectfree.co.uk/graphs/
That page shows how to calculate the variables for the following lines:

y = a + bx

y = a + bx + cx^2

I've implemented them, and everything works fine. However, now I nee to do the same thing for these lines:

y = a + bx + cx^2 + dx^3

y = a + bx + cx^2 + dx^3 + ex^4

y = ab^x

But I can't find similar equations for calculating the replacements for a-e in those equations. I've found some stuff on the web, but nothing in that kind of format (the "first format" shown - which I can understand, and implement!).

Does anyone know how to calculate these?