hw 2.mws

Experiments with Two-by-Two Matrices

1.show that trace of AB= trace of BA

> A:=Matrix([[a,b],[c,d]]);

A := _rtable[13715836]

> B:=Matrix([[p,q],[r,s]]);

B := _rtable[13719436]

> A.B;

>

_rtable[13721444]

> B.A;

_rtable[13723436]

> A.B-B.A;

_rtable[13728548]

>

2.show that (AB-BA)(AB-BA) is scalar

>

> (A.B-B.A).(A.B-B.A);

_rtable[11683524]
_rtable[11683524]
_rtable[11683524]
_rtable[11683524]

>

> expand(((b*r-c*q)^2+(a*q+b*s-p*b-q*d)*(c*p+d*r-r*a-s*c))-((a*q+b*s-p*b-q*d)*(c*p+d*r-r*a-s*c)+(c*q-b*r)^2));

0

>

3.find all matrices commuting with [[1,0][0,2]]

>

> C:=Matrix([[1,0],[0,2]]);

C := _rtable[13734740]

> A.C-C.A;

_rtable[13736740]

>

4.show that A^(-1)BA can never be diagonal

>

>

> A^(-1).B.A;

_rtable[13740772]
_rtable[13740772]
_rtable[13740772]

> expand((d*p/(a*d-b*c)-b*r/(a*d-b*c))*b+(d*q/(a*d-b*c)-b*s/(a*d-b*c))*d);

b*d*p/(a*d-b*c)-b^2*r/(a*d-b*c)+d^2*q/(a*d-b*c)-d*b...

> expand((-c*p/(a*d-b*c)+a*r/(a*d-b*c))*a+(-c*q/(a*d-b*c)+a*s/(a*d-b*c))*c);

-a*c*p/(a*d-b*c)+a^2*r/(a*d-b*c)-c^2*q/(a*d-b*c)+c*...

>

show that there is no real invertible matrix A with A^(-1)[[1,0],[1,1]]A triangular

>

>

> E:=Matrix([[1,0],[1,1]]);

E := _rtable[13742948]

> A^(-1).E.A;

_rtable[7921368]

> expand((d/(a*d-b*c)-b/(a*d-b*c))*b-b*d/(a*d-b*c));

-b^2/(a*d-b*c)

>

> expand((-c/(a*d-b*c)+a/(a*d-b*c))*a+a*c/(a*d-b*c));

a^2/(a*d-b*c)

Spreadsheet in Maple

1.use the spreadsheet in Maple to experiment with the 3x+1 problem

> restart;

> f:=x-> if x mod 2=0 then x/2 else 3*x+1 fi;

f := proc (x) options operator, arrow; if `mod`(x,2...

> f(3);

10

> f(10);

5

>

>

23
70
35
106
53
160
80
40
20
10
5
16
8
4
2
1
4
2
1
4
2
1
4
2
1
4
2
1
4
2

1.How is the number pattern related to the

> restart;

tan(x) u
1+tan(x)^2 1+u^2
2*tan(x)+2*tan(x)^3 2*u+2*u^3
2+8*tan(x)^2+6*tan(x)^4 2+8*u^2+6*u^4
16*tan(x)+40*tan(x)^3+24*tan(x)^5 16*u+40*u^3+24*u^5
16+136*tan(x)^2+240*tan(x)^4+120*tan(x)^6
16+136*tan(x)^2+240*tan(x)^4+120*tan(x)^6
16+136*u^2+240*u^4+120*u^6
272*tan(x)+1232*tan(x)^3+1680*tan(x)^5+720*tan(x)^7...
272*tan(x)+1232*tan(x)^3+1680*tan(x)^5+720*tan(x)^7...
272*u+1232*u^3+1680*u^5+720*u^7
272+3968*tan(x)^2+12096*tan(x)^4+13440*tan(x)^6+504...
272+3968*tan(x)^2+12096*tan(x)^4+13440*tan(x)^6+504...
272+3968*u^2+12096*u^4+13440*u^6+5040*u^8
272+3968*u^2+12096*u^4+13440*u^6+5040*u^8
7936*tan(x)+56320*tan(x)^3+129024*tan(x)^5+120960*t...
7936*tan(x)+56320*tan(x)^3+129024*tan(x)^5+120960*t...
7936*tan(x)+56320*tan(x)^3+129024*tan(x)^5+120960*t...
7936*u+56320*u^3+129024*u^5+120960*u^7+40320*u^9
7936*u+56320*u^3+129024*u^5+120960*u^7+40320*u^9
7936+176896*tan(x)^2+814080*tan(x)^4+1491840*tan(x)...
7936+176896*tan(x)^2+814080*tan(x)^4+1491840*tan(x)...
7936+176896*tan(x)^2+814080*tan(x)^4+1491840*tan(x)...
7936+176896*u^2+814080*u^4+1491840*u^6+1209600*u^8+...
7936+176896*u^2+814080*u^4+1491840*u^6+1209600*u^8+...

3.How is the number pattern related to the sucessive derivatives of cot(x) formed?

>

cot(x) v
-1-cot(x)^2 -1-v^2
2*cot(x)+2*cot(x)^3 2*v+2*v^3
-2-8*cot(x)^2-6*cot(x)^4 -2-8*v^2-6*v^4
16*cot(x)+40*cot(x)^3+24*cot(x)^5 16*v+40*v^3+24*v^5
-16-136*cot(x)^2-240*cot(x)^4-120*cot(x)^6
-16-136*cot(x)^2-240*cot(x)^4-120*cot(x)^6
-16-136*v^2-240*v^4-120*v^6
272*cot(x)+1232*cot(x)^3+1680*cot(x)^5+720*cot(x)^7...
272*cot(x)+1232*cot(x)^3+1680*cot(x)^5+720*cot(x)^7...
272*v+1232*v^3+1680*v^5+720*v^7
-272-3968*cot(x)^2-12096*cot(x)^4-13440*cot(x)^6-50...
-272-3968*cot(x)^2-12096*cot(x)^4-13440*cot(x)^6-50...
-272-3968*v^2-12096*v^4-13440*v^6-5040*v^8
-272-3968*v^2-12096*v^4-13440*v^6-5040*v^8
7936*cot(x)+56320*cot(x)^3+129024*cot(x)^5+120960*c...
7936*cot(x)+56320*cot(x)^3+129024*cot(x)^5+120960*c...
7936*cot(x)+56320*cot(x)^3+129024*cot(x)^5+120960*c...
7936*v+56320*v^3+129024*v^5+120960*v^7+40320*v^9
7936*v+56320*v^3+129024*v^5+120960*v^7+40320*v^9
-7936-176896*cot(x)^2-814080*cot(x)^4-1491840*cot(x...
-7936-176896*cot(x)^2-814080*cot(x)^4-1491840*cot(x...
-7936-176896*cot(x)^2-814080*cot(x)^4-1491840*cot(x...
-7936-176896*v^2-814080*v^4-1491840*v^6-1209600*v^8...
-7936-176896*v^2-814080*v^4-1491840*v^6-1209600*v^8...

4.Express tan(nx) as a rational function of tan(x) for n=1,2,3,4,5,6

>

1 tan(x) tan(x)
2 tan(2*x) 2*tan(x)/(1-tan(x)^2)
3 tan(3*x) (3*tan(x)-tan(x)^3)/(1-3*tan(x)^2)
4 tan(4*x) (4*tan(x)-4*tan(x)^3)/(1-6*tan(x)^2+tan(x)^4)
5 tan(5*x) (5*tan(x)-10*tan(x)^3+tan(x)^5)/(1-10*tan(x)^2+5*ta...
6 tan(6*x) (6*tan(x)-20*tan(x)^3+6*tan(x)^5)/(1-15*tan(x)^2+15...

5.Study the number pattern associated with the indefinite integral of the function x^ne^x

>

>

1 x*exp(x) x*exp(x)-exp(x)
2 x^2*exp(x) x^2*exp(x)-2*x*exp(x)+2*exp(x)
3 x^3*exp(x) x^3*exp(x)-3*x^2*exp(x)+6*x*exp(x)-6*exp(x)
4 x^4*exp(x) x^4*exp(x)-4*x^3*exp(x)+12*x^2*exp(x)-24*x*exp(x)+2...
x^4*exp(x)-4*x^3*exp(x)+12*x^2*exp(x)-24*x*exp(x)+2...
5 x^5*exp(x) x^5*exp(x)-5*x^4*exp(x)+20*x^3*exp(x)-60*x^2*exp(x)...
x^5*exp(x)-5*x^4*exp(x)+20*x^3*exp(x)-60*x^2*exp(x)...
6 x^6*exp(x) x^6*exp(x)-6*x^5*exp(x)+30*x^4*exp(x)-120*x^3*exp(x...
x^6*exp(x)-6*x^5*exp(x)+30*x^4*exp(x)-120*x^3*exp(x...

6.list the Chebyshev polynomials Tn(x) for n = 0,1,2,3,4,5,6

>

0 1 1
1 cos(x) cos(x)
2 cos(2*x) 2*cos(x)^2-1
3 cos(3*x) 4*cos(x)^3-3*cos(x)
4 cos(4*x) 8*cos(x)^4-8*cos(x)^2+1
5 cos(5*x) 16*cos(x)^5-20*cos(x)^3+5*cos(x)
6 cos(6*x) 32*cos(x)^6-48*cos(x)^4+18*cos(x)^2-1