



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to the first maple assignment given by professor gabel, focusing on calculating the slope of the tangent line to the graph of y = sin(x) at the point (pi/4, sin(pi/4)). The maple code and explanations for each problem.
Typology: Assignments
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Full Name = ******************* Is my social security number prime? Digits := 10
> ifactor(347365545); type(347365545,prime); ( 3 ) ( 5 ) ( 23157703 ) false
> f:=x->sin(x);plot(f(x),x=0..Pi); f :=sin
> tan_line:=plot(cos(Pi/4)(x-Pi/4)+sin(Pi/4),x=- 1..2.5,color=black,thickness=3):* > curve:=plot(f(x),x=0..Pi):horiz:=plot(-0.5,x=-1..3,color=blue): vert:=plot([2,t,t=-1..2],color=blue): p1:=pointplot([2,1.55],symbol=diamond,symbolsize=20): p2:=pointplot([2,-0.5],symbol=diamond,symbolsize=20): p3:=pointplot([-0.93,-0.5],symbol=diamond,symbolsize=20): > with(plots):plotsdisplay ; Warning, the name changecoords has been redefined
> rise_over_run:=(1.55-(-0.5))/(2-(-0.93));
rise_over_run :=.
This could also be done with a loop, but this is not required. The above individual computatons are just fine. But, here is the loop version:
> for n from 1 to 11 do h:=1/(10^n): > print("when h is",h," the slope of the secant line is ",evalf(secant_line(h))) > end do:
"when h is" , , ,
10 " the slope of the secant line is "^.
"when h is" , , ,
" the slope of the secant line is ".
"when h is" , , ,
" the slope of the secant line is ".
"when h is" , 1 , , 10000
" the slope of the secant line is ".
"when h is" , , ,
100000 " the slope of the secant line is "^.
"when h is" , , ,
1000000 " the slope of the secant line is "^.
"when h is" , , ,
" the slope of the secant line is ".
"when h is" , 1 , , 100000000
" the slope of the secant line is ".
"when h is" , , ,
1000000000 " the slope of the secant line is "^ 1.
"when h is" , , ,
10000000000 " the slope of the secant line is "^ 3.
"when h is" , , ,
" the slope of the secant line is " 30.
Well, this table of slopes of the secant lines is actually rather strange. Because things seemed to be settling down to something around 0.707, but then the slopes began moving away from .707 and got as large as 1 then 3 and then 30. Frankly, this list does not seem very helpful in estimating the slope of the tangent line. Something looks wrong or fishy here. So, I'd have to say that I cannot use these values to estimate the slope of the tangent line.
Here is what I think is going on. I bet there is round off errors. I remember that this happened in lecture and when Professor Gabel increased the accuracy of Maple with the command Digits:=30, we got much better results. I think I'll try that, but to answer the
question (5) directly, this list of 11 values appears to be of no use. OK - here goes with Digits:=30: > Digits:=30; Digits := 30
> for n from 1 to 11 do h:=1/(10^n): > print("when h is",h," the slope of the secant line is ",evalf(secant_line(h))) > end do:
"when h is"
, 10 ," the slope of the secant line is "
.
"when h is"
, 100 ," the slope of the secant line is "
.
"when h is" 1 1000
, ," the slope of the secant line is "
.
"when h is" 1 10000
, ," the slope of the secant line is "
.
"when h is"
, ," the slope of the secant line is "
.
"when h is"
, 1000000 ," the slope of the secant line is "
.
"when h is"
, 10000000 ," the slope of the secant line is "
.
"when h is"
, 100000000 ," the slope of the secant line is "
.
"when h is"
, 1000000000 ," the slope of the secant line is "
.
"when h is" 1 10000000000
, ," the slope of the secant line is "
.
"when h is"
, ," the slope of the secant line is "
.