Question: Extending diff for procedure

Hi

I wrote a custom recursive procedure to calculate some value (it is an implementation of a recursive algorithm)
During the further calculations derivatives of this procedure occur. Because of the statements in the specific procedure the automatic diff of a procedure does not work (at least I think that is the reason). However this is no problem as the differentiation is far from simple. L'hopitals rule needs to be used when necessary and Maple cannot detect when it needs to be used automatically (because there is another function, implicitly defined involved).
Therefore I am looking to write my own diff procedure as an extension. From the manual I gathered that this can be done as such `diff/name_of_type' =... however my procedure is not a type and I cannot easily write a 'type/name_of_type' function to define it as such. Can someone help me out?

 

I've made a toy example:

toy_example.mw

I know that in the case of this toy example other ways are possible.
What I need is a way to write my own procedure to evaluate the differential (D[1](A))(1,2,3);

Possibly defining procedure A as a type and writing 'diff/A'=proc...

Thanks

 

Please Wait...