13
$\begingroup$

I would like to define a new operator, say:

$\text{stard}[f[x]] = \lim_{h\rightarrow 0}\left(\frac{f[x+h]}{f[x]}\right)^{\frac{1}{h}}$

I think it must be done with an upvalue, but how do I do it?

$\endgroup$
  • $\begingroup$ Just curious: Is there an Anglo-Saxon-Bias here? Why are we talking about "Non-Newtonian-Calculus" when talking about say multiplicative calculus as opposed to additive? I had thought that calculus was invented by Leibniz and Newton independently from each other? $\endgroup$ – gwr Sep 20 '16 at 9:28
  • $\begingroup$ @gwr Leibniz is harder to pronounce and create possessives from. Both "Leibnizian" and "Leibniz's" sound pretty awful. "Non-Leibnizian" is even worse. My guess is this is the main reason for Newtonian being preferred for these purposes. So in essence the bias comes from the language being used (English) rather than any preference for Anglo-Saxon scientists. $\endgroup$ – DRF Sep 20 '16 at 11:17
  • $\begingroup$ @DRF So it might have been called "Non-Leibniz-Newtonian calculus" if an indication of possion was needed at all (no need to use possive forms twice in that case in English, is there?). To me "Non-Newtonian-Calculus" simply seems to be an unfortunate choice of a name, since it suggests that there is something like purely "Newtonian Calculus" as opposed to "Classical Calculus". $\endgroup$ – gwr Sep 20 '16 at 11:35
  • 1
    $\begingroup$ Just filed an official complaint at Michael Grossman and Robert Katz asking them to reconsider that unfortunate choice of name. :) $\endgroup$ – gwr Sep 20 '16 at 12:12
  • 4
    $\begingroup$ @gwr : Wait. Wait. Wait. Why does Leibniz get priority in your version of that name? Why not "Non-FermatAndTheOtherTwoGuys-ian calculus"? $\endgroup$ – Eric Towers Sep 20 '16 at 13:23
21
$\begingroup$

The usual way is to specify both the expression and the relevant variables.

Clear[stard]

stard[expr_, x_] := Module[{h, result},
  result = Limit[((expr /. x -> (x + h))/expr)^(1/h), h -> 0];
  result /; Head[result] =!= Limit]

stard[x^2, x]

(* Exp[2/x] *)

This is what builtin functions do too, e.g. Integrate[expr, x] or FourierTransform[expr, t, ω].


Update: Here's a version which can do multiple steps in one evaluation. The most complex part of this is the error checking. The order of definitions is crucial.

Clear[stard]

stard[expr_, {x_, 0}] := expr
stard[expr_, {x_, 1}] := stard[expr, x]

stard[expr_, {x_, n_Integer?Positive}] :=
 Module[{part},
  part = stard[expr, {x, n - 1}];
  stard[part, x] /; Head[part] =!= stard
 ]

stard[expr_, Except[_List, x_]] := 
 Module[{h, result}, 
  result = Limit[((expr /. x -> (x + h))/expr)^(1/h), h -> 0];
  result /; Head[result] =!= Limit
 ]

Example:

stard[Sin[x], {x, 3}]
(* E^(2 Cot[x] Csc[x]^2) *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ I have corrected my question and it works nicely with your help. I dont understand exactly the difference between Derivative and D $\endgroup$ – cyrille.piatecki Sep 20 '16 at 8:33
  • $\begingroup$ And how to define a D* of any integer order as standard second order derivatives ? $\endgroup$ – cyrille.piatecki Sep 20 '16 at 8:42
  • $\begingroup$ Derivative[n][f][x] is the full form of D[f[x],{x,n}], so, in general, you can use any of them. $\endgroup$ – dpravos Sep 20 '16 at 8:50
  • 5
    $\begingroup$ @DavidPravos That's not quite correct. D[f[x], x] evaluates to Derivative[1][f][x]. The latter isn't the FullForm of the former. What I meant was that D operates on an expression, e.g. D[x^2,x]. There's no need to define a function first. Derivative operates on a function, and doesn't require specifying a variable. $\endgroup$ – Szabolcs Sep 20 '16 at 9:10
  • $\begingroup$ @cyrille.piatecki Updated. Also see comment above. $\endgroup$ – Szabolcs Sep 20 '16 at 9:19
5
$\begingroup$

This is a product derivative. Using the solution from here,

ProductD[f_, x_] := ProductD[f, {x, 1}];
ProductD[f_, {x_, k_Integer?NonNegative}] := Exp[D[Log[f], {x, k}]]


ProductD[Sin[x], {x, 3}]
(* E^(2 Cot[x] Csc[x]^2) *)
| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Of Course, this work but all the non standard derivatives haven't always a so simple formula. $\endgroup$ – cyrille.piatecki Sep 20 '16 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.