## 355 Reputation

8 years, 361 days

## Quickly constructing lower triangular ma...

Maple 2015

How can I quickly construct a lower triangular matrix?

I tried the following:

restart;

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?

## Calculating n times the differential Ope...

Maple 2015

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

So as in

((x*D)@@2)(f)(x)

-> (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

applyrule(x(a::anything)=x,expression)

but that seems rather cumbersome.

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

## Ordering of Operators...

Maple 2018

Hello,

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?

2.

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)(...)

## Numerical Integration very slow...

Maple 2015

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.

restart;

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)

## wrong symbolic integration ?...

Maple

How come there is an imaginary value in the result?

restart;

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

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