|   | 1 |  initial version  | 
Found an example in the docs after posting this... Solving Differential Equations
|   | 2 |  No.2 Revision  | 
Found I found an example in the docs after posting this... 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)
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.