Don Guinn wrote:
> Given:
>  f =: ^&_0.001
>  The integral of f as a J expression ignoring an arbitrary constant is
>   if =: _1000*^&_0.001

The primitive conjunction  D.  is "derivative".   So, for example   f D.1   is 
the first derivative of  f, namely  _0.001 * ^&( _0.001 - 1)  :

           ^&_0.001 D. 1
        (* =/~@(i...@$))@:(_0.001&*@(^&_1.0009999999999999))
           
I'm not sure why  the results are diagonalized with   (* =/~@(i...@$))  but 
then it's a long time since I took calculus.

Anyway, conceptually, if  f D.1  is  the first derivative of  f  then  f D._1   
is the first integral of f, and if J could symbolically calculate these the way 
it symbolically calculates derivatives, then Dieter could have his "right 
answer" with:

    1 -&(f D. _1) _

or using your insert-style:

    -&(f D. _1)/  1 _

And he could "believe" it more or less blindly (in the same way we "believe"  
213213123x * 9918831771x  more or less blindly, i.e. believe=trust).  But, at 
the moment, J does not support integrals (negative RHAs to  D.  ):

           ^&_0.001 D. _1
        |nonce error
        |       ^&_0.001 D._1

Since, with positive RHAs, J already identifies and manipulates the relevant 
information from a useful subset of LHAs, would be much trouble to support 
negative RHAs for this same subset?  Or even a smaller subset; I'm thinking 
particularly of  x&p. D. n  for numeric (maybe real?)  vector  x  (and scalar 
integer  n  negative or positive obviously).

-Dan

PS:    Never thought of it before, but  D.0  is a cute identity adverb in J:

           ('arbitrary function' [ ;:) D. 0
        'arbitrary function' [ ;:

similarly for  @.0   (but  v...@.  is undocumented).  Also, I just realized I 
can do sneaky tricks with  u`v D. n   .

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to