 Let's go ahead and get started. So I thought that the first thing that I would do is go over the homework assignment for this week. We've already covered all the material that you need to know in order to do it. And hopefully it'll be fairly straightforward. Can you see this with the lights on? Okay. All right. So there are six problems. And the first one is to report how many permutations are there of 200 distinguishable objects. So that should be obvious from the notes, how to get such a number. And then the second one has to do with the binomial coefficient. So that's how many ways can you take 200 distinguishable objects and divide them into two groups, one containing 150 and the other containing 50 without regard to the order. And then the third one is a calculation similar to some of the examples we've done in class where you use essentially the binomial distribution to calculate the probability of getting 40 heads in 100 flips of a fair coin. And then in number four, what I'd like you to do is plot the probability of getting exactly M heads in 200 coin flips as a function of the number M. Okay. So again, that's an example, very similar to that in the notes. And I've advised you to use the option plot range arrow all so that you get a full plot of your function as opposed to just part of it. Okay, then number five, there's a couple of things to do. So there is on the homework web page, there's a file called chem1afinalscores.dat, it's final exam scores from a Chem 1A class and two columns of data. The first column is just a number of a student, one, two, three, four, five, et cetera. And the second one is the corresponding scores. So what I want you to do is import that file into a matrix and then I want you to report the minimum, maximum, median, mean, and standard deviation. Okay. And then make a raw histogram. So just the raw counts using a bin width of two, that's part B. And then in part C, I want you to do a couple of things. So first, make a probability density histogram from those scores and it says to use 40 bins, okay. And then you want to assign that to some variable and then make a separate plot which is a normal distribution that has the mean and standard deviation of the distribution of scores, okay. And save that plot as also a variable and then use the show command to put them on top of each other. And the thing I want you to look for here is whether or not you think the normal distribution accurately represents the distribution of scores in this particular Chem 1A class, okay. So you can make a comment about that at the end of the problem. Okay. Last problem is you're going to plot molecular orbitals, okay, using three-dimensional plotting techniques. All right. So you all remember, I'm sure, from your GCAM, the concept of molecular orbitals. So molecular orbitals is a way to describe the electronic structure in molecules and the version of the molecular orbital theory that you learn in general chemistry is the so-called LCAOMO model which stands for linear combination of atomic orbitals. So the idea is that each atom in the molecule contributes some atomic orbitals and then those go into a hat and abracadabra occurs and out of the hat comes the same number of orbitals but now distributed over the molecule. And you may recall that the way those orbitals are combined, the atomic orbitals are combined in the molecular orbitals, you end up with so-called bonding and anti-bonding combinations, okay. You could also get non-bonding combinations, okay. So what you're going to do here is you're going to plot the molecular orbitals that come from combining two hydrogen 1S orbitals into molecular orbitals for the H2 plus ion, all right. And so what you get is two molecular orbitals. One is a sigma called sigma 1S. So it has cylindrical symmetry along the bond axis and it's a bonding combination. And in Cartesian coordinates the functional form is like this. This isn't exactly it but it will give you the right shape, okay. And then there's a non-bonding or an anti-bonding combination that is the same thing except instead of adding them together we actually subtract them in the two terms, okay. So these are basically just S orbital-like functions. All right and here D is the bond length and the units here in Bohr radius but you don't need to worry about that. Okay so I want you to use D equal 2.5 and then make separate plots of each of these functions using plot 3D and you should recognize them because you've seen them in your general chemistry textbooks or you should have anyway. All right now so that's part A and I tell you what range is to plot the functions over in plot 3D and then I want you in parts B and C to make contour plots and density plots of not the orbitals themselves but their squares which are proportional to the probability density of finding the electron at a particular region space and there's slightly different ranges here. And in part C for the density plot I ask you to change the color scheme to gray tones. Okay so that's the homework for this week. Does anybody have any questions on that? No. Okay well so we're going to continue today with plotting and I want to just quickly summarize what we've done so far in terms of plotting. Okay so we have plotted functions or data of the form Y equals F of X. So here we have a single independent variable here. This gives us a two-dimensional plot and we've seen how to do this with the plot command and also the list plot command for discrete data. Okay and then more recently we learned how to plot three-dimensional functions of two variables and we have three ways of doing that which you will explore in the homework. So one is plot 3D and then we also have contour plot and density plot. Okay now today to finish up our plotting we're going to learn how to represent at least partially functions that have this form. So how many dimensions is this function or surface S going to be? One variable, two dimensions, two variables, three dimensions, three variables, four dimensions. It's not a trick question. Okay now I see you're kind of wondering well how are we going to do that? Can anybody see in four dimensions? If you can you're unique. How about do they make four-dimensional glasses like they do for three-dimensional movies? Well so then this is a little strange right because you've certainly seen depictions of functions like this. How many dimensions does an electron in an atom move in? Three. And then how is it that we can depict an orbital in a textbook? You've all seen the pictures right? There's pictures of orbitals. So you're seeing a representation of a four-dimensional function but what you're actually seeing see is a contour plot. So remember when we could plot three-dimensional functions in two different ways right? We can display the whole three-dimensional surface or we can make a two-dimensional plot of a three-dimensional function by drawing its contours. So that's the trick to seeing a picture of say an orbital which is a four-dimensional function represented as a three-dimensional object. It's actually a contour plot which you look at when you see those pictures. Okay and there is a command in Mathematica which we're going to use and we'll use it to visualize atomic orbitals which is called contour plot 3D. Now so what are we actually going to draw with that? Well like I said we're going to draw atomic orbitals. Okay so those of you who are taking PKEM right now you're learning how to solve the Schrodinger equation and pretty soon you'll talk about how that's done for the electron, the problem of the electron in the hydrogen atom and you'll see the hydrogen like orbitals emerging from that. And you'll find that using say X, Y and Z is not the most convenient set of coordinates for solving that problem. Okay you're going to find that it's the distance from the nucleus as well as a couple of angles. And so the functions that you're going to be looking at are going to be functions of r, theta and phi, r being the distance and theta and phi being two angles. Now once you have those orbitals you can write down Cartesian versions of them. So Cartesian coordinates are X, Y and Z. And that's what we're actually going to plot here so that we don't have to worry about all the special functions that arise in the case of r, theta and phi. Okay so we're going to write orbital like functions and you'll see they have more or less the correct shapes so orbital like functions they're going to be functions of the Cartesian coordinates and they're going to be in the following form a constant which we'll ignore times a function G of R and H of X, Y and Z. Okay and R here is the distance measured from the origin which is X squared plus Y squared plus Z squared square root. Okay and the functions that we're going to consider today as examples are as follows. So we're going to consider something that looks like a 1S. In that case G is equal to E to minus R. This is going to be in units of Bohr radius and H is equal to 1. Okay and then we're also going to look at the 2PZ. Do you remember what the 2PZ orbital looks like? It's like a dumbbell. It has two lobes and which axis is it aligned with? Yeah. Okay so this one's going to be E to the minus R over 2 again in units of Bohr radius, the distances and H is going to be equal to Z. And then we're going to look at the 3DZ squared orbital. So you remember what that one looks like? That's the D orbital that looks somewhat like a 2P except it has the same sign in both lobes unlike the 2P. And then it has the donut around the XY plane. Okay and so for that one G is equal to E to the minus R over 3 and H is equal to 3Z squared minus R squared. Okay so these are all going to be four dimensional functions and we're going to represent them as three dimensional contour plots. All right so I think we have everything we need to get started. All right so the first thing I'm going to do is I'm going to define the distance R as a function of XY and Z. Okay so I'm going to say R bracket X underscore Y underscore Z underscore bracket colon equals square root X squared plus Y squared plus Z squared. All right so then once I have that I can use it over and over. Okay now for the 1S orbital then I'm going to say F of XY and Z colon equals E carat minus R of XY and Z. Now the contour plot 3D command so here it is 3D. You actually have to specify the contour level that you want your function to be drawn at. Okay and so this is going to introduce us to a new kind of equals which is the double equals sign and this is a place where yes oh I have an X instead of a Y. Thank you. That would have been a pretty funny looking thing. Thank you very much and okay so what we do then is we say what do we want to plot? Well we're going to plot F of X, Y and Z and then we need to specify the value okay now if you look at the function that we're plotting you can see that it's exponentially decreasing with R. Okay so as XY and Z get bigger and R gets bigger this function dies off exponentially and you can also see that it goes between values of 1 and then as R goes to infinity it will be 0. So the contour we choose should be a low value of the function so that we can draw you know an envelope that it encompasses you know a large amount of the function. Okay and so what I'm going to say is that I'm going to choose the value F equals to 0.1 all right so it will be 90% decayed on the contour that we're going to see. All right now to specify that we have to use double equals okay and if when you're doing these say in homework or something next week if you don't get anything it might be because you forgot the double equals. So I'm going to set it equal to 0.1 and then I have to specify the ranges of X, Y and Z and this is sometimes done by trial and error okay or if you wanted you could plug some numbers into the function and get a rough idea but anyway so for this plot X going from minus 3 to 3 and the same for Y and Z works pretty well. All right so let's go ahead and let it rip. Oops we need a minus 3 here sorry okay now one thing to notice is that there's actually a fair amount of calculation going on here because we have to evaluate the function and find out where it actually equals the contour okay anyway at the end of the day you get something that looks like a sphere centered at the origin and sure enough that's what we know the 1S orbital to actually look like okay. Now what if you wanted to see more of the function? Well you could lower the contour a bit say 0.05 what's that going to do is it's going to make the sphere bigger or smaller? Well what it means is it will be going out to R so where the function is decayed even more so it'll be a bigger surface right the smaller the value of the function the bigger the surface will be. All right see so it grew all right and if you want you can grab this guy and move it around and it's also helpful when you're drawing these to put in some axes so let's go ahead and put in axes labels and so I'll just say X, Y and Z. Oops we need a curly all right so there you have it. So now you can see in four dimensions sort of you can see a shadow in four dimensions okay the shadow of a four-dimensional function basically all right so I want to take this opportunity to show you something that some of you may have already discovered or needed to use but it does occasionally become useful when you're doing number intensive things like these contour plots because from time to time the mathematical kernel gets screwed up and it's useful to know how to stop it and restart it so that you can continue your work so sometimes if you know mathematics is not responding or you think you've put something in correctly and you're not getting a result this is something that you may try in order to make sure that it's not your code and that it's just something going on with the mathematical kernel. So the engine that underlies the program mathematics is called the kernel and the way to turn that off and restart it is as follows so you go under evaluation and you go down here to quit kernel and select local come on and then you say yes I really want to quit okay so now mathematics is dead okay and if you want to start working again you go down and say start kernel local okay and that basically fires it back up and then if you want to reevaluate your notebook you could say evaluate notebook and then it'll just go through and redo everything that you had done and that way you can see if you still have any issue you know this is something that you might want to try from time to time when you're having problems and you don't think it's anything to do with your commands okay now so this here is a beautiful 1s orbital and I imagine that a lot of you are probably a little underwhelmed at the moment so let's do the 2pz it's a little more interesting alright so let's just go ahead and mouse all this F and contour plot stuff in okay and put it back alright now we have to modify the function a little bit so first of all we'll put in the r over 2 here and just to make sure everything is done correctly we'll put this in parentheses and then we just have to multiply out in front by z okay now I think we're otherwise okay for the time being so let's go ahead and enter that and we should see in principle a 2pz orbital now that doesn't look like a 2pz orbital does it does anybody think it does okay so what's the deal well one of the deals is you remember that as the principal quantum number of the electron in the hydrogen atom increases its orbits become larger okay so one thing we could suppose is that we're only seeing a piece of the function here because 2pz orbital is bigger for a given value of the function than is a 1s so we should certainly increase the ranges over which we're looking at the function okay and so for example we might increase these values to 10 boron radii instead of 3 alright so let's try that alright still cut off but we can fix that by just putting in 0.1 instead of 0.05 so we'll see a little less of the function but you can already see that this does not look like a 2pz orbital does it so what's the deal it looks like we're only looking at half well we are only looking at half you may recall from G. Kemp or from organic chemistry where these kind of knowing something about the sign of the lobes of the orbitals one of these lobes has a positive amplitude and the other one has a negative amplitude so we're only looking at the positive one here because we specified a positive value for the contour okay if we want to see the whole thing we need to plot another surface to go with this one that corresponds to the negative the lobe with negative amplitude okay so let's we can fix that pretty easily so what we're going to do is we're going to put in a curly bracket here and we're going to plot this positive one along with a negative one that has the same contour level okay so I'm just going to put a minus sign in here and then a curly bracket okay alright so we can let that rip and now we should see a 2pz orbital okay so now there we have something that looks more like the 2pz orbital that we know and love and it's still not that pretty because we've plotted the surfaces with the same colors and so it might be informative if we're trying to explain to somebody about the signs of the lobes of the 2p orbital it might be informative to color the two lobes different colors okay so we can do that using directives as we did previously for three dimensional plots okay so what I'm going to do now is make a nicer looking plot by turning off the mesh okay so the mesh will be gone and now I'm going to specify some details of the contour style okay so for this I'm going to use directives to make these shiny surfaces with different colors for the positive lobe and the negative lobe okay so for the first one I'll say directive and I'll make this one green and then I'll change the specularity to make it a nice shiny solid looking surface so I'll say white 100 we saw this previously okay so that's for the first one and then for the second I'll do the same except I'll make it a different color okay so we'll change this say to yellow all right so the first directive applies to the positive contour surface so that'll be green the upper one and then the second directive will change the negative contour surface to yellow all right so let's see if that works aha they worked so now you have a picture that's worthy of being put into a GCAM textbook okay all right now let's do the 3DZ squared okay any questions on this so far just scroll up or down do you have the same ranges did you put e to the minus r over 2 you have the z maybe you got a Christa can check it all right any other questions yeah okay so the double equals is the way that we specify the value at which we want the contour to be drawn okay and the double equals it's just the mathematical syntax and we'll see additional uses of that later on it's sort of like saying sort of like saying making a special case right saying I want the function evaluated at that while I want to represent the function that when it's equal to precisely that value okay all right and that's a that's a source of some headaches because sometimes you forget to put that in and then it's hard to see because notice this double equals here has a very tiny little space in there that makes it hard to see that it's actually a double equals any other questions okay so let's move on to the 3DZ squared and so let's go ahead and grab all this stuff put it down here okay so now we need a slightly more complicated function so we'll say h minus r over 3 and then in front we're going to have 3 times z squared minus r of x y and z parentheses okay and we have to increase the limits because now we're moving up another principle quantum number and so I'm going to go ahead and put in 30 okay and so now we'll draw the surfaces in the same way as before the positive lobe will be or the positive part of it will be green and the negative part will be yellow crunch crunch crunch okay something looks a little weird there aha so notice it's 3Z squared minus r squared and I have only r okay so we need to fix that so this should be r of x y and z squared it will be worth the wait okay so there you have it does that look familiar more or less like I say these functions that we're plotting these are not exactly the functions describing the orbitals they're just they're close and they are giving a reasonable depiction of the shape okay so that looks kind of like the 3DZ squared and from this we can be reminded that in the in this orbital the part that's aligned along the z axis that looks a little bit like a p orbital is actually all positive amplitude and the doughnut going around it in the x y plane is negative amplitude and if you want you can change the colors easily so for example suppose we wanted to call this or paint this one red and this one blue we could do that just have to wait okay so while we're waiting I'll tell you that there's another way that we can well there are other convenient ways to depict functions such as this okay so there you have it maybe you like that better if you're feeling patriotic today okay so this is the way we draw three-dimensional contour surfaces contour plots of four-dimensional functions now you've probably also seen in your textbooks other useful representations of the orbitals drawn as contour plots but through but showing a plane cutting through the orbital so I want to show you that because those make nice looking diagrams also so this is taking the three-dimensional contour of the four-dimensional surface but we can also now take slices through this guy and look at two-dimensional representations of it so for example I could come through with a knife and carefully slice through the middle of the thing where y is equal to 0 okay and basically eliminate y from the function so that now I actually would have a function of two variables which I can represent as a three-dimensional object using say contour plot or density plot okay so let's see how we can do that all right so we'll do that with this 3z squared 3dz squared and so what I'm going to do is grab up to here actually I want the function to sorry all right so what I want to do now is represent the this orbital as a slice through the xz plane or in the xz plane so that y is gone okay so how can I do that well first of all I can define my r now as function of x and z only all right so I've removed y from the picture so that'll be square root of x squared plus z squared and now f is not a function of y anymore so we can get rid of that and get rid of it here and get rid of it here okay and now I'm going to use the regular contour plot command and plot f of x and z and I don't need to specify the contour anymore because Mathematica will choose contours for me I can use the same range and I can get rid of the y axis here and then finally put in the bracket here oh I have to get rid of the y limits here too okay so now I think we're ready to see the 3dz squared orbital in the xz plane aha oh it's not squared thank you still got a problem here oh okay that worked all right so then it's a little bit screwed up because it didn't show the whole thing so we can say plot range arrow all re enter and now you see a nice picture of the 3dz squared orbital but now slice down along the y equals zero plane so we're in the actual xz plane and I didn't get labels on my axis because I forgot like I do all the time that the contour plot is drawn with a frame so I have to say frame label okay so now you can see I have x and z okay you want more contours you can put more contours does that look familiar to anybody seen plots like that before you can see the positive lobe drawn with the lighter colors going to its maximum value at the white and then the negative lobe drawn with the darker colors here and of course you could change the color function and draw it in any wild array of colors that you like so does everybody understand or everybody understand what it is we just did here so we drop down another dimension and now we're representing the orbital as a three dimensional object using a two dimensional contour plot all right okay so now the last thing I want to show you with regard to plotting then is that these types of functions look very nice if you make them into density plots let's have a look at what that looks like all right so we can get rid of this contours and change this to density okay so there you have a nice sort of fuzzed up plot that sort of helps you to appreciate the fact that we're plotting a wave amplitude here it's a quantum mechanical object the electron in the 3DZ squared orbital of the hydrogen atom okay so that concludes our plotting lessons all right so now we know how to make all kinds of plots and in the next homework assignment you'll get to practice using these representations of the four dimensional functions okay so now we're going to switch gears now and we're going to start to see a new face of Mathematica that is going to be our introduction to symbolic math okay so actually using Mathematica to do you know mathematics and we'll start out with calculus one dimensional calculus we'll do derivatives and integrals okay so this is useful for many things you may find it to be very helpful in doing your homework or checking your homework sometimes in math classes or P. Kim classes so very very handy okay so to begin here I just want to make sure that we're all on the same page with respect to what is the derivative how's the derivative defined okay so I have a function f equals f of x and now I want to define its first derivative so we'll call it f prime of x actually we could call it y equals f of x and equivalently say dy by dx so anybody remember the definition of the derivative you take it's the local slope right if it's evaluated at a point it's the slope of a curve at that point so we take the value of the function at a particular value x we subtract that from the function evaluated at a little increment away from x we divide by that and we take the limit as the little increment goes to zero. All right so that's our definition of the derivative so now let's see how we can do differentiation in Mathematica all right so the first thing I'll do is I'll generate a function that we will take the derivative of okay so let's say f of x underscore colon equals and it'll be a simple function where we could just you know quickly verify the derivatives in our head so it'll be two x cubed plus eight times x squared and then minus three times x and then plus one okay and I'll enter that all right now there's different ways to ask for the derivative so if it's a function of one variable like this one you can use the prime notation so I can just say give me f prime of x all right and you see you get minus three coming from this term and then you get 16x coming from this term and you get 6x squared coming from this term. Okay you want the dot the second derivative f double prime okay so that's just taking the derivative of the first derivative third derivative f triple prime and then finally if we take the fourth we should get zero and we do okay so that's kind of nice there's an alternative way to do the derivative this is a more generally useful notation and that's by using the d command d standing for derivative and the way that works is you say d capital you specify the function you want to differentiate so f of x and then you say which variable you want to differentiate with respect to all right so this should give the same thing as f prime and it does if you want the second derivative using the d command you say d function and then in curly braces you say x and then the second derivative with respect to x all right so you get the second derivative and you can do the third by putting in three and the fourth by putting in four okay there's yet another way of getting the derivative using the palette and so for that we go down here and you can see that there's this little del button here so the way you use that is you push that button the subscript is the variable you want to differentiate with respect to so x and then the other square there is where you put the thing you want to differentiate so this should give us the first derivative of x I mean f of x and it does okay so three different ways of doing the same thing for simple function of one variable now the next thing I want to tell you about is partial derivative so when we have a function of more than one variable we can take derivatives with respect to each of the variables separately or we can take the derivative first with respect to one variable and then second with respect to another one and the way we do that is through partial derivatives how many people have had experience with partial derivatives most okay so just to make it clear what we're doing here now we're going to suppose that we have a function f of x and y okay and the notation is as follows I could take the derivative partial derivative of f with respect to x and I put a subscript here telling me that while I'm doing that I consider y to be a constant okay and so that would just be f of x plus h comma y minus f of x y divided by h the limit h goes to zero okay so it's just like the one-dimensional version we just treat y as a constant and similarly we could define the partial derivative of f with respect to y holding x constant and in that case we would have x y plus h okay alright and then we could also do second derivatives you can do d squared f by dx squared you could do d squared f by dy squared and you could do mixed ones d squared f dx dy alright so I'm going to show you now how to do those using the d command okay so let's go ahead and generate a function of two variables so we'll say f of x underscore y underscore colon equals so this will be three times x to the fourth minus two times y cubed and then plus x squared times y squared alright now if I want the partial derivative of f with respect to x I'd say d f of x comma y and then I just specify I want x okay so y will be treated as a constant now alright so there you have it does that look right this term gives the 12 x cubed the second term gives us zero because y is treated as a constant and then the third term we get six times x times y squared alright another way to do the same thing is we could use this palette we just say we want the derivative with respect to x and then we can put in f of x and y and you get the same thing okay now suppose you want the derivative with respect to y well you just have to change the x to the y in the d command alright so now you can see the first term gives zero because x is constant the second term gives minus six y squared and then the third term gives two times x squared y which you have here the palette just replace x with y same thing alright now next thing we'll do is we'll take the second partial derivative with respect to x so we can say d f of x comma y comma and then we say x two okay so what is that that's the derivative of this guy with respect to x okay so we get 36 x squared from the first term and 2 y squared from the second term we could do that with the palette by using the neighboring button here so this neighboring button is one that's convenient for second derivatives so we could say x tab x tab f of x comma y and we get the same thing alright what about the mixed partial derivatives so now what I want to do is first take the partial derivative with respect to say x and then take the result of that and differentiate with respect to y so that would be like d squared f by dx dy so we could say d f of x comma y and then we put in the curly brackets x and y whoops what did I do wrong there oh sorry we don't need the curly brackets alright so there's that one what if I reverse the order so I say y comma x I get the same thing and so that's an important rule for these mixed second partial derivatives that if those derivatives both exist then the mixed second partial derivative won't depend on the order of differentiation alright let's see how we do that one with the palette we could just say x tab y and tab f of x comma y same result okay so there you have it some examples of how to do derivatives now what I'd like to do next is use differentiation in Mathematica to do a couple of things relevant to physical chemistry problems okay so I'm going to we'll do let me explain to you what we're going to do here any questions on using the d command or the derivatives pretty straightforward okay so those of you who are in those of you who are in chem 131a now are learning about quantum mechanics and you're learning that variables such as momentum and kinetic energy that are just numbers or functions in classical mechanics classical physics can be represented by what are called operators in quantum mechanics okay so for example the momentum can one of you tell me what's the momentum operator this would be the momentum in the x direction call it px and the little carrot there is meant to indicate that it's an operator okay so this thing by itself doesn't mean anything it operates on a function so for example the wave function okay all right what about the kinetic energy I have this upside down don't I? Yeah it's h bar over i sorry okay oh and by the way for those of you who haven't seen it before h bar is the Planck's constant divided by 2 pi okay so the kinetic energy which maybe we could call say k that's defined as the square of the momentum divided by 2 times the mass of the particle okay and what the square here means is that we first operate on the wave function with the momentum operator and then we do it again okay in this case we can kind of see what's going to happen we're going to get h bar squared the i squared in the denominator is going to give us a minus sign and then we have divided by 2m and then we get the second derivative with respect to x okay so those are differential operators in quantum mechanics corresponding to the momentum in the x direction and the kinetic energy the corresponding kinetic energy all right so what we'll do is we'll evaluate those for our one-dimensional particle in a box which has the wave function psi of x 2 over l to the 1 half sin n pi x over l now what we're doing here is we're just going to apply these two guys to this wave function and those of you who are taking Chem 131a now know that that in itself doesn't produce anything meaningful in order to produce the actual value of these quantities we'd have to do more work but we'll get to that later after we talk a little bit more about once you have probability distributions how you actually get so-called expectation values out but for now we'll just use this as practice for you know doing the differentiation on something that's relevant to physical chemistry all right so what we'll do to begin with is we'll go ahead and oops where did that go type setting we will go ahead and put in a wave function psi make a function of x colon equals 2 over I'll use a little l for the length of the box and then raise that to the one half power and then multiply it by sine oops n times pi times x divided by the length of the box okay and now we'll evaluate the momentum operator acting on the wave function okay so I need to put in h bar over I and there's the h bar right there so I can make it look nice and then I is the capital I and then I say d psi of x with respect to x all right so that gives me the following result now like I say this thing that we just did here is only part of what you would actually be interested in doing if you're wanted to evaluate the value of the momentum but it's just a little exercise of differentiation so that we can see how you know we might use it in a real problem okay what about the kinetic energy all right well for that we need minus h bar squared divided by 2m and I'll put that in parentheses and now we'll multiply it by d bracket psi of x and now we need the second derivative so we say x comma 2 and we probably should put a parentheses in here and I need to make sure that I have a star here okay all right so then now we've seen the result of applying the kinetic energy operator to the wave function for the one dimensional particle in a box all right so one of you in chem 131a if I actually wanted to evaluate the expectation value of the kinetic energy the observable value what would I do next well what I would do next is multiply the complex conjugate of the wave function with the result of applying the kinetic energy operator in this case it would be the same as the actual function because it's not a complex function and then I would integrate over the length of the box okay all right so there's one example now the next thing I want to do is an example from thermodynamics which those of you who are in chem 131 now will see I guess in spring quarter so here's what we're going to do all right so in thermodynamics there are a couple of properties material properties one is called the coefficient of thermal expansion and it's given the symbol alpha so what this is a measure of is how much does the volume change of some substance when I change the temperature and it's defined per unit volume okay so how much does the volume change and it's for constant pressure mean that means dv by dt at constant pressure okay and it's done per unit volume so the actual definition has one over v in front all right so if we have an equation of state like the ideal gas equation for example where we know how the volume depends on the temperature we can evaluate this derivative and have an expression for this quantity all right another material property is called the isothermal compressibility it's given symbol kappa what is compressibility sound like to you because it sounds like something like how much does the volume change when I apply pressure does that seem sensible and isothermal means constant temperature now what do you suppose the sign of this is do things get bigger when you squeeze them no they get smaller so this derivative is in general going to be negative and the quantity itself is defined to be a positive number so it's got a minus sign in front of it and it's also defined per unit volume okay now what we're going to do is we're going to evaluate these for the ideal gas law okay now the details of these are not important to our class this is just a problem where we want to see how to use differentiation to do something relevant to physical chemistry and those of you who are in chem 131 will get to do this later on in the year okay so first thing we'll do is we'll notice that we want to take derivative of volume with respect to both temperature and pressure okay so we're going to define the volume as a function of temperature and pressure so say v is a function of t and p colon equals so what is that going to be for the ideal gas law and whoops little n times r times t divided by p okay and I'm going to start by clearing r because we were using it earlier okay and then we can enter that function all right now we want the coefficient of thermal expansion alpha so what do we need to do take 1 over v times d v of p and t and then t okay so this gives us the expression for the coefficient of thermal expansion whoops I should have said t and p sorry all right so it's nr over pv or in other words it's 1 over t all right has units of Kelvin to the minus 1 now we'll do the isothermal compressibility so that's going to be minus 1 over v times d of v of t and p and now we want the derivative with respect to pressure okay so that comes out to be nrt over p squared v but nrt over v is p so this is actually 1 over p if you wanted to simplify okay all right so there's a couple of examples of differentiation that are relevant to physical chemistry and I think we'll call it a day here any second now next time we'll do another example and then we'll start to talk about the much more challenging problem of doing integration so maybe between now and Thursday you can remind yourself that differentiation is easy, integration is hard and we'll see some examples of that next time they seem like they're you know integration is like anti-differentiation but for some reason that turns out to be a lot harder than differentiation so we'll get a reminder of that next time okay so see you then