Items tagged with evaluation


It is possible to display something like:

4 + 3 = x - 1

without Maple actually adding the 4 and 3 and putting that as a 7?


Same idea with sqrt. Is it possible to write sqrt(9) in a worksheet and actually seeing it as square root of 9 rather than a 3. Maple automatically simplifies everything so it's kinda hard to show a step by step process. Is there a way to solve this problem?

To be clear, I am talking about typing this into an active worsheet line. I know I can do a lot of this if I just do text becuase text lines obviously don't execute. They just display text. The reason I need to have this working is becuase sometimes I would have a command line where I want some of it to be excuted and some of it not so I can't just use text.

Thank you


Hello people in mapleprimes,


I wonder if there is not any way to control the timing of substitution.

For  example,


brings mu := c^(a-b)/x. Please note that I made x unevaluated with '' around x, so that,

into the output of mu, the definition of x of (t^(1-s)+s^(1-2*s))^a does not appear.

But, in this case, when I typed the expression of


and clicked return, the definition of x is inserted into the result of 1+m, though

I want x to remain x yet.

Surely, if I wrote ''x'' in stead of 'x', 1+mu does not contain the definition of x.

But, in that case as well, when I have other following calculations, in those the definition 

of x should apear, which I don't like.


On the other hand, when I write as

x:=(t^(1-s)+s^(1-2*s))^a; x:='x';
mu:=c^(a-b)/x; 1+m;

surely as x is initialized once, the result of mu and 1+mu does not cotain the definition of x.

But, in this case, I have to write x:=(t^(1-s)+s^(1-2*s))^a; when I want the definition of x

to be inserted. Though in this case the definition of x is short, original relations I have and

haven't writen above is a little more complicated, so that to insert is not desiable.


Aren't there any good way to evaluate the value of particular variables and to leave them

unevaluated at each time I want to choose each one?


I hope I could have written my question as easly understood.

And, thanks in advance.






It's funny how Maple automatically evaluates an expression, it can be frustrating at times, but suppose the user wants it entered the way he types.


                   - sin ( 4 + Phi)  #automatically evaluates the negative outside


                   - sin (-x -y -z + Phi)


Even though both expressions are the same it seems Maple prefers -sin to +sin, in the second example above Maple has now 3 extra negatives. 

Is all we need just a double set of single quotes around our expression so that when we recall that variable it returns exactly how we entered it in?

b:= ''sin(x+y+z-Phi)''

           b:= ' sin(x+y+z-Phi) '



      sin( x + y + z - Phi)


Would that work?  Where would that fail?  Is there a better way?

When using seq function below in the second call, it does not generate a sequence of functions with 'a' being 1, 2, and 3, and I had expected. 

First seq function call is just to show that it works without the function "x ->" wrapping.

I could of couse use unapply as in the third call, but I had expected the second call to work.

Am I doing anything wrong, or is this a Maple bug?

No need to hurry, esthetics is not a vital issue ... but thanks in advance.

PS : sorry for the syntax errors "waves" generated in the original Word document

Doing the following:

Why is int used when defining F not evaluated to x^2/2 when used to defined function F as shown in (2), when the int is evaluated when used separately in (3)?

I have lots of subsections for organization and have all the outputs at the end...  is there any way to force all/any sections/subsections to remain closed while the whole page is being evaluated? I still want the section to evaluate, but I want it to stay closed.

Is there a help page which explains why braces provide the partial text evaluation in this code?

RopeLen := 30;RopeAddLen := .5;

plots[textplot]([1, 1, typeset("%1", (({(1/2)*RopeLen}+{(1/2)*RopeAddLen})^2-{(1/2)*RopeLen}^2)^(1/2))])

Hello everyone,

I'm working on a simulation for standing wave to prove that the combination of 2 waves in opposite direction can create standing wave. So I use these:

> restart;
> with(plots):
> W1:=A*cos(omega*t-k*x);

> W2:=A*cos(omega*t+k*x);

> W:=W1+W2;

> SW:=(A,omega,k)->animate(plot,[{W1,W2,W},x=-4..4,y=-4..4,color=[red,green,blue],scaling=constrained],t=0..5,frames=10);

> display(SW(2,2*Pi,5),insequence);

It did work if SW is a function with one variable, now I need 3 variables (A,omega,k);

It said: "Plotting error, empty plot"

Please show me my mistake or an another method. Thank you

I have this matrix


uA := Matrix([[-w^2+x^2+y^2-z^2, -2*(w*y+x*z), 2*(-w*x+y*z)], [2*(-w*y+x*z), w^2+x^2-y^2-z^2, -2*(w*z+x*y)], [2*(w*x+y*z), 2*(-w*z+x*y), -w^2+x^2-y^2+z^2]])

and I would like to evaluate the variables like this


x = -x, y = -y, z = -z, w = -w

I tried this

Eval(uA, x = -x, y = -y, z = -z, w = -w)

but it didnt work.


Any suggestions??


Thank you so much



Hi!! i am working on assignment.

h:= x-> (x^17-x*sin(x^16))/x^49+exp(sqrt(x+8))*ln(abs((cos^4*(x)-5)));


i want to find the value of the h(10)

i use eval , but it comes out a function, not a solution.!!

I have been here before...  My head is full of cotton, as usual.


f := proc (t) 2*t^3+9*t^2-60*t+1 end proc;
df := t->deq;  ## this is most likely one of my problems.
isneg := x -> if is(df(x) < 0) then df(x) else 0 end if;  ## and, another??

The if statement is not fully evauated.

I am missing something.  What?

Tom Dean

Hi everyone,

I have a great problem with the evaluation of following definite integral

> restart;

> int((t-x)^2)/(1+2t+(1/2)t^2-ln(t^2+2t+2)t-ln(t^2+2t+2)+arctan(1+t)t^2+2arctan(1+t)t+ln(2)t+ln(2)-(pi/4)t^2-(pi/2)t)^2,t=0..x)

I have tried different classical commands but Maple doesn't give an answer. Probably, it's just a silly fault.

Does anyone knows how to solve it?


I have this (which finds each Fourier term of a sequence)

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*Pi/n *(k*m)),m=0..n-1);
end proc;

Now I call it as


and it returns

So it evaluated and convert the exp(-I * 2*Pi/n *(k*m)) terms. I wanted to keep these as is, so I can compare result with textbook. Then do simplify if I wanted to above output. 

I can do that if I use small pi instead of large Pi, like this

term := proc(lst,k::integer)
    local n;
    n := nops(lst);     
    seq(lst[m+1]*exp(-I * 2*pi/n *(k*m)),m=0..n-1);
end proc;

and now r:=term([1,2,3],1); return

Which is what I wanted, but with Pi instead of pi.  now how would I evaluate the above?

I tried to use subs to replace small pi with large Pi, but it does not work

subs(pi=Pi,r); #error

Then I tried eval, which worked


So, I can use the above method.

My question is: Is the above a common way to handle such case? Is there another way to use Pi but at the same time prevent Maple from automatic simplification of the exp() terms?







  I have the following code for using "PolynomialSystem" solve equations of polynomial




f:=PolynomialSystem({x+y-3, x^2+y^2-5}, {x, y}):




The output is


x, y
{x = 2, y = 1}, {x = 1, y = 2}
{x = 2, y = 1}
{x = 1, y = 2}
x = 2
y = 1
x = 2, y = 1
-x = -2.
-y = -1.


From what I have seen, I cannot subtract the values of x and y as 2 and 1. Is there any way that I can get the values of solutions of variables, namely I can assign a variable "a" as 2, and the other variable "b" as 1?


Thank you very much!





1 2 3 Page 1 of 3