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); |
| (1.1) |
| > | g:=-x*cos(x)+sin(x); |
| (1.2) |
| > | h:=diff(f,x); |
| (1.3) |
| > | i:=diff(g,x); |
| (1.4) |
| > | with(plots): |
| > | p1:=plot(f,x=-5..5,color=red); |
| (1.5) |
| > | p2:=plot(g,x=-5..5,color=orange); |
| (1.6) |
| > | p3:=plot(h,x=-5..5,color=blue); |
| (1.7) |
| > | p4:=plot(i,x=-5..5,color=brown); |
| (1.8) |
| > | display(p1,p2,p3,p4); |
![]() |
| > |
Problem 2
| > | fsolve(f=g,x,-5..0); |
| (2.1) |
| > | fsolve(f=g,x,0..5); |
| (2.2) |
| > |
Problem 3
| > | z:=sqrt(1-(cos(x))^2)/x; |
| (3.1) |
| > | Limit(z,x=0,right); |
| (3.2) |
| > | evalf(%); |
| (3.3) |
| > | Int(z,x=0..1); |
| (3.4) |
| > | evalf(%); |
| (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; |
| (4.1) |
| > | nonsense(2); |
| (4.2) |
| > | nonsense(11); |
| (4.3) |
| > |