WeBWorK Problems

Variable in a matrix:why is 'x' ok but not 't'?

Variable in a matrix:why is 'x' ok but not 't'?

by Jack Dockery -
Number of replies: 2
I am trying to use the variable t instead of x in the matrix $M below and can't seem to figure out how to do so and I am not sure why 'x' works. Any help would be great.

## DBchapter(Operation calculus)
## Level(3)



$S = Matrix([[Compute(random(4,6)),0,0],
$M = Matrix(["e^(x*$s11)",0,0],

Recall that
[`` e^{t} = 1 + t + \frac{t^2}{2!} + \frac{t^3}{3!}+\cdots ``]

With this it seems reasonable to define
[`` e^{Ax} = I + xA + \frac{(xA)^2}{2!} + \frac{(xA)^3}{3!}+\cdots ``]
where [` x `] is a scalar.

Suppose that [` A `] is diagonlizable with eigenvalues [` \lambda_1=[$s11], \lambda_2=[$s22], \lambda_3=[$s33]`] so that
[` A `] is given by
[``A = W [$S] W^{-1}``]
where the columns of [` W `] are the eigenvectors of [` A `]: [` v_1, v_2, v_3 `].

Check to see that
[` (x A)^n = W \left[ \begin{array}{ccc}
([$s11] x)^n & 0 & 0 \\
0 & ([$s22] x)^n &0 \\
0 & 0 & ([$s33] x)^n
\right] W^{-1} `]

Given that, what is:
[``e^{xA} = W``][____]*{$M}[``W^{-1}?``]


In reply to Jack Dockery

Re: Variable in a matrix:why is 'x' ok but not 't'?

by Alex Jordan -
Hi Jack,

When you load a context (Context("Matrix")) the context has a set of variables that can be used. This is how it parses some string that a student or the problem-writer uses. It needs to distinguish variables from constants from function names, etc. By default, "x" is often the only variable that comes with a context. But you can add more with a line like:


or replace the allowed variables, like:


The 'Real' is because you can have variables that take Complex or other values too.

Put one of these lines after declaring the Matrix context, but before making a matrix that uses "t".