# Sage Calculus Tutorial -- continuity practice problems

Can anyone help me understand how to do some of the practice problems in the sage calculus tutorial? In particular, I'm stuck on problems 5 and on at the bottom of this page http://www.sagemath.org/calctut/conti...

For example, I am not sure how to define 'k'. As it stands, graphing the function in problem 5, sage does not know what to do with the variable 'k', because it is not defined.

edit retag close merge delete

Sort by » oldest newest most voted

To define the variable k, you can write:

sage: var('k')
k


Concerning problem 5, Sage does not answer the right result:

sage: solve(limit(cos(x), x=pi/2, dir='-') == limit(sin(x+k), x=pi/2 , dir='+'), k)
[k == 1/2*pi]


Indeed, 1/2*pi is one of the solutions, but the solutions are all numbers of the form 1/2*pi+n*pi (where n is an integer). So, you have to be careful with symbolic computations.

more

You need to use the definition of continuity, which will involve the limit command, and the solve command to find k.

var('k')
solve(limit(3*x-2,x=k,dir='-')==limit(2*x+3,x=k,dir='+'),k)

more