Maple 2025 Questions and Posts

These are Posts and Questions associated with the product, Maple 2025

The title says it all. Nevertheless, I am doing some symbolic computation/manipulations with tensors in the Physics pacakge. When I type out my expressions and execute it changes some positions of the indices -- example below. Why? 
**Sorry, contents will not post. 

Download IndexQuestion.mw

The below problem has already occured several times to me. In all such instances Maple did not realise that extracting a factor from a square root is the key for further simplification. Doing this by hand is obvious and often easy when extracted factors are positive.  

Did I overlook something? Are there other ways avoid disassembling an expression with the op command?
Should simplify or other commands be improved to adress such problems?

restart

How to transform the left-hand side by commands that it matches the right-hand side

sqrt(x__0+1)*sqrt(-2*beta^2*x__0-2*beta^2+4)*sqrt(-(x__0+1)*(beta^2-1))/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/(sqrt(-beta^2+1)*sqrt(-2*beta^2*x__0-2*beta^2+4))

(x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(1)

assumptions := 0 < x__0 and x__0 < 1, 0 < beta and beta < 1

0 < x__0 and x__0 < 1, 0 < beta and beta < 1

(2)

`assuming`([simplify(lhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))))], [assumptions])

-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2))

(3)

I have tried the usual simplify and combine commands to remove the square root from the numerator.
Extracting a factor for -2 from the square root would probably make further simplification possible but there is no simple command to do so.

Factor_ := -2

-2

(4)

old := simplify([op(denom(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2))))])

[(-beta^2+1)^(1/2), -2+(x__0+1)*beta^2]

(5)

new := old; new[1] := old[1]/Factor_; new[2] := old[2]*Factor_

[-(1/2)*(-beta^2+1)^(1/2), 4-2*(x__0+1)*beta^2]

(6)

subs(1/old[1] = 1/new[1], 1/old[2] = 1/new[2], -(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))

2*(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(4-2*(x__0+1)*beta^2))

(7)

expand(simplify(2*(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(4-2*(x__0+1)*beta^2))))

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(8)

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = rhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(9)

is(2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

true

(10)

Second approach after "discovering" that content works also on square roots

[op(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))]

[-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)]

(11)

mul(`~`[`*`](`~`[content]([-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)]), `~`[primpart]([-1, 1/(-beta^2+1)^(1/2), (4+(-2*x__0-2)*beta^2)^(1/2), 1/(-2+(x__0+1)*beta^2)])))

-2^(1/2)*(-beta^2*x__0-beta^2+2)^(1/2)/((-beta^2+1)^(1/2)*(beta^2*x__0+beta^2-2))

(12)

simplify(-2^(1/2)*(-beta^2*x__0-beta^2+2)^(1/2)/((-beta^2+1)^(1/2)*(beta^2*x__0+beta^2-2))) = rhs((x__0+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)*(-(x__0+1)*(beta^2-1))^(1/2)/((beta^2*x__0+beta^2-2)*(beta^2*x__0+beta^2-x__0-1)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2)))

2^(1/2)/((2+(-x__0-1)*beta^2)^(1/2)*(-beta^2+1)^(1/2)) = 2/((-beta^2+1)^(1/2)*(-2*beta^2*x__0-2*beta^2+4)^(1/2))

(13)

is(%)

true

(14)

NULL

Context: The left-hand side in an integrand which was produced by a change of variables in a elliptic integral. Maple simplifies only halfway which makes validation of the result of the variable change difficult.  

NULL

Related functional programming question: Is a onliner `...`(-(4+(-2*x__0-2)*beta^2)^(1/2)/((-beta^2+1)^(1/2)*(-2+(x__0+1)*beta^2)))from the above content-primpart construct possible?NULL

Download Simplify_radical_02.mw

Help me rewrite the code to create visible Bar chart of different colors. I can't figure out why this code is not giving me a visible bar graph

restart; with(Statistics); with(plots); Data := [45, 38, 51, 67, 74, 91]; P := BarChart(Data, tickmarks = [[1 = "Chemical Vector Control", 2 = "Resistant Cultivars", 3 = "Roguing & Sanitation", 4 = "u1+u2", 5 = "u1+u3", 6 = "Integrated"], default], width = .75); T := textplot([[1, 48, "45%"], [2, 41, "38%"], [3, 54, "51%"], [4, 70, "67%"], [5, 77, "74%"], [6, 94, "91%"]], font = ["TIMES", "BOLD", 12]); display([P, T], title = "Figure 20: Comparative Effectiveness of Optimal Control Strategies", labels = ["Control Strategies", "Reduction in Coinfection Burden (%)"], labelfont = ["TIMES", "BOLD", 14], titlefont = ["TIMES", "BOLD", 16], axes = boxed, gridlines = true, view = [.5 .. 6.5, 0 .. 100], size = [1000, 650])

 
 

NULL

Download Bargraph.mw

The HTML characters in the attached document cause problems here on MaplePrimes. You have to open the worksheet

Download HTML_characters_in_math_mode.mw

I am trying to plot a function where one of the variables is determind via a procedure that uses fsolve and depends on some parameters. When I go to try and make a plot using Explore to vary the parameters I get the following error:
"in fsolve  S  is in the equation, and is not solved for"
My worksheet is seen below:

restart;

 

T := 2^(2/3)*(16*CC(S,mu,Z,Pr)^2*Pi^2 + 2*Pi^2*Z^2 + 16*Pi*S*CC(S,mu,Z,Pr) + 3*S^2)*Pr^(1/3)/(4*(4*CC(S,mu,Z,Pr)*Pi + S)^(2/3)*(2*Pi^2*Z^2 + 4*Pi*S*CC(S,mu,Z,Pr) + S^2)^(2/3)*CC(S,mu,Z,Pr)^(1/3)*Pi^(2/3))

(1/4)*2^(2/3)*(16*CC(S, mu, Z, Pr)^2*Pi^2+2*Pi^2*Z^2+16*Pi*S*CC(S, mu, Z, Pr)+3*S^2)*Pr^(1/3)/((4*CC(S, mu, Z, Pr)*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*Pi*S*CC(S, mu, Z, Pr)+S^2)^(2/3)*CC(S, mu, Z, Pr)^(1/3)*Pi^(2/3))

(1)

 

mu = 2^(2/3)*S*(16*C^2*Pi^2 - 2*Pi^2*Z^2 - S^2)*Pr^(1/3)/(4*(4*C*Pi + S)^(2/3)*(2*Pi^2*Z^2 + 4*C*Pi*S + S^2)^(2/3)*C^(4/3)*Pi^(2/3))

mu = (1/4)*2^(2/3)*S*(16*C^2*Pi^2-2*Pi^2*Z^2-S^2)*Pr^(1/3)/((4*C*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*C*Pi*S+S^2)^(2/3)*C^(4/3)*Pi^(2/3))

(2)

CC:=proc(S,mu,Z,Pr)
fsolve((2),C,C=0.01..100)
end proc;

proc (S, mu, Z, Pr) fsolve(mu = (1/4)*2^(2/3)*S*(16*C^2*Pi^2-2*Pi^2*Z^2-S^2)*Pr^(1/3)/((4*C*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*C*Pi*S+S^2)^(2/3)*C^(4/3)*Pi^(2/3)), C, C = 0.1e-1 .. 100) end proc

(3)

CC(1,0,0.5,0.2)

.1938622552

(4)

Explore(plot(T,0..15),parameters=[[mu=0 .. 1,minorticks=0.25],[Z=0..0.5,minorticks=0.1],[Pr=0..1,minorticks=0.25]])


When I try to move the sliders on my parameters this is where I get the error. I want to plot over S, but I can only get CC once I have all the other values including S. I assume it has something to do with the fact that my plotting variable is in the procedure?

Any help would be greatly appreciated, thanks. 

Download Explore_Plot_Problem.mw

Greetings, Friends.

I have a function f(t) which is a density function. It has a [0,2] interval and integrates to unity. I convolve f(t) with itself to get g(t). It has a [0,4] interval and integrates to unity. All is well with that and I understand.

BUT, the boundary of g(t) shouild be on the interval [0,4/sqrt(3)]. This is based upon both my simulation and other analyses.

At present, the area of the g(t) function on the [4/sqrt(3), 4] interval accounts for 1.408701% of the area under the curve. Not a "trivial" nor "throwaway" amount.

Does anyone know of a way to "re-scale" or modify my convolved result g(t) so that all of the resultant area under the curve is on the [0,4/sqrt(3)] interval?

My work is attached.

restart

with(Statistics)

f := proc (t) options operator, arrow; piecewise(t <= 0, 0, t <= 2, 6/5-(3/2)*t^2+(3/4)*t^3-(3/80)*t^5, 2 <= t, 0) end proc

proc (t) options operator, arrow; piecewise(t <= 0, 0, t <= 2, 6/5-(3/2)*t^2+(3/4)*t^3-(3/80)*t^5, 2 <= t, 0) end proc

(1)

plot(f(t), t = 0 .. 2)

 

int(f(t), t = 0 .. 2)

1

(2)

simplify(int(f(tau)*f(t-tau), tau = -infinity .. infinity))

(1/1971200)*piecewise(t <= 0, 0, t <= 2, t^11-220*t^9+1320*t^8+7920*t^7-103488*t^6+147840*t^5+887040*t^4-2365440*t^3+2838528*t, t <= 4, -(t^4+28*t^3+228*t^2+536*t+80)*(t-4)^7, 4 < t, 0)

(3)

g := unapply(simplify(int(f(tau)*f(t-tau), tau = -infinity .. infinity)), t)

proc (t) options operator, arrow; (1/1971200)*piecewise(t <= 0, 0, t <= 2, t^11-220*t^9+1320*t^8+7920*t^7-103488*t^6+147840*t^5+887040*t^4-2365440*t^3+2838528*t, t <= 4, -(t^4+28*t^3+228*t^2+536*t+80)*(t-4)^7, 4 < t, 0) end proc

(4)

plot(g(t), t = 0 .. 4)

 

int(g(t), t = 0 .. 4)

1

(5)

evalf(int(g(t), t = 0 .. 4/sqrt(3)))

.98591299

(6)

evalf(int(g(t), t = 4/sqrt(3) .. 4))

0.1408701e-1

(7)
 

NULL

Download SphereConvolution.mw

Hi mapleprimes, and all,

did a little exploration with the Matrix() and ifactor() Maple commands.

prime_factorization_of_one_digit_numbers.mw

have a look
no warnings, and no errors

Regards,
Matt

Note that Maple 2026 is not an available option on the product list above. This operation was used in Maple 2026.

I obtained code for the shuffle product of two lists from the AI Assistant. Included in the code was the following list operation to extract a sublist.:

 defined list  u:=[a,b,c]:  extract the sublist using the operation u[2..-1] which gives correct result [b.c]

Normally, I would have expected this operation would be encoded as [op(2..-1),u] . 

Is the shortcut notion reliable or should the operation have been encoded using op() to be safe.

In the Maple dock i am having problems finding the explicit value for x, for my equation. I need it, to find the value for r later.

so i will be kindly asking for Maple wizards to help me.

i thank of you in advance for your help, any comment is appreciated.

Hi Maple community, and all,

My intrest in prime numbers continues.

Made a quick example file.

3_tuple_admissible_example.mw

3_tuple_admissible_example.pdf

also, see my webpage for similar content
https://mattanderson.fun
and Norman, in Germany
prime k-tuplets & Primzahlen

Enjoy

Matt

 

 

 

 

when getting sequence of RealRange, I'd like to convert this to normal list. Currently I have to use map twice on the result, but I think there should be simpler way.

Below is what I do. I was wondering if there is a better way in Maple to do this, may be a built in command?

Basically, if the input is

RealRange(-2*Pi,Open(-7/4*Pi)), RealRange(Open(-5/4*Pi),Open(-3/4*Pi)), 
RealRange(Open(-1/4*Pi),Open(1/4*Pi)), RealRange(Open(3/4*Pi),Open(5/4*Pi)), 
RealRange(Open(7/4*Pi),2*Pi)

I want to change the above to normal list like this (without any Open, etc.. in it) to make it easier to post process (say for plotting and so on)

[[-2*Pi, -7/4*Pi], [-5/4*Pi, -3/4*Pi], [-1/4*Pi, 1/4*Pi], [3/4*Pi, 5/4*Pi], [7/4*Pi, 2*Pi]]

This is what I do now on an example that generates sequence of RealRange

restart;

f:=x->2*x-tan(x);
the_intervals:=solve(diff(f(x),x)>0 and x>=-2*Pi and x<= 2*Pi,x);

proc (x) options operator, arrow; 2*x-tan(x) end proc

RealRange(-2*Pi, Open(-(7/4)*Pi)), RealRange(Open(-(5/4)*Pi), Open(-(3/4)*Pi)), RealRange(Open(-(1/4)*Pi), Open((1/4)*Pi)), RealRange(Open((3/4)*Pi), Open((5/4)*Pi)), RealRange(Open((7/4)*Pi), 2*Pi)

lprint(the_intervals);

RealRange(-2*Pi,Open(-7/4*Pi)), RealRange(Open(-5/4*Pi),Open(-3/4*Pi)),
RealRange(Open(-1/4*Pi),Open(1/4*Pi)), RealRange(Open(3/4*Pi),Open(5/4*Pi)),
RealRange(Open(7/4*Pi),2*Pi)

map(X->convert(X,list),[the_intervals]);
map(X1->map(X2->`if`(has(X2,Open),op(X2),X2),X1),%);

[[-2*Pi, Open(-(7/4)*Pi)], [Open(-(5/4)*Pi), Open(-(3/4)*Pi)], [Open(-(1/4)*Pi), Open((1/4)*Pi)], [Open((3/4)*Pi), Open((5/4)*Pi)], [Open((7/4)*Pi), 2*Pi]]

[[-2*Pi, -(7/4)*Pi], [-(5/4)*Pi, -(3/4)*Pi], [-(1/4)*Pi, (1/4)*Pi], [(3/4)*Pi, (5/4)*Pi], [(7/4)*Pi, 2*Pi]]

lprint(%);

[[-2*Pi, -7/4*Pi], [-5/4*Pi, -3/4*Pi], [-1/4*Pi, 1/4*Pi], [3/4*Pi, 5/4*Pi], [7/
4*Pi, 2*Pi]]

 

 

Download convert_realrange_to_list.mw

Any idea why plot fail when adding legend and using {1} instead of [1] ? Since both have one curve.

Maple 2026 and 2025.2. searched help but do not see anything on this so far.

restart;

plot({1},x = -10 .. 10,'legend'="A");

Error, (in plot) the legend option cannot be used when plotting a set of objects

plot([1],x = -10 .. 10,'legend'="A");

 

 

Download plot_legend_problem_march_25_2026.mw

Can someone explain what the meaning of "visible character width" for e.g. TextArea components is?

My understanding is that the width should correspond to the number of characters that are visible in the TextArea. But apparently this is not the case.

A definition of 4 allows at least 8 characters. A definition of 6 at least 12, 8 gives 16 and 10 gives 20.

Test_visible_character_width.mw

I defined two tensors (vectors) U and D and their components in Maple 2025 using the Physics package. I enter U[~alpha]*U[alpha] and get a symbolic result. SumOverRepeatedIndices expands this but does not substitutes the expressions of the components I gave. How to force Maple to use the values of the components?

Thank you!

Hello Friends.

I have created two piecewise functions: dx(t) and dy(t).  I then converted them to RandomVariables:  DX and DY.  When I try to perform a mathematical operation on the random variables, I get a Dirac function, which is unintended.  When I read about this issue, I learned that flawed (discontinuous) piecewise functions may be the problem.  However, my piecewise functions look ok to me.

Does anyone know why this is happening?  I do expect a lenghty result when I process the random variables, but not a Dirac function.  My code is below:

TriangleEuclidean.mw

1 2 3 4 5 6 7 Last Page 1 of 19