4993 Reputation

15 Badges

9 years, 212 days

MaplePrimes Activity

These are answers submitted by tomleslie

The problem with sqrt(5) is that it is either 2.236067977 or -2.236067977: so when you ask - is 2<sqrt(5), what is the correct answer. You can generally circumvent this problem by using sqrt(5.0), when (by default) the positive square root will be returned - so


returns unevaluated, because sqrt(5) is ambiguous. However


returns 0

Since you choose to post unexecutable "pictures" of code, rather than the code itself, it is pretty much impossible to debug what you claim to get from your code - and some of it surprises me. However if you just want to check what sort of code actually works, then try the following

delta[1]:= Vector(3, [1,0,0]);
delta[2]:= Vector(3, [0,1,0]);
delta[3]:= Vector(3, [0,0,1]);
Eq3:= delta[1].delta[1], delta[1].delta[2], delta[1].delta[3],
          delta[2].delta[1], delta[2].delta[2], delta[2].delta[3],
          delta[3].delta[1], delta[3].delta[2], delta[3].delta[3];
Eq4:= add( add( delta[i].delta[j], j=1..3), i=1..3);

If you wish to debug your specific code, then I suggest you upload it using the big green up-arrow in the toolbar

There are lots and lots of very clever ways to make information/procedures/data etc available across multiple worksheets, but I am assuming that you want the simplest, which (I think) is

  1. understandable
  2. works

I have tried to keep the following as simple as possible - sophistication can come later!!!

Suppose you define a procedure to produce the square of its supplied argument, then you can define and save this procedure with the following code sequence

dosq:= proc( x)
                  return x*x;
           end proc;
save dosq, "C:/Users/TomLeslie/dosq.mpl";

In any new worksheet you can load this procedure with

read "C:/Users/TomLeslie/dosq.mpl";

and execute in the new worksheet with (for example)


which ought to return 16

Note that where I use the path "C:/Users/TomLeslie/", you should use something appropriate for your machine, and where you want ro store your Maple procedures - If you have a single-disk machine then


would be a reasonable choice

You make the statement

The collect command is supposed to rewrite the expression in terms of the variable descending order.

This is incorrect. The help page for the collect command states quite clearly (my highlighting)

The collect function views a as a general polynomial in x.  It collects all the coefficients with the same rational power of x.  This includes positive and negative powers, and fractional powers.  Note that the resulting expression is not necessarily sorted by powers of x.

As the help page for the collect command clearly states

To sort a polynomial see the sort function.

So try the following

p := expand((a^2+2*x)*(a^2+2*x));

to see the difference. Note that, for more complicated expressions

sort( collect(p, x), x)

may be useful


a1 := Matrix(3, [1, 2, 3, 7, 8, 9, 13, 14, 15]);
a2 := Matrix(3, 2, [5, 6, 11, 12, 17, 18]);
a3 := Matrix(2, [19, 20, 25, 26]);
a4 := Matrix(3, 2, [5, 6, 11, 12, 17, 18]);
A := eval(Matrix(2, 2, ['a1', 'a2', 'a3', 'a4']));

Seems to be a lot of confusion for such a simple problem?!?!

Simply execute either of the following code snippets to get the answer you want

evalf(Tangent(-ln(x)+exp(x), x=2));


evalf(Tangent(f(x), x=2));

and read the help page for Student[Calculus1])[Tangent] to understand why both/either work.

If you really want only three significant figures, then modify the above, using a second argument to the evalf() command, to

evalf(Tangent(-ln(x)+exp(x), x=2), 3);


evalf(Tangent(f(x), x=2), 3);

I mean, how hard can this be??????

You got really unlucky!!

There seem to be two commands for plotting a space curve (whihc surprised me!!

  1. plots[spacecurve]( [list of components], range=whatever )
  2. Student[VectorCalculus][SpaceCurve](<cos(t),sin(t),t>,t=1..5,axes=framed)

Note the differences in capitalisation of the term spacecurve between these two, and lso the fact that the first takes a list of components eg [cos(t), sin(t), t] and the second takes a vector of components <cos(t), sin(t), t>

You seem to have used the first of these - ie plots[spacecurve] but with the vector form for the corrdinates rather than the list!!

See that attached for both ways

It seems as if the default axes and colour option for these two commands are different

For future reference you can upload worksheets using the big green up-arrow in the toolbar.

Several syntax errors, and usages of deprecated structures,so  that I have difficulty working out what you actually want. Whilst making the minimum(?) number of changes to your original code, the following produces something - which may (or may not be) what you want.

Your code seems for complicated for what you are trying to achieve, but since I don't actually understand what you are trying to achieve.....

Go to Tools->Options->Display and set input display to Maple Notation,

followed by Apply to Session or Apply Globally

I think you have a problem with parentheses - your plot range 0..100 is included in a ist with functions to be plotted becuase of the positioning of your square brackets. The following is a trivial example of two plots, which does work

plot([Y2(t),-X2(t)], t=0...100, numpoints=100);

  1. You have missed the multiplication sign between 'p' and '(4x2+6)' - one of the perils of using 2D math input is that this sort of thing is difficult to spot
  2. Once you correct the above, your loop will only return non-zero values for n=1, because your 'polynomial' only contains terms in p^1

see attached

dsolve(eq, x(t));

cos it works for me

Try this



Using default (ie cubic) spline curve fitting, the following works

  xlist:= [150, 250, 500, 800, 1300, 2500, 5000]:
  ylist:= [.3, .5, .8, 1.0, 1.2, 1.4, 1.6]:
# Define a function to retiurn y-value for given x
  gety:= unapply( Spline([seq([xlist[j], ylist[j]], j=1..7)], x), x):
# Define a function to retiurn x-value for given y
  getx:= unapply( Spline([seq([ylist[j], xlist[j]], j=1..7)], y), y):
# Compute the y-value for say x=3000
# Check that previous result corresponds to the supplied x-value
# (near enough!)

Not sure I understand the problem - if I change your final command to

CodeTools:-Usage( plot([f1,u21], 0..10, adaptive=false, axes=none, numpoints=200,labels=[x,u],legend=["t=0","t=0.2"],color=[green,red]) )

then two curves are plotted -one of which shows that your "double integral" is more or less identically zero.

So what exactly is your issue???

First 102 103 104 105 106 107 108 Last Page 104 of 112