If we go by the modern definition of mathematics as the science of formal proof or logical demonstration, then the relation between logic and mathematics becomes very intimate.
Both logic and mathematics are formal sciences. They deal with relations between propositions which are independent of the content of the propositions. In arithmetic, for instance, we may use numbers to count anything. What we actually count makes no difference to counting. Thus two plus two will be four whatever we add books, balls, tables or anything else.
Since the relations with which logic and mathematics deal are independent of content these sciences are able to use symbols in place of words. Also, both logic and mathematics deal with relations which are applicable to actual as well as possible objects.
Further, both logic and mathematics are deductive in character. They begin with certain axioms and deduce conclusions from them.
Moreover, the method of both is a priori. Though both logical and mathematical operations may take place with reference to any empirical entity, knowledge of the principles of these disciplines is not gained by observation or sense experience. Such knowledge is called ‘a priori’, i.e., independent of experience.