sum up

• To: mathgroup at smc.vnet.net
• Subject: [mg69716] sum up
• From: dimmechan at yahoo.com
• Date: Thu, 21 Sep 2006 07:30:51 -0400 (EDT)

```Hello.

The last two-three days I posted some messages about some things that
they look strange (and not only to me).

In case somebody was lost and in view of Chris Chiasson's suggestion I
sum up my queries/findings.

Some of these questions have been answered a bit (actually it is these
answers that make me to deal more with) but I repost in case somebody
is interested.

1) Why built-in functions like Plot, Integrate and NIntegrate exhibit
listability although they do not have the Attribute Listable?

lst = {1/x, 1/x^2};
Integrate[lst, {x, 1, 2}]
{Log[2], 1/2}
NIntegrate[Evaluate[lst], {x, 1, 2}]
{0.693147180559947, 0.5000000000000211}
Plot[Evaluate@lst, {x, 1, 2}];
({#1, Attributes[#1]} & ) /@ {Integrate, NIntegrate, Plot}
Protected}},
{Plot, {HoldAll, Protected}}}

To me (at least now) look more normal the behavior of
CauchyPrincipalValue.

Needs["NumericalMath`"]
lst2= {1/x, 1/Sin[x]};

Both of these fail to produce Output (apart from the NIntegrate::inum
messages).

CauchyPrincipalValue[lst, {x, -1, {0}, 2}]
CauchyPrincipalValue[Evaluate[lst], {x, -1, {0}, 2}]

2) Why do the following commands fail to prevent the appearance of
NIntegrate::inum?

Block[{Message}, NIntegrate[lst1, {x, 1, 2}]]
Block[{\$Messages = {}}, NIntegrate[lst1, {x, 1, 2}]]

The relevant Plot::plnr message can be prevented from displaying.

Block[{Message}, Plot[lst, {x, 1, 2}]];
Block[{\$Message = {}}, Plot[lst, {x, 1, 2}]];

3) Why the first (second) command below fails (succeeds) to provide
Output?

Block[{Message}, CauchyPrincipalValue[lst, {x, -1, {0}, 2}]]
Block[{\$Messages = {}}, CauchyPrincipalValue[lst, {x, -1, {0}, 2}]]

4) From where all these "x" appear in the following list of sampled
points?

Take[Reap[CauchyPrincipalValue[1/x, {x, -1, {0}, 2}, EvaluationMonitor
:> Sow[x], AccuracyGoal -> 20]][[2,1]], -12]
{1.7298614049356686, x, x, x, x, x, x, x, x, x, x, x}

That's all (I guess for know!).

Regards
Dimitris Anagnostou

P.S1. In case someone wonders, all these questions appear in my attempt
to get more insight of Mathematica thanks to this forum and some amazing people
(In fact even how you can command Mathematica to make your dinner...).
I do not mention anyone, because there are so many and I do not want to
forget someone.

PS2. Nevertheless let me make just one exception and thank deeply