Doug Meade

 

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

MaplePrimes Activity


These are Posts that have been published by Doug Meade

The following would appear to be a pretty straightforward improper integral for Maple to handle:

q := Int( 1/x^p, x=1..infinity );
                                /infinity      
                               |          1    
                               |          -- dx
                               |           p   
                              /1          x    

Things start of well, with Maple recognizing that the answer depends on the value of p:

value( q );               # fine
                         /   (-p + 1)                  \
                         |  x         - 1              |
                    limit|- -------------, x = infinity|
                         \      p - 1                  /

The first case is when p>1:

value( q ) assuming p>1;  # good
                                      1  
                                    -----
                                    p - 1

The other case should be for p<1:

value( q ) assuming p<1;  # say what?
                            infinity p - infinity
                            ---------------------
                                    p - 1        

One of our TAs reported this to me earlier today. (A student reported it to him.)

Sum(sin(1/10000.0*i^2), i = 0 .. 199):
%, value( % ), evalf( % );
            199                                                   
           -----                                                  
            \                                                     
             )      /                 2\                          
            /    sin\0.0001000000000 i /, 80.85387129, 127.2891137
           -----                                                  
           i = 0     

The student used evalf. I suggested that value was a better first option in this case. Since this is just the sum of a fixed set of numbers, an even better alternative is to use add:

add(sin(1/10000.0*i^2), i = 0 .. 199);

                                 80.85387132

The problem disappears when Digits increases to (at least) 15.

The following example was shown to me by Matthias Kawski.

He noticed a difference in the way Maple 12 handles some definite integrals from the way they were done in Maple 8. Both cases point out some problems. I'll offer my explanation of the problem after I show what Matthias observed: First, the results from Maple 8. Each of these 4 examples evaluates a definite integral in two different ways, the first using a function and the second using an expression. All looks fine until the last example.

 

Maple gives different error messages to the same input depending on whether the input is done with Maple notation or 2D Math Input.

My example is to enter the following erroneous input in both Maple notation and 1D math notation:

plot( sin(x, x=0..1 );

Clearly this is missing a right parenthesis after the first x.

Here is how this section of my worksheet copies into MaplePrimes:

A colleague recently showed me some strange behavior when trying to plot vertical lines. The following works to create the unit square:

plot( [x=0,x=1,0,1], x=0..1, y=0..1, color=black, axes=none ); # OK

But doubling the size in each direction does not produce a square:

plot( [x=0,x=2,0,2], x=0..2, y=0..2, color=black, axes=none ); # BAD

The vertical lines extend only up to y=1, not y=2 as requested. The next command shows that vertical lines at the boundary are treated differently.

2 3 4 5 6 7 8 Page 4 of 9