# Note: this is for Maple 5.5. In Maple 5.4 replace # the percentage sign % by the quotation mark " # 1. length(1000!); # 2. evalf(exp(1),50); # or: Digits:=50; evalf(exp(1)); # 3. expand(cos(Pi/6)); evalf(%); expand(ln(2*e)); expand(arctan(sqrt(3)+2)); # 4. ifactor #5. h:=(x^5-3*x^4-4*x^3-11*x^2+6*x-11)/(x^5-5*x^4+4*x^3-x^2+5*x-4); f:=numer(h); g:=denom(h); d:=gcd(f,g); quo(f,d,x); quo(g,d,x); # or normal(f/d); normal(g/d); normal(h); convert(h,'parfrac',x); #6. f:=exp(-x^2); diff(f,x); int(ln(x),x); diff(h,x); int(h,x); #7. taylor(sin(x),x=0,10); taylor(exp(x),x=0,20); f:=1/(1-x-x^2); taylor(f,x=0,20); # coeffs = fibonacci numbers. #8. solve(a*x^2+b*x+c, {x}); fsolve(x^8+x^3-x^2-1,x); fsolve(x^8+x^3-x^2-1,x,complex); #9. A:=matrix(4,4,[1,0,1,0,1,1,1,1,0,1,1,1,0,0,0,1]); B:=matrix(4,4,[1,0,1,0,1,1,1,1,0,1,1,1,1,0,0,1]); with(linalg); det(A); det(B); evalm(A^(-1)); # or inverse(A); evalm(A &* B); # Note: in Maple the asterisk * is always # a commutative multiplication, so for # matrix multiplication we need &* #10. A:=matrix(4,4,[x,seq(i,i=2..15),y]); solve( det(A) ); #11. A:=matrix(4,4,[-12,12,4,0,4,4,4,4,-40,4,4,4,21,0,0,4]); evalm(A^4); charpoly(A,lambda); #12. N:=4; A:=matrix(N,N,[seq(seq( (x.i)^j ,j=0..N-1),i=0..N-1)]); # A is a Vandermonde matrix. Note that if x.i = x.j # then A has two equal rows and hence then det(A)=0. So # (x.i-x.j) must be a factor of det(A) for all i <> j. factor(det(A)); #17. `iszero?`:=4*arctan(1/5)-arctan(1/239)-Pi/4; evalf(`iszero?`); # close to 0. expand(sin(`iszero?`)); # result: 0. Hence `iszero?` is # a multiple of Pi, furthermore it is very close to zero # hence it can only be 0. #19. p:=5; matrix(p-1,p-1,[seq(seq(i*j mod p,i=1..p-1),j=1..p-1)]); matrix(p-1,p-1,[seq(seq(i/j mod p,i=1..p-1),j=1..p-1)]); #20. F:=proc(n::nonnegint) options remember; if n<2 then 1 else F(n-1)+F(n-2) fi end; FF:=proc(n::nonnegint) expand( ( ((1+sqrt(5))/2)^(n+1) - ((1-sqrt(5))/2)^(n+1) )/sqrt(5)) end: