Hi, I have a question about derivatives of functions. if i have the following function, f <- function(x) x^3-2*x^2+3*x-5 i need a simple function for the derivative of this with respect to 'x', so that i can then sub in values to the the derivative function, and use Newtons method of finding a root for this. Please help. Regards, Kon Knafelman _________________________________________________________________ [[alternative HTML version deleted]]
Kon Knafelman wrote:> > > if i have the following function, > > f <- function(x) x^3-2*x^2+3*x-5 > > i need a simple function for the derivative of this with respect to 'x', > so that i can then sub in values to the the derivative function, and use > Newtons method of finding a root for this. >?deriv ?uniroot (if this is not homework) Dieter -- View this message in context: http://www.nabble.com/%28no-subject%29-tp23498039p23498366.html Sent from the R help mailing list archive at Nabble.com.
> if i have the following function, > > f <- function(x) x^3-2*x^2+3*x-5 > > i need a simple function for the derivative of this with respect to > 'x', so that i can then sub in values to the the derivative > function, and use Newtons method of finding a root for this.You could take a look at ?deriv, but since the example you presented is just a polymonial, you can probably learn about calculus ( http://en.wikipedia.org/wiki/Derivative#Derivatives_of_elementary_functions ) and differentiate it in your head in less time than it took you to write this help question. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}