Ask Your Question
1

How to take partial derivative of abstract/unknown function?

asked 2017-10-04 11:15:39 +0100

wrenoud gravatar image

I have a function f(x) that I do not want to be expanded but wish to evaluate the partial derivative of g(x,f(x),...) with respect to x, I can not figure out how to declare the function and indicate it is a function of x without an explicit definition.

Code example:

var("x")
f = ??? # how do I define this?
g = x * f(x)
g.diff(x)

Expected output:

x * f'(x) + f(x)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-04 11:39:32 +0100

wrenoud gravatar image

updated 2017-10-05 17:46:10 +0100

I found an example in the docs after asking: Solving Differential Equations

Applying to the example given in the question though:

var("x")
f = function("f")(x)
g = x * f
g.diff(x)

Output:

x*diff(f(x), x) + f(x)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-10-04 11:15:39 +0100

Seen: 1,775 times

Last updated: Oct 05 '17