RE: Entering constant placeholders

*To*: mathgroup at smc.vnet.net*Subject*: [mg32362] RE: [mg32328] Entering constant placeholders*From*: "David Park" <djmp at earthlink.net>*Date*: Wed, 16 Jan 2002 03:30:22 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

progman, There are a number of ways to do this. I would do it this way because it separates the parameters from the variable of the polynomial. (By the way, your Mathematica syntax is not at all correct. You must especially separate a, b, and c from the x expressions by a space.) poly[a_, b_, c_, d_][x_] := a*x^3 + b*x^2 + c*x + d Now, you can use the shortcut expression for differentiating. poly[a, b, c, d]'[x] c + 2*b*x + 3*a*x^2 David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > From: progman [mailto:dglfl at home.com] To: mathgroup at smc.vnet.net > > I can't seem to make this work. When I enter the following, I get these > errors: > > SetAttributes[a,b,c, Constant] > > Syntax::tsntxi: "SetAttributes a,constant" is incomplete; more input is > needed. > > d(ax^3 + bx^2 + cx + d)/dx > > The answer should be 3ax^2+2bx+c . I can't figure out how to tell > mathematica that a,b, & c are constants. > > > > Thanks >