Question: Using sagemaths jupyter notebook language code solve the following: Sagemath is capable of working with piecewise defined functions, a ) Find which function in Sage

Using sagemath"s jupyter notebook language code solve the following:
Sagemath is capable of working with piecewise defined functions,
a) Find which function in Sage is used to create piecewise functions and define the piecewise function
f(x)={x2ifx16ifx=15-3xifx>1
b) Try to compute limx1f(x), and observe that we get an error. However, the function can use multiple algorithms. We can change the algorithm
used by adding an additional argument algorithm ='sympy' or algorithm = 'giac'. Try to compute limx1f(x) using each of these algorithms.
Notice that while there is no longer an error, the value returned is incorrect (what should the output be?). Does anything change when we try to compute
the limit on the left or right with these algorithms?
Remark: While we see that limit() does not work correctly for piecewise functions, there are ways to circumvent this issue efficiently. By using the
function expression_at()(the syntax is f.expression_at()), we can take the limit of the appropriate piece of f. For example, the input
. expression_at(2), x=1) will return the correct limit from above for f.
Using sagemath"s jupyter notebook language code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!