355 Reputation

8 Badges

8 years, 361 days

MaplePrimes Activity

These are questions asked by digerdiga

How can I quickly construct a lower triangular matrix?

I tried the following:


n := 4;

M1 := Matrix(Vector([seq(k, k = 1 .. n)]), shape = diagonal);

M2 := Matrix(Vector([seq(1, k = 1 .. n-1)]), shape = diagonal);

M := Matrix([M1, M2], shape = triangular[lower])




In this case the diagonal has value 1,2,3,4 while the line below 1,1,1.


edit: Actually I managed with

M := Matrix([[1], seq([seq(0, i = 1 .. k-2), 1, k], k = 2 .. n)], shape = triangular[lower])




but I was wondering if it is also possible to use Matrices to fill parts of a bigger matrix?

Is it possible to use the diff(f,x) operator together with @@ ??

So as in


-> (x*diff(f,x))@@2 which is of course wrong, but I guess you know what I mean.

In the first case maple evaluates ((x*D)@@1)(x) to x(x)*D(x), but of course x(x) is nonsense here, as x is the variable, so x(anything)=x and D(x) should also be reduced to 1. Is it not possible to tell D that x is the differentiation variable?


Probably I could make rules like


but that seems rather cumbersome.

Much simpler would it be to tell maple in the first place how D and x precisely act.


1 .

If A and B are non-commuting operators and I want to calculate

(A+B)^n for some integer n, how can I tell maple to not commute them?



And if I have this operator construct A^3. How can I replace it with some defined function f, so A^3 becomes (f@@3)(...)

I have this expression which I want to integrate numerically, but it is exponentially slow. I tried methods like _d01ajc but it does not help.



f2 := proc (m) options operator, arrow;

evalf(Int(exp(-(2*m-4)*exp(t)+t*(m+1))*(t-2*exp(t)), t = 0 .. infinity))

end proc;


plot([f2], 3 .. 10)

How come there is an imaginary value in the result?


int(exp(-t)/(1-t), t = 0 .. infinity, CauchyPrincipalValue = true)

4 5 6 7 8 9 10 Last Page 6 of 25