 If you keep a charge at the center of a sphere, then we've seen that the electric flux, the total flux through the sphere happens to be Q divided by epsilon naught. But what's amazing is that even if this was not a sphere and you had kept a charge in some random shaped surface as long as it's closed, the flux through that would still remain the same. So the flux through any closed surface would still be Q divided by epsilon naught, regardless of where the charge is kept. And in general, if there are multiple charges, then the total flux will be just the sum of all the charges inside the closed surface divided by epsilon naught. And this is what we called the Gauss's law. So the goal of this video is to mathematically prove that this is true for not just spheres, but for any random shape. So where do we begin? I think we can begin by recapping how we proved it for a sphere. We said, hey, flux through the entire sphere can be calculated as flux phi equals the product of electric field times the perpendicular area at that point. And of course, we have to integrate this over the entire surface. But because the electric field due to a point charge everywhere over here is the same, and because the area everywhere is the perpendicular, I can just multiply them. And if I do that, the electric field is 1 by 4 pi epsilon naught Q by r square. So Q divided by 4 pi epsilon naught r square, where r is this distance, or you can imagine the radius of the sphere. And the perpendicular area is just the area of the sphere. The entire sphere is perpendicular. So the entire area of the sphere is 4 pi r squared. And as a result, this cancels and voila, the flux through the sphere happens to be Q divided by epsilon naught. And this is a quick and dirty derivation, but if you need a more detailed derivation, we've talked about all of that in all its nuances in our previous video on Gauss's Law. So feel free to go back and check that out. But now, how do we prove this for any random shape? Because now electric field everywhere would be different. And the area is not nice, and the area is all crooked, so it's going to be a nightmare to calculate it, right? So how do we do it? There are probably multiple ways to prove it, but one of the ways I love is what I found in Richard Feynman's book. And the method goes as follows. Even though we're now calculating the flux through this big surface, let's still imagine a tiny sphere of any radius you want, which is centered at that charge. Now we know the flux through this sphere is Q by epsilon naught. We know that. Now all we have to prove is that the flux through the big surface is exactly the same as the flux through the sphere. See what I'm saying? If we can prove that the flux through this big, close surface is the same thing as the flux through this sphere, then we are done. Then we can say that should equal Q by epsilon naught. So how do we prove that? For that, we'll divide this sphere and the big surface into teeny tiny pieces like this. So I'm going to show you how we'll divide it. So let me draw a couple of dotted lines over here. So let's say this is one of the lines. I'm dividing this into tiny piece now. And this is another line. So we'll find one tiny piece over here. Remember this is in three dimensions. This is a surface. So you'll see a circle over here. And there's another tiny piece over here. And you imagine that these two lines are very close to each other. This angle is almost zero. So you imagine these are like almost point, you know, these are like very tiny surfaces. Now all you have to do is prove that the flux through this piece is exactly equal to flux through this piece. If we can do that, we are done. Because then I can do the same thing over here. And I could say, hey, flux through this piece by the same argument would be flux through this piece. Then I can say, hey, flux through this piece would be the same as flux through this piece. And as a result, I can then say, hey, flux to the sphere is the same thing as the flux through this whole surface. And as a result, the flux through the closed surface would be Q divided by epsilon naught. So you see how we are changing our proof? It all finally boils down to proving that the flux through this piece is exactly equal to flux through this piece. And so the question now is, how do we do that? Well, let's go ahead and try and calculate. So what's the flux through this tiny piece? Let's call that as phi one, only through this piece. Well, that would be the electric field at that point, which we know how much it is. I'm just going to write it as e for now. So that's going to be e times the perpendicular area over here. Now, since this is a sphere, we know that spheres are always perpendicular to the radius. Electric field is along the radius. So this area automatically becomes perpendicular. So this entire area, if we call that as a, the entire area becomes perpendicular. And as a result, the flux through this piece is just e times a. Now let's figure out what the flux through this piece is. And let's prove that it will also be e times a, okay? All right, how do we do that? So flux through this piece, let's call that as phi two. That's going to be the electric field here, multiplied by the area perpendicular over here. But what's the electric field over there? We know electric field is going to be radial this way. But that electric field is going to be less than e, right? Because we have gone farther away. But how much less? I want to compare this. If I call this electric field as e dash, I want to know e dash. I want to compare e dash and e. So how do I write e dash in terms of e? Well, one way to do that is we can look at the distances. So let's say this distance is r, this distance is r. And then let's say this distance from here to here is n times r. And remember, because this is a very tiny piece, this distance and this distance and this distance are all same. They're all just n times r, okay? So here's my question now. If this is r and this is n times r, if this electric field is e, what will be e dash? Can you pause the video and think about that? What will be e dash in terms of e? It's going to be e divided by something. Can you pause and think about what that will be? So e dash is going to be q divided by 4 pi epsilon or not nr square. And so there will be an n square. Since this whole thing is e, it's going to be e divided by n square. Does that make sense? So electric field over here e dash is going to be e divided by n square. If you think about it, that kind of makes sense. Because electric field goes down as 1 over r square, if you increase the distance by n, the electric field decreases by n square. This is the whole 1 over r square law. So electric field has reduced by n square. Now the final question is, what's the area over here? How do we calculate that? So at first we'll be like, okay, how do I calculate this area? How do I know how much this area is? But remember, I don't care about this area. I care about the area perpendicular. And this area in fact is not perpendicular. I know it's a little hard to see, but you can see it's kind of slanted. And so this is really not perpendicular to the electric field. So I need to calculate, and let me try and draw that now. I need to calculate the area that is perpendicular. So you can imagine it's a component of the area. It's a little hard to see. Let me use a little lighter color. So let me use pink. In fact, let me zoom in a little bit. Okay, so let's say this is the component of this area, which is perpendicular to our electric field. All right, so this is our area perpendicular. And the question now is, how much is that area compared to this area? At first it looks like things have become more complicated. Now we have a perpendicular component and all of that. But if you think about it, it's actually become easier. It's easier to calculate this area. Because if you look at, if you see carefully, you can see this area and this area and this charge together form a nice cone. And we know this distance is r and we know this is n times r. So using geometry, can you figure out if this area is a, how much will this area be? It's going to be bigger than a, but how much, how much will it be? Can you compare? Again, this is the last time I want you to pause the video and see if you can try this on your own again. What would be this area perpendicular? All right, let's see. Let me redraw that somewhere down over here. Big. Let me zoom out so that we can see properly. So to calculate this area, let's first concentrate on the diameters. Because if I know the diameters of the radius, then I can calculate the area. So there's one diameter over here. Let's consider the diameter over here. And now actually I see two triangles. And if you look at it, they're similar triangles because they have one common angle. They have this corresponding angle and this corresponding angle. Ooh, this means the sides are in the same ratio. So if this is n times this side, this diameter should be n times this diameter. Or this radius should be n times this radius. So if the radius is n times more than this, what can you say about the area? Well, area is pi r square. So this will be pi r squared. This area would be pi nr whole square. Or it'll be n square times pi r square. Or it'll be n square times a. So what we find is that this area, this area, is n square times this area. And now you can see right in front of your eyes something absolutely beautiful. You're seeing that the n square cancels out. I've never been happier about cancelling things in my life before. And as a result, the flux through this is exactly equal to the flux through this piece. Why is it happening that way? Because when I go farther away, the electric field goes down as 1 over n square. But the area increases by n square. And so the product stays the same. And since the flux here is exactly the same as flux here, this means the flux through this entire sphere should be the same as the flux through this surface. And that means the flux through that entire closed surface is also q divided by epsilon naught. Hence proved. But wait, before we celebrate, remember Gauss law works for multiple charges. How can we prove that? What if there was another charge over here? How can we prove that the flux now is q1 plus q2 by epsilon naught? How can we prove that? Well for that what we can do is we can individually calculate the flux due to q2. And for that we can draw another tiny sphere over here. And we can prove, same way, that the flux through this surface has to be q2 by epsilon naught. And then we can use superposition principle and we can say, hey, flux through due to both the charges must be q1 by epsilon naught plus q2 by epsilon naught. So it'll be q1 plus q2 by epsilon naught. And we can do the same thing for all the charges regardless of where they are. But finally, remember Gauss law says that charges outside do not contribute to the flux. Can we prove that as well? So what if there's a charge q3 over here? Can we prove that the flux due to this charge is zero? Yes, we can. In fact, using the same technique. So what we can do is, again, we can divide this entire surface into tiny pieces this way. Let's say I divide it like this. And now you have two surfaces over here. And now using the same idea, we can prove that the flux entering here is exactly the same as the flux exiting here. And we can do that for the entire surface, same way, by considering tiny, tiny pieces. And we would have proved that the flux entering this entire piece, entire blue surface, is exactly equal to the flux exiting it. And therefore the total flux contribution from this charge would be zero. And so even if there are hundred charges outside, their contribution to the flux would be zero. And now we have completely proved Gauss's law. That the flux through a closed surface indeed equals the total charge inside divided by epsilon naught. This is easily one of my favorite proofs in physics.