## Is this a Maple error or my system?...

Maple 2022.2

> restart
> expr = x^4-10*x^2+1
> plot(expr)

produces an error message:
com.maplesoft.maplets.ComponentAccessException: not a valid plot structure

plot(expr, x) works Ok.

Tom Dean

## How do I solve differential equations in Maple?...

How I can solve a PDE on two regions with matching conditions at the common boundary?

T1.mw

## Solving for a product of two terms....

How would I solve for the product of two terms ( s*V or s^2*V). This is a simple example but I would be applying this on much higher order equations.

V = Vx/(a*s^2 + b*s + c)

## How to solve a coupled quantum harmonic oscillator...

Hello,

What would be the procedure to find the eigenvalues for a coupled harmonic oscillators characterized by eigenvalue E1 and E2? Are they treated as parameters in the numerical solution of the system of ode?

## How to plot a equation with matrix?...

How to plot this equation

y(x):=

where,

A := Matrix([[1, -1, 1, -1], [1, 1, -1, -1], [-1, 1, 1, -1], [1, 1, 1, 1]]);
B := Matrix([[1], [0], [1], [0]])

## 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)
 >

## 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.

## 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

 >