The distinction between a discovery and and invention has great economic importance as it relates to patents. It is highly controversial and the rules are evolving.
In the area of chemistry, for example, a chemical structure generally could not be patented as it was deemed a "composition of nature." That characterization clearly applies to natural products, such as penicillin and firefly luciferin. But what if you synthesized a new antibiotic? Could you patent its structure? The answer was generally "no," because you could not prove it did not exist before. You could,of course, patent its method of synthesis and its use as an antibiotic. Years later and with the advent of gene sequencing, those rules are evolving. Effectively, some gene sequences are being patented.
I am sure there are many discussion in the legal literature that aim to distinguish invention from discovery. I found this Wikipedia discussion particularly understandable as it relates to the very fine distinction between the two terms:
Gene patent - Wikipedia, the free encyclopedia
As for applied mathematics, it is stated that an algorithm, say one that calculates cube roots, is not patentable. But, an algorithms that calculate risk factors for a disease or disorder (for example birth defects or heart attacks) are considered inventions and have been patented.
There is no simple answer, particularly when large sums of money are involved.
John