List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Re: Evaluation problem
| [MUG] Re: Evaluation problem |
|
Author: Maple User Group
Posted: Fri, 13 Dec 2002 16:54:24 -0500
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 12 Dec 2002 15:54:35 -0500
From: Bill Bauldry "BauldryWC"
Subject: Evaluation problem
To: "maple-list"
>>> From: Colin Campbell - IST "campbell"
> This problem actually arose recently in a Calculus assignment on
> exploring limits with the help of Maple.
>
> 1. Here is the function:
>
> f := (x) -> ( x - 8 ) /
> ( x^(1/3) - 2 );
>
> 2. We evaluate the function at x=8, (Maple 8, Win XP)
>
> f(8);
>
> but instead of getting: "Error, numeric exception: division by zero"
> we get: "0" as the result.
[snip]
Colin,
The problem is that Maple works in the Complex domain while your students
are working in the Real domain. In C, the "first" cube root of 8 isn't
necessarily 2 (branch choice matters), so the 0 can be correct.
If you have your students enter:
> with(RealDomain):
at the beginning of a session, they'll get what they expect.
Happy Holidays,
Bill
______________________________________
Wm C Bauldry, PhD
Professor and Chairperson
Department of Mathematical Sciences
Appalachian State University
121 Bodenheimer Dr
Boone, NC 28608-2092
_____________________
phone: (828) 262-3050
fax: (828) 265-8617
"mailto:BauldryWC"
http://www.mathsci.appstate.edu/~wmcb/
______________________________________
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Fri, 13 Dec 2002 08:38:50 +1000
To: "maple-list"
From: "W.Whiten" (Bill Whiten)
Subject: Evaluation problem
Note this expression can be simplified to x^(2/3)+2*x^(1/3)+4 which gives
the value 12 at x=8 in real arithmetic, and 0 for the complex roots of 8 :
> eq1:=( x - 8 ) /( x^(1/3) - 2 );
x - 8
eq1 := ----------
(1/3)
x - 2
> factor(y^3-8);
2
(y - 2) (y + 2 y + 4)
> eq2:=x^(2/3)+2*x^(1/3)+4;
(2/3) (1/3)
eq2 := x + 2 x + 4
> testeq(eq1,eq2);
true
> s1:=solve(y^3=8);
s1 := 2, -1 + I sqrt(3), -1 - I sqrt(3)
> eq3:=y^2+2*y+4;
2
eq3 := y + 2 y + 4
> subs(y=s1[1],eq3);
12
> simplify(subs(y=s1[2],eq3));
0
> simplify(subs(y=s1[3],eq3));
0
Regards,
-----------
Bill Whiten, "W.Whiten"
Julius Kruttschnitt Mineral Research Centre,
The University Of Queensland, Tel: int +61 7 3365 5888
Isles Rd, Indooroopilly, Fax: int +61 7 3365 5999
Brisbane Qld 4068, AUSTRALIA.
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Dr Francis J. Wright" "F.J.Wright"
To: "campbell"
Subject: Evaluation problem
Date: Fri, 13 Dec 2002 16:00:13 -0000
I think the question is really this: "Should Maple simplify 0/X to 0?"
There is probably no right answer to this. Currently, Maple does simplify
0/X to 0, which I guess is what users want in the majority of cases.
However, when further information shows that X is, in fact, zero, one
realizes that the simplification was not justified, by which time it is too
late to go back and fix things because the X has gone.
Here is another way to avoid the problem, which should make sense to
students who are studying limits:
> F := X -> simplify(limit(( x - 8 ) / ( x^(1/3) - 2 ), x=X));
> F(8);
12
Francis
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 12 Dec 2002 14:37:06 -0400
From: C W "sylvester7"
To: "maple-list"
Subject: Evaluation problem
No evaluation problem :
plot(`@`(proc (x3) options operator, arrow; x3^2+2*x3+4 end,proc (x) options
operator, arrow; surd(x,3) end),-10..10);
Chris
|
[View Complete Thread]
Previous by date: [MUG] Re: Curious simplification, Greg Gamble
Next by date: [MUG] Re: Forcing Maple Output with Simplifying, Maple User Group
Previous thread: [MUG] Two bugs in evalapply(), Helmut Kahovec
Next thread: [MUG] Forcing Maple Output with Simplifying, Fraser Murray
|