## Is there an "easy" way to extend Maple's standard ...

As a part of my learning curve, I am trying to play with extending Maple's BernsteinBasis, which has only a limited support right now (BernsteinBasis - Maple Help (maplesoft.com)).

My goal is to implement basis operation on polynomials in Bernstein basis, so that derivatives, integrals and products of polynomials in  BernsteinBasis would be again expressed in BernsteinBasis.

While it looks like it is relatively easy to extend diff procedure, by using `diff/BernsteinBasis`, I didn't find anything similar for the int. Is there something like `int/BernsteinBasis`?

The problem is that when I am trying to implement my own int procedure in a module that  would extend standard int, it seems I need to manually implement logic for (at very least) linearity, so that int(p(x) + q(x), x) would decay into int(p(x), x) + int(q(x), x ) (I probably don't need more complex rewriting rules). So before trying this approach, is there any easy way such as with diff?

 > restart;
 (1)
 > # General formula diff(BernsteinBasis(k, n, a, b, x), x);
 (2)
 > # In expressions diff(2*x*BernsteinBasis(1, 2, 0, 1, x) + BernsteinBasis(2, 2, 0, 1, x), x);
 (3)
 > # Convertion to MatrixPolynomialObject works p := diff(BernsteinBasis(1, 2, 0, 1, x) + BernsteinBasis(2, 2, 0, 1, x), x); P := convert(p, MatrixPolynomialObject, x); P:-Value(a);
 (4)

# Now, integrataion
with(BernsteinPolynomials);

 (5)
 > # Still works int(x^2, x);
 (6)
 > # Not implemented but will be added later... int(BernsteinBasis(1, 2, 0, 1, x), x);
 (7)
 > # This is the problem: how to implement basis properties such as linearity? int(2 * BernsteinBasis(1, 2, 0, 1, x), x);
 (8)
 >

```BernsteinPolynomials := module()
description "Basic operations in Bernstein basis";
option package;
global BernsteinBasis, `diff/BernsteinBasis`;
export int;

BernsteinBasis := proc(k, n, a, b, x)
description "Bernstein basis polynomial";
if k::numeric then
if k < 0 then
return 0;
end if
end if;
if n::numeric then
if n < 0 then
return 0;
end if;
if k::numeric then
if k > n then
return 0;
end if;
end if;
end if;
'procname'(_passed)
end proc;

`diff/BernsteinBasis` := proc()
description "Derivative of the Bernstein basis polynomial in the Bernstein basis";
if _npassed = 6 then
if _passed[-1] = _passed[-2] then
_passed[2] * BernsteinBasis(_passed[1] - 1, _passed[2] - 1, _passed[3], _passed[4], _passed[5]) / (_passed[4] - _passed[3]) -
_passed[2] * BernsteinBasis(_passed[1], _passed[2] - 1, _passed[3], _passed[4], _passed[5]) / (_passed[4] - _passed[3]);
end if;
end if;
end proc;

int := proc()
description "Integral of the Bernstein basis polynomial in the Bernstein basis";
if type(_passed[1], 'specfunc'(anything, BernsteinBasis)) then
print("Will be implemented here...");
end if;
:-int(_passed)
end proc;

end module;
```

## error from allvalues. Is this to be expected? igcd...

In my code, without knowing what the expression is, other than it has RootOf, the code called allvalues and got internal error

Error, (in SolveTools:-Basis) invalid input: igcd received 5/7, which is not valid for its 2nd argument

Is this to be expected depending on the input, or is this some internal problem I need to report?

```restart;
expr:=RootOf(R^4*b+R^2*a*_Z+2*_Z^2-exp(RootOf(tanh(1/2*(a^2-8*b)^(1/2)*(4*S-_Z)/a)^2*R^4*a^2-8*tanh(1/2*(a^2-8*b)^(1/2)*(4*S-_Z)/a)^2*R^4*b-R^4*a^2+8*R^4*b-8*exp(_Z))))

allvalues(expr)
```

Error, (in SolveTools:-Basis) invalid input: igcd received 5/7, which is not valid for its 2nd argument

Maple 2023.2 on windows 10

ps.  Reported to Maplesoft

## Why does this error appear after simplifying?...

 > restart
 > V := m^4*(1-(varphi/mu)^p);
 (1)
 > V1 := diff(V, varphi);
 (2)
 > V2 := diff(V1, varphi);
 (3)
 > f := Zeta * (varphi^2);
 (4)
 > f1 := diff(f, varphi);
 (5)
 > f2 := diff(f1, varphi);
 (6)
 > R:= simplify(((V/3-f1*V1/(3*V))/((1-kappa^2*f)/(12*kappa^2)+f1/V)));
 (7)
 > N:=evalf(int((3*V1*kappa^2*((2*V*V1)/3 - f1^2*V1*R/(3*V) - f1*V1^2/(3*V))/(V*(-f*kappa^2 + 1)*(-R*f1 - 2*V1))),varphi=varphi__hc..varphi__end)assuming varphi__hc > 0, varphi__hc > varphi__end);
 (8)
 >

## Maple factorization...

Can anyone help me factor this thing out, so I ll get an irreductible result?

x2 := 2*u - 2/3*(a - 1)*(a + 1)*u^3 + (26/45*a^4 - 4/9*a^2 + 26/45)*u^5 + O(u^6)

## General `convert/elsymfun` like SymPy's “symmetriz...

In an old question, @mbras asked for a "partial" ``convert/elsymfun``. However, SymPy's `sympy.polys.rings.PolyElement.symmetrize` seems to provide more examples that cannot be handled by the program that appeared in that question.
For instance,

```>>> from sympy import var
>>> var('x:z,p:r')
(x, y, z, p, q, r)
>>> from sympy.polys.polyfuncs import symmetrize
>>> symmetrize(x**2-(y**2+2**z),[y,x],formal=True,symbols=[p+p,q*q])[0]
-2**z - 4*p**2 + 2*q**2
>>> symmetrize(x*x*y+y*y*z+z*z*x,[y,x,z],formal=True,symbols=[p,q,r])
(0, x**2*y + x*z**2 + y**2*z, [(p, x + y + z), (q, x*y + x*z + y*z), (r, x*y*z)])```

Though I can , can't the built-in  be generalized to such expressions (in other words, write the polynomial part of input as a symmetric part and a remainder with (named, if need be) elementary symmetric polynomials)?

Besides, since any symmetric polynomial can also be expressed in terms of the complete symmetric polynomials, is there a similar  command in Maple?

## Is there a better way to tile the Poincare disk?...

The uploaded worksheet begins to uniformly tile the Poincare disk with pentagons using hyperbolic reflection .

Although relatively easy to create the central pentagon and the first adjacent pentagon, it becomes increasingly difficult to determine which lines to reflect to create the remaining pentagons in the first tier adjacent to the central pentagon and more so to create the pentagons of the second tier adjacent to those in the first tier and so on.

Is there a better technique for accomplishing this?

In particular can Mobius tranformations be employed to do this? If so, please replay with or point to a working example of this for me to follow.

Sorry, I forgot that respondents to this question must establich their own link to the DirectSearch package.

## Does "Submit Software Change Request" form work on...

I was trying to fill a Submit Software Change Request form a couple of times (with an interval of a couple of days) to report a small issue in Maple2023, which happens when I try to open an empty mpl-file. However, each time I received an error message. It looks like it is just broken.

Does anyone know if there is any reliable mechanism to provide feedback on MapleSoft products?

## What does `_EnvLinalg95` do?...

Why does `_EnvLinalg95` only affect  (and ) and not and ?

 > restart;
 > m := <3 , 4 | 4 , 3>;
 (1)
 > LinearAlgebra:-Eigenvalues(m);
 (2)
 > LinearAlgebra:-Eigenvectors(m);
 (3)
 > LinearAlgebra:-EigenConditionNumbers(m);
 (4)
 > _EnvLinalg95 := true:
 > whattype(m);
 (5)
 > LinearAlgebra:-Eigenvalues(m);
 (6)
 > LinearAlgebra:-Eigenvectors(m):
 > LinearAlgebra:-EigenConditionNumbers(m);
 (7)
 > _EnvLinalg95 := false:
 > LinearAlgebra:-Eigenvectors(m);
 (8)

I have read the help page of Eigenvectors but couldn't find anything related.

## how to find CharacteristicPolynomiall of matrix wi...

how to find CharacteristicPolynomiall of matrix with vector entries?

 >
 >
 >
 >
 (1)
 >
 (2)
 >
 >
 >

## spline options in the SavitzkyGolayFilter...

Hello,

I want to use the spline options in the SavitzkyGolayFilter, but I don't understand the description in the Maple help. Can someone give me Sytax examples? I would also like to specify the 1st and 2nd derivatives of the endpoints.

I am grateful for any help!

## what does tr_is_cos mean? internal exception calli...

This looks like a bug I have not seen before. Any one seen this before?

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

Can others reproduce it? I am using Maple 2023.2 on windows 10

btw, I found that by doing int(evala(integrand),t) instead of int(integrand,t) then the error goes away but not all the time. Below are two examples. The first where evala() fixes it, but the second it does not fix it.

 > Physics:-Version()

 > interface(version);

 > restart;

 > integrand:=-(((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 15*I*sqrt(3)*sqrt(27983) + (25*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))/2 + 2265)*(-150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I - (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*(150 + (-150 + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3))*sqrt(3)*I + (-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) - 24*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3))*((sqrt(3)*sqrt(27983)*I + 276)*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) - 15*I*sqrt(3)*sqrt(27983) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3)*((-594 + 6*I*sqrt(3)*sqrt(27983))^(2/3) + 12*(-594 + 6*I*sqrt(3)*sqrt(27983))^(1/3) + 150)*sin(t)*cos(t))/(10101630528*(sqrt(3)*sqrt(27983)*I - 99)^2*(sqrt(3)*sqrt(27983)*I + 27983/33)*exp(t)) - ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-594 + 6*I*sqrt(83949))^(1/3)*(sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3)*I - 15*I*sqrt(83949) + 276*(-594 + 6*I*sqrt(83949))^(1/3) - 2265)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))*(8*cos(t)^2/exp(t) - 4/exp(t))/(5196312*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)) + ((-594 + 6*I*sqrt(83949))^(2/3) + 12*(-594 + 6*I*sqrt(83949))^(1/3) + 150)*(2*I*sqrt(83949)*(-594 + 6*I*sqrt(83949))^(1/3) + 30*I*sqrt(83949) + 25*(-594 + 6*I*sqrt(83949))^(2/3) + 552*(-594 + 6*I*sqrt(83949))^(1/3) + 4530)*(-150 + (-594 + 6*I*sqrt(83949))^(2/3))*(-594 + 6*I*sqrt(83949))^(2/3)*exp(-t*((-594 + 6*I*sqrt(83949))^(2/3)/3 + (-594 + 6*I*sqrt(83949))^(1/3) + 50)/(-594 + 6*I*sqrt(83949))^(1/3))/(1154736*(sqrt(83949)*I + 27983/33)*(sqrt(83949)*I - 99)*exp(t)):
 > int(integrand,t)

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 >

But the trick of using evala() to avoid this error does not always work. Here is an example below. So need to find another workaround for this.

 > restart;

 > interface(version);

 > integrand2:=1/40406522112*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*exp(t*(5/3*3^(1/2)*2^(1/2) *sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/ 6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-\ 594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*( 2265+(276+I*(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2) )^(1/3)+5*I*(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(2265-25*(-594+6*I*3^( 1/2)*27983^(1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+ 6*I*3^(1/2)*27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*( (-594+6*I*3^(1/2)*27983^(1/2))^(2/3)+12*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+ 150)*3^(1/2)*(-150+I*(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-(-594+ 6*I*3^(1/2)*27983^(1/2))^(2/3)+24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3))/(I*3^(1 /2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)^2/exp(t)*sin(t)*cos(t)-1/ 20785248*I*(I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*3^(1/2)+(-594+6*I*3^(1/2)* 27983^(1/2))^(2/3)-150*I*3^(1/2)-24*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+150)* exp(5/3*3^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-5*cos(1/3* arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)*t-t)*(2265-25*(-594+6*I*3^(1/2)*27983^ (1/2))^(2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2) *27983^(1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*(2265+(276+I *(27983^(1/2)+92)*3^(1/2)-27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1/3)+5*I *(-151+3*27983^(1/2))*3^(1/2)+15*27983^(1/2))*(-594+6*I*3^(1/2)*27983^(1/2))^(1 /3)*3^(1/2)/(I*3^(1/2)*27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)*(8/exp( t)*cos(t)^2-4/exp(t))+1/13856832*I*(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)*(-450+I *(-150+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)-3*(-594+6*I*3^(1/2)*27983^ (1/2))^(2/3))*exp(t*(5/3*3^(1/2)*2^(1/2)*sin(1/3*arctan(1/99*83949^(1/2))+1/6* Pi)-5*cos(1/3*arctan(1/99*83949^(1/2))+1/6*Pi)*2^(1/2)-1))*(150+I*(-150+(-594+6 *I*3^(1/2)*27983^(1/2))^(2/3))*3^(1/2)+(-594+6*I*3^(1/2)*27983^(1/2))^(2/3)-24* (-594+6*I*3^(1/2)*27983^(1/2))^(1/3))*(2265-25*(-594+6*I*3^(1/2)*27983^(1/2))^( 2/3)+(276+I*(-276+27983^(1/2))*3^(1/2)+3*27983^(1/2))*(-594+6*I*3^(1/2)*27983^( 1/2))^(1/3)+15*I*(151+27983^(1/2))*3^(1/2)-45*27983^(1/2))*3^(1/2)/(I*3^(1/2)* 27983^(1/2)+27983/33)/(I*3^(1/2)*27983^(1/2)-99)/exp(t):
 > int(integrand2,t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 > int(evala(integrand2),t);

Error, (in Handlers:-TrigExpOnly) cannot determine if this expression is true or false: tr_is_cos

 >

ps. send to Maplesoft support.

## Residue for a function...

Since C2=D1.D1inv should be equal to I. But return is just an expression (see attached). Further, how to obtain residue for a function C2?

residue.mw

## Does there exist a generalized ListTools:-SearchAl...

There seems to be a consensus about using `ListTools:-SearchAll` to locate an item in a list. However, this subroutine does not work on other expressions; A simple instance is that “ListTools:-SearchAll(1, [[1], 1]);” only outputs  while what I need is  (because both “op([1, 1], [[1], 1])” and “op([2], [[1], 1])” are ). And actually, I hope that there is a more general version in Maple.
For example, I intend to do something like

```restart;
expr, elem := ToInert(eval(`print/Diff`)), '_Inert_NAME'("_syslib"):
SearchAll(elem, expr);
```

and

```List:=[[[[cS,[[[cS,cS],cS],[[[cS,cS],[[cK,cK],cS]],cS]]],cS],cS],[[[cS,[[cK,cS],cK]],cK],cS]]:
items:=Or([[[identical(cS),anything],anything],anything],[[identical(cK),anything],anything]):
SearchAll(items,List); ```

In other words, I need all positions of an operand of an expression (cf. `op`).

It may be manually checked that the "indices" of  in  include [5,1,1,2,1,1,1,2,1,2,1,2], [5,1,2,2,1,1,1,1,2,1,2], and [5,2,2,1,1,3,1,2], since

```patmatch(op([5, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2], expr), elem);
=
true

patmatch(op([5, 1, 2, 2, 1, 1, 1, 1, 2, 1, 2], expr), elem);
=
true

patmatch(op([5, 2, 2, 1, 1, 3, 1, 2], expr), elem);
=
true

```

Similarly, after some manual searchs,

```[[1], [1, 1, 1, 2], [1, 1, 1, 2, 2], [1, 1, 1, 2, 2, 1, 2], [2], [2, 1, 1, 2]]:
convert(typematch~(map2(`?[]`, List, `%`), items), `and`);
=
true

```

It turns out that all "indices" in  of  are [1][1,1,1,2][1,1,1,2,2][1,1,1,2,2,1,2][2], and [2,1,1,2].
But isn't there such a  command that can eliminate the need to manually retrieve them?

When the original poster receives or finds the answer to the question he/she posed, should he/she

I have seen "true answers" that were converted to a reply, despite addressing the initial answer correctly. In case there are no other answers, the question will still be listed under unanswered question which is incorrect.

What practice should be applied in MaplePrimes for "true answers"?

## How to change the placement of arrows in a 2-D/3-D...

In an old question, @nm asked how to . While the answer in that question was almost up to the mark, there remains a regret.

As the instance listed below shows, Maple, by default, draws arrows on a rectangular grid (rather than on a hexagonal mesh):

```  # Example of a three-dimensional vector field:
vf__2d := VectorCalculus:-VectorField([sin(x)*(cos(x) + cos(y)),
sin(y)*(cos(x) - cos(y))], 'cartesian'[x, y]):
# Example of a two-dimensional vector field:
vf__3d := VectorCalculus:-VectorField([1 - (sin(u - v) + sin(u - w)),
1 - (sin(v - w) + sin(v - u)),
1 - (sin(w - u) + sin(w - v))], 'cartesian'[u, v, w]):
# Phase portrait.
Student:-VectorCalculus:-PlotVector(vf__2d, (x, y) =~ -Pi .. Pi,
'grid' = [`\$`](25, 2),
'arrows' = 'THICK',
'fieldstrength' = log[63],
'color' = ColorTools:-Color("#0072BD"),
'axes' = "box"(*, …omitted…*));
= ```

Note that I have changed some of the options in order to make the layout of arrows more prominent.
However, according to the help page of Mma's `VectorPoints`, among the following methods of location generation, Mma by default uses Hexagonal for 2D field vectors and FaceCenteredCubic for 3D field vector:

Here is a collection of different settings available in Mma:

So if the requirement is to get the Maple's output looking like Mathematica's (see the beginning), the number and placement of vectors to plot should be thought of as well. In Maple, “the number of vectors” can be controlled by the plot (or plot3d) opinion , but how do I specify “the placement of vectors” (e.g., Mma's "Hexagonal" and "Mesh")?

Although there exists an  chapter in the documentation, randomly positioned arrows do not fit the bill. Is there any workaround?

 First 11 12 13 14 15 16 17 Last Page 13 of 339
﻿