On 3/20/2007 3:17 PM, enrico.foscolo wrote: > Dear participants to the list, > > this is my problem: I want to obtain an expression that represents the second > derivative of one function. > With "deriv3" (package "stats") it is possible to evaluate the second > derivative, but I do not know how I can get the (analytical) expression of > this > derivative. > > For example: Suppose that I have a function of this form: > f(x,y)=x^3+y^3+(x^2)*(y^2). With "deriv3" I can evaluate the first derivative > and the hessian matrix, as follows:
R isn't the package I'd choose for symbolic calculations, but you can get what you want with D: > e <- expression(x^3+y^3+(x^2)*(y^2)) > D(D(e, "x"), "y") 2 * x * (2 * y) Duncan Murdoch ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
