Both are composed from rules and assumptions which enable us to deduce other inevitable truths that results from these rules and assumptions, right?
Initially, mathematics was the systematic deduction of the logical consequences of axioms, axioms understood as constituting together, somehow, a model of some particular aspect of the real world. The most historically glorified example of that is probably Euclid's geometry:
Euclidean geometry is an example of synthetic geometry, in that it proceeds logically from axioms describing basic properties of geometric objects such as points and lines, to propositions about those objects, all without the use of coordinates to specify those objects.- Euclidean geometry - Wikipedia https://en.wikipedia.org/wiki/Euclidean_geometry
The aspect of that which is still true today is that mathematics is a formal discipline: axioms are formal expressions, derivation of consequences is a formal process based on formal expressions, and the validity of the derivations is hopefully entirely justified on form.
However, in the 20th century, mathematics has evolved its methodology in different directions. One aspect of that is that while before the 20th century mathematicians appear to have used the same logic to deduce consequences, now the picture is much more diverse and indeed complicated.
The expression now favoured by mathematicians is not the "deduction of the consequences". It is the "derivation of consequences".
According to Collins, derivation is "the process of deducing a mathematical theorem, formula, etc, as a necessary consequence of a set of accepted statements".
A derivation is thus a process, or rather a procedure, and therefore essentially seen as a concrete operation, essentially like the derivation of the result 5 from the operation 2 + 3. It is also still an entirely formal operation, in that it depends only of the formal properties of these "accepted statements", as Collins calls them.
As an entirely formal process, any derivation could be performed, at least in principle, by a computer, although the vast majority of mathematical proofs are still for now arrived at using, as Wikipedia puts it, "rigorous informal logic".
Deduction of course, at least in the context of a formal discipline, is itself a formal operation, and there is in effect little difference between the two notions. However, the term derivation allows mathematicians to emphasise the idea of a formal procedure, whereas deduction is essentially thought of, and indeed has always been thought of from Aristotle himself, as a particular kind of reasoning, that is, somehow, as an operation of the mind.
Thus, while strictly speaking deduction is constrained by the kind of mind and, presumably, the kind of brain, humans have, derivation can be made to proceed according to any number of ad hoc rules that do not necessarily reflect human deduction. Thus, mathematicians themselves can decide which rules apply, and different mathematicians may decide to use different rules.
In particular, mathematical logic, which is itself a discipline, not a method of logic, brings together mathematicians who use, and investigate the use of, different sets of rules. And there is indeed a large number of such systems, such as for example 1st order logics and second order logics, relevance logics and paraconsistent logics, constructive or intuitionistic logics.
As a concrete example, we can mention intuitionistic logic, also called constructive logic, which differs from mainstream mathematical logic, itself usually and tellingly called "classical logic", by not including the law of excluded middle and the double negation elimination rule, which are, however, fundamental inference rules in classical logic.
Some systems of logic, for example multi-valued logics, will have different but analogous laws to stand in for the law of excluded middle.
Thus, while there is only one logic of argument, as understood since Aristotle first formalised it in his syllogistic 2,500 years ago, there are now any number of ways that a mathematicians can choose to derive a theorem from a set of axioms.
Relationships on cases are different from relationships on genuses. When we logically affirm the scope of equivalency, we say for example that "X is a Z". When we are dealing with heuristic mathematical reasoning, we are instead not working on contradictions and counterexamples; Rather, in approximative experiential mathematics, we pinpoint what are not true for NEARLY all those propositions that result from going through processes of de-paradoxization.