Document

>
22M16 Fall 05 J. Simon
Solutions for sample Final Exam problems
Problem 1
> f:=x^2-3*x+9/x+1;
9
+1
x
2
f := x - 3 x +
> dfdx=diff(f,x);
dfdx = 2 x - 3 -
9
2
x
> subs(x=3,%);
dfdx = 2
Problem 2
> Int(4*x+1/x^2,x=1..2);
2
ó
ô
1
ô 4 x + 2 dx
ô
x
õ1
> value(%);
13
2
Problem 3
> f:=x^3;
3
f := x
> AverageValue:=(1/(b-a))*Int(f,x=a..b);
b
AverageValue :=
ó
3
ô
ô x dx
ô
õa
> subs(a=1,b=3,AverageValue);
3
ó
3
1ô
ô x dx
2ô
õ1
b-a
> value(%);
10
Problem 4
> f:=(x/(x+y))-(x/(x-y));
f :=
x
x
x+y x-y
> subs(x=4,y=-2,f);
4
3
Problem 5
> X:=[2,3,4];
X := [2, 3, 4]
> Y:=[-1,0,1];
Y := [-1, 0, 1]
> dist:=sqrt((Y[1]-X[1])^2+(Y[2]-X[2])^2+(Y[3]-X[3])^2);
dist := 3 3
> answer:=sqrt(27);
answer := 3
3
Problem 6
> z:=x-y^2;
2
z := x - y
> with(plots):
Warning, the name changecoords has been redefined
> contourplot(z, x=-2..2, y=-2..2, color=black, thickness=2);
Problem 7
> plot3d([x,y,x+sin(y)], x=-2..2, y=-2..2, style=hidden, color=black,
axes=boxed, labels=[x,y,'z'], tickmarks=[3,3,3]);
Problem 8
(Note typo - says df/dy, should be dz/dy)
> z:=exp(x)*cos(x)*y^2;
x
2
z := e cos(x) y
> dzdy:=diff(z,y);
x
dzdy := 2 e cos(x) y
> answer:=subs(x=0,y=3,dzdy);
0
answer := 6 e cos(0)
> simplify(answer);
6
>
Problem 9
> f:=x^2+x*y+1/y^3;
2
f := x + x y +
1
3
y
> fx:=diff(f,x);
fx := 2 x + y
> fy:=diff(f,y);
3
fy := x -
4
y
> answer:=subs(x=2,y=1,fx-fy);
answer := 6
Problem 10
> f:=x^2+y^2+x*y-4*x-2*y+5;
2
2
f := x + y + x y - 4 x - 2 y + 5
> dfdx:=diff(f,x);
dfdx := 2 x + y - 4
> dfdy:=diff(f,y);
dfdy := 2 y + x - 2
> eqns:={dfdx=0,dfdy=0};
eqns := {2 x + y - 4 = 0, 2 y + x - 2 = 0}
> solve(eqns,{x,y});
{x = 2, y = 0}
> answer:=subs(x=2,y=0,f);
answer := 1
Problem 11
> f:=x^2+x*ln(y);
2
f := x + x ln(y)
> fx:=diff(f,x);
fx := 2 x + ln(y)
> fy:=diff(f,y);
fy :=
x
y
> fxx:=diff(fx,x);
fxx := 2
> fyy:=diff(fy,y);
fyy := -
x
2
y
> fxy:=diff(fx,y);
fxy :=
1
y
> CheckAccuracy:=fyx=diff(fy,x);
CheckAccuracy := fyx =
1
y
> Discriminant:=fxx*fyy-fxy^2;
Discriminant := -
2x 1
2
2
y y
> answer:=subs(x=0,y=1,Discriminant);
answer := -1
End of sample problems.