Most people think of magic as being antithetical to science. The standard scholarly view in the history of science has been that the scientific revolution of the 17th century was a decisive break from the magical views of the past. But recently, some historians of science have argued that the development of science was contiguous with the practices of magic. For example, the argument would go, it's not the case that alchemy stood in the way of the development of chemistry; rather, alchemists laid some of the groundwork for the development of chemistry. Fascinating stuff.
The Elizabethan magus John Dee explicitly allied himself with mathematics and science, leaving Cambridge and traveling to the Continent in order to pursue his studies. In England at the time, his allegiance to science was considered anti-intellectual, since university education emphasized humanities in the tradition of the Greeks, especially philosophy, philology, and rhetoric. Dee's alliance with science - note, not with magic - also made him suspicious to the Church. Fortunately, he had a patron and defender in Elizabeth I.
The novelist John Crowley has based many of his works on the idea that the laws underlying the claims of magic used to be true in the same way that the laws underlying the claims of science are true now. There has been a shift between worlds, if you will: what was true then is no longer true now, but what is true now, by the same token, wasn't true then. Now we have Egypt, and our Egypt has its history, but that history is different from the history of the country that once was Ægypt. (I hope I got this right; if you're intrigued, start with his novel, Ægypt.)