text: I don't know what you mean by terminal endpoints linearity.  I've never heard of it.  Are you simply linearizing a function?  If so, you should be able to see how to do it in any calculus text.  As for the line of best fit, check out the least-squares method.