Maple: Slope of Tangent Line to y=sin(x) at x=Pi/4, Assignments of Analytical Geometry and Calculus

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

Pre 2010

Uploaded on 02/10/2009

koofers-user-1fb-1
koofers-user-1fb-1 🇺🇸

9 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SOLUTION to First Maple Assignment - Professor Gabel - 25 points total
restart;Digits:=10;[This is required.]
Full Name = *******************
Is my social security number prime?
:= Digits 10
> ifactor(347365545);
type(347365545,prime);
()3()5( )23157703
f
alse
(1) [5 points] Using Maple, plot the function y=sin(x) from 0 to Pi.
> f:=x->sin(x);plot(f(x),x=0..Pi);
:=
f
sin
pf3
pf4
pf5

Partial preview of the text

Download Maple: Slope of Tangent Line to y=sin(x) at x=Pi/4 and more Assignments Analytical Geometry and Calculus in PDF only on Docsity!

SOLUTION to First Maple Assignment - Professor Gabel - 25 points total

restart;Digits:=10;[This is required.]

Full Name = ******************* Is my social security number prime? Digits := 10

> ifactor(347365545); type(347365545,prime); ( 3 ) ( 5 ) ( 23157703 ) false

(1) [5 points] Using Maple, plot the function y=sin(x) from 0 to Pi.

> f:=x->sin(x);plot(f(x),x=0..Pi); f :=sin

(2) [2 points] On your actual graph, above, draw [with a pencil] as best you

can the line that is tangent to the graph of y=sin(x) at the point (p/4, sin(p/4).

Note: p/4=0.785… and sin(p/4)=0.707….

Here is the tangent line drawn with maple. To do this, I'm using that the

slope of the sine function is the cosine function. YOUR paper should be doing

this by hand, with a pencil, and would thus just be an estimate of the tangent

line. The commands with(plots) and plots[display] are more flexible than just

plot, for it allows you to mix several types of graphs.

> 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

(3) [3 points] Estimate the slope of this line by computing the value of the

fraction "rise" over "run" between two points on the line.

> 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.

(5) [5 points] Based on this table, what would you estimate to be slope of the

line that is tangent to the graph of y=sin(x) at the point (p/4, sin(p/4)?

Explain.

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 "

.