## 3038 Reputation

19 years, 29 days

Doug

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

## Maplet for Unique Random Number Generato...

Maple

This is a continuation of the new thread that was started with this post.

Code to create a maplet that generates unique random numbers from a sample space could look like:

## changing fonts in a legend...

Maple

How can I change the fonts used to create the legend for a plot?

What I really want to do is increase the font size. I can do this for the title, labels, and axes - but not for the legend. (At least I don't see how to do this in the online help.)

Before I start digging through the code, I thought I'd see if anyone here has dealt with this previously.

Doug

## Maple worksheets and Microsoft Exchange ...

Our university has recently begun a migration to an Exchange based e-mail system. With this change we are no longer able to send Maple worksheets (.mw files) as simple attachments to our messages. Here is the latest (and most informative) information I have received about this situation:

## Integrating Absolute Values...

Here's an interesting problem from a colleague. Consider the following two improper integrals; the only difference is the absolute value in the integrand. I think this is another instance in which Maple mis-applies the FTOC.

```restart;
with( IntegrationTools ):
#infolevel[all]:=3:
q := x*sin(1/x^2)-cos(1/x^2)/x;
/1 \
cos|--|
| 2|
/1 \      \x /
x sin|--| - -------
| 2|      x
\x /
I0 := Int( q, x=0..1 ):
I1 := Int( abs(q), x=0..1 ):```

Maple gives values for both integrals.

```value( I0 );
1
- sin(1)
2
value( I1 );
1
- sin(1)
2
```

It's a little odd that these two answers came out the same. It's easy to see that q does change signs infinitely often in [0,1]. A nice visualization of this can be obtained with:

```plot([1/x,abs(q)],x=0..1,y=0..50); ```

We can dig a little deeper by looking at the values of the definite integrals on [A,1] and taking a limit as A->0.

```int( q, x=A..1 );
1  2    /1 \   1
- - A  sin|--| + - sin(1)
2       | 2|   2
\A /
int(abs(q),x=A..1);
/ 2    /1 \      /1 \\
|A  sin|--| - cos|--||
|      | 2|      | 2||
1  2       |      \A /      \A /|    /1 \   1
- - A  signum|--------------------| sin|--| + - sin(1)
2          \         A          /    | 2|   2
\A /
```

This starts to show where Maple is missing some important information. More is seen by looking at the antiderivatives of q and abs(q):

```Q := int(q,x);
1  2    /1 \
- x  sin|--|
2       | 2|
\x /
Q2 := int( abs(q), x );
/ 2    /1 \      /1 \\
|x  sin|--| - cos|--||
|      | 2|      | 2||
1  2       |      \x /      \x /|    /1 \
- x  signum|--------------------| sin|--|
2          \         x          /    | 2|
\x /

plot( [q, Q], x=0..1, view=[DEFAULT,-5..5] ):

plot( [abs(q), Q2], x=0..1, view=[DEFAULT,-1..5] ); plot( [Q,Q2], x=0..0.6, thickness=[3,1], discont=true ); ```

Clearly, the two improper integrals at the start of this post should not have the same values.

Let's convert the problem to an improper integral on [1,infinity) by making a substitution x=1/u. When Maple makes this change of variable, it finds:

```I2 := Change( I1, x=1/u );
/infinity       / 2\      / 2\  2
|            -sin\u / + cos\u / u
- |          - --------------------- du
|                      3
/1                     u              ```

It's a little interesting that the absolute values have disappeared. (A plot quickly shows that this integrand is not always an increasing function.

```q2 := GetIntegrand( Combine(I2) );
/ 2\      / 2\  2
-sin\u / + cos\u / u
---------------------
3
u
plot( q2, u=1..50 ); ```

What gets really interesting is the value of this integral:

```value( I2 );
1
- - sin(1)
2       ```

Maple returns the same value for the definite integral with the correct (absolute value) in the integrand. Once again it is surprising that Maple reports the same values for these two integrals. But, the fact that these values are negative - even when the integrand is non-negative - is alarming.

It does appear that in some cases Maple is able to detect and correctly handle an infinite number of discontinuities in the antiderivative:

```int(abs(cos(v)/v),v=1..infinity);
/1   \
-Ci(1) + Ci|- Pi|
\2   /

/infinity                                                   \
| -----                                                     |
|  \                                                        |
|   )    /  /1           \     _k     /3           \     _k\|
+ |  /     |Ci|- Pi + Pi _k| (-1)   - Ci|- Pi + Pi _k| (-1)  ||
| -----  \  \2           /            \2           /       /|
\ _k = 0                                                    /
evalf( % );
Float(infinity)

```

## equations: what they are, what they are ...

Maple
This is a new thread to continue a discussion that started under the topic What is wrong with my program? (by resolvent). Here are the first three responses:
﻿