I might have caused inadvertently some confusion by inserting the
derivative of 0^x ((0&^)d.1) into the discussion of the integral of 0^x
(see my reply to Raul).

"
...
Which is fine... as long as the log of a is defined. But at a = 0, log(a) =
__. Which blows up the whole thing. J's d. operator has a few issues,
handling this is just one of them.
"

Right, that is why I suggested to look directly at the evaluation,
according to J, of the function 0^x (0&^):

"J evaluates 0^x as follows:

 _ if x < 0
 1 if x = 0
 0 if x > 0
"

and proceed from there.  The integral of 0^x for the interval x > 0
presents no problem; however, the situation for its complement, the
interval x <= 0, is quite another matter.  (My suggestion is to evaluate
((0&^)d._1) as _. for any value in that troublemaker interval).

Wolfram Alpha's response, see the comment (the NB's) I inserted afterward,
makes more sense to me.

"   ((_9&^)d.1)  NB. integral of (-9)^x
gives
   _0.244136j_0.349606
That is clearly wrong. My fix should clear up a few of these issues.
"

The sentence ((_9&^)d.1) is supposed to produce the derivative, as opposed
to the integral, of (-9)^x, and I get,

   ((_9&^)d.1)
2.1972245773362196j3.1415926535897931&*@(_9&^)

(I do not know what to make of that answer anyway.)


On Mon, Oct 2, 2017 at 8:27 AM, 'Jon Hough' via Source <sou...@jsoftware.com
> wrote:

> > however, for instance,
>
> > ((0&^)d.1) _1
> >   __
>
> > is beyond my comprehension.  Can anybody
> > explain this result?
>
> Standard (or naive) way to evaluate integral of some number to the power x.
> integral of a^x dx
> can be rewritten as
> integral exp(log(a)*x) dx
> which can be easily evaluated to
> exp(log(a)*x) /  log(a)
> and simplified to
> a^x/log(a)
>
> Which is fine... as long as the log of a is defined. But at a = 0, log(a)
> = __. Which blows up the whole thing. J's d. operator has a few issues,
> handling this is just one of them.
> Another issue:
>
>    ((_9&^)d.1)  NB. integral of (-9)^x
> gives
>    _0.244136j_0.349606
> That is clearly wrong. My fix should clear up a few of these issues.
> --------------------------------------------
> On Mon, 10/2/17, Jose Mario Quintana <jose.mario.quint...@gmail.com>
> wrote:
>
>  Subject: Re: [Jsource] d. fix
>  To: sou...@jsoftware.com
>  Date: Monday, October 2, 2017, 2:43 PM
>
>  "
>  My main
>  point was that I'm not sure how the best way to handle
>  integral of
>  0^x is. I guess it could be
>  considered the
>  integral of 0 (i.e. 0^x = 0).
>  So ...
>  "
>  It seems that
>  J evaluates 0^x as follows:
>
>  _ if x < 0
>  1 if x = 0
>  0 if x > 0
>
>  So, which is the function, apart from adding a
>  constant, whose derivative
>  is 0&^?  If
>  x > 0 I would say it is 0"0; otherwise, it might be
>  wise to
>  regard it as undefined.
>  Consider the derivative of 0^x, according to
>  J,
>
>     (0&^)d.1
>  __&*@(0&^)
>
>  If x > 0 the evaluation makes sense to me;
>  however, for instance,
>
>
>  ((0&^)d.1) _1
>  __
>
>  is beyond my comprehension.  Can anybody
>  explain this result?
>
>  NB.
>  Wolfram Alpha
>  NB. https://www.wolframalpha.com/input/?i=d%2Fdx(+0%5Ex)
>  NB. d/dx(0^x)
>  NB. 0 if x
>  >0
>  NB. indeterminate otherwise
>
>  Incidentally, although Wolfram
>  Alpha regards 0^0 as undefined, it is fine
>  with integral x^0 dx and agrees with J...
>
>  NB. Wolfram Alpha
>  NB. https://www.wolframalpha.com/input/?i=integral+x%5E0+dx
>  NB. integral x^0 dx
>  NB. x +
>  constant
>
>
>  (^&0)d._1
>  [
>
>  NB. Wolfram Alpha
>  NB. https://www.wolframalpha.com/input/?i=d%2Fdx(+integral+x%5E0+dx)
>  NB. d/dx( integral x^0 dx)
>  NB.
>  1
>
>     (^&0)d._1 d.1
>  1
>
>
>  On Sun, Oct 1, 2017 at 9:18 PM, 'Jon
>  Hough' via Source <sou...@jsoftware.com
>  > wrote:
>
>  > Yes, the sentence I wrote is essentially
>  gibberish. I'll put it down to
>  >
>  tiredness. (J only defines 0^0 as 1).
>  >
>  My main point was that I'm not sure how the best way to
>  handle integral of
>  > 0^x is. I guess it
>  could be considered the
>  > integral of 0
>  (i.e. 0^x = 0). So
>  >
>  >
>  (0&^) d. _1
>  > could either be 0 (+
>  some constant)
>  > or
>  >
>  undefined.
>  >
>  > Wolfram
>  Alpha decides to go with undefined. Seems reasonable, since
>  if you
>  > are trying to integrate 0^x
>  anyway, you probably have other issues with
>  > your code.
>  >
>  --------------------------------------------
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to