diff --git a/sympy/core/function.py b/sympy/core/function.py
index cda559716..12a83e7a3 100644
--- a/sympy/core/function.py
+++ b/sympy/core/function.py
@@ -771,6 +771,16 @@ def _sage_(self):
         func = sage.function(fname)(*args)
         return func
 
+class UndefSage(object):
+    def __get__(self, ins, typ):
+        from sage.calculus.var import function
+        if ins is None:
+            return lambda: function(typ.__name__)
+        else:
+            args = [arg._sage_() for arg in ins.args]
+            return lambda : function(ins.__class__.__name__)(*args)
+
+
 class UndefinedFunction(FunctionClass):
     """
     The (meta)class of undefined functions.
@@ -780,6 +790,7 @@ def __new__(mcl, name, bases=(AppliedUndef,), __dict__=None, **kwargs):
         __dict__.update(kwargs)
         __dict__['__module__'] = None # For pickling
         ret = super(UndefinedFunction, mcl).__new__(mcl, name, bases, __dict__)
+        ret._sage_ = UndefSage()
         return ret
 
     def __instancecheck__(cls, instance):
