## Alec Mihailovs

Dr. Aleksandrs Mihailovs

## 4470 Reputation

20 years, 16 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

## Social Networks and Content at Maplesoft.com

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

## Nice...

Nice!

Here is what I got using RealDomain,

```use RealDomain in simplify(z) end;

undefined
```

It works also without map,

```simplify(simplify(evalc(z)),size);

n / 1/2               n Pi             n Pi \
-1/3 2  |3    (C1 - C2) sin(----) - 3 C1 cos(----)|
\                    3                3   /
```

Works also with the inner simplify replaced with expand,

```simplify(expand(evalc(z)),size);

n / 1/2               n Pi             n Pi \
-1/3 2  |3    (C1 - C2) sin(----) - 3 C1 cos(----)|
\                    3                3   /
```

and without factoring out 2^n as

```collect(expand(evalc(z)),sin,factor);

n  1/2               n Pi        n     n Pi
-1/3 2  3    (C1 - C2) sin(----) + C1 2  cos(----)
3                 3
```

Alec

## Nice...

Nice!

Here is what I got using RealDomain,

```use RealDomain in simplify(z) end;

undefined
```

It works also without map,

```simplify(simplify(evalc(z)),size);

n / 1/2               n Pi             n Pi \
-1/3 2  |3    (C1 - C2) sin(----) - 3 C1 cos(----)|
\                    3                3   /
```

Works also with the inner simplify replaced with expand,

```simplify(expand(evalc(z)),size);

n / 1/2               n Pi             n Pi \
-1/3 2  |3    (C1 - C2) sin(----) - 3 C1 cos(----)|
\                    3                3   /
```

and without factoring out 2^n as

```collect(expand(evalc(z)),sin,factor);

n  1/2               n Pi        n     n Pi
-1/3 2  3    (C1 - C2) sin(----) + C1 2  cos(----)
3                 3
```

Alec

## 10% more efficient version...

10% more efficient version of MinPolyGF can be written as

```MinPolyGF1:=proc(x,y:=_X)
local A, i;
A:=Matrix(100,[seq([op(modp1(Rem(Shift(x,i),F:-extension),2))],i=0..99)],datatype=integer[4]);
(Sqrfree(LinearAlgebra:-Modular:-CharacteristicPolynomial(2,A,y)) mod 2)[2,1,1]
end:

CodeTools:-Usage(seq(MinPolyGF(F:-`^`(z,k),x),k=1..1000)):
memory used=0.57GiB, alloc change=0 bytes, cpu time=17.38s, real time=17.48s
```

Alec

## Comparing to Sage...

It is much faster in Sage,

```sage: k=GF(2^100,'a')
sage: L=[k.random_element() for i in range(1000)]
sage: time M=[i.minpoly() for i in L]
CPU times: user 0.62 s, sys: 0.00 s, total: 0.62 s
```

This timing is for (my custom build of) Sage running in cygwin on Windows. It might be faster on Linux, but Maple is faster there, too.

Maple could use NTL library though through external calling for that. That may give comparable timing. On the other hand, it is GPLed and it is a part of Sage (also GPLed), so why not to use Sage directly?

Alec

## dot...

As I said, you shouldn't make the multiplication implicit (using a space). It's much better to use a dot instead - then Maple won't interpret it as * which produces those errors.

In general, the best tutorials available are Maple manuals (available from the Help menu and for download from the Documentation Center.) Or posts on this site. Everything else (books etc.) is outdated.

Alec

## dot...

As I said, you shouldn't make the multiplication implicit (using a space). It's much better to use a dot instead - then Maple won't interpret it as * which produces those errors.

In general, the best tutorials available are Maple manuals (available from the Help menu and for download from the Documentation Center.) Or posts on this site. Everything else (books etc.) is outdated.

Alec

## plot...

```plot({f(t),
```

In case of non-zero b[i], you should add corresponding terms in a similar manner, with b instead of a, sin instead of cos, and B instead of A (as I see you did).

Alec

## plot...

```plot({f(t),
```

In case of non-zero b[i], you should add corresponding terms in a similar manner, with b instead of a, sin instead of cos, and B instead of A (as I see you did).

Alec

## In Maple 14...

It worked in my Maple 14. Perhaps, there were some problems with that in Maple 13?

The formulas that I've just added at the end don't include Re and Im, so they should work even if Re and/or Im don't work.

Alec

Edit: Yes, I've just checked that in Maple 13 -

```Im(<I>);
Error, invalid input: simpl/Im expects its 1st argument, x, to be of type {boolean, algebraic},
but received Vector(1, [...], datatype = anything)
```

while in Maple 14

```Im(<I>);
[1]
```

Well, the easiest is just to add ~ to Im - that works in both Maple 13 and Maple 14,

```Im~(<I>);
[1]
```

Alec

## In Maple 14...

It worked in my Maple 14. Perhaps, there were some problems with that in Maple 13?

The formulas that I've just added at the end don't include Re and Im, so they should work even if Re and/or Im don't work.

Alec

Edit: Yes, I've just checked that in Maple 13 -

```Im(<I>);
Error, invalid input: simpl/Im expects its 1st argument, x, to be of type {boolean, algebraic},
but received Vector(1, [...], datatype = anything)
```

while in Maple 14

```Im(<I>);
[1]
```

Well, the easiest is just to add ~ to Im - that works in both Maple 13 and Maple 14,

```Im~(<I>);
[1]
```

Alec

## A minute bug...

```minpol(15);

x - 1[1]
```

Alec

## A minute bug...

```minpol(15);

x - 1[1]
```

Alec

## Another one...

@Alejandro Jakubi : Another one,

```sum(1/(k^5+1),k=1..infinity);

/   -----          \
|    \             |
-infinity signum(- 1/5 + 1/5 |     )      _alpha|)
|    /             |
|   -----          |
\_alpha = %1       /

/   -----                          \
|    \                             |         gamma
+ 1/5 |     )      _alpha Psi(1 - _alpha)| - 1/5 + -----
|    /                             |           5
|   -----                          |
\_alpha = %1                       /

4     3     2
%1 := RootOf(_Z  - _Z  + _Z  - _Z + 1)

evalf(%);

Float(undefined) + Float(undefined) I

evalf(Sum(1/(k^5+1),k=1..infinity));

0.5359628432
```

Without the first term, the first result would be correct. In the first term, the sum of roots is 1, so it can be simplified to  -infinity*signum(0), which is still wrong - it should be just 0 there.

Alec

## Another one...

@Alejandro Jakubi : Another one,

```sum(1/(k^5+1),k=1..infinity);

/   -----          \
|    \             |
-infinity signum(- 1/5 + 1/5 |     )      _alpha|)
|    /             |
|   -----          |
\_alpha = %1       /

/   -----                          \
|    \                             |         gamma
+ 1/5 |     )      _alpha Psi(1 - _alpha)| - 1/5 + -----
|    /                             |           5
|   -----                          |
\_alpha = %1                       /

4     3     2
%1 := RootOf(_Z  - _Z  + _Z  - _Z + 1)

evalf(%);

Float(undefined) + Float(undefined) I

evalf(Sum(1/(k^5+1),k=1..infinity));

0.5359628432
```

Without the first term, the first result would be correct. In the first term, the sum of roots is 1, so it can be simplified to  -infinity*signum(0), which is still wrong - it should be just 0 there.

Alec

## strange...

I think that's strange because it works with an assigned n, say n=11,

```infolevel[sum]:=3:
sum((-1)^(k+1)/k^11,k=1..infinity);
sum:   "process the input arguments"
sum:   "definite sum"
ClosedForm:   simple definite summations
ClosedForm:   infinite summation
Indefinite:   "process the input arguments"
ClosedForm:   "handle floats"
ClosedForm:   "indefinite summation"
ClosedForm:   "indefinite summation failed"
ClosedForm:   definite summation using hypergeometric functions
ClosedForm:   definite summation using hypergeometric functions
sum/hypergeom:   Function    -1/(x+1)^11*(-1)^(x+1)    satisfies the criteria

1023
---- Zeta(11)
1024
```

If the definite summation using hypergeometric functions works for n=11 (and other n), it should work with an unassigned name n assuming n>1.

Another humorous thing is that the summation works after changing a sign,

```sum((-1)^k/k^n,k=1..infinity) assuming n>1;

(1 - n)
(2        - 1) Zeta(n)
```

Even without assumptions,

```sum((-1)^k/k^n,k=1..infinity);

polylog(n, -1)
```

Alec

 4 5 6 7 8 9 10 Last Page 6 of 180
﻿