A Modern Course in Mathematical Methods for the Physical Sciences Using Mathematica

Peter Taboric built a free Mathematica-based textbook for mathematical methods courses with 100 notebooks, auto-graded problem sets, and case studies. It replaces expensive traditional texts while teaching students to actually compute solutions rather than just derive them.
Questions this video answers
About 35,000 students per year.
About 100 notebooks.
About 150 megabytes.
About 15 years ago.
Roughly 100 students.
Chapters
I'm Peter Taboric, I'm in the physics department at UC Irvine and I want to tell you about a course that we have developed here for you know, to teach basically mathematical methods to physical science students. It's based on a, an electronic, you know, a Mathematica based book called Mathematica Handbook. And we've also developed a web based grading platform to automatically grade undergraduate level math methods problems. I want to describe what the content and kind of what these courses are all about and then the motivations for developing this new version and I'll give you some examples of the undergraduate version of the class and the graduate version of the class class. So. All right, let me, let me tell you explain sort of what this course is all about. Students in engineering, physics, physical chemistry are required to take courses that are typically called something like Mathematical Methods in Physical sciences or whatever. And they're offered both at the undergraduate and the graduate level. And the reason for these courses is that the preparation that undergraduates get in their math classes, the type of skills they develop there are really not the, the type of skills that we need in sort of the physical sciences. And we, we really, they, they can't succeed at problem solving in physics and engineering without additional help in, in practice and those kind of skills. And they're just a little bit different than what they get in their math courses. And so that's, it's a standard thing at both the undergraduate and the graduate level. There are standard books to do this and here's a list of a few of them and they are, and they all have titles such as Mathematical Methods, you know, in Physical Sciences, in Engineering for Science and Engineers and so on. And these are again very standard courses. And there's at least 35,000 students per year take these classes in the U.S. and of course, you know, many more internationally. Just to give you a flavor for what's in them. This is sort of the table of contents of two particularly well known books. One is the boas, which is sort of a physics standard in sort of undergraduate physics, and Krasig, which is a standard in undergraduate engineering and the content overlaps between the two. So there's always stuff about complex, complex numbers and complex variable techniques and the weighting and the order is a little bit different depending on, on the class in the book. But there's complex analysis and, and here it is in the engineering thing there's lots of discussion of, of linear algebra. So there's linear algebra, matrices, vectors, etc. Basically a review of vector calculus applied to things so there's a vector calculus thing, lots of stuff on Fourier series and transforms. And you'll see that there the chapter titles, there's lots of overlap, so lots of discussion of ordinary differential equations. And the weighting is a little bit different here. There's special functions and series solutions, PDEs, probability and statistics. So all these sort of standard topics are common to all of these books and with slightly different weighting. And they're very similar. These books all cost over a hundred dollars. The first edition, they're sort of classic books. And the first edition of these books was written in the 60s, and they've gone through many subsequent editions. And in the 60s, this was before the era of personal computers, but there have been many subsequent editions. And the newest editions sort of acknowledge the existence of computers by adding things to the problems, such as use your computer algebra system to check your results. That that's the level at which they acknowledge computation. There have been some more recent books that are explicitly for Mathematica. Here's a couple of them. But these are still sort of dead tree books. They're. They're books with, you know, in the standard format, but add a little bit of Mathematica. So I started developing a course, you know, I started actually about 15 years ago and, and I took up the challenge of trying to make a kind of a modern version of this that was completely electronic. So it consists of Mathematica notebooks. And some of the motivations for making this thing was to reduce the textbook cost because textbooks are expensive. The typical problems in the standard books are solve this differential equation, find these eigenvalues, and they're sort of computationally, not in computer sense, but just doing, you know, calculating some number or some equation. And I wanted to reduce the emphasis. That's not. Those skills are just not what we want our students to, to learn and to. To perfect and rather emphasize understanding of algorithms which solve a wide class of problems and in general to develop modern technical problem solving skills. The sort of 60s, the skills that were required in the 60s, they just changed. And the way that modern technical people solve problems is really quite different. And I wanted to make a book that acknowledged and addressed those problems. So the criteria for this textbook are, one of the first ones is that the topics, you can't get carried away with innovation. The academics are surprisingly conservative and there's a hierarchy of skills and there are prerequisites and you can't change things too fast. So the topics of whatever you generate here have to overlap whatever the conventional course Is another problem is that if you're going to use Mathematica a lot and you have naive undergraduates in your class, you really have to provide a pretty serious introduction to Mathematica so that they can do whatever is going to happen. You want to utilize graphics, manipulate, animate and use that in a maximal way to illustrate concepts. Mathematica is full of relatively high level beautiful commands that do interesting things like residue matrix exponential, asymptotic, dsol value, et cetera. But to use these in an intelligent way, you really have to understand what the algorithms are doing. So the whole, the way that I try to do that to the students is basically to go through a one calculation by hand to see what is going on, what the algorithm is. Then once they master the algorithm, they're free to use the higher and Mathematica functions and then you can use Mathematica. The other thing that you want to use in a modern textbook is to use Mathematica to leverage the power that you get to solve more complicated and more relevant more interesting problems that arise in subjects that they're going to address later. Classical mechanics, quantum mechanics, fluid mechanics or whatever. So. The, the. This book is now available at a website. You go to this website and you can download it and what it does is generate. There's about 100 notebooks in it. It's about 150 megabytes of material and it generates a palette that is the thing that lets you go to it. I'll show you the live thing in here in a minute, but one of the things I mentioned there was that you have to teach a little bit of Mathematica otherwise you can't proceed with these students. And some of the things that I found that require attention and they're kind obvious but that just things, they're sort of syntax issues that have to get addressed before you can proceed. And so you have to, you have to explain the difference between equal, double equal, colon equal, etc. The whole slash dot operator is a needs explanation in practice, otherwise they don't understand it. Things that cause a lot of frustration and confusion are the fact that the square root of X squared is not X and the real part of x +iy is not x unless you provide assumptions and assuming. And similarly, you know, just get used to the idea that you do sign square bracket X not not round parentheses and that things that you, that come from printed mathematics that you think would be obvious already just require assumptions and you have to do all that. Let me, let me show you how this thing works. Now in live. In a live way. So once you've downloaded the book, it generates a palette and the, And the palette, the tool looks like this. So and as well. All right, there's a tutorial section. Let's talk about that first. So the very first thing they do this brings up a notebook. And the format of all these notebooks is a bunch of statements and outline, sort of an outline of what's going to happen. Typically there's sort of an introductory paragraph that says what's going on and a some hyperlinks to issues that you're trying to make. So how to use basic elementary functions, how complex numbers work, etc. There are built in quizzes into this so you can push on this and they'll give you a quiz and you can get the answers. Here. It goes through how to use an elementary function, how to set up equations with double equals, how to do basic calculus, how to do lists and matrices, how to understand, how to use slash, dot, et cetera. So that's, and this kind of material takes roughly basically, in two lectures I managed to get them to do basically everything they need to know. There's some other, another thing that's important for people in physical, you know, that are going to study the, you know, science and engineering are. Kind of using vectors and integrals and these issues of, you know, how to use power, expand and assuming assumptions. And so there's another notebook that explains all that. And it, and it does that by sort of typical physics problems. Damped harmonic oscillator, calculating the magnetic field from a current loop and statics, you know, static, a simple statics problem, how to set up linear equations that help you understand forces and so on. This is all put together. There's a cheat sheet which is pretty popular, which is for an undergraduate class. You really need to understand about 20 functions. And here they are. And if you want to. And it just illustrates how to do some of these things. So and, and really you don't need to do too much. It takes a lecture or two and the students are really pretty good at doing it. Another thing I mentioned that that is good to do is to use, you know, to use the power of Mathematica to illustrate more complicated stuff. So let me show you a few examples of that. So. Well, let me first point out again that after you've done the tutorial, there's tutorials and there's more advanced things in here. There's just a review of all the sort of a quick review of plotting capabilities in Mathematica that You know, so that students can quickly refer to things like that. But other than that, the titles and the subject matter mirrors the conventional books pretty well. There are, you know, all the standard topics are covered in here in, in that standard way. So let, and there's. But there's some additional things. What. Let me, Let me do this complex things first. So this opens a notebook and this is sort of a, you know, typical undergraduate level thing, by the way. There are. For all the introductory subjects, there are videos associated with it. So I, I myself tend to like to read things, but I know that some students just like to hear stuff. And there's. So there's videos that will guide you through these notebooks and, you know, just to leverage the imaging capability of Mathematica, there's nice diagrams in here that just with discuss various things. And when you're talking about complex functions, there's a number of ways to illustrate in a nice clear way how complex functions work. It's a hard thing for undergraduates to understand the difference between F of X, a real variable, and F of Z, a complex variable. And here's a way that, here's a tool that helps them do this. So this is a thing that will. It writes W is some function of Z in the Z plane and maps things into the W plane. And you can type in any function you want in here. So to show students that E to the Z is not the function that they think it is. It's not simply the real value function. You can just draw a picture in the Z plane and it immediately maps it over into the W plane. So you can see the image of anything you want. So you can understand, you know, how it just gives you a visceral feel for how these complex functions work. So that's one example. I mentioned that using this thing for. Other problems. So there's a whole thing in here that wouldn't be in a traditional book, but it's applications in case studies. So there's. It covers a bunch of, you know, slightly more complicated problems that are computationally intensive. A standard problem in any E M class, electricity and magnetism class, is reflection of waves off of an interface. And the algebra, it's in all the books. The algebra is rather complicated and it's a perfect thing to illustrate computer algebra, to actually solve it. And it, it boils down to satisfying some boundary conditions and setting up a system of equations that you can just solve. But the solutions are complicated, they're complex and rather complicated. So what do you do with them? And we can use Various techniques to draw some of the traditional plots. But we can also do this kind of thing where you know, that's a simple manipulate, but it illustrates for the, this is a vector wave, so there's polarization involved and we can look at the how much energy gets reflected and transmitted. And you can say for instance, that there's a magic angle, which is a rooster angle where all the wave goes in, but then as you increase it, it goes away and, and so on. And there's many of these in this system. See, in order to make a course out of this, you really need to provide practice and feedback to the students. And the problem is that it's time consuming, expensive to grade. So I want to show you a system that we've developed. This, this was developed by a grant from the, from the state of California to develop affordable web based education. And we have used it to do, To do some of these math methods things too. So this is the platform, this is the way it looks and, and it's organized around libraries of questions and we have many of them. There's a bunch of, there's physics, chemistry, various levels of physics that are used at community colleges and conceptual sort of physics for poets kind of things. We have some chemistry, we have a complete set and there are thousands of questions in here. All, all of which have, you know, nice solutions. So the, the way this, you can look at this problem and there are, there are solutions that are provided to it and those solutions would be available to the students. So that's, that's the, there's many things. The things I want to talk about are mainly this math methods. Let's see what, I'll show you. First, Let me show you how an instructor would generate a set of problems. Let's just call this demo. One will create it and what we typically would do, you can write your own questions, but you typically get a library. And then this is a library for undergraduate math methods. Let's say we want vector calculus problems. Let's say we, let's take a look at this one. So it's evaluate some line integral. We look at it, it's got a couple parts. We can quickly look at the solution, see if it's what are, what are what our students, you know, whether our students are ready for it. And the format for all of these things by the way, is a, reflects a concern of other faculty that the students learn how to do this all by hand, in detail. So the format of all the answers are do it in, in detail, essentially by hand, where you could have done it by hand. There's an answer at the undergraduate level, the answers tend to be simple like -2 PI. And then they, and then it always has a check with how you would do this in Mathematica. So it also teaches them how to do things in Mathematica. But you can sort of see whether that is what you want your students to be doing. If you like it, if think that's the way to go, you just click that button and you can look at some other ones. You can look at this one and say, do I like that? I can look at the solution, see if it's good and say, yep, that's what I want. And now I've got a question set that I can add to a course. So, and it will. And well, let me look at it. All right, so this, this is actually a live course that one of my colleagues is using to do this. And let's see. Well, wait a second. Let me show you what it looks like to a student. Now to a student, it looks like, look at an old homework problem. So these are. So it looks like this. And, and the students will, can either do it on paper and pencil and type a number in here, or they can copy and paste for Mathematica if they want. And it gets automatically graded so they, they get immediate feedback into, you know, whether they got it right or wrong. And from the instructor's point of view, there, there's a. So this is literally a course that's going on right now and it has roughly 100 students in it. And the system is automatically grading all these things. And if we look at. This is literally, this is what a student. This is a homework that was due, I think last week. And so here, here are the, here's some of the inputs that the students put in and they got it correct and so on. And there's another feature for all these problems. The problems I've showed you so far have sort of simple symbolic solutions, but you can also have them upload a file. And for something that show a proof or whatever, you can have them actually upload a file and then. But you have to grade that by hand. So that's how that system works. And it's been quite effective. And it, you know, we've done it for math methods, but. And for physics. Let me give you a quick sort of idea of how the grading algorithm works. So we have sort of the, a general purpose symbolic grader, the website. These are API functions. And so the website sends a message to a function that is on The Wolfram cloud. And the first thing you do is make sure that it's syntactically makes sense. And then we do some string manipulate. There's a lot of ENM problems that have epsilons and muse and all that. We take care of that. Basically the idea for the simple stuff, an algorithm seems to work pretty well is figure out what variable. If there's symbols in both the student's input and the correct answer, we find those symbols and then basically assign random numbers to those symbols. So we turn it into a numeric thing. And then you also have to check sort of the basic structure of the answer. If it's a list, is it the right length, is it the right structure, is the answer? And, and then you, and then you send back yes or no to the yes or no or you can give hints and you know about what kind of errors got detected. And that generates the score. And you put those in the Wilfram cloud. And it's been working very well. For non unique answers there are a bunch of problems where it's not. You can't just simply say is this equivalent to the correct value? And we have special functions that do that. And a typical example is a solution to equation or finding the eigenvalues. There's no order to them, so you can't just say is this the same? And so you have to write some special code for it. And that's easy to do too. We have a graduate version of this and the subject matter is similar, but it's sort of higher level. So at linear algebra, you know, we discuss some of these things, but we include things like pseudo inverse singular value decompositions, we talk about fancier complex analysis and so on. Let me show you a typical homework assignment. So this is the graduate version. And this, of course you cannot grade these automatically. So the format in this thing is the homework is assigned as a notebook and then turned in as a home. And I'll show you what that looks like. So this is a homework assignment involving different trying to explore the differences in asymptotic solutions. In a linear and a nonlinear system is another nonlinear equation problem. These are some asymptotic evaluations of integrals, a perturbation problem, a simple PDE problem. And then one of the things I emphasize to my students is that this is typically a first year graduate course. And I emphasize to them that this is basically the last time that they will be in an exam room where their performance is judged by a timed exam in one hour. And that more realistic thing is that they're going to be working on problems that take them months and years. And they're going to do this with many people. They're going to have collaborators and so on. And therefore technical communication is very important that you have to be able, it's important to both. So you can go back to your own work three months from now and you can communicate with your boss and with your collaborators in an effective way. And Mathematica is great at that. And I encourage mine. You know, I basically teach my students how to do that nicely. And so, yeah, let me, let me show you what you know. So that notebook, I give them that notebook and this is sort of the flavor of what comes back from them. And they, they learn to do beautiful plots. They do nice explanations of what they're doing and why they're doing it. They, you know, they know how to use the graphics very well. You know, they, they get carried away actually with, you know, funny simulations of stuff and, and so on. So you can see that they do a, a very nice job and it's readable and it carries over into their subsequent research work. And I want to contrast that, actually, I think I have a picture of that somewhere. Yeah, this is, this is what my more conventional colleagues get as a response to a homework problem. And you can, I think you can appreciate the difference. And it just prepares the students for the real world in a much better way. All right, let me summarize what I've said. I developed a completely notebook based textbook for mathematical methods course both and it can be used as the, at the undergraduate level or the graduate level. And it's sort of a, you know, plugin compatible with the standard courses and it can replace the standard books. It covers the same material at roughly the same level with, and, and there's a gradation of levels. So you can use it either undergrad or undergrad. And then we have built a web based platform that has thousands of questions with nicely formatted solutions and, and leverages Mathematica to automatically grade that stuff. And we've used it, the same technology is used and actually gets used more for grading basically undergrad introductory physics classes and chemistry. And if you or your colleagues have any interest in using these technologies, I would be very happy if you got in touch with me and we could, you know, explore how to do it.
More from Guy

Cheryl Strauss Einhorn | The Human Edge: Smarter Decisions in the Age of AI | Talks at Google

Rachel Glennerster | Innovation and the Center for Global Development | Talks at Google

Rebecca Winthrop | Rethinking the Purpose of Education in the Age of AI | Talks at Google

Dr. Robert Wachter | A Giant Leap: How AI Is Transforming Healthcare... | Talks at Google






