Math185\_Lab\_03\_Continuity\_Greene

Math185\_Lab\_03\_Continuity\_Greene
Andrew Greene
9/21/2015
# Math 185 Calculus I
# Lab 3 Continuity
# OBJECTIVES :
# Apply the Intermediate Value Theorem to solve equations involving \
continuous functions .
# Approximate solutions to equations using plot () and find_root ()
# Recognize inaccuracies relating to continuity in graphs produced with \
technology .
# ADDITIONAL RESOURCES TO LEARN MORE ABOUT CALCULUS WITH SAGE :
# http :// doc . sagemath . org / html / en / reference / calculus / sage / calculus /\
calculus . html
# http :// www . sagemath . org / calctut / continuity . html
# http :// doc . sagemath . org / html / en / tutorial /
# EXAMPLE
# Consider the following equation
sqrt ( x ^4+25* x ^3+10) =5
Error in lines 3-3
Traceback (most recent call last):
File "/projects/78a2b622-8623-4a99-b456-dbbd5995c838/.sagemathcloud/sage_server.py",
line 879, in execute
exec compile(block+’\n’, ’’, ’single’) in namespace, locals
File "<string>", line 1
SyntaxError: can’t assign to function call
# The reason for the error above is that a single "=" is used for \
assignment . A double "==" will test for equality and is used to solve\
equations . Here are two obvious exmaples :
1==1
1==0
True
False
# If we have an equation that may be difficult or even impossible to \
solve algebraically and the equation involves a continuous function , \
1
then we may be able to use the Intermediate Value Theorem to show a \
solution exists . In the example above , we could let the expression on\
the right - hand side define a function f ( x ) . We can use the method " N\
() " to get a decimal approximation .
f ( x ) = sqrt ( x ^4+25* x ^3+10) ;
f (0)
f (0) . N ()
f (1)
sqrt(10)
3.16227766016838
6
# Since 5 is between f (0) and f (1) and f ( x ) is continuous on the interval\
[0 ,1] , then the Intermediate Value Theorem guarantees a value c with \
f ( c ) =5.
# If we want to approximate such a c , we could use a graph or we could \
use the solve () function . Here are both approaches :
# GRAPHING : Plot y = f ( x ) and plot y = L . Use the output of one graph to \
adjust xmin / xmax to zoom in for the next graph .
plot ([ f ,5] ,( x ,0 ,1) ) . show ( xmin =0 , xmax =1 , figsize =4)
plot ([ f ,5] ,( x ,0 ,1) ) . show ( xmin =0.8 , xmax =0.9 , figsize =4)
plot ([ f ,5] ,( x ,0 ,1) ) . show ( xmin =0.82 , xmax =0.84 , figsize =4)
plot ([ f ,5] ,( x ,0 ,1) ) . show ( xmin =0.833 , xmax =0.835 , ymin =4.98 , ymax =5.02 , \
figsize =4)
2
3
4
5
# The graphing parameters were chosen with a lot of trial and error . The \
last graph is pretting convincing that c is approximately .834 , \
rounded to the nearest 3 decimals .
# An easier approach is to let Sage solve the equation :
solve ( f ( x ) ==5 , x )
[x == -1/4*sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) + 625*(5/2*sqrt(3516905) 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) - 1/2*sqrt(-(5/2*sqrt(3516905) 9375/2)^(1/3) + 20/(5/2*sqrt(3516905) - 9375/2)^(1/3) + 15625/2/sqrt((4*(5/2*sqrt(3516905)
- 9375/2)^(2/3) + 625*(5/2*sqrt(3516905) - 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) 9375/2)^(1/3)) + 625/2) - 25/4, x == -1/4*sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) +
625*(5/2*sqrt(3516905) - 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) +
1/2*sqrt(-(5/2*sqrt(3516905) - 9375/2)^(1/3) + 20/(5/2*sqrt(3516905) - 9375/2)^(1/3) +
15625/2/sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) + 625*(5/2*sqrt(3516905) 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) + 625/2) - 25/4, x ==
1/4*sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) + 625*(5/2*sqrt(3516905) - 9375/2)^(1/3) 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) - 1/2*sqrt(-(5/2*sqrt(3516905) - 9375/2)^(1/3) +
20/(5/2*sqrt(3516905) - 9375/2)^(1/3) - 15625/2/sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3)
+ 625*(5/2*sqrt(3516905) - 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) +
625/2) - 25/4, x == 1/4*sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) +
625*(5/2*sqrt(3516905) - 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) +
1/2*sqrt(-(5/2*sqrt(3516905) - 9375/2)^(1/3) + 20/(5/2*sqrt(3516905) - 9375/2)^(1/3) -
6
15625/2/sqrt((4*(5/2*sqrt(3516905) - 9375/2)^(2/3) + 625*(5/2*sqrt(3516905) 9375/2)^(1/3) - 80)/(5/2*sqrt(3516905) - 9375/2)^(1/3)) + 625/2) - 25/4]
# HOLY OUCH ! It looks like Sage was able to find an exact answer , but it \
is really hard to read with human eyes .
# To get a numerical approximation , tell sage to find a " root " between \
two numbers .
find_root ( f ( x ) ==5.0 , 0 , 1)
0.8342542793176062
# EXERCISES
# Instructions : Do not start the problems below until you have read the \
examples above .
# PROBLEM 1
% typeset_mode True
f ( x ) = x * sin ( x ^2+ x ) +3* x -11
print " PROBLEM 1\ n \
1 a . Use the Intermediate Value Theorem to show that the following \
equation has a solution on the interval (4 , 5) .\ n \
1 b . Use the plot command to find all solutions . Make sure you zoom in / out\
appropriate to find all of them . Write a complete sentence saying how\
many solutions there appear to be .\ n \
1 c . Use the find_root command to approximate some of the solutions . For \
convenience , approximate only 3 of the roots . " ; f ( x ) ==0
PROBLEM 1
1a. Use the Intermediate Value Theorem to show that the following equation has a
solution on the interval (4, 5).
1b. Use the plot command to find all solutions. Make sure you zoom in/out appropriate to
find all of them. Write a complete sentence saying how many solutions there appear to be.
1c. Use the find_root command to approximate some of the solutions. For convenience,
approximate only 3 of the roots.
x sin x2 + x + 3 x − 11 = 0
# 1a.
# 1b.
# 1c.
# PROBLEM 2
% typeset_mode True
g ( x ) = sin ( x ) / x ;
print " PROBLEM 2\ n \
2 a . Plot the following function and describe any innaccuracies appearing \
in the graph . \ n \
2 b . Is the function continuous at 0? \ n \
2 c . Conjecture the value of the the limit as x approaches 0. " ; g ( x )
7
PROBLEM 2
2a. Plot the following function and describe any innaccuracies appearing in the graph.
2b. Is the function continuous at 0?
2c. Conjecture the value of the the limit as x approaches 0.
sin (x)
x
# 2a.
# 2b.
# 2c.
8