HW 2
HW 2
HW 2
Q1
a)
x:= t-> 2*sin(t); y:= t-> 3*cos(t)*sin(t);
(1)
A:=plot([x(t),y(t),t=0..2*Pi],color=black,thickness=2,color=
black):
B:=plot([x(t),y(t),t=0..2*Pi],filled=true,color=gray):
with(plots): display(A,B,scaling=CONSTRAINED);
1 2
b)
plot([x(t),y(t),t=0..Pi/2],color=black,thickness=2,color=black);
1
1 2
(4)
evalf(arcL);
15.39249064 (5)
Q2
a)
restart: r:= theta -> piecewise(theta>=0 and theta<Pi/4, 2*sin
(theta),
theta>=Pi/4 and theta<3*Pi/4,sin(theta)+
cos(theta));
(6)
r(theta);
(7)
(7)
with(plots): polarplot('r(theta)',theta=0..3*Pi/4,thickness=2,
numpoints=1000);
2
4 4
0
0
4 4
2
b)
Area:=1/2*int(r(theta)^2,theta=0..3*Pi/4);
(8)
Q3
a)
restart: f:=x-> ln(x^3 + 1);
(9)
psM:=convert(f(x),FormalPowerSeries,x=0);
(10)
b)
a:=k->(-1)^k*x^(3*k+3)/(k+1);
(11)
ratio:=simplify(abs(a(k+1)/a(k)));
(12)
L:=limit(ratio,k=infinity);
(13)
solve(L<1,x);
(14)
subs(x=-1,psM): %=value(%);
(15)
So the series diverges at x=-1
subs(x=1,psM): %=value(%);
(16)
c)
p:=series(f(x),x=0,4);
(17)
p3:=convert(p,polynom);
(18)
d)
plot([f(x),p3],x=-1..1,y=-2..1,color=[ orange,blue],linestyle=
[1,3],thickness=2);
1
1
y x
Q4
a)
restart: with(plots):
g:= (x,y)-> (x^4 * y^2)/(x^2 +1);
(19)
Int(g(x,y),x=-sqrt(4-y^2)..sqrt(4-y^2),y=0..2): %=value(%);
(20)
area1:= int(g(x,y),x=-sqrt(4-y^2)..sqrt(4-y^2),y=0..2):
b)
implicitplot(x^2 +y^2=4,x=-2..2,y=0..2,color=black,thickness=2,
view=[-2.5..2.5,0..2.5],scaling=CONSTRAINED,grid=[600,600]);
2
y 1
0 1 2
x
c)
bpolar:=simplify(subs([x=r*cos(theta),y=r*sin(theta)],g(x,y) ));
(21)
Int(bpolar*r,r=0..2,theta=0..Pi): %=value(%);
(22)
area2:= int(bpolar*r,r=0..2,theta=0..Pi):
area1-area2;
0 (23)
The area in (a) is the same as the area in (c).
Q5
a)
restart: f:= (x,y)-> y^2/2 + (3-x)^2/2;
(24)
(25)
with(linalg): gradf:=grad(f(x,y),[x,y]);
(26)
v:=[2,2]; u:=normalize(v);
(27)
Du:=dotprod(gradf,u);
(28)
x0:=-1; y0:=3;
(29)
DuP:=subs([x=x0,y=y0],Du);
(30)
evalf(%);
(31)
b)
with(plots):
plot3d([f(x, y),0], x = abs(y) .. 4, y = -4 .. 4,gridstyle=
triangular,axes=boxed,thickness=1,style=WIREFRAME,color=[gold,
gray]);
c)
fx:=diff(f(x,y),x); fy:=diff(f(x,y),y);
(32)
SurfaceArea:=sqrt(fx^2+fy^2+1);
(33)
Int(SurfaceArea, x=abs(y)..4, y=-4..4): %=evalf(value(%));
(34)