Ask Your Question
1

How to take partial derivative of abstract/unknown function?

asked 2017-10-04 04:15:39 -0500

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 04:39:32 -0500

wrenoud gravatar image

updated 2017-10-05 10:46:10 -0500

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 04:15:39 -0500

Seen: 51 times

Last updated: Oct 05