Differentiating a 6 order polynomial

prodrive

New Member
Joined
Jun 9, 2014
Messages
3
Hi,

I am trying to calculate the gradient of a 6 order trendline. I have recreated the trendline equation in a worksheet however I can't work out how to differentiate the line equation to give me a single gradient figure (worked out how to get the gradient at a specific point on the curve, however not for the whole curve). How can I manipulate excel's functions to get the gradient of a 6 order polynomial?

Any help would be appreciated.

Many thanks
 
I think he's saying that the derivative gives you the slope at every point in the domain, as opposed to doing it numerically for the tabulated points.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Well I'm obviously being a bit thick but as there's an infinite number of those I'm not sure how we're supposed to list them
 
Upvote 0
I didn't see anything about listing them.
 
Upvote 0
If I were to use LINEST or LOGEST how would I utilise the formula to get the gradient for a six order poly

Suppose your x values are in X1:X12 and your y values are in Y1:Y12.

For an order-6 polynomial, select 7 contiguous cells in a column, e.g. A1:A7, and array-enter the following formula (press ctrl+shift+Enter instead of just Enter):

=TRANSPOSE(LINEST(Y1:Y12,X1:X12^{1,2,3,4,5,6}))

As a double-check, put the following normally-entered formula (just press Enter as usual) into Z1 and copy down through Z12:

=SUMPRODUCT($A$1:$A$7,X1^{6;5;4;3;2;1;0})

Graph columns X, Y and Z using a scatter chart, and compare the curve for the z data with the order-6 polynomial trendline for the y data.

They should be very similar, even if the LINEST and trendline coefficients are very different.

(Actually, for the data that you posted, the coefficients are very similar up to 7 decimal places.)

-----

Alternatively, you could select 7 contiguous cells in a row, e.g. A1:G1. Then the formulas would be:

=LINEST(Y1:Y12,X1:X12^{1,2,3,4,5,6})

=SUMPRODUCT($A$1:$A$7,X1^{6,5,4,3,2,1,0})

Remember to array-enter the LINEST formula.

Whether to use semicolon for row separators and comma for column separators or vice versa depends on your Regional and Language Options control panel settings.
 
Last edited:
Upvote 0
copy down through Z12:

=SUMPRODUCT($A$1:$A$7,X1^{6;5;4;3;2;1;0})
Or =SERIESSUM(X1, 6, -1, $A$1:$A$6) + $A$7 to avoid a #NUM error for x=0.
 
Upvote 0

Forum statistics

Threads
1,222,505
Messages
6,166,414
Members
452,037
Latest member
Kdog64

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