Question 1

> f:=x->x^3*exp(3*x)*cos(2*x);

f := proc (x) options operator, arrow; x^3*exp(3*x)...

> a1:=(D@@3)(f)(1);

a1 := 96*exp(3)*cos(2)-190*exp(3)*sin(2)

> a2:=evalf(a1);

a2 := -4272.527272

Question 2

> restart;

> f:=x->x^3*exp(3*x)*cos(2*x);

f := proc (x) options operator, arrow; x^3*exp(3*x)...

> a1:=int(f(x),x=0..1);

a1 := 4068/28561*cos(2)*exp(3)+1178/28561*sin(2)*ex...

> a2:=evalf(a1);

a2 := -.4622331277

Question 3

> restart;

> g(x):=exp(a*x)*cos(b*x);

g(x) := exp(a*x)*cos(b*x)

> a1:=taylor(g(x),x=0,8);

a1 := series(1+a*x+(1/2*a^2-1/2*b^2)*x^2+(-1/2*a*b^...
a1 := series(1+a*x+(1/2*a^2-1/2*b^2)*x^2+(-1/2*a*b^...

> a2:=op(15,a1);

a2 := -1/240*a^5*b^2+1/5040*a^7+1/144*a^3*b^4-1/720...

Question 4

> a3:=subs(a=cos(Pi/14),b=sin(Pi/14),a2);

a3 := -1/240*cos(1/14*Pi)^5*sin(1/14*Pi)^2+1/5040*c...

> combine(a3);

0

Question 5

> restart;

> f:=(exp(x)-exp(sin(x)))/x^3;

f := (exp(x)-exp(sin(x)))/(x^3)

> limit(f,x=0);

1/6

Question 6

> h:=x->2-cos(x)+sin(x)-exp(x);

h := proc (x) options operator, arrow; 2-cos(x)+sin...

> Digits:=10; h(10.0^(-10));

Digits := 10

0.

> Digits:=20; h(10.0^(-10));

Digits := 20

0.

> Digits:=30; h(10.0^(-10));

Digits := 30

0.

> Digits:=40; h(10.0^(-10));

Digits := 40

-.333333334e-30

> Digits:=50; h(10.0^(-10));

Digits := 50

-.3333333333416666667e-30

> Digits:=60; h(10.0^(-10));

Digits := 60

-.33333333334166666666666666667e-30

Question 7

> restart;

> fsolve(x^5-x-1/2=0);

-.7690997032, -.5506065793, 1.098331302

Question 8

> restart;

> with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> A:=matrix(4,4,[2.0,0,-1,1,0,2,0,1,0,-2,2,-2,2,-1,0,1]);

A := matrix([[2.0, 0, -1, 1], [0, 2, 0, 1], [0, -2,...

> ev:=eigenvects(A);

ev := [1.272947203+1.144006781*I, 1, {vector([-.231...
ev := [1.272947203+1.144006781*I, 1, {vector([-.231...
ev := [1.272947203+1.144006781*I, 1, {vector([-.231...
ev := [1.272947203+1.144006781*I, 1, {vector([-.231...
ev := [1.272947203+1.144006781*I, 1, {vector([-.231...
ev := [1.272947203+1.144006781*I, 1, {vector([-.231...

> ev[4][1];ev[4][3][1];

.7342055864

vector([-.5175567314, -.7745298108, .3252750932, .9...

Question 9

> restart; with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> A:=matrix(3,3,[a,1,1,1,1,1,1,1,1]);

A := matrix([[a, 1, 1], [1, 1, 1], [1, 1, 1]])

> ev:=eigenvals(A);

ev := 0, 1/2*a+1+1/2*sqrt(a^2-4*a+12), 1/2*a+1-1/2*...

> expand(ev[2]*ev[3]);

2*a-2

Question 10

> restart; with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> v:=vector([sqrt(t)*cos(t),sqrt(t)*sin(t),t]);

v := vector([sqrt(t)*cos(t), sqrt(t)*sin(t), t])

> w:=map(p->diff(p,t),v);

w := vector([1/2*cos(t)/(sqrt(t))-sqrt(t)*sin(t), 1...

> am:=dotprod(w,w,orthogonal);

am := 1+(1/2*cos(t)/(sqrt(t))-sqrt(t)*sin(t))^2+(1/...

> an:=factor(simplify(am));

an := 1/4*(2*t+1)^2/t

> sqrt(an);

1/2*sqrt((2*t+1)^2/t)

=====================================================================

Question 1

> restart;

> f1:=x->sin(x) ; f2:=x->c*x*exp(-x);

f1 := sin

f2 := proc (x) options operator, arrow; c*x*exp(-x)...

> e1:= f1(a)=f2(a); e2:= D(f1)(a)=D(f2)(a);

e1 := sin(a) = c*a*exp(-a)

e2 := cos(a) = c*exp(-a)-c*a*exp(-a)

> subs(c=solve(e1,c),e2);

cos(a) = sin(a)/a-sin(a)

> plot({cot(a),1/a-1},a=0..2*Pi,-4..4,discont=true);

[Maple Plot]

> plot({cot(a),1/a-1},a=0..0.4,-4..40,discont=true);

[Maple Plot]

> sol1:=fsolve({e1,e2},{a,c},a=1..3);

sol1 := {a = 2.042786943, c = 3.362500905}

> sol2:=fsolve({e1,e2},{a,c},a=4..6);

sol2 := {c = -31.68467277, a = 5.396016118}

> f:=piecewise(x<a,f1(x),f2(x));

f := PIECEWISE([sin(x), x < a],[c*x*exp(-x), otherw...

> plot(subs(sol1,f),x=-10..20);

[Maple Plot]

> plot(subs(sol2,f),x=-10..20);

[Maple Plot]

Question 2

> restart;

> with(linalg):

Warning, the protected names norm and trace have been redefined and unprotected

> B:=matrix(3,3,[1,2,-2*s,6+s,3,1,1,-1,2]);

B := matrix([[1, 2, -2*s], [6+s, 3, 1], [1, -1, 2]]...

> p1:=charpoly(B,lambda);

p1 := lambda^3-6*lambda^2+15-14*s-2*s^2

> p2:=diff(p1,lambda);

p2 := 3*lambda^2-12*lambda

B has two eqaul eigenvalues when if lambda=0 or 4. What does this mean for s?

> s1:=solve( subs(lambda=0,p1), s);

s1 := -7/2-1/2*sqrt(79), -7/2+1/2*sqrt(79)

> s2:=solve( subs(lambda=4,p1), s);

s2 := -7/2-1/2*sqrt(15), -7/2+1/2*sqrt(15)

> eigenvects( map( p->subs(s=s1[1],p) , B) );

[6, 1, {vector([-1/3+1/3*sqrt(79), -13/3+1/3*sqrt(7...

> eigenvects( map( p->subs(s=s1[2],p) , B) );

[6, 1, {vector([-1/3-1/3*sqrt(79), -13/3-1/3*sqrt(7...

> eigenvects( map( p->subs(s=s2[1],p) , B) );

[-2, 1, {vector([-3-1/5*sqrt(15), 1-1/5*sqrt(15), 1...

> eigenvects( map( p->subs(s=s2[2],p) , B) );

[-2, 1, {vector([1, -3/7-2/21*sqrt(15), -5/14-1/42*...

The geometric multiplicity is always 1, even for the eigenvalue with algebraic multiplicity 2.

>

Question 3

> restart;

> Digits:=1005;

Digits := 1005

> p:=evalf(sin(1));

p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...
p := .841470984807896506652502321630298999622563060...

> for i from 1 to 1000 do p:=p*10: d[i]:=floor(p): p:=p-d[i]: od:

>

> for n from 0 to 9 do

> q[n]:=0:

> for j from 1 to 1000 do if(d[j]=n) then q[n]:=q[n]+1 fi: od:

> print(q[n]); od:

112

107

101

90

88

97

106

93

101

105

Question 4

> restart;

> with(plots):

Warning, the name changecoords has been redefined

> implicitplot(x^4+y^4=1,x=-1.5..1.5,y=-1.5..1.5);

[Maple Plot]

> implicitplot(x^2+y^2=4/3,x=-1.5..1.5,y=-1.5..1.5);

[Maple Plot]

> implicitplot({x^2+y^2=4/3,x^4+y^4=1},x=-1.5..1.5,y=-1.5..1.5);

[Maple Plot]

> sol1:=fsolve({x^2+y^2=4/3,x^4+y^4=1},{x,y},x=-0.8..1,y=0.5..0.8);

sol1 := {x = .9499310119, y = .6564787930}

> sol2:=fsolve({x^2+y^2=4/3,x^4+y^4=1},{x,y},y=-0.8..1,x=0.5..0.8);

sol2 := {x = .6564787930, y = .9499310119}

I am not expecting the students to do the next bit......

If we work in polar coordinates r,theta we have r^2=4/3 and r^4 (sin^4 theta + cos^4 theta) = 1. So r = sqrt(4/3) and

sin^4 theta + cos^4 theta = 9/16. so (1-cos^2 theta)^2 + cos^4 theta = 9/16. Let's find cos theta:

> ct:=solve((1-c^2)^2+c^4=9/16 , c);

ct := -1/4*sqrt(8+2*sqrt(2)), 1/4*sqrt(8+2*sqrt(2))...

For each value of cos theta there are two values of sin theta. So we get 8 points. For example

> c:=1/4*sqrt(8+2*sqrt(2)): pt:=( sqrt(4/3)*c, sqrt(4/3)*sqrt(1-c^2));

pt := 1/6*sqrt(3)*sqrt(8+2*sqrt(2)), 1/6*sqrt(3)*sq...

> evalf(pt);

.9499310119, .6564787938

> I1:=int((1-x^4)^(1/4)-(4/3-x^2)^(1/2), x=pt[2]..pt[1]);

> evalf(I1);

==================================================================================================

>