MaplePrimes Questions

I want to create a variable that is made up of a letter and an arrow on top. How to do that?

Also, how can I create a variable that is bold? I tried to type it as bold and then assign. But when I hit return it returns a normal symbol.

How to distinguish between a scalar variable and a vector variable in Maple?


I want to solve a differential equation and plot the particle densities versus the distance.

How can I do this in Maple?


Suppose I want to calculate gcd(g(x),f(x))=a(x)f(x)+b(x)g(x) for two polynomial, i.e finding the RHS representation of the gcd, then how to implement this in maple?

I know of the command GCD(f(x),g(x)) but how to find the RHS representation?


Many formulas use a capital D to define parameters. A popular example is the second moment of area "I" of a tube. In Maple we get

Both I and D are protected symbols in Maple and are therefore printed in roman. With the "local" command, I and D can be used as unprotected symbols. However, only the unprotected "I" is printed in italic (like other symbols or names do). D is still printed in roman, which spoils Maple's excellent printout (a bit).

I hope this inconsistency can be improved one day. For the time being, I am looking for better alternatives than my workaround with a fat white space in the attachment. Are there better workarounds?

primes_integrale_exp.mwThe integral in x of 

exp(-sqrt(x^2 + c))

was done by Maple 11 but return unevaluated in Maple 2021,

see attached worksheet 

I am trying to solve the equation in the attached Maple file, but Maple cannot return a result.



Digits := 30




[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]




say the f(x) is a Beta with parameters alpha and beta


alpha := 10



beta := 100000




proc (x) options operator, arrow, function_assign; Statistics:-PDF(BetaDistribution(alpha, beta), x) end proc



piecewise(x < 0, 0, x < 1, x^9*(1-x)^99999/Beta(10, 100000), 0)



semilogplot(PDF(BetaDistribution(alpha, beta), x), x = 0 .. 1)



fsolve(int(f(x), x = 0 .. y) = .1, y = 0 .. 1)


On a shared cluster with 32 CPU cores, how do I limit Maple (called from the Linux command line) to use only 8 cores? (Certain built-in operations in Maple are parallelized by default.)

I try to sove the equation x^2-10*y^2=9 with tne procedure : 
genpellsolve := proc(D::posint, N::integer)
local t, u, L1, L2, sols, x, y;
if type(sqrt(D), integer) then error "D must be a nonsquare integer"; end
if; t, u := pellsolve(D); if 0 < N then L1 := 0;
L2 := floor(sqrt(1/2*N*(t - 1)/D)); elif N < 0 then L1 := ceil(sqrt(-N/D));
L2 := floor(sqrt(-1/2*N*(t + 1)/D)); else return {[0, 0]}; end if;
sols := {}; for y from L1 to L2 do x := sqrt(N + D*y^2);
if type(x, integer) then sols := sols union {[x, y]};
if (x^2 + D*y^2) mod N <> 0 or (2*x*y) mod N <> 0 then sols := sols union {[-x, y]};
end if;
end if;
end do;  return sols;
end proc:
This procedudure fails; I don't see why. Thank you for your help.

I upgraded to Maple 2022 and some of my old sheets from Maple 2021 don't work anymore. When I plot a histogram with a legend I get an error saying: Error, invalid input: Statistics:-Histogram expects value for keyword parameter legend to be of type list, but received data set 1.

OK so maybe Histogram changed in 2022 although I didn't think it did. I ran it in Maple 2021 and I received no such error message. I chose to comply with the error message and the plot is output without an error message, however the legend labels carry extra characters I don't want to be there.  My attempt at a solution was to first use square brackets to make the object a list, then use the typeset command to typeset the label.  Strangely, the typeset command was not recognized.

What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string which I have done many times in the past. I have attached below, a maplesheet which explicitly shows the problematic behaviour.









Define Random Variable

X := RandomVariable(Normal(1, 2))



Sample that variable and plot a histogram.

s := Sample(X, 1000)


Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It want's it defined in a list as requested in the pink error message.

Histogram(s, legend = "data set 1")

Error, invalid input: Statistics:-Histogram expects value for keyword parameter legend to be of type list, but received data set 1




Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It works fine in Maple 2021. Maple 2022, want's it defined in a list. This works but, the square brackets and quotation marks appear when I don't want them to. The legend shouldn't have these extra quotations and brackets, just the desired name.

Histogram(s, legend = ["data set 1"], size = [300, 300])


I tried the typeset command. It doesn't seem to be recognized anymore.


Histogram(s, legend = [typeset("data set 1")], size = [300, 300])


What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string.   


I want to solve a system of 3 simple real linear odinary differential equations.

The solution using dsolve has some extra imaginary terms with very small (10^-10) coefficients.   How to I get just the real part of the solution.

Here is an example code:

v1 := 1;
v2 := 0.5;
k := 0.12;
p1 := 0.328;
p2 := 0.74;
l1 := 0.31;
l2 := 1.16;
sysode := diff(Cp(t), t) = -(p1 + p2 + k)*Cp(t) + l1*C1(t) + l2*C2(t), diff(C1(t), t) = (p1*Cp(t) - l1*C1(t))/v1, diff(C2(t), t) = (p2*Cp(t) - l2*C2(t))/v2;
ics := Cp(0) = 0.347, C1(0) = 0., C2(0) = 0.;
sol := convert(dsolve([sysode, ics]), float);

Hello everybody!! Can you please help me figure it out. I wrote the code, but for some reason I have an infinite loop going on, it counts normally to the cycle, as the cycle reaches, then everything is infinite

f:=unapply(2*x-4*cos(x)-0.6,x); #the equation itself
f1:=unapply(diff(f(x),x),x); #its derivative
a:=-0.5; b:=1.5; eps:=0.001: #interval and accuracy
phi:=unapply((4*cos(x)-0.6)/2,x); #solving the equation with respect to x
x[0]:=1; #I take any point from the interval
while abs(evalf(x[n]-x[n-1])) > eps do


I'm trying to solve a coupled inductor problem.  All I'm trying to do is solve for the currents (which I could do), then solve for resonance by setting the imaginary part of I1 to 0 and solving for omega.  I then want to plug this resonant frequency back into I1 and evaluate it for some component values and coupling coefficient.

The problem is that even though I define the various variables as real,  Maple doesn't seem to recognize them as such.  I suspect I've failed to define one of them, and that is why it is responding like it is, but I can't find it.  

I'm also getting some weird behavior.....for example if I type :  wres0, I get the value I assigned to it --that's fine.  But then, when I type : wres0/(2*pi), I get an error, "Error, unable to parse 'mverbatim"   --- what does this mean?

This should be a pretty straight forward calculation on Maple, but at this point, I think I may be better off doing it by hand!  I appreciate any help you can provide.  Thank you.

Hello :)

So what I was trying to find Galois group for quartic polynomials in a form f=x^+a_3*x^3+a_2*x^2+a_1*x+a_0, where 0<=a_i<=2 and a_0 <>0. I get polynomials and galois groups - that's not an issue. Lets say I specifically need polynomials with group D_4 so I run script

A := {seq(0 .. 2)};
A0 := A minus {0};
m := numelems(A)^3*(numelems(A) - 1);
a := Iterator:-CartesianProduct(A0, A $ 3);
s := seq(x^4 + add(v[i]*x^(i - 1), i = 1 .. 4), v = a);
for k to m do
if irreduc(s[k]) = 'true' then print(f[k] = s[k], galois(s[k])); end if end do;

This one gives all list of polynomalias and their galois group.

for k to m do
    if irreduc(s[k]) = 'true' then if galois(s[k]) = ("4T3", {"D(4)"}, "-", 8, {"(1 3)", "(1 2 3 4)"}) then print(f[k] = s[k], galois(s[k])); end if; end if;
end do;

This one gives me a list of D_4 specifically. 
When 0<=a_i<=2 - there are not many polynomials so I cant count it by hand, but if I make a sequence larger there are too many polynomials to count them manually. So the question is how to count how many polynomials there are with a group D_4? Or lets say how do I count how many polynomials are in each group?
Thank you

First 87 88 89 90 91 92 93 Last Page 89 of 2195