HP 35s y^x vs. yrootx



#2

Puzzled that the integration on the HP 35s will not work with 3 1/x y^x, but will work with 3 root x.

On the other hand, the extremum program kindly posted by Dieter in that situation will not accept 3 root x, say, but works with 3 1/x y^x.

Any ideas why?


#3

First of all, 3 XROOT and 3 1/x y^x are two different expressions. The former stands for the cube root of y (or y1/3, the latter is y0,3333333333333.

Do you see the difference?

 -8 ENTER 3  XROOT => -2
-8 ENTER 3 1/x yx = -80,333333333333 => INVALID yx
The latter happens since there is no real solution for -80,333333333333. The exponent does not equal 1/3, only the first twelve digits agree.

However, a complex result exists:

 -8i0 ENTER 3  1/x  yx = 1 + 1,73205080757i
Quote:
Puzzled that the integration on the HP 35s will not work with 3 1/x y^x,

Of course it will. If the 35s throws an error, it's because of the mentioned reason.
Quote:
On the other hand, the extremum program kindly posted by Dieter in that situation will not accept 3 root x, say, but works with 3 1/x y^x.

Sure. On the 35s, the XROOT function is only defined for real arguments. On the other hand, yx will also work in the complex domain. That's why the comment in the program listing advises the user to make sure that all operations used within the function are defined for complex arguments.

Dieter


Edited: 28 Sept 2013, 12:13 p.m.


#4

Thanks. Your discussions are excellent and appreciated.

#5

Quote:
 -8 ENTER 3  XROOT => -2
-8 ENTER 3 1/x yx = -80,333333333333 => INVALID yx
The latter happens since there is no real solution for -80,333333333333. The exponent does not equal 1/3, only the first twelve digits agree.

However, a complex result exists:

 -8i0 ENTER 3  1/x  yx = 1 + 1,73205080757i

Well, there are three solutions to

 -8 ENTER 3  XROOT 
One of wich is -2, and another one is
1 + 1,73205080757i

It is probably too late and I had too much to drink, so I can't see clearly, but couldn't

 -8i0 ENTER 3  1/x  yx
also be -2 (+ 0.000000something*i to allow for the rounding error in 1/3)?


#6

Harald wrote:

Quote:
Well, there are three solutions to
 -8 ENTER 3  XROOT 
One of wich is -2,

...which is the only real root. Since the 35s here is in real mode (all arguments are real), this is the only possible solution. So the returned result is fine.
Quote:
...and another one is 1 + 1,73205080757i

...which is exactly what the 35s returns in complex mode, i.e. when at least one of the arguments is complex. Just enter 8 as "8 i 0" and you'll get this result.

The third possible solution, i.e. the second complex one, is 1 - sqrt(3) i. But just as all other calculators I know of, the 35s returns just one possible solution:

In real mode that's either -2 (with 3 XROOT) or an error message (with 3 1/x yx) since no real result exists.

In complex mode it's 1 + sqrt(3) i. It's the same as on any simple calculator with a [SQRT]-key which returns just one result, the positive root.

Quote:
...but couldn't
-8i0 ENTER 3  1/x  yx
also be -2 (+ 0.000000something*i to allow for the rounding error in 1/3)?

Hmmm... I am not an expert on complex arithmetics, but as far as I can see the real part of e.g. (-2 + 1E-15 i)1/0.333333333333 will not equal 8 even when rounded to twelve digits, and the imaginary part will be small, but not zero.

But even if this was a possible solution: just as any other calculator, the 35s returns one single result. In this case the one that Wolfram Alpha returns as well. Which I think can be trusted. ;-)

Dieter


Edited: 29 Sept 2013, 10:18 a.m.


#7

Thanks for your reply Dieter. I think the problem is that I don't understand how the calculator "decides" which solution to display. Obviously in real mode it is programmed to come up with real results if possible.

I guess the way to calculate y^x is e^((ln y) * x). So it comes down to which solution of the logarithm the calculator uses. But I am out of my depth here as well. Can anyone help?

Cheers,
Harald


#8

I'm fairly sure that "principal value" is almost always the one with the smallest argument (or angle). Here we could give the answer at 60 degrees, at 180 degrees, or at 300 degrees; so 60 is the one chosen (despite 180 being a real answer).


#9

That makes sense. Thanks!

#10

To follow along with Dieter's comment, the program

RCL X
3
1/x
y^x
RTN
integrates as long as the integration range is non-negative, as does
RCL X
SQRT
RTN
The program using XROOT instead (RCL X; 3; XROOT; RTN) integrates, although it takes a while unless you crank it down to FIX 1 or 2, and the accuracy isn't very good (I used the range from -8 to 1, which should give -11.25, and FIX 2 gave me -11.07 and FIX 3 gives -11.244).

Note: all of this was done on the emulator, since my actual machine is in the office, but I'm not aware of any differences here.

Edited: 28 Sept 2013, 12:32 p.m.


Forum Jump: