 All right, so we've seen the definition of this quantity of called the variational energy where even if we don't know whether a function, this function phi is or is not a wave function, we can at least tentatively compute the energy of that wave function by doing this set of integrals in the numerator and the denominator. And in the occasion where we happen to have gotten lucky and guessed the right wave function, then this energy function now will tell us the correct energy of that wave function. So to see how that works in practice, let's do a relatively simple case. Let's imagine that the problem we're trying to solve is the one-dimensional particle in a box. So this is a case where we do know the correct solutions. We solved Schrodinger's equation for the particle in a box. Those wave functions look like the ground state wave function psi sub 1 looks like some normalization constant times a sine function, sine of pi x over the length of the box. And remember what that looks like is if I have a box that runs from 0 to a, the sine wave hits 0 at the two edges of the box because the probability has to be 0 outside the box and it looks like the ground state wave function looks like a sine wave, a half lobe of a sine wave inside the box. And the energy, remember, not pi but m, energy of that wave function is h squared over 8 times the mass of the particle times the box length squared in the denominator. So our task is, let's say we don't know the right answer. Let's say we couldn't solve Schrodinger's equation or we don't feel like it and instead of using the correct solution, we know at least qualitatively that the function should start at 0, it should go up and then it should come back down and land at 0 at x equals a. Another function that has that at least qualitatively correct behavior is a parabola, a parabola that starts at 0, rises to a maximum in the middle of the box and then decreases to 0 at the other edge of the box, has two 0s, a 0 at x equals 0 and a 0 at x equals a. So this function gives an expression for something that at least looks somewhat like the right solution. So let's see if we can figure out what the variational energy of that trial solution is. So we'll start with first just by calculating the quantity in the denominator. We'll do these two integrals one at a time to calculate the integral of the trial function times itself with a complex conjugate. We don't need to worry about the complex conjugate here because there's no i's, no complex terms in our wave function. So this is just going to be the integral of the wave function times the wave function integrated over the variable in our problem, x, integrated from one side of the box to the other. So that integral, if we work it out, that's the integral of, so x times x is x squared. The a minus x times a minus x is going to look like a squared minus 2ax plus x squared. If I then multiply by the x squared, I'm going to have an extra x squared, x is going to become x cubed and x squared is going to become x to the fourth. That's the thing that I want to integrate from zero to a. So integral of a polynomial, integral of x squared is one third x cubed and I've still got an a squared in front of that. Integral of x to the fourth is one fourth x to the fourth with a minus 2a. Integral of x to the fifth is one fifth of x to the fifth and that whole thing is evaluated between zero and a. So taking those terms one by one, if I plug in a in free checks, a squared times a cubed gives me a to the fifth. There's a three in the denominator. A fourth, a to the fourth times a is also a to the fifth and this time I've got a two over four is two in the denominator and in the last term a to the fifth with a five in the denominator and then when I plug zeros in for x is all those terms go away. So I don't have to worry about the second set of three terms. So this is all equal to each term looks like an a to the fifth. My fractions, if I put them all over the same common denominator, common denominator of three and two and five looks like it's going to be 30. So I've got 10 over 30 is the same as one third. 15 over 30 is the same as one half and six over 30 is the same as one fifth. 10 plus six is 16 minus 15 is one. So I end up with the result of a to the fifth over 30. So all that work was just to figure out what is the value of this integral in the denominator. Notice that my way function, I didn't take any care to normalize it. This is not a normalized way function. If it were normalized, the denominator would be one. In this case it comes out to some value that's probably not one depending on what the length of my box is. So essentially I've just done the work of having to normalize the way function since I didn't bother to do it when I set the problem up. The next step, let's calculate the integral in the denominator and that one's actually going to be a little bit easier as it turns out. So if I continue my work over here, way function complex conjugated if I need to, which I don't for this example, multiplied by the Hamiltonian times the way function again, that's going to be the integral of my function x times a minus x. Hamiltonian, remember for the harmonic oscillator, I've been saying harmonic oscillator, I mean particle in a box. For the particle in a box that Hamiltonian is just h squared over 8 pi squared mass times the second derivative. And the thing I want to take the second derivative of is again the wave function. This is probably a good time to say that I can rewrite this wave function x times a minus x as x a minus x squared as an intermediate piece of work. So the thing I want to take the second derivative of is the wave function, which I'll write in this case as x a minus x squared. Second derivative of this quadratic just gives me, if I take the first derivative, I'll get minus 2x and the second derivative turns that minus 2x into a minus 2. So this whole second derivative term is just gives me minus 2. So the result is I want the integral of x a minus x, which I can go ahead and write since I've done the work, as x a minus x squared. My constants stick around minus h squared over 8 pi squared mass. Second derivative has given me minus 2. And I want to take the integral with respect to x integrating from 0 to a. So these are all constants which I'll pull out front. So h squared over 8 pi squared mass times a 2. Integral of x a minus x squared is 1 half a x squared minus 1 third x cubed. Again evaluated from 0 to a. If I plug in a's for my x's I'll find for the term in brackets 1 half of a cubed when I plug in a here and then minus a third a cubed when I plug in a in for the x right here. So the net result 1 half minus a third is a sixth. Two times a sixth is a third. So I can write my result as h squared over 8 pi squared mass. 2 divided by this six is 1 over 3. And I have an a cubed on top. Alright, so that's the second piece of work I needed to calculate the numerator of the function. The final step is to figure out what the variational energy is itself. That variational energy is numerator divided by denominator. So I've got h squared over 8 pi squared mass times a cubed over 3. That's the numerator. I'm going to divide by the result I got for the denominator 8 of the fifth over 30. So when I divide by 8 of the fifth over 30, I'll write that as 8 of the fifth under 30. We have a lot of cancellation. Let's see. The 3 cancels the 10, cancels the 30 and leaves me with a 10. The a cubed cancels 3 of the a's hiding in the a fifth. So I get an a squared in the denominator. I've still got an h squared on top. An 8 in the denominator. The pi squared in the denominator. I'm going to move over to here. And I've got an m in the denominator. So the reason I've collected the terms in that particular way is I've put the h squared over 8ma squared together because that reminds me of the correct energy of the ground state of this particle in a box. Energy is h squared over 8ma squared if I had chosen the correct ground state wave function. I didn't. So what I got was not exactly the ground state energy, but the ground state energy multiplied by some other collection of constants. Turns out that 10 over pi squared is larger than one. It's not far away from one. Pi squared is 9 point something. So if I calculate the value of 10 over pi squared, what I find out is the energy, the trial energy, the variational energy I've gotten for this trial function is the correct energy times 1.013. So essentially by guessing a function that looked reasonable but wasn't quite right, I got an energy that was 1.3% larger than the correct ground state energy. And it's no coincidence that the energy I got was larger than the correct ground state energy. It turns out no matter what trial function I guess, unless I guess the correct ground state wave function, I'm always going to get an energy larger than the ground state. And that's something we'll take advantage of a lot and something that will prove to be the case in the next video lecture.