I am curious why computer-science majors have to learn calculus to receive their bachelor’s degrees. My father worked as a software engineer for twenty years and never used it. It seems to have little more value in programming than other forms of mathematics. What is it about calculus that makes it a requirement for computer-science majors? Is it just that it's a tradition in STEM fields?
There are several answers:
Answer 1: Not all CS programs
First, not all CS programs require calculus in order to get a bachelor's degree. The Bachelor of Arts (BA) program at Mills College, where I teach, does not require calculus. Instead, we require two semesters of discrete mathematics, which we consider far more useful to computer scientists, because it (at least the way we teach it) includes:
- inductive proofs
- Boolean logic
- proof by contradiction
- basic probability
- recurrence relations
- graph theory
- regular expressions
- finite state automata
- formal languages
Answer 2: Scientific foundation
That said, getting a Bachelor of Science (BS) degree from Mills or just about any other school requires calculus as part of general scientific knowledge, along with introductory chemistry, biology, physics, etc., none of which we claim someone will necessarily be useful to a computer scientist. These courses are part of the college-wide BS core, not specified by any individual department. The idea is that anyone holding a BS degree should understand the fundamentals of major scientific fields even if they will never apply them in their careers. (Similarly, most colleges require students to take classes in history, even though they are unlikely to become time travelers.)
Answer 3: Historical reasons
Computer science as an academic discipline has not been around that long. Most CS programs started within either Mathematics or Electrical Engineering programs. Both of those fields legitimately require calculus. I went to MIT, where CS was added to the EE department. All CS majors were required to learn both digital and analog electronics, the latter of which requires calculus.
In my decades as a computer scientist, including in industry, I never used any of what I learned in the required calculus (I, II, and III), linear algebra, or differential equations. That said, they did give me the background to go into computer graphics, electrical engineering, or machine learning, had I later chosen to.
Whether programs should require calculus is another question.
It's certainly of little use in CS fields which centre on databases, OSes, general PC applications, and anything like that.
It's somewhat important in CS fields relating to data transmission. Whilst this is mostly centred on OSI layers and the like, there is theoretical work by Nyquist and Shannon which underpins it, and the theory is ongoing.
However calculus and extensions from it are critical for a number of other major CS areas. Off the top of my head:
- Digital signal processing for audio
- Digital signal processing for graphics
- Computer modelling of processes
- Optimisation of processes
- Games with objects moving (most obviously in 3 dimensions, but even working out position changes for a varying speed in 1 dimension needs calculus)
- Computer vision
- Electronic control systems for anything that moves (cars, planes, missiles, machinery, ...)
- Some forms of data compression, especially lossy data/audio compression
All of these either use calculus directly, or use further maths which is derived from calculus.
In addition to good answers given, some others.
Plenty of computer scientists do use calculus, and other important math.
It's good general mathematical training, which is helpful to learn to think rigorously about other topics later on.
Building on the above, it's helpful for understanding (not just learning to write down, but understanding) some CS topics that might not directly require calculus, like growth rates of functions and big-O notation.
You could ask a similar question about, say, doctors and organic chemistry, and i think similar answers would apply.
While it's true that today not all CS programs require calculus, I believe the answer to this question will change due to trends in Machine Learning and Data Science.
First, many topics in Machine Learning -- such as neural networks -- require knowledge of derivatives to really understand common algorithms like gradient descent. Familiarity with vector calculus, partial derivatives, etc., is essential for this reason.
Second, with the explosion in big data we need future CS grads to understand data science fundamentals -- including a deeper appreciation of probability and statistics than before, which invariably means more calculus. Deriving the basic Normal distribution, for example, requires integrals.
Therefore, I believe it is now essential that CS grads learn calculus, even if calculus wasn't always required before.
Much of the material one learns in school has no direct utility in one's job as a software engineer. Conversely, much of the working knowledge one needs as an industry practitioner is not gained in school. What school is supposed to do is provide some basic knowledge and a basic framework for learning, out of which an individual is going to actively retain a small-ish portion for their day-to-day use on the job.
However, much engineering work is multi-disciplinary, and therefore "surplus" knowledge is not exactly useless: it can provide a useful bridge to other disciplines. Calculus in particular occurs in the math that describes physical processes.
In today's global economy, it is likely that one will switch employers and job specializations multiple times in one's career. At the start of one's career it is impossible to foresee what knowledge is going to come in handy later on. About twenty-five years into my career, I found myself interfacing to domain specialists whose bread and butter are differential equations. When I was in school, studying for a CS degree, I could have taken optional classes to learn about differential equations, but decided not to as I was already struggling with my math workload. So late in my career I came to regret my earlier decision, as it put me at a disadvantage relative to colleagues with a working knowledge of differential equations.
The exact nature and number of math classes required in a CS program may in part be driven by departmental tradition. For example, in the school I attended, the CS program had grown out of the math program in the early 1970s. Therefore, math was heavily emphasized. In fact, as an undergrad I took exactly the same math classes as students in the math program. Out of those, linear algebra turned out to be useful for computer graphics, and numerics turned out to be useful for high-performance computing. Multi-dimensional analysis and statistics I never needed again, but it might have been quite different had my career taken me in a data science direction.
This isn't really an answer, but I'd like to say a few things about calculus. I think that what is needed by a CS major from that realm and what is needed by a math major are very different. As such, I think that if calculus is taught to CS majors, and to history majors, for that matter, the needs imply that it might be a different sort of course than that taken by the math majors.
First, not a lot of people who have taken Elementary Calculus (i.e. Calc I, II, and III) actually have much insight into what is really the point. It is easy to get lost in details of differentiation and integration and techniques and such without realizing that it is really a study of the relationship between what happens locally with a function (differential calc) and what happens globally (integral calc). It is all tied together by the Fundamental Theorem.
But even the nature of the derivative is poorly understood for a long while - it took me several years of graduate study in math to really grok it. The derivative you study in Elementary Calculus is really only one specific form of a wide variety of possibilities. The limit used in Elementary Calculus could be replaced by alternatives. The difference quotient in the derivative could be replaced by another "average ratio of change". This would result in a different theory.
However, the standard version of Elementary Calculus (note that I keep writing Elementary") is very good for understanding the behavior of well behaved functions: those that are mostly continuous. But aside from Catastrophe Theory (why do bridges fall down unexpectedly?) it is these continuous functions that form the basis of understanding a lot of the applications of both math and CS. Probability, for example, depends on calculus once you get past counting.
So, elementary calculus is useful for applications of rational thought to the real world - which CS folk do a lot of.
However, the "nice" functions of elementary calculus are pretty boring to a mathematician. The interesting functions are those that are misbehaved - even wildly misbehaved - even wildly misbehaved everywhere. A function that is continuous but nowhere differentiable starts to be interesting. A function that is continuous everywhere but zero, but takes on every real value in every neighborhood of zero starts to be interesting. That is where the calculus sequence is headed for math majors, but it probably isn't very useful for a CS person. How about functions not even defined on the rationals. Is that a yummy or a yucky?
So, a good compromise, if a university can arrange it, is to have a single course that is something like Calculus I with some ideas of the derivative and the integral, but focused on why these are important (rates of growth, etc) rather than just computational details, might be worth designing and offered generally to people interested in becoming widely educated, rather than becoming mathematicians.
Note that this precise subject was the basis of my doctoral work: variations on the ideas of calculus and the deeper meaning for the study of functions.
There are many good answers here, but ultimately your question comes down to, "Why does A require X, when my dad was B for many years."
Software engineering is not a field that only seeks out computer scientists. I work in software engineering right now having graduated CS, but I work along side of other software engineers from various engineering degree programs, math degree programs, and science degree programs. In short, you do not actually need a computer science degree to be a software engineer.
What does this mean about computer scientists? What do they do that is different?
As others have so very well pointed out, there are areas that computer scientists are pioneering. Machine Learning is one example, but look at the other answers for more good ones. Another area that hasn't been mentioned is computing theory.
In short, a computer scientist major learns calculus, not because it is necessary for software engineering, which does not require a CS degree at all, but because of what Computer Scientists can potentially do: Software pioneering, refinement, and computational theory.
Some of this is academic in nature, some of this is still something you can get a job doing in the commercial sector. My former boss at this company has a Ph. D. in computer science, and I know 2 others who work here that also do, and they handle slightly different work. One is in charge of R&D, another is in charge of developing a brand new system no one has ever conceived of before, and I'm not sure what the other one does.
In short though, if you were looking to get into software development, you are right, you likely do not need Calculus, you also don't need a Computer Science degree. However, if you want to be a top innovator in computing, that's when you want to get that degree.
Edit: An example of a Computer Scientist who is not doing software development with his degree is the one I was able to sit in on for his Graduate Thesis. He was doing microcircuit design using machine learning data models, and had developed a 4 bit adder that was smaller than 50x50x50 microns^3. So there are also other fields you can go into with Computer Science.
Given all the answers, I'm kind of surprised I didn't see anyone mention this, but...
Back in the 80's when I was taking CS (and likely somewhat in the vicinity of when your father took it), Accredited Computer Science was still fairly new as a degree. Very few colleges offered it as its own stand-alone school. For most, it was a department in either their School of Engineering, or their School of Mathematics.
Schools all have their own graduation requirements, but both of those types of schools are quite likely to require calculus. In my case, it was under the School of Engineering, so I was required to not only take 3 semesters of Calculus, but also two semesters of Chemistry.
Now Chemistry is a Noble subject (pun intended), worthy of study, but probably not vital to a typical CS degree holder. I certainly didn't learn much of it from that huge lecture class where the instructor spoke with badly accented Norwegian, the TA's in incomprehensible Chinenglish, and a 17% on tests was a passing grade.
Degree graduation requirements are just something you have to deal with as a College student. We were also required to take 2 semesters of English (which served me much better in my career), and 4 other semesters of Liberal Arts classes, all of which were wonderful experiences I'm glad I had, because I took stuff I was really interested in.
Now that being said, you don't know where your career is going to lead. You need a good survey of knowledge on damn near everything, and this goes double for math. 10 years after graduation I found myself writing software for flight simulators, where the communications protocol we used called out using quaternions to calculate the position and rotation of other aircraft in between updates. This was pre-Web, so I found myself driving all over town looking for a book telling me how to do that.
Despite more than 30 years of programming professionally I have yet to use calculus for work. Does that mean it was a waste? No--my observation from school is that you only truly learn the material that you use in future classes. Calculus is the step above differential equations--and I have used that knowledge professionally more than once.
(And note that I have used the results of calculus in a program I whipped up to solve a problem. I looked it up, though--my calculus is far too rusty to have handled the integration involved. I have also had the experience of looking at a bit of code and being utterly unable to understand what a key equation was doing. In hindsight I realize it was the integration of stuff I understood but that was before I had taken calculus, I couldn't see the relationship.)
Computer Science is not Software Engineering
This depends on your definitions, of course, and in most common definitions they are very closely related.
But the long and the short of it is, there is a difference between sorting an array (which in many programming languages is about as simple as calling array.sort()), and implementing the underlying logic of the .sort() function.
Software Engineering is more about knowing WHY and WHEN to sort, rather than HOW to sort. Very often, these lines can get quite blurred - for instance, if engineering a high-performance application, it may be important to understand the underlying algorithm to fine-tune the WHEN, or maybe even write a supporting routine that heuristically chooses from a set of possible sorting algorithms.
Algorithms, and many other HOWs of computers and Computer Science, often require Calculus to understand and research. These things are commonly much less useful in day-to-day Software Engineering.
Please also see this CS SE question for why calculus is something very useful for the study of Computer Science in general.
During my CS course, I developed the rather cynical theory that the CS faculty were using the Math faculty to fill out their curriculum. It saved them time and effort and so it was that we taught some really hairy math which I can't imagine ever being of use to me. 3D integration anyone?
If I ever were to be working on a project that needed such things, I'd expect a subject matter expert to be providing the requirements, just as I'd expect a botanist to be writing the specification for controlling an asparagus greenhouse. Of course some math is valuable, but I think it lingers in CS just because it was often the mathematics department that originally had to teach computing to undergraduates.
Calculus is not useless to computer scientists. But it is not very useful either. If the required mathematical fields in CS were ranked, according to usefulness and/or necessary depth, the list would be something like this:
- Linear Algebra
- Probability Theory
- Discrete Mathematics/Abstract Algebra
- Numerical Analysis
- Number Theory
- Complexity Theory
- Calculus/Real Analysis
You can certainly quibble about the importance order, but that misses the point, the point is that Calculus will always be ranked fairly low. Calculus by its nature concerns itself with the infinite, but computer scientists are mostly interested in finite things.
I believe it is taught because of inertia and because universities are slow to adapt their curriculum.
Calculus requires several semesters of concerted effort to master. It is not as easily picked up on the job, unlike learning a new computer language (I have programmed in 28 professionally) or library. College should teach key building blocks not easily acquired in another setting.
I didn't need that calculus until I got a job dealing with insurance research, such as modeling the effect of hurricanes on a real estate policy. Insurance work is loaded with math, including calc. Try numerical integration in 1,000 dimensions without it!
If you want to do programming related to financial instruments (like I did at another job, working at CRD on their investment management system), calculus is heavily involved.
If you want to work in scientific computing (like I currently do at Shell, the oil major) calculus comes in handy.
If you want to work in optimization and operations research (like I did at EF Education, in the Travel industry, when optimizing the consolidation of tours based on matching parameters), it also comes in handy.
Any programming that requires obtaining expert domain knowledge outside of simple website design or business database programming and report prep is likely to bring you into contact with problems that require advanced math. If you don't have that knowledge, you get stuck writing the CRUD (and there is always loads of CRUD to write). If you do, you get to tackle the fun problems and be the tech lead.
Bottom Line: If learning all the new stuff fast and being superproductive at writing and testing lots of commonplace code is your forte, there is a place for you in software. If solving really hard problems and getting recognition and compensation for doing that is what you want.... LEARN CALCULUS!
There are some parts of Computer Science that use Calculus. DSP is an obvious one. Linear Regression, which is an ML technique, uses gradient descent to minimize a cost function. I learned about gradient descent in Multi-Variable Calculus (Calc 3). Newtonian physics obviously involve some calculus, and are in turn used in things like physics engines.
In general, I think CS programs should give students a decent math foundation, since it is an engineering discipline, and is entangled with many other sciences. When solving more science-y problems, mathematics are bound to come up. Calculus is a pretty fundamental area of math, whose absence seems like a serious gap to me.
We actually used integration to derive big-O complexity in an upper-level course on complexity theory. I remember being quite impressed at the time, because no, I hadn't used it in any of my prior CS classes. Unfortunately, I don't remember the details -- it's been a very long time.
If I'd gone into modeling and simulation, or if I'd stuck with graphics, I'm quite sure I would have used it more.
Calculus is a hard and rigiorous course. Taking it you learn skills of organization and time management more than anything else. You learn how to think and absorb information at lightning speed. If you can learn Calculus then you can learn anything. These skills are useful for a programmer. I speak of my own experience taking Calculus while studying Computer Science at the university.
As Computer Science students, you should know the fundamentals of university mathematics, for the further development of your own skills.
I believe that all science-oriented persons must study mathematics. For one thing, that study helps you to learn both of your subjects. And fundamentally, philosophically, I don't think that the two subjects are divided. Which is mathematics, and which is science? They are of a piece, essentially—they form an undivided unity.
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.