From
diff(sin(x),x) == cos(x)
one gets just trivial equality cos(x)== cos(x) instead of True.  This can be fixed by loading sympy and 
import sympy as sp
from sympy import *
x = symbols('x')
but this spoils my code. Is there a sage solution?
 
 