Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Here is another case where an incorrect solution of a non-algebraic expression is returned.

How to make Maple exclude solutions obtained with allsolutions where the expression is not defined?

IMO, allsolutions facilities of Maple should do this automatically. Anything from a mathematical point of view that speaks against an automatic exclusion?

(Are there other commands that provide a correct solution?)

By the way:

solve(sin(x)/x)

does not return a single solution as stated on the solve help page ("In general for transcendental equations, the solve command returns only one solution,...") because solve correctly discards x=0 but does not consider returning x=pi.

restart

expr := sin(x)/x

sin(x)/x

(1)

The above expression is not defined at x = 0

Eval(expr, x = 0)

Eval(sin(x)/x, x = 0)

(2)

value(Eval(sin(x)/x, x = 0))

Error, (in value/Eval) numeric exception: division by zero

 

Roots of the expression with RootOf

sol := allvalues(RootOf(expr))

Pi*_Z1

(3)

indets(sol)

{_Z1}

(4)

about({_Z1}[])

Originally _Z1, renamed _Z1~:
  is assumed to be: integer
 

 

getassumptions({_Z1})

{_Z1::integer}

(5)

type(0, integer)

true

(6)

subs(x = sol, expr) = 0

sin(Pi*_Z1)/(Pi*_Z1) = 0

(7)

is(sin(Pi*_Z1)/(Pi*_Z1) = 0)

true

(8)

The above should be false because expr is not defined for _Z1 = 0.However, this is what automatic simplifcation does behind the scenes with the output (7) 

sin(Pi*_Z1)/(Pi*_Z1) = 0

0 = 0

(9)

For this particular case Maple should have returned a special name expressing nonzero integers, like _NZ .
`ℤ__≠0`or `minus`(integer, {0})or `#msup(mi("ℤ",fontstyle = "normal"),mo("*"))`are common symbols for that
So _Zis incorrect in the solution and automatic simplification does something wrong.
Only substituing everything at once leads to a correct response:

subs(x = sol, _Z1 = 0, expr)

Error, numeric exception: division by zero

 


Solve

solve(expr, x)

x_sol := [solve(expr, x, allsolutions)]

[2*Pi*_Z2, Pi*(2*_Z2+1)]

(10)

indets(x_sol)

{_Z2}

(11)

subs(x = x_sol[1], expr) = 0

(1/2)*sin(2*Pi*_Z2)/(Pi*_Z2) = 0

(12)

is((1/2)*sin(2*Pi*_Z2)/(Pi*_Z2) = 0)

true

(13)

(1/2)*sin(2*Pi*_Z2)/(Pi*_Z2) = 0

0 = 0

(14)

subs(x = x_sol[1], _Z2 = 0, expr) = 0

Error, numeric exception: division by zero

 

Again _Z2 = 0is not a valid solution for the first solution butNULLworks for the second solution

subs(x = x_sol[2], expr) = 0

sin(Pi*(2*_Z2+1))/(Pi*(2*_Z2+1)) = 0

(15)

is(sin(Pi*(2*_Z2+1))/(Pi*(2*_Z2+1)) = 0)

true

(16)

sin(Pi*(2*_Z2+1))/(Pi*(2*_Z2+1)) = 0

0 = 0

(17)

Substituing everything at once works

subs(x = x_sol[2], _Z2 = 0, expr) = 0

sin(Pi)/Pi = 0

(18)

sin(Pi)/Pi = 0

0 = 0

(19)

However, the second solution does not cover all solutions (it misses even multiples of π)

[seq({_Z2}[] = i, i = -2 .. 2)]

[_Z2 = -2, _Z2 = -1, _Z2 = 0, _Z2 = 1, _Z2 = 2]

(20)

seq(subs([_Z2 = -2, _Z2 = -1, _Z2 = 0, _Z2 = 1, _Z2 = 2][i], x_sol[2]), i = 1 .. nops([_Z2 = -2, _Z2 = -1, _Z2 = 0, _Z2 = 1, _Z2 = 2]))

-3*Pi, -Pi, Pi, 3*Pi, 5*Pi

(21)

Related topic: I also think that new users and students should profit from a directly understandable output like this

Maybe adding new convert form is an option.

Download roots_of_sinc.mw

I calculate a long polynomial p(x) where the coefficients depend on a varaiable d. That takes about 10 minutes. I put a colon at the end of the computation because the result is very large. Then I put d=12.2 say and proceed to do a lot of other things. All well and good. I save the file as fooapril23 and go home. When I return I want to repeat the computaion with d=12.5 which I can do by opening the file, saving it as fooapril24. Then I have to recalculate p which is 10 mintes wasted until I can say d=12.5 and proceed with my work..  I would like to "park" the result for p in a file somewhere and then import it when needed. I went to the read and writeto help pages but could not understand it at all. (I tried bit when I did the writeto command and then opened a new worksheet and tried to read I got an error:

Error, on line %1, syntax error, `>` unexpected:

(The > was the Maple prompt I guess.)

I have tried over the years to use the writeto and read commands but I think the help pages are written for unix gurus and I am a Mac user.

BTW I am using Maple 2026 My worksheet starts with > restart; Digits:=20: with(Plots):
I guess requiring the with(Plots): command in 2026 is some kind of an in joke?

I do have a stundent license permanently and I've installed the OpenMaple java examples: JCEngineCallBacks, JCHelpCallBack, jcmaple in Eclipse.

I've also installed the MapleTest.java which runs fine.

When I start the jcmaple.java I get the error: license communication problem 1  Error starting OpenMaple session

So I don't know why.

Meanwhile I was able to solve the issue

When I click on

called from here

Maple 2026 crashes. I had to use this

PackageTools:-Install("https://maple.cloud/app/4797495082876928/Maple+Customer+Support+Updates",overwrite=true)

Is that issue known?

It can take a lot of time to verify the equality of the determinant of a Kronecker Product and the Zehfuss determinant. See attached worksheet)



As Acer has pointed out Abstract Linear Algebra is not implemented in Maple.
https://mapleprimes.com/questions/239405-How-To-Force-Maple-To-Use-Basic-Math-Results

Today I have been trying to replace the determinant of a Kronecker product by an unevaluated Zehfuss determinant. The first problem is how to detect whether there is a determinant of a Kronecker product present in an expression. Neither I nor Copilot, ChatGPT, Gemini and Claude were able to take this first step (although all the AI programs were very optimistically continuously presenting new code with the same disappointing results). 

Maple_vraag.mw

I am running Maple 2026 and my interest is in Physics.

Am I able to load the Physics package "Version 1854 and higher require Maple 2025"  in Maple 2026?

Does the Physics package offer capability that is not in the standard Maple 2026 product?

Will there be a Physics package for Maple 2026 that will available shortly?

Thanks in advance.

...and starting values. I want to reproduce the maximum in Maple using the solution structure in the attached file, similar to the old Mathcad method. Instead of using the Euler-Lagrange equation, I want to separately enter the objective function, then the boundary conditions, and finally the starting values ​​for an iteration (as was done in the old Mathcad solution block). I entered the latter into the "maximize" command using the Maple help text. But nothing is being calculated. What am I doing wrong? As I said, I only want a numerically generated approximate solution.test.mw

restart

kernelopts(version)

`Maple 2026.0, X86 64 WINDOWS, Mar 05 2026, Build ID 2001916`

(1)

interface(version)

`Standard Worksheet Interface, Maple 2026.0, Windows 11, March 05 2026 Build ID 2001916`

(2)

with(VariationalCalculus)

[ConjugateEquation, Convex, EulerLagrange, Jacobi, Weierstrass]

(3)

with(plots, implicitplot)

[implicitplot]

(4)

with(Optimization)

 

assume(x >= 0, y(x) >= 0)

"p(a,b,c,x):=a∗x^(2)+b∗x+c;"

proc (a, b, c, x) options operator, arrow, function_assign; a*x^2+b*x+c end proc

(5)

" q(d,f,x):=d∗x^(2)+f∗x;"

proc (d, f, x) options operator, arrow, function_assign; d*x^2+f*x end proc

(6)

"yn(a,b,c,d,f,g,x):=p(a,b,c,x)∗exp(q(d,f,x))+g;"

proc (a, b, c, d, f, g, x) options operator, arrow, function_assign; p(a, b, c, x)*exp(q(d, f, x))+g end proc

(7)

" wn(a,b,c,d,f,g,xend):=(∫)[0]^(xend)x∗yn(a,b,c,d,f,g,x)ⅆx;"

proc (a, b, c, d, f, g, xend) options operator, arrow, function_assign; int(x*yn(a, b, c, d, f, g, x), x = 0 .. xend) end proc

(8)

"constr(a,b,c,d,f,g,xend):=(∫)[0]^(xend)(sqrt(1+((ⅆ)/(ⅆx)(yn(a,b,c,d,f,g,x)))^(2))-50)ⅆx=0;"

proc (a, b, c, d, f, g, xend) options operator, arrow, function_assign; int(sqrt(1+(diff(yn(a, b, c, d, f, g, x), x))^2)-50, x = 0 .. xend) = 0 end proc

(9)

 

maximize(wn(a, b, c, d, f, g, xend), constr(a, b, c, d, f, g, xend), initialpoint = {a = -0.2e-1, b = 1.06, c = 0.14e-2, d = 0.46e-3, f = -0.12e-2, g = -0.14e-2, xend = 30})

maximize(-(1/16)*(8*a*xend^2*(-d)^(11/2)*exp(d*xend^2+f*xend)-8*g*xend^2*(-d)^(13/2)+4*a*f*xend*(-d)^(9/2)*exp(d*xend^2+f*xend)+8*b*xend*(-d)^(11/2)*exp(d*xend^2+f*xend)+2*exp(d*xend^2+f*xend)*(-d)^(7/2)*a*f^2+4*b*f*(-d)^(9/2)*exp(d*xend^2+f*xend)+8*c*(-d)^(11/2)*exp(d*xend^2+f*xend)-erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^3*a*f^3+2*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^4*b*f^2-4*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^5*c*f+8*a*(-d)^(9/2)*exp(d*xend^2+f*xend)+erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*a*f^3*d^3-2*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*b*f^2*d^4+4*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*c*f*d^5-2*a*f^2*(-d)^(7/2)-4*b*f*(-d)^(9/2)-8*c*(-d)^(11/2)+6*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^4*a*f-4*erf((1/2)*(2*d*xend+f)/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*d^5*b-6*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*a*f*d^4+4*erf((1/2)*f/(-d)^(1/2))*Pi^(1/2)*exp(-(1/4)*f^2/d)*b*d^5-8*a*(-d)^(9/2))/(-d)^(13/2), int((1+((2*a*x+b)*exp(d*x^2+f*x)+(a*x^2+b*x+c)*(2*d*x+f)*exp(d*x^2+f*x))^2)^(1/2)-50, x = 0 .. xend) = 0, initialpoint = {a = -0.2e-1, b = 1.06, c = 0.14e-2, d = 0.46e-3, f = -0.12e-2, g = -0.14e-2, xend = 30})

(10)

 

Download test.mw

I have troubles writing text passages including non-executable math with Maple 2026 in worksheet mode.

Since these "indicator switches" (or radio buttons) are not available any more, I have tried "toggling" between text and non-executable math by using F5. I am struggeling with too many use errors (changing mode, start writing in the wrong mode, deleting wrong text, toggling the mode with F5).

Is it normal that the cursor does not clearly indicate the entry mode state? Here is an example

There seems to be no difference between non-executable math and executable math. Only a small underline is visible. In document mode the cursor changes to grey for non-executable and to light blue for executable input. Was it allways like this (and I did not pay attention because of the above indicators switches) or is it something related to my local setting? Can someone confirm? Any other suggestions to speed up text editing.

Context: Commenting Maple worksheets with text mixed with nonexecutable math. I look for ways to speed up my workflow because the new quick access buttons do not provide quick access to change the entry mode. Too many clicks are needed. Usabilty has been degraded further with Maples 2026 version by shrinking the quick access button in size and moving them out of the user focus. They are now in the upper right corner of the screen but most user interactions happen on the left side of the screen. This is forcing me going back to shortcuts that I stopped using after the introduction of Maple 2021.

Insetr Table seems to default too test inpul in the cells. I am inserting it from this icon 

I can't figure out how to change the whole table to 1d or 2d math input without individually changing each cell..

What am I misssing here?

pdsolve is capable of numeric solution for a 1-D standing wave equation with a constant c:

diff(u(x, t), t, t) = c^2*diff(u(x, t), x, x)

In my problem, c is a function of lambda; both c and lambda has a common parameter H.  My problem has piecewise nonlinear function of c(H) and lambda(H) which cannot be reformulate as c(lambda) readily.  I therefore use a procedure based on fsolve to enter lambda and back out c.  In the example, I use piecewise linear function as demonstration.  I ran into a "(in fsolve) Can't handle expressions with typed procedures" error.

If I can overcome this, my input to the procedure also includes du/dx.  Can pdsolve handles such an equation?

Hi,

I am trying to generate an implicitplot command for a plot of two variables. The dummy code is as follows:

implicitplot([f1(x,y)=1, f2(x,y)=1, f3(x,y)=1], x=x1..x2, y=y1..y2, axes = boxed, view = [x1..x2, y1..y2], color=[yellow, green, black, khaki, magenta, green], linestyle=[solid, dash, dot, dashdot, longdash, spacedot], thickness=[2, 2, 2, 2, 2, 2], coloring=["SteelBlue", "DarkGreen", "Brown"], labels = [x, y], labeldirections=[horizontal, vertical], labelfont = ["TIMES New ROMAN", 13], legend = ["txt1", "txt2", "txt3"]);

The expressions f1(x,y), f2(x,y), and f3(x,y) are complex in form, and they are defined separately. 

For some instances, I get the implicitplot output. However, for many choices of x1 and x2, and y1 and y2, I get the following error message "`[Length of output exceeds limit of 1000000]`". I tried many options to fix the issue, e.g., using the options gridrefine=0, crossingrefine=0, grid=[50,50], numpoints=1000. No luck yet!

I would appreciate your input to resolve the issue. 

Regards,

Omkar

The command completion facility is real time saver. On the other hand, entering the colon dash is not fluent since it requires searching the keys on the key board.

I was wondering if there is a keyboard shortcut that enters both characters at once.

Hi

I want to add this rule to maple invlaplace:

invlaplace(Divide[exp(-s*a),b*Power[s,2] +c)]) - Wolfram|Alpha

It works on expressions that use "exp(-s*a)" but not on expressions with "e^(-s*a)". I do not know how to force maple to substitute the expressions and I do not know how to formulate this rule to make it stable. I need this functionality since maple returns results with e^(...) instead of exp(...). Can you please help me? I have attached a workbook example.

restart;with(inttrans)

[addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin, savetable, setup]

(1)

addtable(invlaplace,exp(-s*a)/(b*s^2+c),Heaviside(t - a)*sin(sqrt(c)*(t-a)/sqrt(b))*1/(sqrt(b)*sqrt(c)),s,t,a,a::positive)

addtable(invlaplace,e^(-s*a)/(b*s^2+c),Heaviside(t - a)*sin(sqrt(c)*(t-a)/sqrt(b))*1/(sqrt(b)*sqrt(c)),s,t,a,a::positive)

 

assume(a_pos::positive)

invlaplace(exp(-s*a_pos)/(b*s^2 + c), s, t)

Heaviside(t-a_pos)*sin((c/b)^(1/2)*(t-a_pos))*(c/b)^(1/2)/c

(2)

invlaplace(e^(-s*a_pos)/(b*s^2 + c), s, t)

invlaplace(e^(-s*a_pos)/(b*s^2+c), s, t)

(3)

 

algsubs(e^=exp,e^c)

Error, symbol unexpected

 

NULL

Download inttrans_exponent_question.mw

Thanks!

edit: simplified example

Consider a soil moisture transport problem with parameters: a = 9.88\times10^{-5} m/s,  b = -0.0065\ m3/m3, and D = 3.51*10^{-7} m2/s. The length is L=0.08 m, and no-flux (outflow) is assumed, meaning q=0. In this case θ0= 0.355$ and θL = 0.10.

A solution is expressed as a contour integral involving a complex-valued function V(k,x,t) and evaluated numerically in Maple using parameterized contours k1(r),k2(r),k3(s).

However, when this code is executed, Maple takes an extremely long time and appears to run indefinitely.

Could you suggest an alternative numerical or analytical approach ( that could improve efficiency when evaluating this type of contour integral?

a := 988/10000000;
b := -65/10000;
d := 351/1000000000;
q := 0;
theta0 := 355/1000;
thetaL := 1/10;
L := 8/100;
mu := a*(theta0 + b)/d;
c := a*(thetaL + b)/d;

mu := a*(theta0 + b)/d;
c := a*(thetaL + b)/d;

V := 1/(2*Pi)*exp(-d*k^2*t)*((exp(k*x*I)(mu - k*I) - exp(-mu*L)*exp(k*(L - x)*I)*(mu + L*I))*k*cos(k*L)/(k^2 + mu^2) + c*sin(k*L) - exp(k*L*I)(k*I + c)*sin(k*x)*(1 - exp(-mu*L)*exp(-I*k*L))/(mu + k*I) - (k*cos(k(L - x)) + c*sin(k(L - x)))*(1 - exp(-mu*L)*exp(k*L*I))/(mu - k*I) + 2*I*k*d*(k*cos(k(L - x)) + c*sin(k(L - x)))/(d*k^2 + a*q/d))/(k*cos(k*L) + c*sin(k*L)):

l := 5;
k1 := r -> l + I + r*exp(1/6*I*Pi);
k2 := r -> -l + I + r*exp(5/6*I*Pi);
k3 := s -> s + I;

dk1 := D(k1);
dk2 := D(k2);
dk3 := D(k3);

integrand1 := Re(eval(V, k = k1(r))*dk1(r) + eval(V, k = k2(r))*dk2(r));
integrand3 := Re(eval(V, k = k3(s))*dk3(s));
integrand2 := simplify(evalc(integrand1));

integrand4 := simplify(evalc(integrand3));
approx_u := proc(x, t) local temp1, temp2; temp1 := Int(eval(integrand2, [:-x = x, :-t = t]), r = 0 .. infinity, method = _d01amc); temp2 := Int(eval(integrand4, [:-x = x, :-t = t]), s = -L .. L, method = _d01ajc); evalf(temp1 + temp2); end proc;
1 2 3 4 5 6 7 Last Page 1 of 2249