[Date Index] [Thread Index] [Author Index]
Re: Integer Values
Adrean Webb wrote: > > Hello. I'm having trouble defining constants in Mathematica as integer > values. For example, how do you define a constant C such that > Mathematica performs the derivative of x^C as Cx^(C-1)dx? Is this > possible? > > Thanks > Adrean D[x^n,x] returns n x^(-1+n) whether or not n is an integer. The only way I am familiar with "declaring" a symbol to be integer is to put in a function construct specifying the parameter as an integer(ie f[x_Integer], but all this does is prevent the function from executing if the parameter is not an integer. Personally, I think that one of the weaknesses of mathematica is the "typelessness" of the language. It is odd that it doesn't have this feature since it is written in c, which is a type-based language.