MaplePrimes Questions

I am looking to do some gravitational perturbations around a generic background spacetime. But before doing that, I wanted to look at just linearized gravity, and make sure all the standard calculations work with Physics before throwing something a little more complicated at it. I went to ?Physics,Library and found the Linearize command, and I thought this was great! When I was reading through it however, I found that the sign infront of the perturbation in the inverse metric is incorrect. Now, this does not give any invalid results for the Ricci tensor as displayed in the worksheet, since we are only going to linear order, but if we want to go beyond linear order, this will start to cause issues. 

Is there a way that Maple can handle this? Or do I have to do some sort of double Define for the metric: one with all downstairs indices, and one with all upstairs indices? If so, how do I do that? 

Any help would be greatly appreciated!

restart: with(Physics): with(Library):

Setup(coordinates = cartesian,signature=`-+++`):

`Systems of spacetime coordinates are:`*{X = (t, x, y, z)}

 

_______________________________________________________

(1)

g_[];

g_[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(2)
  

 

Define(h[mu, nu],symmetric)

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)
  

 

Define(eta[mu,nu]=rhs((2)))

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)

g_[mu,nu]=eta[mu,nu]+epsilon*h[mu,nu]

Physics:-g_[mu, nu] = epsilon*h[mu, nu]+eta[mu, nu]

(5)

Lets "define" the inverse metric as it appears from the Library:-Linearize worksheet.

g_[~mu,~alpha]=eta[~mu,~alpha]+epsilon*h[~mu,~alpha]

Physics:-g_[`~alpha`, `~mu`] = epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`]

(6)

If we multiply the metric and its inverse together, we should expact that we return the KroneckerDelta by definition -- if we consider only to linear order.  

(5)*(6)

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = (epsilon*h[mu, nu]+eta[mu, nu])*(epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`])

(7)

expand((7))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon^2*h[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[`~alpha`, `~mu`]*h[mu, nu]+eta[mu, nu]*eta[`~alpha`, `~mu`]

(8)

Substitute(eta=g_,(8))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon^2*h[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[`~alpha`, `~mu`]*h[mu, nu]+Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`]

(9)

subs(epsilon^2=0,(9))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon*Physics:-g_[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[`~alpha`, `~mu`]*h[mu, nu]+Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`]

(10)

Simplify(%)

Physics:-g_[nu, `~alpha`] = 2*epsilon*h[nu, `~alpha`]+Physics:-g_[nu, `~alpha`]

(11)

 

As we can see, we do not get delta alone on the right-hand-side, but instead we still have the perturbation still.

If we instead, use the proper way the inverse should look, which of course comes from the definition of the inverse, it should have minus sign.

g_[~mu,~alpha]=eta[~mu,~alpha]-epsilon*h[~mu,~alpha]

Physics:-g_[`~alpha`, `~mu`] = -epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`]

(12)

subs(epsilon^2=0,expand((5)*(12)))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = -epsilon*eta[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[`~alpha`, `~mu`]*h[mu, nu]+eta[mu, nu]*eta[`~alpha`, `~mu`]

(13)

Simplify(Substitute(eta=g_,(13)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]

(14)

Which is the desired result we want. So, my question: is there a way that Maple can produce the correct inverse metric not only to linear order, but to say quadratic, without explicitly deriving it ourselves?

 

 

 

 

 

Here is the Physics:-Library(Linearize) Worksheet/Example with some comments


 

restart: with(Physics): with(Library):

Setup(coordinates = cartesian);

`Systems of spacetime coordinates are:`*{X = (x, y, z, t)}

 

_______________________________________________________

 

[coordinatesystems = {X}]

(1)
  

The default metric when Physics is loaded is the Minkowski metric, representing a flat (no curvature) spacetime

g_[];

g_[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(2)
  

Suppose you want to define a small perturbation around this metric. For that purpose, define a perturbation tensor h[mu, nu], that in the general case depends on the coordinates and is not diagonal, the only requirement is that it is symmetric (to have it diagonal, change symmetric by diagonal; to have it constant, change delta[i, j](X) by delta[i, j])

h[mu, nu] = Matrix(4, (i, j) -> delta[i, j](X), shape = symmetric);

h[mu, nu] = (Matrix(4, 4, {(1, 1) = delta[1, 1](x, y, z, t), (1, 2) = delta[1, 2](x, y, z, t), (1, 3) = delta[1, 3](x, y, z, t), (1, 4) = delta[1, 4](x, y, z, t), (2, 1) = delta[1, 2](x, y, z, t), (2, 2) = delta[2, 2](x, y, z, t), (2, 3) = delta[2, 3](x, y, z, t), (2, 4) = delta[2, 4](x, y, z, t), (3, 1) = delta[1, 3](x, y, z, t), (3, 2) = delta[2, 3](x, y, z, t), (3, 3) = delta[3, 3](x, y, z, t), (3, 4) = delta[3, 4](x, y, z, t), (4, 1) = delta[1, 4](x, y, z, t), (4, 2) = delta[2, 4](x, y, z, t), (4, 3) = delta[3, 4](x, y, z, t), (4, 4) = delta[4, 4](x, y, z, t)}))

(3)
  

In the above it is understood that delta[i, j] are small quantities, so that quadratic or higher powers of it can be approximated to 0 (i.e., discarded). Define the components of h[mu, nu] accordingly

Define((3));

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)
  

Define also a tensor eta[mu, nu] representing the unperturbed Minkowski metric

eta[mu, nu] = rhs((2));

eta[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(5)

Define((5));

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(6)
  

The weakly perturbed metric is given by

g_[mu, nu] = eta[mu, nu] + h[mu, nu];

Physics:-g_[mu, nu] = eta[mu, nu]+h[mu, nu]

(7)
  

Make this be the definition of the metric

Define((7));

_______________________________________________________

 

`Coordinates: `[x, y, z, t]*`. Signature: `(`- - - +`)

 

_______________________________________________________

 

Physics:-g_[mu, nu] = Matrix(%id = 36893488152142178892)

 

_______________________________________________________

 

`Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

 

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], h[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(8)
  

The linearized form of the Ricci tensor is computed by introducing this weakly perturbed metric in the expression of the Ricci  tensor as a function of the metric. This can be accomplished in different ways, the simpler being to use the conversion network between tensors, but for illustration purposes, showing steps one at time, a substitution of definitions one into the other one is used

Ricci[definition];

Physics:-Ricci[mu, nu] = Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, mu, alpha], [X])+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, alpha]-Physics:-Christoffel[`~beta`, mu, alpha]*Physics:-Christoffel[`~alpha`, nu, beta]

(9)

Christoffel[~alpha, mu, nu, definition];

Physics:-Christoffel[`~alpha`, mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~beta`]*(Physics:-d_[nu](Physics:-g_[beta, mu], [X])+Physics:-d_[mu](Physics:-g_[beta, nu], [X])-Physics:-d_[beta](Physics:-g_[mu, nu], [X]))

(10)

Substitute((10), (9));

Physics:-Ricci[mu, nu] = Physics:-d_[alpha]((1/2)*Physics:-g_[`~alpha`, `~kappa`]*(Physics:-d_[nu](Physics:-g_[kappa, mu], [X])+Physics:-d_[mu](Physics:-g_[kappa, nu], [X])-Physics:-d_[kappa](Physics:-g_[mu, nu], [X])), [X])-Physics:-d_[nu]((1/2)*Physics:-g_[`~alpha`, `~tau`]*(Physics:-d_[mu](Physics:-g_[tau, alpha], [X])+Physics:-d_[alpha](Physics:-g_[tau, mu], [X])-Physics:-d_[tau](Physics:-g_[alpha, mu], [X])), [X])+(1/4)*Physics:-g_[`~beta`, `~iota`]*(Physics:-d_[nu](Physics:-g_[iota, mu], [X])+Physics:-d_[mu](Physics:-g_[iota, nu], [X])-Physics:-d_[iota](Physics:-g_[mu, nu], [X]))*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[beta](Physics:-g_[lambda, alpha], [X])+Physics:-d_[alpha](Physics:-g_[lambda, beta], [X])-Physics:-d_[lambda](Physics:-g_[alpha, beta], [X]))-(1/4)*Physics:-g_[`~beta`, `~omega`]*(Physics:-d_[mu](Physics:-g_[omega, alpha], [X])+Physics:-d_[alpha](Physics:-g_[omega, mu], [X])-Physics:-d_[omega](Physics:-g_[alpha, mu], [X]))*Physics:-g_[`~alpha`, `~chi`]*(Physics:-d_[nu](Physics:-g_[chi, beta], [X])+Physics:-d_[beta](Physics:-g_[chi, nu], [X])-Physics:-d_[chi](Physics:-g_[beta, nu], [X]))

(11)
  

Introducing the perturbed metric, and the inert form of Ricci for simplification purposes

Substitute((7), Ricci = %Ricci, (11));

%Ricci[mu, nu] = (1/2)*Physics:-d_[alpha](eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`], [X])*(Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X])+Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X])-Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]))+(1/2)*(eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`])*(Physics:-d_[alpha](Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X]), [X])+Physics:-d_[alpha](Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X]), [X])-Physics:-d_[alpha](Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]), [X]))-(1/2)*Physics:-d_[nu](eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`], [X])*(Physics:-d_[mu](eta[alpha, tau]+h[alpha, tau], [X])+Physics:-d_[alpha](eta[mu, tau]+h[mu, tau], [X])-Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]))-(1/2)*(eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`])*(Physics:-d_[mu](Physics:-d_[nu](eta[alpha, tau]+h[alpha, tau], [X]), [X])+Physics:-d_[alpha](Physics:-d_[nu](eta[mu, tau]+h[mu, tau], [X]), [X])-Physics:-d_[nu](Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]), [X]))+(1/4)*(eta[`~beta`, `~iota`]+h[`~beta`, `~iota`])*(Physics:-d_[nu](eta[iota, mu]+h[iota, mu], [X])+Physics:-d_[mu](eta[iota, nu]+h[iota, nu], [X])-Physics:-d_[iota](eta[mu, nu]+h[mu, nu], [X]))*(eta[`~alpha`, `~lambda`]+h[`~alpha`, `~lambda`])*(Physics:-d_[beta](eta[alpha, lambda]+h[alpha, lambda], [X])+Physics:-d_[alpha](eta[beta, lambda]+h[beta, lambda], [X])-Physics:-d_[lambda](eta[alpha, beta]+h[alpha, beta], [X]))-(1/4)*(eta[`~beta`, `~omega`]+h[`~beta`, `~omega`])*(Physics:-d_[mu](eta[alpha, omega]+h[alpha, omega], [X])+Physics:-d_[alpha](eta[mu, omega]+h[mu, omega], [X])-Physics:-d_[omega](eta[alpha, mu]+h[alpha, mu], [X]))*(eta[`~alpha`, `~chi`]+h[`~alpha`, `~chi`])*(Physics:-d_[nu](eta[beta, chi]+h[beta, chi], [X])+Physics:-d_[beta](eta[chi, nu]+h[chi, nu], [X])-Physics:-d_[chi](eta[beta, nu]+h[beta, nu], [X]))

(12)
  

The sign infront of the perturbation in the inverse metric is wrong, it should be minus.

  

This expression contains several terms quadratic in the small perturbation h[mu, nu]. The routine to filter out those terms is Linearize, that takes as second argument the symbol representing the small quantities (perturbation)

Lets look at the metric times inverse in this setup

g_[mu,nu,definition]*g_[~mu,~alpha,definition]

Physics:-g_[mu, nu]*Physics:-g_[`~mu`, `~alpha`] = (eta[mu, nu]+h[mu, nu])*(eta[`~mu`, `~alpha`]+h[`~mu`, `~alpha`])

(13)

Linearize((13),h)

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = eta[mu, nu]*eta[`~alpha`, `~mu`]+eta[mu, nu]*h[`~alpha`, `~mu`]+eta[`~alpha`, `~mu`]*h[mu, nu]

(14)

Simplify(subs(eta=g_,(14)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]+2*h[nu, `~alpha`]

(15)

The result is not correct, left-hand-side does not match right-hand-side, this is because the inverse metric has the wrong. If it were a minus, we would get:

g_[mu, nu]*g_[~alpha, ~mu] = eta[mu, nu]*eta[~alpha, ~mu] - eta[mu, nu]*h[~alpha, ~mu] + eta[~alpha, ~mu]*h[mu, nu]

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = eta[mu, nu]*eta[`~alpha`, `~mu`]-eta[mu, nu]*h[`~alpha`, `~mu`]+eta[`~alpha`, `~mu`]*h[mu, nu]

(16)

Simplify(subs(eta=g_,(16)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]

(17)

Which is correct. The continued calculation from the Help page is below.

 

Linearize((12), h);

%Ricci[mu, nu] = (1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

(18)

 

 

  

In this result, eta[mu, nu] is the flat Minkowski metric. To further simplify this expression using the internal algorithms for a flat metric it is practical to reintroduce g[mu, nu] representing that Minkowski metric

g_[min];

_______________________________________________________

 

`The Minkowski metric in coordinates `*[x, y, z, t]

 

`Signature: `(`- - - +`)

 

_______________________________________________________

 

Physics:-g_[mu, nu] = Matrix(%id = 36893488152069364060)

(19)
  

Replace in the expression for the Ricci tensor the intermediate Minkowski eta[mu, nu]by g[mu, nu]

subs(eta = g_, (18));

%Ricci[mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

(20)
  

Simplifying, results in the linearized form of the Ricci tensor

Simplify((20));

%Ricci[mu, nu] = -(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu](Physics:-d_[tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics:-d_[mu](Physics:-d_[tau](h[nu, `~tau`], [X]), [X])

(21)

This is correct result, because we are going to linear order only the +/- does not have an effect on the end result.


 

Download LinearizedWorksheet-Comments.mw

Download LinearQuestion.mw

I am trying to use the Perm command in the GroupTheory package to create permutations. The problem is when the permutation has fixed points. For example, neither of the forms

[[1,4,7],[2,8,5],[3],[6]]

[[1,4,7],[2,8,5],[3,3],[6,6]]

will work. Any suggestions?

Has anybody seen something like that? I do not use Maple 2026 very often.

Does this vanish when the document is executed on another machine?

 

repeated_equation_labels.mw

Update:

  • expanding the document block by "show command" makes the equation labels disappear.
  • copying the input to another document block seems to fix the problem

Consider these two output, both for solving system of 2 first order different equations.

Why is the first result is put in a list, then each solution is in a set inside the list, while the second one is just a set of the two solutions?

My guess is that because the first system is non-linear.  Is this why?

This makes it little harder to parse the result later on, as it can change each time. 

Is there a way to get same output for the first example as in the second example?

Mapkle 2026.1

ode:=diff(x(t),t) = x(t)^2, diff(y(t),t) = exp(t);
sol:=dsolve([ode],[x(t),y(t)])

ode:=diff(x(t),t) = x(t), diff(y(t),t) = t;
sol:=dsolve([ode],[x(t),y(t)])

ps. the ode's are not even coupled in these example. So each can be solved on its own if needed.

And if there is one ode with multiple solutions, now dsolve returns expression sequence. No set, no list.

ode:=2*x*diff(y(x),x)*diff(diff(y(x),x),x) = -1+diff(y(x),x)^2; 
dsolve(ode,y(x));

This whole thing is a mess. 

There should be one consistent way to return solutions for all cases. 

Regadless if it is one ode with one solution, or one ode with mutliple solutions, or coupled systems of odes, linear or not and so on.

The output should be the same form in all cases. A list of lists or list of sets or whatever it is decided on.

But it should not change.

i do same trasnformation but i don't know what is issue  the result is near to same but parameter (t) appear in my which that make my ode  not be correct so  i can't see the problem in here  and i am intrested in finding this, regarding to this i will put here my result and the papers result rregarding to resolve the issue 

pde1

pde2

 

T1.mw

I was trying to use the debugger into a proc that has this call

P:=plots:-contourplot(RHS,':-colorbar' = false,':-contours' = L):

Even though the proc has : at its end, and the above call to plots also ends with :, the debugger insists in printing to the debugger window the contour cuves lines. i.e the value of P

Is there a way to tell the debugger not to do this? i.e. not show the value of P. It seems it does that automatically.

Here is the worksheet. Simply evaluate the call foo(); this will open a debugger windows. Then click on next button and now debugger will print  the output of plots:-contourplot(RHS,':-colorbar' = false,':-contours' = L): 

restart;

kernelopts('assertlevel'=2):
kernelopts(numcpus=1);

32

interface(version);

`Standard Worksheet Interface, Maple 2026.1, Windows 10, April 28 2026 Build ID 2011354`

foo:=proc()
local L := [$ -4 .. 4]:
local RHS:=y/tan(x):
local P,T:

DEBUG();
P:=plots:-contourplot(RHS,':-colorbar' = false,':-contours' = L):
T:= timelimit(60,plottools:-getdata(P,'rangesonly')):
end proc:

 

foo();  #this will open a debugger window

 

Download hang_maple_2026_1_on_timelimit.mw

Here is screen shot

In my main actual code, the output was so large that it hanged Maple UI when stepping into the debugger and hitting that line.  I had to kill Maple from task manager as Java UI got stuck due to large output.

Why is it showing value of P when I have : at the end? Is there an option to turn automatic display of variables in debugger as one steps in?

I have a rather involved double summation which I am trying to evaluate for various values of the four parameters. Is there a straightforward way that Maple can evaluate this summation?

For example, lambda=nu= +1/2 and/or -1/2 and kappa=mu=1/2 for a start. I would like an expression as a .mw file into which I could put various values and get varying degrees of simplification, rather than trying to do "handraulic" evaluations.

regarsd, RJH

The integral shown in the attached file "test" was posted on another forum for calculation. I unsuccessfully attempted to apply Green's theorem in Maple and—as befits a Maple beginner—failed. Does Maple offer a sequence of commands to carry this out? I would appreciate some advice. If this is possible, I would then tackle the line integral using the residue theorem.

restart

NULL

NULL

 

``

Download test.mw

This is a follow-up question from here concerned with rearraging (not simplifying) an expression for an easier visual comparision.

restart

In a Maple document I want to demonstrate (easier to follow from the output without the knowledge of Maple commands) that the following expression

expr := sqrt(2)/(sqrt(-beta^2+1)*sqrt(2+(-x-1)*beta^2))

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

(1)

can visually match the integrand of this ellpitic integral

FunctionAdvisor(definition, EllipticF)

[EllipticF(z, k) = Int(1/((-_alpha1^2+1)^(1/2)*(-_alpha1^2*k^2+1)^(1/2)), _alpha1 = 0 .. z), MathematicalFunctions:-`with no restrictions on `(z, k)]

(2)

This can be done with following substitution

x = 2*k^2-1

x = 2*k^2-1

(3)

subs(x = 2*k^2-1, 2^(1/2)/((-beta^2+1)^(1/2)*(2+(-x-1)*beta^2)^(1/2)))

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

(4)

simplify(2^(1/2)/((-beta^2+1)^(1/2)*(-2*beta^2*k^2+2)^(1/2)))

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

(5)

Since the substitution comes without explanation, I though about rearranging expression (1) by Maple commands in a way that facilitates visual pattern matching.
How to collect the factor 1+x in (1) leading to  sqrt(2)/(sqrt(-beta^2+1)*sqrt(2-(1+x)*beta^2))

It looks as one would write by hand.

 

At a glance, this much easier suggest that k^2 = (1+x)*(1/2).

Download Collect_one_plus_x_-_02.mw

(Maple 2025.2 only for easier editing. Results are the same with Maple 2026)

Original Post - Collect_one_plus_x.mw

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

I am implementing the Fokas (unified transform) method for the heat equation on a finite interval [0,1]. The solution is expressed as a contour integral in the complex k-plane and I evaluate it numerically in Maple.

When I call plot3d I get the following error, even though approx_u(0.5, 0.1)

Is there a way to make plot3d work? Any help appreciated.

restart; with(plots)

V := exp(-k^2*t)*((-4*k*(sin(k*x)/exp(1)+sin(k*(1-x)))*(k^2-1))*(1/((k^2+1)*(k^4+1))))/((2*Pi)*(exp(I*k)-exp(-I*k)))

-2*exp(-k^2*t)*k*(sin(k*x)/exp(1)+sin(k*(1-x)))*(k^2-1)/(Pi*(exp(I*k)-exp(-I*k))*(k^2+1)*(k^4+1))

(1)

L := 3/4; k1 := proc (r) options operator, arrow; L+(3/4)*I+r*exp(((1/6)*I)*Pi) end proc; k2 := proc (r) options operator, arrow; -L+(3/4)*I+r*exp(((5/6)*I)*Pi) end proc; k3 := proc (s) options operator, arrow; s+(3/4)*I end proc; dk1 := D(k1); dk2 := D(k2); dk3 := D(k3)

3/4

 

proc (r) options operator, arrow; L+(3/4)*I+r*exp(((1/6)*I)*Pi) end proc

 

proc (r) options operator, arrow; -L+(3/4)*I+r*exp(((5/6)*I)*Pi) end proc

 

proc (s) options operator, arrow; s+(3/4)*I end proc

 

proc (r) options operator, arrow; exp(((1/6)*I)*Pi) end proc

 

proc (r) options operator, arrow; exp(((5/6)*I)*Pi) end proc

 

1

(2)

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

approx_u(.5, .1)

.6536368264

(3)

``

forget(`evalf/int`); forget(evalf); CodeTools:-Usage(plot3d(approx_u, 0 .. 1, 0 .. 2*Pi, grid = [10, 10], axes = boxed, labels = ["x", "t", "u(x,t)"], title = "Fokas Method of solution", shading = zhue))

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

 

memory used=14.27GiB, alloc change=-16.00MiB, cpu time=92.96s, real time=88.85s, gc time=8.99s

 

 

 

Download heat_equation_on_finte_interval.mw

Any one knows a trick to help Maple obtain this much simpler solution to this ode obtained using AI?

ode := 4*(-1 + sqrt(1 - 1/x^2)*x^2)*sec(4 + 4*x + 4*arccsc(x))^2 - sqrt(1 - 1/x^2)*x^2*diff(f(x), x) = 0

ode:= 4*(-1 + sqrt(1 - 1/x^2)*x^2)*sec(4 + 4*x + 4*arccsc(x))^2 - sqrt(1 - 1/x^2)*x^2*diff(f(x), x) = 0;

4*(-1+(1-1/x^2)^(1/2)*x^2)*sec(4+4*x+4*arccsc(x))^2-(1-1/x^2)^(1/2)*x^2*(diff(f(x), x)) = 0

maple_sol:=dsolve(ode);

f(x) = c__1+Int(8*(-1+(1-1/x^2)^(1/2)*x^2)*x^6/((1-1/x^2)^(1/2)*(-8*((x^2-1)/x^2)^(1/2)*x^7*sin(8+8*x)+x^8*cos(8+8*x)+x^8+80*((x^2-1)/x^2)^(1/2)*x^5*sin(8+8*x)-32*x^6*cos(8+8*x)-192*((x^2-1)/x^2)^(1/2)*x^3*sin(8+8*x)+160*x^4*cos(8+8*x)+128*((x^2-1)/x^2)^(1/2)*x*sin(8+8*x)-256*cos(8+8*x)*x^2+128*cos(8+8*x))), x)

odetest(maple_sol,ode);

0

AI_sol:=f(x)=_C1+tan(4*(1+x+arccsc(x)));

f(x) = c__1+tan(4+4*x+4*arccsc(x))

odetest(AI_sol,ode)

0

 

 

Download AI_sol.mw

given

ode:=2*x^(1/2)*diff(y(x),x)-y(x) = -sin(x^(1/2))-cos(x^(1/2)); 
ic:=y(infinity) = y__0; 
sol:=dsolve([ode,ic]);

It gives  

This solution satisfies the ode itself. Now cos(sqrt(x)) when x=infinity is  -1..+1

But IC says y(infinity)=y0  so odetest do not verify the IC and gives this

odetest(sol,[ode,ic]);

I think dsolve should not have returned a solution at all. 

What do the experts here think of this result?

Maple 2026.1 on windows 10

I'm trying to rewrite my initialization routines a bit, and want to find out if there are any other procedures with a certain name that should be called.
However there seems to be a problem with the scope. I'm trying to explain that with a little program.

The question is - why is InitSpecific not found by the InitCommon procedure here?

Module1 := module()

 

``

Module2 := module()

Module1:-InitCommon()

"false"

(1)

Module2:-InitSpecific()

"InitSpecific"

(2)

NULL

Download InitCommon.mw

The uploaded worksheet references two youtube videos.

The first one displays the animation of a simple device rotating about an axis tilted at a small angle from the device's principal axis having an intermediate moment of inertia.

The animation and accompanying verbal description demonstrate the Dzhanibekov effect.
The second video contains the first video's narrator's equations which produce the values used in creating the animation.

The uploaded worksheet contains my failed attempt to reproduce these values.

Please suggest the Maple 2020 compatible statements which correctly produce these values.

Dzhanibekov_effect.mw

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