# Change of programmation of implicit

In the former question "Calculus with formal functions: substitution?", one can obtain implicit differentiation by the following code

var('f,x,y')
y = function('y',x)
f = function('f',x,y)
f.diff(x)


which gives

D1(x, y(x))*D0(x) +D0(x, y(x))

But I use the last version ofg SageMath and I have the following error

TypeError: function() takes exactly 1 positional argument (2 given)

Is there some new way to handle this code ?

edit retag close merge delete

Sort by » oldest newest most voted It seems that you want the following:

var('x')
y = function('y')(x)
f = function('f')(x,y)
f.diff(x)


Output:

D(f)(x, y(x))*diff(y(x), x) + D(f)(x, y(x))

more

On my computer this lead to : name 'var' is not defined

Dear Emmanuel I Don't know why my computer refused to do the job all the day. And then all in a sudden it accepts to work correctly without any complete shutdown.

To amplify rbuning's answer, which is exact, you should try

function?


which should be illuminating...

Sage's online help is exceptionally useful, on par with R's, and should be used as a first recourse.

A very good primer on Sage is this book, which also exists in German, and which is the translation of a french book.

more

When I typeset function? here is the answer

Object function not found.

Either you have a seriously hosed system or you don't stat it the right way...

Can you describe: - your system (OS, version) - your Sage installation (how did you install sage ?) - how you start Sage (Jupyter notebook ? terminal ? (old) Sage notebook ? other ?) - what you see on the screen ?