Role of math in Computer Science I've been wondering this for quite some time and decided to ask finally. What really is the role of math in computer science on higher levels like master's and PhD? Currently I am working on my BSc and hopefully get it done next summer. I have done like 5 math courses(linear algebra etc) + 5 statistics courses. I also did calculus in high school(integrals, derivatives etc) as I took the longer version of math which typically increases your chances to attend STEM programs here(EU country). Some of my professors have spoken how important they think math is in computer science, but is it really unless you go to some very specific fields like theoretic computer science? Because I haven't found it that useful outside of a few specific courses.

I am not sure whether I would like to pursue a PhD in the future but I've been leaning more towards it lately. Security research has gotten my interest and I've done some reverse engineering + vulnerability analysis and working on a small JIT assembler. Sadly not many undergrad courses teach these things so I've worked on them largely by myself. I haven't had any use for university level math on that, maybe I've just scratched the surface?

In some ways I feel bad for not taking more math courses and it's something that keeps annoying me but it's very hard to try to convince myself that some proofs about integrals are going to be useful in my future work/research. It would be nice if someone could elaborate what kind of role math plays in higher level of computer science studies. I have never honestly liked math that much but instead seen it as a something that you just need to know. What are some really useful math courses one should take?
As Galileo has said, "[The universe] is written in the language of mathematics," and it is no different for computer science.  To be a strong computer science researcher, you need to at least be fluent in the forms of mathematics that describe the work you wish to be engaged with.

Mathematics, however, is not a single thing, but a broad domain, and what you need to know will depend on what sort of research you are engaged with.  For example, if you go into computer vision, you'll probably need to know a lot of complex geometry, whereas if you go into cryptography, you'll probably need really deep understanding of number theory.  In some particular paths of work, you might in practice need very little mathematical knowledge at all.

What you absolutely must have, whether for computer science or for any other scientific pursuit, is a comfort with mathematical and scientific thinking in general, enough general mathematical fluency to acquire new expertise at need, and a solid working knowledge of statistics and data analysis to aid in interpreting experimental results.  In almost all computer science work, you will also be greatly aided by fluency in algebra, general discrete maths, Boolean logic, and asymptotic complexity theory.  Beyond that, it all depends on what you're doing.