Declaration of funcion domains ?



This is inspired by https://groups.google.com/forum/#!topic/sage-support/
o0rwQId7ELU and http://trac.sagemath.org/ticket/14976.

There seems to be no way to declare explicitly a function and function 
domains. Consider :

(%i1) display2d:false;

(%o1) false
(%i2) define(h(x), integrate(f(t), t, g1(x), g2(x)));

defint: lower limit of integration must be real; found g1(x)
 -- an error. To debug this try: debugmode(true);

;; Let's try to declare g1 and g2 as real-valued *symbols*. Kinda sorta
;; works :

(%i3) declare(g1, real, g2, real);

(%o3) done
(%i4) define(h(x), integrate(f(t), t, g1(x), g2(x)));

(%o4) h(x):='integrate(f(t),t,g1(x),g2(x))
(%i5) diff(h(x), x);

(%o5) f(g2(x))*'diff(g2(x),x,1)-f(g1(x))*'diff(g1(x),x,1)

;; This was the expected result
;; Now, we'd like to *declare* a symbol as a real-valued function

(%i6) declare(s(x), real);

declare: improper argument: s(x)
 -- an error. To debug this try: debugmode(true);

;; doesn't work!

On the other hand, Sage, which uses Maxima for symbolic calculations, 
allows (needs !) declaration of formal functions, but does not allow to 
declare their domain. There is an horrible workaround (see http://
trac.sagemath.org/ticket/14976), but the plroblem remains.

Should this be considered a bug ?

					Emmanuel Charpentier