## 2024 possible bug...

Windows 10 64bit

If I double click on a  file to open it from explorer  i.e. launch Maple, it is 50/50 whether Maple hangs on opening the file and I have to kill it in the Task Manager. This only happens the 1st time I try to open the file. Subsequent clicks on it will open it. If Maple is already open the problem does not happen.  The problem willl also be there after the PC is restarted. Has anyone else noticed this?

## How can I efficiently remove all twins associated ...

Hello,

I'm seeking an efficient solution to a particular problem. To illustrate, I'll provide a simplified example, though in practice, I'm handling lists with millions of elements.

Let's take the list, l: [1, 2, 3, 4, 5, 6, 7, 8]. Each element in this list has a corresponding twin. For instance, 1 has twins [4, 5], and 2 has twins [9, 12] (note that 12 is not in the original list, but that's not problematic). The complete list of twins is represented as t: [[4, 5], [9, 12], [6, 8], [1, 5], [1, 4], [3, 8], [13, 14, 17], [3, 6], [2, 12], [11, 12, 15]], and the twins are made available as they are needed.

The objective is to remove all twins starting from the first element of the list. Once a twin is removed, there's no need to check for twins for that particular element. For example, consider the first element, 1; the twins [4, 5] are removed, and there's no need to find the twins for those elements. The desired outcome would be the list [1, 2, 3, 7,10].

My solution utilizes a combination of a while loop and sets. However, it's painfully slow when dealing with lists larger than a few hundred thousand elements.

Many thanks.

## Creating a conditional differential equation in Ma...

I am a new Maple user. I have a system of differential equations and I want Maple to solve the system such that if one of the solutions (dependent variable) is larger than a certain value, one of the differential equation will be described in a different way. I will describe it with an example:

``````restart;
with(plots);
# imagine we have two differential equations:
eqn1 := diff(T(x), x) = x + T(x)/10 + q(x)/2;
eqn2 := diff(q(x), x) = T(x)^2/10 + 3*q(x);
#The solution is given by:
sol := dsolve({eqn1, eqn2, T(0) = 0, q(0) = 0}, {T(x), q(x)}, numeric, method = mebdfi);
odeplot(sol, [x, T(x)], x = 1 .. 3);

#what I want to do is to write a conditional differential equation that depends on the solution T(x) of the system. For exmaple, if the value of T(x) is larger than 4, the solver sould use a different equation to solve the system. Say for example instead of eqn1 it will use something else like: eqn1:=diff(T(x),x)=x+T(x)^2/200+q(x)/300.

#Internally after each iteration, the solver should check the value of the solution T(x), and depending on it it will choose a different differential equation to use in the next step x.``````

I tried defining the differential equation as piecewise but I was not successful.

## Basic question on solve and extra solutions...

Maple gives solutions that do not satisfy the equation. Wondering what do I need to change.

```restart;
n:=3;m:=2;
eqx:=x^(n/m)=a;
maple_sol:=[PDEtools:-Solve(eqx,x)]; #also tried solve()
F:=map(X->eval(eqx,X),maple_sol);
map(X->evalb(X),F);
```

I always verified in Mathematica

Any thought what is going on and what do I need to change in my Maple code to make it give the solution x=a^(2/3) only?

It is also possible that Mathematica is the one who is skipping the two complex solutions, but then I need to verify these in Maple, and so far I can't. Only the first solution is verified by Maple.

Even simplification with assuming a>0 do not verify these two extra solution given with complex values. I also tried RealDomain package but this also had no effect. I tired assuming real also and tried simplify with symbolic option.

Anything else I should try?

Maple 2024 on windows 10

update

As I said, I tried RealDomain but with PDEtools:-Solve. With solve it works. Is this a bug? worksheet below

 > restart;

 > interface(version);

 > Physics:-Version();

 > restart;

 > n:=3;m:=2; eqx:=x^(n/m)=a; use RealDomain in (PDEtools:-Solve(eqx,x)) end use; F:=map(X->eval(eqx,X),[%]); map(X->evalb(X),F);

 > restart;

 > n:=3;m:=2; eqx:=x^(n/m)=a; use RealDomain in (solve(eqx,x)) end use; F:=map(X->eval(eqx,x=X),[%]); map(X->evalb(X),F);

## How are the two spellings colour and colour handle...

I have used "colour" as my spelling on optional inputs to procedures in my package.  How can I also handle the alternative spelling "color"?

 > restart
 >
 > coltest:=proc(c)   if c="b" then return 1    elif c="r" then return 2    elif c="g" then return 3   end if; end proc:
 >
 > foo:=proc(a,{colour:="b"}) local COL;    COL:=coltest(colour); if COL=1 then return a   elif COL=2 then return a^2   elif COL=3 then return a^3   else error `wrong colour`; end if ; end proc:
 >
 > foo(3,colour="r")
 (1)
 > foo(2,colour="p")

## suggestion for simpler form of solution to this od...

May be someone can come up with a way to simplify this ode solution? I used the option useInt but the solution can be written in much simpler way than Maple gives.  Below is worksheet showing Maple's 2024 solution and my hand solution.

 > ode:=diff(y(x),x)^3=y(x)+x

 > maple_sol:=dsolve(ode,useInt): maple_sol:=Vector([maple_sol]);

 > mysol1:= Intat(1/(_a^(1/3) + 1), _a = (y(x) + x))=x+_C1: mysol2:= Intat(1/( -(-1)^(1/3)*_a^(1/3) + 1), _a = (y(x) + x))=x+_C1: mysol3:= Intat(1/( (-1)^(2/3)*_a^(1/3) + 1), _a = (y(x) + x))=x+_C1: mysol:=Vector([mysol1,mysol2,mysol3]);
 >

 > map(X->odetest(X,ode),mysol)
 >

 >

I keep losing the edits I do. I post screen shot. Click submit, then find all my changes are lost. Will try one more time and give up:

This is Maple solution

This is implified version

Both versions are verified correct by odetest. The question is there is a way to obtain the simpler form from Maple.

## two technical questions regarding my BoxPlot...

Hi,

I need your insights on two technical questions regarding my BoxPlot:

1) How to adjust the color of the text (Title and caption)

2) How to remove only the y-axis

Thank you

S5StatBoxPlotBtest.mw

## how to obtain this simpler solution for this ode...

I was wondering why Maple do not give this simpler solution to this ode. It solves it as exact. But if solved as separable, the solution is much simpler.

I solved this by hand and Maple verifies my solution. You can see the separable solution is much simpler. Any tricks to make Maple gives the simpler solution?

 > interface(version);

 > ode:=diff(y(x),x)^4+f(x)*(y(x)-a)^3*(y(x)-b)^3*(y(x)-c)^2 = 0;

 > infolevel[dsolve]:=5; sol:=dsolve(ode); odetest(sol,ode);

Methods for first order ODEs:

-> Solving 1st order ODE of high degree, 1st attempt

trying 1st order WeierstrassP solution for high degree ODE

trying 1st order WeierstrassPPrime solution for high degree ODE

trying 1st order JacobiSN solution for high degree ODE

trying 1st order ODE linearizable_by_differentiation

trying differential order: 1; missing variables

trying simple symmetries for implicit equations

--- Trying classification methods ---

trying homogeneous types:

trying exact

<- exact successful

 > mysol:=Intat(1/( (_a-c)^(2/3)*(_a-b)*(_a-a))^(3/4),_a = y(x))=Intat( (-f(_a))^(1/4),_a=x)+_C1; odetest(mysol,ode)

Hand solution

Maple 2024

## Strange simplification of sqrt with sin(x) ...

it took me hrs to find this as my solution was failing verification and I did not know why.

What logic do you think Maple used to simplify this:

```expr:=sqrt(1 + sin(x))/x;
simplify(expr)```

To this

How could the above be simpler than

?

Compare to Mathematica

And this is what I expected. I am now scared to use simplify in Maple as I do not know what I will get back.

Is there a way to tell Maple not to do such strange "simplification"? I am doing this in code, and the code does not know what the expression is.

To see an example of the side effect of this, here is one, where if solution to an ode is simplified first, it no longer verifies by odetest without adding extra assumptions:

 > interface(version);

 > restart;

 > ode:=diff(y(x),x)=(cos(x)-2*x*y(x)^2)/(2*x^2*y(x)); sol:=dsolve([ode,y(Pi)=1/Pi]); odetest(sol,ode);

 > odetest(simplify(sol),ode);

One does not expect that simplified solution no longer verfiies the ode.

Sure, I can do

odetest(simplify(sol),ode) assuming real;

and now it gives 0. But the point is that the first one did not need assumptions.

Maple 2024 on windows 10.

I am trying to tidy up cases where a proc returns multiple values. Have being trying Tabulate. I can get it to work when called after the results are returned. I would the procedure to do this but  keep acces to the name(s) assigned to the returned values.

A,B,C:= proc(...)  .....  return a, b, c    end proc.

So basically display a tabulated of a, b, c.

 > restart
 >
 > QQFProj := proc(q12::algebraic, q23::algebraic, q34::algebraic, q14::algebraic,{columns:=[QQFproj,Q13proj,Q24proj]},prnt::boolean:=true) description "Projective quadruple quad formula and intermediate 13 and 24 quads. Useful for cyclic quadrilaterals"; local qqf,q13,q24, sub1,sub2,sub3, R; #uses  DT = DocumentTools; sub1:= (q12 + q23 + q34 + q14)^2 - 2*(q12^2 + q23^2 + q34^2 + q14^2) ; sub2:=-4*(q12*q23*q34+q12*q23*q14+q12*q34*q14+q23*q34*q14)+8*q12*q23*q34*q14; sub3:=64*q12*q23*q34*q14*(1-q12)*(1-q23)*(1-q34)*(1-q14); qqf:=(sub1+sub2)^2=sub3; q13:=((q12-q23)^2-(q34-q14)^2)/(2*(q12+q23-q34-q14-2*q12*q23+2*q34*q14));#check this q24:=((q23-q34)^2-(q12-q14)^2)/(2*(q23+q34-q12-q14-2*q23*q34+2*q12*q14));#check this #if prnt then #return [columns,[qqf,q13,q24]]; if prnt then print(cat(" ",columns[1],"    ",columns[2],"     ",columns[3])) ; end if; return qqf ,q13,q24  end proc:
 > q12:=1/2:q23:=9/10:q34:=25/26:q41:=9/130: #Cyclic quadrilateral  AA:=QQFProj(q12,q23,q34,q41,true); AA[1]; AA[2]; AA[3]
 (1)
 > # Can the below be built into the proc to nicely didplay the results but maintain access to the results as shown when prnt=true.
 > columns:=[QQFproj,Q13proj,Q24proj]: BB:=QQFProj(q12,q23,q34,q41,false): DocumentTools:-Tabulate([columns,[BB]],width=55):#could do with a variable width depending on length of output epression.
 > BB[1]; BB[2]; BB[3]
 (2)
 > dspformat:=(BB,columns)->DocumentTools:-Tabulate([columns,[BB]],width=75);
 (3)
 > CC:=dspformat(BB,columns):#layout not as expected
 > CC[1] ; #  just gives  letters from Tabulate
 (4)
 >

## How to transform this sine expression into a more ...

I am trying to get Maple to simplify the following trigonometric expressions (for "generic" parameters) as much as possible

```sineExpr(3) := (
sin(a[2] - b[1])*sin(a[3] - b[1]))/(
sin(b[2] - b[1])*sin(b[3] - b[1]))*sin(a[1] - b[1]) + (
sin(a[3] - b[2])*sin(a[1] - b[2]))/(
sin(b[3] - b[2])*sin(b[1] - b[2]))*sin(a[2] - b[2]) + (
sin(a[1] - b[3])*sin(a[2] - b[3]))/(
sin(b[1] - b[3])*sin(b[2] - b[3]))*sin(a[3] - b[3]);
=

sineExpr(4) := (
sin(a[2] - b[1])*sin(a[3] - b[1])*sin(a[4] - b[1]))/(
sin(b[2] - b[1])*sin(b[3] - b[1])*sin(b[4] - b[1]))*
sin(a[1] - b[1]) + (
sin(a[3] - b[2])*sin(a[4] - b[2])*sin(a[1] - b[2]))/(
sin(b[3] - b[2])*sin(b[4] - b[2])*sin(b[1] - b[2]))*
sin(a[2] - b[2]) + (
sin(a[4] - b[3])*sin(a[1] - b[3])*sin(a[2] - b[3]))/(
sin(b[4] - b[3])*sin(b[1] - b[3])*sin(b[2] - b[3]))*
sin(a[3] - b[3]) + (
sin(a[1] - b[4])*sin(a[2] - b[4])*sin(a[3] - b[4]))/(
sin(b[1] - b[4])*sin(b[2] - b[4])*sin(b[3] - b[4]))*
sin(a[4] - b[4]);
=

```

So far, all of my attempts have failed:

 > restart:
 > kernelopts('version');
 > Physics:-Version();
 (1)
 >
 > combine(simplify(normal(sineExpr(1), expanded), trig), trig);
 (2)
 > combine(simplify(normal(sineExpr(2), expanded), trig), trig); # which can be transformed into sin((a[1]+a[2])-(b[1]+b[2])) only in certain legacy versions!
 (3)
 > combine(simplify(normal(sineExpr(3), expanded), trig), trig);
 (4)
 > CodeTools:-Usage(combine(simplify(normal(sineExpr(4), expanded), trig), trig));
 memory used=244.67MiB, alloc change=0 bytes, cpu time=6.17s, real time=5.49s, gc time=1000.00ms
 (5)
 > CodeTools:-Usage(combine(simplify(normal(sineExpr(5), expanded), trig), trig)): # rather lengthy
 memory used=4.23GiB, alloc change=-32.00MiB, cpu time=2.66m, real time=2.29m, gc time=29.98s

Can , , and  be reduced to , , and  respectively by Maple itself (that is, with as little user-intervention as possible) if one is not aware of such reductions in advance?

Note that because zero testing is frequently considerably easier, `combine` always succeeds in showing that the difference between the simplest possible and the original version is zero.

```combine(sin((a[1]+a[2]+a[3])-(b[1]+b[2]+b[3]))-sineExpr(3));
=
0

combine(sin((a[1]+a[2]+a[3]+a[4])-(b[1]+b[2]+b[3]+b[4]))-sineExpr(4));
=
0
```

However, I wonder if Maple can thoroughly simplify them without knowing those known “simplest possible” form beforehand
I also tried some other functions like `rationalize`, `radnormal`, and ``convert/trig``, yet Maple appears to have not been capable of completely simplifying even the sub-simplest case 𝑚＝2. Is there any workaround?

Of note, it can be demonstrated inductively that m∈ℕ

where none of the denominators is 0. Nevertheless, as mentioned above, is it possible to transform  and  (as well as , if possible) into potentially more elegant forms (Ideally,  is rewritten into ,  is rewritten into , and  is rewritten into .) without any such a priori knowledge
In Mma, these may be done using `TrigReduce` directly (cf. ); unfortunately, I cannot found a Maple equivalent to such functionality.

## How to get Help Overview to top of listing?...

I am writing help pages for a package. The inital Overview should be at the top of the listing like in other Maple help directories.

How to I do this? Mine is listing purely alphabetically.

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

## why dsolve does not give this simple solution to f...

THis ode looks complicated

`ode := (2*x^(5/2) - 3*y(x)^(5/3))/(2*x^(5/2)*y(x)^(2/3)) + ((-2*x^(5/2) + 3*y(x)^(5/3))*diff(y(x), x))/(3*x^(3/2)*y(x)^(5/3)) = 0;`

But is actually a simple first order linear ode:

```RHS:=solve(ode,diff(y(x),x));
new_ode:=diff(y(x),x)=RHS;
```

Whose solution is

But Maple gives this very complicated answer as shown below. When asking it to solve as linear ode, it now gives the much simpler solution.

Maple complicated solutions are all verified OK. But the question is, why did it not give this simple solution?

Attached worksheet.  All on Maple 2024

 > restart;

 > interface(version);

 > Physics:-Version();

 > ode := (2*x^(5/2) - 3*y(x)^(5/3))/(2*x^(5/2)*y(x)^(2/3)) + ((-2*x^(5/2) + 3*y(x)^(5/3))*diff(y(x), x))/(3*x^(3/2)*y(x)^(5/3)) = 0;

 > #why such complicated solutions? sol:=[dsolve(ode)];

 > #all solution are correct map(X->odetest(X,ode),sol);

 > RHS:=solve(ode,diff(y(x),x)); new_ode:=diff(y(x),x)=RHS;

 > dsolve(new_ode);

 > #force it to solve it as first order linear ode dsolve(ode,y(x),[`linear`])

## is this a new bug in plot?...

In Maple 2022

```restart;

res := t^3 - 3*t^2*sqrt(t^2*(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(1/3))*ln(t)/(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(2/3) - 2*t^2*sqrt(t^2*(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(1/3))*sqrt(2)/(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(2/3);
plot(res,t=-5..1)```

gives

The same exact code in Maple 2024 gives

Worksheet is below.

Both on same PC. Windows 10.

Will report to Maplesoft, but thought to check also here is others have seen such problem before.

Btw, Maple 2022 plot is the correct one.

 > interface(version);

 > Physics:-Version();

 > restart;

 > res := t^3 - 3*t^2*sqrt(t^2*(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(1/3))*ln(t)/(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(2/3) - 2*t^2*sqrt(t^2*(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(1/3))*sqrt(2)/(12*sqrt(2)*ln(t) + 9*ln(t)^2 + 8)^(2/3); plot(res,t=-5..1)

 >

## how to obtain conditions coulditbe used to obtain ...

Maple's coulditbe  is useful. But unfortunately it does not return back to the user the conditions under which the proposition was found true. This could make it much more useful. It seems in way similar to Mathematica' Reduce but Reduce returns the conditions.

Is there a way to find the conditions which makes it true?

I use coulditbe alot. I use it to verify that the result of odetest (I call it the residue) is zero or not. Maytimes, odetest does not return zero. And using simplify, or evalb or is to check if the residue is zero, all fail. But many times, coulditbe returns true, meaning the residue is zero. But I do not know under what conditions. In Mathematica's Reduce, it tells me the conditions.

Here is one of hundreds of examples I have

```restart;
ode:=(t^3+y(t)^2*sqrt(t^2+y(t)^2))-(t*y(t)*sqrt(t^2+y(t)^2))*diff(y(t),t)=0;
ic:=y(1)=1;
sol:=dsolve([ode,ic]);
the_residue:=odetest(sol,[ode,ic]);

```

You see, odetest says it could not verify the solution (the first entry above) but it did verify the solution against the initial conditions.

Using simplify, evalb and is all also could not verify it

```simplify(the_residue[1]);
evalb(the_residue[1]=0);
is(the_residue[1]=0);
```

Now coulditbe does:

```_EnvTry:='hard':
coulditbe(the_residue[1]=0);
```

So the solution is correct, but I do not know under what conditions. Using Mathematica's Reduce I can find this:

So now back in Maple, I can do this

```simplify(the_residue[1]) assuming t>exp(-2*sqrt(2)/3);
```

0

Actually in this example, just using assume t>0 also gives zero. But I am using Mathematica's result for illustration.

You might ask, why do I need to know for what values of the independent variable is the residue zero?

Because in some cases, the residue is zero only at single point! So it does not make sense to say the solution is verified to be correct only at one single point of the domain, right?

it needs to be some finite range at least. Here is an example of an ode whose solution is correct only at x=0

```ode:=diff(y(x),x)=3*x*(y(x)-1)^(1/3);
ic:=y(3)=-7;
sol:=dsolve([ode,ic]);
the_residue:=odetest(sol,[ode,ic]);
```

And simplify, evalb, is all fail to verifiy this, but coulditbe says true

```simplify(the_residue[1]);
evalb(the_residue[1]=0);
is(the_residue[1]=0);
_EnvTry:='hard':
coulditbe(the_residue[1]=0);
```

So now, we ask, is this solution then correct or not? It turns out to be zero but only at origin x=0

```plot(abs(the_residue[1]),x=-1..1)
```

If I knew that residue is zero only at single point, then I would say this solution is not correct, right?

And that is why I need to know under what conditions coulditbe retruned true.

I tried infolevel[coulditbe]:=5 but nothing more was displayed on the screen.

Mathematica's Reduce confirms that when x=0 the residue is zero.

So my question is simply this: Can one obtain the conditions used by coulditbe to determine when result is true?

It will be useful if Maple could in future version return the value/range which makes it true.

 First 10 11 12 13 Page 12 of 13
﻿