vv

13310 Reputation

20 Badges

9 years, 119 days

MaplePrimes Activity


These are questions asked by vv

g:= a -> int(f(x+a),x=a..2*a):
eval(g(x),x=1);
                    int(f(2 x), x = 1 .. 2)
eval(g(z),z=1);
                   int(f(x + 1), x = 1 .. 2)

eval is advertised as smart, but it's not enough!


(Related to a recent answer of Carl Love about bound variables.)

 

Edit: shorter version

g:= a -> int(sin(sin(x+a)),x=a..2*a):
evalf(eval(g(x),x=1))=evalf(eval(g(z),z=1));
                  0.1052070507 = 0.5294405453

minimize((x+y)^2+cos(y)^2, x=-4..4, y=-2..2);  # cos(2)^2    should be 0
minimize((x+y)^2+cos(y), x=-4..4, y=-4..4);      
  
Error, (in unknown) mapped procedure in `ormap' must return true or false
minimize((x+y)^2+cos(y));                                   # infinity   ?!  should be -1

Edited. Corrected second example

This question is related to the recent post
http://www.mapleprimes.com/questions/211460-Series-Of-Bessel-Functions

1. Consider the following fast convergent series:

f:=n->(-1)^(n+1)*1/(n+exp(n));
S1:=Sum(f(n),n=1..infinity);
evalf(S1);
S2:=Sum(f(2*n-1)+f(2*n),n=1..infinity);
evalf(S2);

As expected, the sum of the series is obtained very fast (with any precision), same results for S1 and S2.


2. Now change the series to a very slowly convergent one:

f:=n->(-1)^(n+1)/sqrt(n+sqrt(n));

evalf(S1) is computed also extremely fast, because the acceleration algorithm works here perfectly.
But evalf(S2) demonstrates a bug:

Error, (in evalf/Sum1) invalid input: `evalf/Sum/infinite` expects its 2nd argument, ix, to be of type name, but received ...


3. Let us take another series:

f:=n->(-1)^(n+1)/sqrt(n+sqrt(n)*sin(n));

Now evalf(S1) does not evaluate numerically and evalf(S2) ==> same error.
Note that I do not know whether this series is convergent or not, but the same thing happens for the obviously convergent series

f:=n->(-1)^(n+1)/sqrt(n^(11/5)+n^2*sin(n));

(because it converges slowly (but absolutely) and the acceleration fails).
I would be interested to know a method to approximate (in Maple) the sum of such series.

Edit. Now I know that the mentioned series 

converges (but note that Leibniz' test cannot be used).

I have posted long time ago a patch for Shadebetween and you have transformed it into a hot fix:

http://www.mapleprimes.com/questions/205956-Error-In-Shadebetween

In the last Maple 2015 update, the problem was not fixed.

Just curious: is it fixed in Maple 2016? Because I feel that the Maplesoft team is not "impressed" by such patches.

Edit. This was a comment related to acer's patch for NLPSolve, but it was transformed (I don't know why) into a separate question.

The following integral appears in the recent SEEMOUS 2016 competition:
Int( arctan(x) * ln(1+1/x^2), x = 0..infinity );

Maple 2015 can compute it, but with a little help.
What about Maple 2016?

First 9 10 11 12 Page 11 of 12