> with(LinearAlgebra): > dsolve({# diff is the differentiation function > diff(y1(t), t) = 4*y1(t) - 2*y2(t), > diff(y2(t), t) = 1*y1(t) + 1*y2(t) > }, > {# must list unknowns as functions in t > y1(t), y2(t)} > ); > {y1(t) = _C1 exp(3 t) + _C2 exp(2 t), y2(t) = 1/2 _C1 exp(3 t) + _C2 exp(2 t)} # Note that the solution given in class is different because I used a # different scalar multiple of the eigenvector corresponding to # eigenvalue 3. However, my y_2(t) is a linear combination of the above # solution: 3*y1(t) - 2*y2(t). > dsolve({# diff is the differentiation function > diff(y1(t), t) = 3*y1(t) + 4*y2(t), > diff(y2(t), t) = 3*y1(t) + 2*y2(t), > # initial conditions are additional equations > y1(0) = 6, y2(0) = 1}, > {# must list unknowns as functions in t > y1(t), y2(t)} > ); > {y1(t) = 4 exp(6 t) + 2 exp(-t), y2(t) = 3 exp(6 t) - 2 exp(-t)} > exp(2*Pi*I); 1 > dsolve({diff(y1(t), t) = y2(t), > diff(y2(t), t) = -y1(t), > y1(0) = 1, y2(0) = 0 > },{y1(t), y2(t)} > ); > # {y1(t) = cos(t), y2(t) = -sin(t)} > Eigenvalues(Matrix([[0,1],[-1,0]])); [I ] [ ] [-I] >