Maple Exam 1 

Answer Key 

 

The solutions shown here are representative. There may be other methods to solve the problems. 

>
 

Problem 1 

> f:=x*sin(x)+cos(x);
 

`+`(`*`(x, `*`(sin(x))), cos(x)) (1.1)
 

> g:=-x*cos(x)+sin(x);
 

`+`(`-`(`*`(x, `*`(cos(x)))), sin(x)) (1.2)
 

> h:=diff(f,x);
 

`*`(x, `*`(cos(x))) (1.3)
 

> i:=diff(g,x);
 

`*`(x, `*`(sin(x))) (1.4)
 

> with(plots):
 

> p1:=plot(f,x=-5..5,color=red);
 

PLOT(CURVES([[-5., -4.51095918785246575], [-4.89101422916666628, -4.63551587069341586], [-4.78202845833333346, -4.70085434150373693], [-4.75832147421875007, -4.70738647346096339], [-4.7346144901041666... (1.5)
 

> p2:=plot(g,x=-5..5,color=orange);
 

PLOT(CURVES([[-5., 2.37723520197926996], [-4.89101422916666628, 1.85310895590633295], [-4.78202845833333346, 1.33032501151987193], [-4.68720052187499991, .881631915665253118], [-4.59237258541666638, .... (1.6)
 

> p3:=plot(h,x=-5..5,color=blue);
 

PLOT(CURVES([[-5., -1.41831092731613140], [-4.89101422916666628, -.869020071774684100], [-4.78202845833333346, -.332748860157257076], [-4.68720052187499991, .118050871885741440], [-4.59237258541666638... (1.7)
 

> p4:=plot(i,x=-5..5,color=brown);
 

PLOT(CURVES([[-5., -4.79462137331569238], [-4.97275355729166613, -4.80515280766494346], [-4.94550711458333314, -4.81173509506152097], [-4.91826067187500015, -4.81440257186125731], [-4.8910142291666662... (1.8)
 

> display(p1,p2,p3,p4);
 

Plot_2d
 

>
 

Problem 2 

> fsolve(f=g,x,-5..0);
 

-3.660297082 (2.1)
 

> fsolve(f=g,x,0..5);
 

1.863729558 (2.2)
 

>
 

Problem 3 

> z:=sqrt(1-(cos(x))^2)/x;
 

`/`(`*`(`^`(`+`(1, `-`(`*`(`^`(cos(x), 2)))), `/`(1, 2))), `*`(x)) (3.1)
 

> Limit(z,x=0,right);
 

Limit(`/`(`*`(`^`(`+`(1, `-`(`*`(`^`(cos(x), 2)))), `/`(1, 2))), `*`(x)), x = 0, right) (3.2)
 

> evalf(%);
 

1.000000000 (3.3)
 

> Int(z,x=0..1);
 

Int(`/`(`*`(`^`(`+`(1, `-`(`*`(`^`(cos(x), 2)))), `/`(1, 2))), `*`(x)), x = 0 .. 1) (3.4)
 

> evalf(%);
 

.9460830704 (3.5)
 

>
 

Problem 4 

> nonsense:=proc(x) local y;
 

> if x<=10 then y:=x^2;
 

> else y:=10*x;
 

> end if;
 

> return y;
 

> end proc;
 

proc (x) local y; if `<=`(x, 10) then `:=`(y, `*`(`^`(x, 2))) else `:=`(y, `+`(`*`(10, `*`(x)))) end if; return y end proc
proc (x) local y; if `<=`(x, 10) then `:=`(y, `*`(`^`(x, 2))) else `:=`(y, `+`(`*`(10, `*`(x)))) end if; return y end proc
proc (x) local y; if `<=`(x, 10) then `:=`(y, `*`(`^`(x, 2))) else `:=`(y, `+`(`*`(10, `*`(x)))) end if; return y end proc
(4.1)
 

> nonsense(2);
 

4 (4.2)
 

> nonsense(11);
 

110 (4.3)
 

>