Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to take partial derivative of abstract/unknown function?

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)