I am new to this newsgroup, so if these bugs have been reposted before I apologize. But I would like to understand what causes these.
BUG 1 :
The following command (both in V3 and V4 )
fsolve(x^5-5^x,x,x=3..5);
gives as output \(x=4\) . (This bug was discovered by one of my calculus students!)
Two solutions are \(x=1.76\).. and \(x=5\) and nothing in between. If you decrease 3 all the way to 1.8 or up to about 3.4 you get a whole range of incorrect answers, so the problem is stable!
If you write a small Newton procedure, it always gets it right, and indeed if you look at the graph it is hard to understand why it would do this. (Of course I know how to "avoid" this by always checking your results, but I would like to understand the "bug")
The bug is removed with Maple V Release 5. (U. Klein)
BUG 2:
If you say (both in V3 and V4 )
implicitplot((y-x)^2=0,x=-5..5,y=-5..5);
you get an empty picture. No matter how much you increase the grid, you always get an empty picture. Of course this is more annoying in examples like:
implicitplot(9*x^2+16*y^2-24*x*y-8*y+6*x+1=0,x=-5..5,y=-5..5)
(which I unfortunately assigned to my calculus class).
I read in the Flight Manual (for V4) that implicit plot constructs a grid in the rectangle specified (default 25x25) and computes at each point whether the equation is approximately true and then connects nearby points. This would make sense, but the above example shows it is not true.
If you change the power to an even power you get the same result, but for an odd power it can draw it. So apparently it checks sign changes. Does someone know how implicitplot really works and what the grid option really does?
BUG 3:
The following integral
int(sqrt(x)*sqrt(1+1/x),x);
which you can easily do by hand gives 2/5(x+1)^3/2 in V3 and the correct answer 2/3(x+1)^3/2 in V4 .
Since this example is so simple, does someone understand what the bug in V3 was? Very puzzling how it can get it so wrong.
I understand that you can "circumvent" it with
value(combine(Int(sqrt(x)*sqrt(1+1/x),x)));
but my calculus students just laughed at me (or got mad) when I presented that "solution".
In fact Maple did not "pass" my midterm because of problems of the above type. Maple has a hard time with arclength and surface area problems. I learned the hard way that I cannot just assign standard problems from the book, thinking that Maple must be able to do this since my students can. V4 is better but not perfect either. Does someone know what integration "techniques" have been improved in V4 and what kind of integrals it will be better at?
The confidence of my students was really shaken by the above examples, but maybe that was a good lesson.
Finally a question:
As you noticed from the above, we are still using V3 in our calculus courses but are planning to switch to V4 this summer.
Has anyone done this yet on a large scale like a whole university and have any experience what problems to expect (besides complaints from the students)?
| BUG 2:
| I read in the Flight Manual (for V4) that implicit ...
Not quite. It constructs a grid, at each point of which it computes the difference between the two sides of the equation. Then in each cell of the grid it sees whether these values change sign, and if so draws a line to interpolate. Your function being always >= 0, there will be no sign changes.
Wolfgang Ziller recently pointed out a shortcoming with implicitplot; namely the fact that y-x^2=0 will be plotted correctly, but (y-x^2)^2=0 will not. In addition whenever you have a polynomial in two variables that has singular points they are almost never plotted correctly.
I would like to propose that Maple add an algorithm for plotting polynomial equations. Specifically, Gabriel Taubin (Rasterizing algebraic curves and surfaces, IEEE Computer Graphics and Applications 14, 14-23) published an algorithm for plotting implicit polynomial equations that is much better. I implemented it myself and am much happier with it. The algorithm subdivides the screen into 4 parts and tests to see if the graph might enter each quadrant. If so, it subdivides recursively. In the end the graph never misses any points of the curve. Occasionally it graphs a few extra pixels. This has never bothered me, but Taubin also included a second more sophisticated algorithm to correct for this.
Can’t help you with the reasons why the three bugs occur I’m afraid, but have a couple of comments on your final question.
We have been using Rel 4 campus wide since July 96 and the reaction has generally been very favourable. There are (probably) fewer bugs than in Rel 3 that affect beginning students and the improved user interface and error diagnostics have lead to more ’hassle free’ lab classes.
One unexpected bug that students found in my calculus class is that using
>sum(a(n), n=1..infinity);
to sum infinite series gives wrong answers for quite a number of standard textbook problems.
As a simple example, sum((-2)^n, n=1..infinity) gives an answer of -2/3. The problem seems to be in the hypergeometric series which is used in these cases. (Correct results are obtained by taking the limit of the sum of a finite number of terms.)
The three "bugs" that were recently posted all share a common theme: while Maple might be powerful, do NOT expect it to think for you (or your students). This is a trap that almost all users encounter from periodically. Addressed correctly, they can be used to enhance the educational experience.
| BUG 1 :
Let me be picky for a moment. The output from fsolve is a floating-point 4.000000 (not the integer 4). Second, the only REAL-valued solutions are (approximately) 1.76... and 5. Thus, as you proceed to say, this equation does not have a solution in the interval 3 .. 5. This fact should have been detected BEFORE asking for a floating-point solution. Two good ways to do this are to plot the function or ask for exact
solutions:
> f := x^5 - 5^x; > plot( f, x=0..8 ); > solve( f=0, x ); > evalf( % );
But, in fact, you have discovered a bug in the way fsolve processes results obtained by Newton’s method (in fsolve/scalnewt). A close examination of the processing shows that fsolve/scalnewt returns FAIL (indicating no solution in the given interval), but this result is not processed correctly and hence the erroneous result for fsolve. (I hope someone at Maple’s Technical Support notices this!)
| BUG 2:
Plots of implicitly-defined functions can be tricky. The resolution is often not what you would hope. This is all reasonable, as the general problem of finding points that satisfy \(f(x,y)=0\) is non-trivial! In both cases that you give, I would encourage students/colleagues to try to find a different way to look at the problem. For example:
> E1 := (y-x)^2=0; > solve( E1, {y} ); > > E2 := 9*x^2+16*y^2-24*x*y-8*y+6*x+1=0; > student[completesquare]( E2, x ); > sovle( %, {y} );
Actually, the two solves are so simple that they should not be done in this example. The difference between even and odd powers is probably due to the different domains for even and odd roots, but I’ll not comment further on this at this time.
| BUG 3:
The integral is not "easy" in it’s original form. It becomes easy when you write the integrand in a more natural form. The precise form that is most appropriate is not always known a priori (and is not always the same for human and Maple). It is not generally reasonable to assume Maple will be able to convert a problem to the appropriate form. In fact, there are technical problems with the domains (in its original
form, the natural domain is \(x>0\); after conversion, the domain is x>=-1). While this does not excuse the incorrect response, this is the type of distinction that humans (particularly students) easily overlook but can be stumbling blocks to software.
| In fact Maple did not "pass" my midterm because of problems ...
If you expect Maple to be a black box, it will be a great failure. Used intelligently, it can be effective. As pointed out above, there are real problems, but most can be avoided and/or explained by trying to understand the problem before concluding that Maple couldn’t solve the problem. I’ll bet Maple could easily pass your exam if the problems were posed in the proper way. I don’t mean this to suggest that you change your exam. Rather, this is the problem-solving and intellectual(?) part of Calculus that gives all but the best students real trouble. I view this as an advantage – I can directly address the formulation of problems and interpretation of solutions.
| Finally a question: ...
The uner interface takes some time to learn. I have a conjecture that it is easier to learn the R4 interface if you don’t know the R3 interface, but can’t test this on myself and don’t yet have enough classroom experience with R4 to know if this is accurate. With proper guidance, explanations, (not always easy – but keep posting questions to MUG), and expectations, Maple can be a very effective educational tool.
I hope these comments have been of some use. Thanks for reading all of this.
I extend my apologies in advance for the length of this submission. There are three parts. Each begins with a comment of Wolfgang Ziller followed by a response from Douglas Meade. My remarks then follow. Part I might be amusing for some muggers. It is included to buttress Richard Patterson’s recent plea for improvements in the implicitplot algorithm.
My contribution to Part II is somewhat boring but it is included for the WMS folks who read MUG. It includes an unwanted "Error, (in int) argument is not an algebraic." It also includes an example of a crash. Finally, as remission from the discussion of MAPLE problems, part III is upbeat (MAPLE as Grand Integrator).
I.
| implicitplot((y-x)^2=0,x=-5..5,y=-5..5);
Douglas Meade:
| Plots of implicitly-defined functions can be tricky. ...
Anyone who cares to try the following may judge for himself the reasonableness of MAPLE’s plot. I don’t know the extent to which graphics are system dependent but I think that Wintelists at least will see what I am seeing. This example is more fun if you try to predict in advance what plot MAPLE will return. Enlarging the grid only seems to exacerbate the effect:
Punctured_Folium := 1=3*x*y/(x^3+y^3): implicitplot(Punctured_Folium,x=-4..4,y=-4..4);
Increasing the value of Digits will result in a decent plot. But with Digits := 80, for example, improvement is not an increasing function of grid size. Try
> Digits := 80: > implicitplot(1 = 3*x*y/(x^3+y^3),x=-4..4,y=-4..4,grid=[30,30]); > implicitplot(1 = 3*x*y/(x^3+y^3),x=-4..4,y=-4..4,grid=[40,40]); > implicitplot(1 = 3*x*y/(x^3+y^3),x=-4..4,y=-4..4,grid=[50,50]);
The spurious lines \(x+y = a\) with \(0.15 < a < 0.35\) that appear in these plots also appear with style = POINT. I won’t quarrel with anyone for whom all of this is reasonable, but I do wonder why less sophisticated software better overcomes whatever tricky nontrivial problems there may be. For comparison I successfully plotted both Wolfgang Ziller’s examples and the Punctured_Folium using calculus-based software written at SFSU.
II.
| The following integral
Douglas Meade:
| The integral is not "easy" in it’s original form. ...
In the context of a MAPLE session I would not apply the adjective "easy" to any call. But were I a developer, I would want to investigate why an algorithm failed at something that appears particularly easy to a human. Especially when the failure replaces a former success. To that end, the indefinite integral
/ 1/2 | x | ------------------- dx | 1/2 1/2 / (a x) - (b x)
does not seem like a potential troublemaker. And the following are OK:
> int( subs( {a=a,b=b} , x^(1/2)/((a*x)^(1/2)-(b*x)^(1/2))),x); 1/2 1/2 1/2 1/2 x (b x) x (a x) ------------- + ------------- -b + a -b + a > int( subs( {a=Pi,b=exp(1)} , sqrt(x)/(sqrt(a*x)-sqrt(b*x))),x); 1/2 1/2 1/2 1/2 x (exp(1) x) x (Pi x) ------------------ + -------------- -exp(1) + Pi -exp(1) + Pi
But
> int( subs( {a=31/7,b=13/19} , sqrt(x)/(sqrt(a*x)-sqrt(b*x))),x);
Error, (in int) argument is not an algebraic The specific rational choices of a and b are whimsical but irrelevant. I tried a variety of rational substitutions, all with the same result. There is a certain regression here: R3’s response to this call is a correct answer.
Strange things happen with the similar integral
/ p (1/p) | (x ) | ------------------------- dx | p (1/p) p (1/p) / (a x ) - (b x ) > int( subs({p=p,a=a,b=b},(x^p)^(1/p)/((a*x^p)^(1/p)-(b*x^p)^(1/p))),x); x --------------- (1/p) (1/p) a - b > int( subs({p=p,a=2,b=1},(x^p)^(1/p)/((a*x^p)^(1/p)-(b*x^p)^(1/p))),x); x ---------- (1/p) 2 - 1
OK so far, but:
> int( subs({p=3,a=2,b=1},(x^p)^(1/p)/((a*x^p)^(1/p)-(b*x^p)^(1/p))),x); Error, (in int) argument is not an algebraic
Once again R3 has no trouble with this integral. As before the particular rational values of a and b are not significant. Now leave the exponent alone and set a=Pi and R4 fails:
> int( subs({p=3,a=Pi,b=1},(x^p)^(1/p)/((a*x^p)^(1/p)-(b*x^p)^(1/p))),x); / 3 1/3 | (x ) | -------------------- dx | 3 1/3 3 1/3 / (Pi x ) - (x )
More regression: R3’s response is the correct answer 1/(Pi^(1/3)-1)*x).
Much worse, the next call in R4 reliably results in crashes under Win95 and Win NT:
> interface(version); Maple Worksheet Interface, Release 4, IBM INTEL NT, Jun 13 1996 > int( subs({p=5/2,a=Pi,b=1},(x^p)^(1/p)/((a*x^p)^(1/p)-(b*x^p)^(1/p))),x);
... and crash
By contrast, the above call is harmlessly returned in unevaluated form in R3.
III.
| In fact Maple did not "pass" my midterm because of problems ...
Douglas Meade:
| If you expect Maple to be a black box, it will be a great failure. ...
Penn’s students are no doubt better than my own so for fair comparison I will refer to the exam that leads to the title "Grand Integrator of M.I.T." The first part is an hour long exam consisting of 40 integrals. For this particular exam the top 11 scores fell in the interval [26,35]. Some of the integrals were trivial, some quite hard. Others were easy but tedious (eg. int(x^5*exp(x),x)). Many integrands were not
presented in simplest terms. Some integrands benefited from transformations that my colleagues here have decided not to teach anymore (eg. Weierstrass’s substitution). Although I did not take the exam myself, I think that I would be satisfied with a score of 35 for the 1 hour allotted. However I did "administer" the exam to both MAPLE and the TI-92. It took me nearly 16 minutes to enter the exam in MAPLE. I
entered the integrals exactly as they appeared on the exam. On my slow office PC it took MAPLE 21 seconds on the CPU clock to evaluate all 40 integrals correctly. (I did check MAPLE’s answers. Since the integrals were indefinite, I counted as correct any MAPLE answer that was a primitive of the given integrand on some open real interval. It is possible that three MAPLE answers were not everywhere valid but
each of MAPLE’s answer was correct on at least some open real interval). This was a blackbox trial.
As for the TI-92, I could not reasonably separate my data entry time from the response time. Suffice to say that I reached problem #40 after 26 minutes. The TI-92 (based on the DERIVE kernel) returned answers to 37 of the 39 questions. I did not check their accuracy. The 40’th integral, int(sqrt(tan(x)),x) in MAPLE syntax, crashed the calculator! (I had to remove the batteries to end its non-responsive
state.)
This doesn’t contradict the thrust of Meade’s assertions. MAPLE did require a little human intervention for some not particularly difficult integrals of subsequent rounds (eg. int(cot(x)/ln(sin(x)),x); ). But it is certainly not true that MAPLE will necessarily be a great failure as a blackbox. Indeed, it can be very impressive in blackbox form.