النص الكامل للفيديو
We continue with the special functions playlist by looking at gamma function as promised. Gamma function. It's one of the special functions we consider. We already saw it under the introduction in the previous video. So let's go ahead and take some deep look at gamma function. So first of all the topics covered here will include things like factorial extension oil integral functional equation reflection formula duplication formula poles and residues we saw poles and residues under different under complex numbers right so we saw poles and resides so we're going to see poles and residues here too then stelling approximation diagram gamma function poly gamma polomials worked examples and some python implementation. So let's go straight to it. we already saw in the introductory video that gamma function is one of the most important special functions in mathematics. it's generalizes the factorial function to non- integer and complex variables. So you know factorial functions we know factorial functions to be something like if you have five factorial that's 5 * 4 * 2 * 2 * 1. But gamma function helps us to generalize that even for even for non- integers maybe fractions or even negative numbers and complex values too. So the gamma function appears in calculus, complex analysis, probability theory, quantum mechanics, differential equations and statistical mechanics. The gamma function is defined by gamma of z= integral from 0 to infinity t^ - 1 e^ - dt for the real part of greater than zero. Okay. Now in the last video, one of the one of the worked examples did that solved by hand was you know showing that gamma of + one is equal to mean that showing that gamma of + 1 here is equal to gamma gamma Yeah. So that that was the kind of thing we saw there. Okay. So the motivation for gamma function is the extension of factorials. So recall the factorial function factorial which is 1 * 2 * 3 up to So if you have seven factorial that means 1 * 2 * 2 * 4 * 5 * 6 * 7 like that. Then examples you have 1 factor that's simply 1. 2 factorial that's 1 * 2 which is 2. 3 factori 1 * 2 * 3 which is 6. 4 factorial that's 4 * 3 * 2 * 1 or 1 * 2 * 2 * if you like that's 24. Now the question becomes this can factorial be extended to non- integers such as half factorial. Can we find half factorial? That's the question. So the gamma function provides this extension when you now deal with things like half factorial. You know, of course, we also know that 0 factorial is one. So gamma function is very cozy place to prove that 0 factorial is one, right? So the gamma function is defined by oiler's integral. So here we're looking at oiler integral definition. The gamma function is defined by the oiler's integral that gamma of equals integral from 0 to infinity t^ - 1 e^ minus dt. Now we could just say gamma of + 1 is integral of 0 to from 0 to infinity of t^ e^ minus dt. So if you have + 1 we have t^ if you have just we have t^us we can even have gamma zus one that have t^ zus 2 e^us dt. So whatever happens just pay attention to what you have here. So this integral converges for the real part of greater than zero. So interpretation is that t^ minus one provides algebraic growth while e^ minus provides exponential decay. So it's more like you have an interaction between growth and decay happening at the same time. Together they create convergent improper integral. Right? So you have one decaying you have one growing and then together they create convergent improper integral. Now you have functional equation. So the gamma function satisfies the recurrence relation gamma + 1= gamma That was why did in the other in the last video, one of the examples did was to show that gamma + 1 is equal to gamma or if you have gamma + 1 that's gamma or even if you like gamma is equal to - 1 gamma - 1 anyh how you you have it. So this is the continuous analog of the fact that + 1 factorial is the same thing as + 1 * factorial right there. Okay. So the functional equation is the key property that connects gamma with factorial. So this gamma equation is the key thing that connects gamma with factorials. So proof of functional equation now so so the proof that that was what did in the other video right so I'll just run through it slowly. So if you start with gamma + 1 to be integral from 0 to infinity of t^ minus dt then if you use integration by parts so you can let so integration by parts is about you pick part you pick part which is easy to differentiate another part which is easy to integrate and then you integrate differentiate integrate and put them together and get the result. So t^ is easy to differentiate in that if you keep if you differentiate minus one times you get constant. If you integrate times you get zero at the end of the day but e^ minus it keeps going. So it's better to pick this as what you're integrating. So if you let be t^ and dv is minus dt then it means u^ means du is t^ - 1 dt while dv= - dt means that is minus e^ - If you integrate this side now so now you can put it together by applying integration by parts. So gamma + 1 is then integral from so you you need generally speaking right that's in integral of dv okay integral of dv equals minus integral of du. So you just put all of that together and you have that. So you have this is now that's t^ and is minus 3^ - That's why this minus is what you have is for minus from 0 to infinity. If you put infinity is for minus infinity goes to zero. So it makes everything go to zero. You put zero when is whatever this is everything goes to zero again. So so this whole thing goes to zero as you can see here. And then for this now you have du right? So here you have minus e^ minus But you know here was supposed to be minus right? So the minus and minus becomes plus here and then you have zt rais^ zus one. So this comes out here and you have t^ minus one because the variable we looking at is is So that's why is more like constant here. So by the time you're done with that as this goes to zero you then have integral from 0 to infinity zus So if gamma + 1 is t^ e^ - dt under the integral then this thing t^ - 1 is simply gamma So that's easy proof that gamma + 1 is the same thing as gamma So now we then see that gamma extends factorials. gamma extends factorials. So using gamma + 1= gamma based on what we've established already. We can then see that gamma 1 is equal to 1 gamma 0. Right. yeah, that'll be gamma 1 is one 0 0 gamma 0. no okay no no no we not say gamma 1 is not 0 gamma 0. But the fact that gamma + 1 is + and gamma 1 is 1. If you can prove it to that gamma 1 is actually one. Then we obtain gamma 2 which is 1 gamma 1 which is 1. Then gamma 3 is 2 gamma 2. So that's two * gamma 2 is one. So you get two. Then gamma 4 is 6 which is 3 gamma 3. So that's 3 * 2. Gamma 3 is 2 that's 6. Thus we can say that gamma + 1 is simply factorial. So you see gamma 4 is 3 factorial. Gamma 3 is 2 factorial. Gamma 2 is 1 factorial for positive integers established. So then let's can we then compute the gamma of 1 /2. So one of the most important identities in mathematics is the fact that gamma 1 / 2 is square root of pi. So we derive this result carefully step by step. Start with the gamma function definition that gamma of is equal to integral from 0 to infinity t^ - 1 - dt. So if you now set to be half because you're looking for gamma of So it means that gamma half will be integral from 0 to infinity of t^ is half. So half - 1 e^ - dt. So if you simplify the exponent/ - 1 is simply minus/. So we have that gamma half is integral from 0 to infinity t^ - half e^ minus dt here. Okay. So next you now substitute you use the substitution you can then say here now let so for this now you say let be x². So we substitute the variable is two. So we substituting that with x². So that means if you differentiate = dt dx is 2x that means dt is 2x dx. So also then we have t^ - half - means for since is not square so we have square minus half. So 2 cancels half. So we get so we get 1 / this should actually be 1 /x believe. Yeah, because cancels here. So this should be 1 /x, not 1 / x². Okay. Well, mean that's more like Okay. Well, doing the indices that's 1 / roo 2. That's still fine, but could have just cancelled it. So that's still 1 /x, but that's So it ends up being 1 /x either way. So if you take to be greater than or equal to 0, right? 2 is and 2 - 1 /x. So was just going to do it this way. 2 cancels 2. So we have x^ -1 which is 1 /x that we end up getting at the end of the day. So you can substitute into the integral. So gamma of 1 / 2 is equal to integral from 0 to infinity 1 /x e^ - x^ 2x dx. mean what we have done there is to say this tus is simply 1 /x. And on the other hand now is x^ 2. So we have minus x^ 2. Now dt is okay e^ minus dt. Yeah. No dt alone is 2x dx. So we have this 2x dx right here. So we can then bring out the two. All right. So we have 1 /x. cancels here. So we bring out two. So we have 2 integral from 0 to infinity e^ - x² dx. Now this now becomes this looks pretty simple but then it becomes very big issue. So gamma/ 2 integral from 0 to infinity - x² dx. So normally if you just maybe let be x^ 2 and we differentiate but it doesn't work that way because it's not as straightforward as it is. So we now derive the gshian integral that integral from you know integral from minus infinity to infinity - dx is root of pi. That's where we are going to so want to show that this is equal to root of pi. So now let be integral from minus infinity to infinity of e^ - x^ 2 dx for starters. So if you square both sides so you have if you square both sides you have i^ 2. So square means you have integral integral from minus infinity to infinity of - dx because you have squared it. Now you can also now say that's integral from minus infinity to infinity of e^ - y^2 So they functionally the same. So then if you combine the integrals you have y^2= integral from minus infinity to infinity integral from minus infinity to infinity of e^ minus. So add up you have minus x^2 + y^2 dx So it now becomes kind of surface integral. So this is double integral over the entire plane now. So that that's the double integral there. So now we we have to now do something. So we convert to polar coordinates. So first of all if you say x= cos theta is sin theta. So then it means that x^2 + y^2 will be r² cos theta + r² sin square theta. So if you factoriize r² that will be r² into cos square + theta that will be 1. So that means x2 + is r². So so + will be 2. Then the jacobian then gives that dx dy is theta. If you do the jacobian of this we get theta. Thus we can say then that I^ 2 is integral from 0 to 2 pi you know now in polar coordinates we have and we have theta so we have line and angle kind of so for the line we have 0 to 2 pi for the no for the line we have 0 to infinity for the angle we have 0 to 2 pi so it's now eus r² da because the whole of this dx dy now is rd da we have here so if you separate the integrals we have integral from 0 to 2 pi of theta that's the only angular part and the the linear part is integral from 0 to infinity - r² dr like this. So if you compute the angular integral that's integrate theta integral of theta is theta. So that's theta from 0 to 2 pi that's 2 pi - 0. So the answer is simply 2 pi settled. Hence we then have 2 pi integral from 0 to infinity of - r² So we then need to evaluate that other part now. So now evaluate integral from 0 to infinity of - 2 Okay. So that means if you use substitution if you say let be 2 then we say du is 2 rdr. So and rdr now is simply 1 / 2du. So we have rdr here. So rdr is 1 / 2 du. So and if you put all of that together integral from 0 to infinity of of minus r² is now 1 / 2. So minus remains then is can simply go to du. So in this case we can evaluate integral from 0 to infinity of minus du. So eus du is more like from 0 to infinity right minus udu. So here minus from integral from 0 to infinity of minus du that's like if you integrate minus you end up getting you get minus e^ minus from 0 to infinity. Okay so that's take out the minus so you have minus from 0 to infinity. So this is minus e^ minus infinity minus e^ minus 0. Okay? If you put infinity first and then 0 later that's minus e^ minus infinity that's 1 / e^ infinity if you if you don't mind that minus 1 / e^ 0 if you like. Then this is minus 1 / e^ infinity is infinity minus 1 / e^ infinity e^ 0 is 1. So this is minus 1 / infinity is 0 because / 0 is infinity. So if you cross multiply that means 0 * infinity is If you divide through by infinity so this cancels out. So it means / infinity is 0. So anything divided by infinity is 0. So that's why this is 0 and this is one here. So 0 so this is minus one minus into minus one and the answer is simply one there. So that's that's why e^ minus ud du is equal to is equal to 1 here. So it means this is half * 1 basically. So that means i² now is 2 pi into half. So 2 cancels 2 here. So i^ 2 is equal to pi. And because square is pi then we can say therefore integral from minus infinity to infinity of - dx is simply root. That's how we come about the fact that gamma of half is equal to square roo of pi over yeah like this. So since e^ - x^ 2 is even that we can say that integral from minus infinity to infinity of - dx is the same thing as 2 integral from 0 to infinity - Now take note what's happening here. So minus infinity to infinity what that means is minus infinity to infinity can be written like this. So integral from minus infinity to infinity can be the same as integral from minus infinity to 0 minus infinity to 0 plus 0 to infinity. This is minus infinity to 0 and 0 to infinity. But since is an even function whatever is it's always the same. So we can say that's the same thing as integral from 0 to infinity for both. Okay. And that means you just then have two integral from 0 to infinity. That's exactly what's happening over there. So that you now have this whole thing is 2 integral from 0 to infinity of - square dx= roo of pi. And then integral from 0 to infinity - dx / 2. And that's how we have that. So that gamma of 1 / 2 now is equal to if you remember we stopped at where we have 2 * integral from 0 to pi 0 to infinity - x^ 2 dx. So that means you have 2 * again remember that integral from 0 to infinity of - dx is roo / 2. Then we say gamma half is 2 * roo / 2 that cancels out. So gamma half is simply roo pi. Okay gamma half is simply root pi. So we have that right there. So it looks like lengthy process but you know we we can see we have proven beyond all doubts that gamma half is square root of pi and that's one of the most important relationships as far as gamma function is concerned. So using the we can also talk about half integer formulas now. So using the recurrence relation gamma + 1= gamma We already established that starting from the last video. We compute that gamma / two now is simply you know + one that means if you subtract one so you have half gamma half and now we already know what half is gamma half is like so it means that gamma 3 /2 is the same thing as half * roo / 2 this 1 / two right we know gamma half is root pi so gamma 3 over2 is roo / 2 easily similarly gamma 5 / 2 is 32 mean 3 /2 gamma 3 /2 and we know gamma 3 over2 2 from here is roo / 2. So 3 /2 * roo / 2 is 3 / 4 like that. And then we have the reflection formula. So oiler discovered the reflection identity that gamma is gamma 1 - that is equal to / sin pi Okay. So this formula analytically continues the gamma function into the complex plane. So this what is called the reflection formula. So gamma m* gamma 1 - is the same thing as pi / sin pi So the formula analytically continues the gamma function into the complex plane. It also reveals the connection between gamma function. So we have gamma function there trigonometry function and complex analysis in that is complex number here. Then that's the reflection formula for the example of reflection formula. Right? If you set to be half you know in this case now if is half so we have gamma half then gamma half gamma 1 - half so that will give you gamma half * gamma 1 -/ and that is equal to / sin / 2 since is half now so that's / 2 sin / 2. Thus we can say that gamma 1 /2 from what we have here is equal to you know sin / 2 that's sin 90 which is 1. So that's / 1 which is simply pi. So you have gamma 1 / 2 all^ 2 is And that also establishes the fact that gamma 1 / 2 is root pi just like what we derived the other time using the reflection formula which is gamma into gamma 1 - z= / sin pi Then we have so having talked about the reflection formula we also have the duplication formula. So for the duplication formula now legend duplication formula states that gamma gamma + 1 / 2 is equal to 2^ 1 - 2 square root of pi gamma 2z. So this formula connects gamma rallies as shift at shifted arguments. So we then have the application of the the example of the duplication formula if is half. So what happens? So you have gamma into gamma half plus half which is gamma 1 that is equal to since is half now. So 2 * half is 1. 1 - 1 is 0. So you have 2^0 square root of pi. Then 2 * half that's one again. So gamma 1 and we know gamma 1 is one already. So here now you have gamma half gamma 1 is 1. Gamma 1 is one. So 2^ 0 is also one. So we just have gamma half to be square root of pi. Another establishment of the reality that gamma half is square root of pi which we proved lengthy. And of course reflection and duplication formulas al also establish those realities. Then for analytic continuation the integral definition only converges for the real part greater than zero. Real part of greater than zero. However that's for positive real part. So however the function the functional equation gamma + 1 equals gamma you know extends gamma to almost all complex numbers. For example, if you have gamma of minus half, you know that can simply be okay. What's basically happening here is this. If you have gamma + one, that's gamma Okay, think should write that out. Right? So you have gamma + 1, which is gamma right? Now we say that so if you need gamma it means that you can divide through by So you have gamma. Okay, let me just do my normal thing. So, gamma + 1 is divided by will give you gamma Okay, so it looks like square but don't it's not because there's no that extra tail isn't there. Okay, so mean that we can have gamma equals gamma. Okay, now the square root thing is trying to come. So gamma + 1 all over itself. So in essence we are saying that if we need gamma - half we can work it out. So that's gamma - half + 1 all over minus half. So that means we have gamma - half + 1 is gamma half all over - half and we already know gamma half is square root of pi and now all over - 1 / 2. So that means we can simply have this to be minus 2 pi like that and we are good to go. So distinguish between gamma very important it's not the same thing as square root very important to note that. So that's minus 2 pi right there. So that's what we have this. So it means this formula is so powerful that you can then apply you know extend factorial to even fractions and non- integers generally. So poles of gamma functions the gamma function has simple poles at z= 0 - or - 3 and so on and so forth. So this occurs because gamma z= gamma + 1 / division by 0 appears at negative inteious. Now see what what that simply means. So let's try gamma 0 for instance and see what happens. So imagine you want to do gamma 0. No, that should be gamma gamma 0 + 1 all over 0. That'll be gamma 1 all over 0. That's undefined. That that's why it's pole right there. What about gamma - one? That'll be -1 + 1 all over -1. And that is that is gamma 0 over minus one. So still undefined and so on and so forth. So gamma of yeah that's gamma zero right. So still undefined like that. So that you have those poles going on like that. So this occurs because this division by 0 appears at negative integers. So then we have residues of gamma functions. So we deal dealt with poles talking about residues now. So at at the poles right we know zed is equal to minus So where can be 0 1 2 and so on and so forth. So the residues are residues of gamma minus that's -1^ / factorial you know and then the examples imagine that at = -1 the residue is -1 at z= -2 the residue will 1 / 2 okay so residue here is -1 the residue here is 1 / 2 at = -2 then that takes us to the idea of stelling approximation and we get the full der derivation of that for large values of factorials grow extremely rapidly. So Stelling's approximation provides an asmtotic formula for estimating factorial. So this result is factorial is approximately roo of 2 pi n* / e^ So since factorial is equal to gamma + 1 right you know that's established because gamma is the same thing as factorial. So the gamma function satisfies that gamma is roughly square root of 2 pi you know raised to power 1 that's we are taking more like we're taking to be one now so roo of 2 pi z^ - 1 / 2^ minus so for large so we now derive this formula carefully so let's try to derive this formula we have here this gamma thing so start from the gamma function as usual So knowing that gamma + 1 is integral from 0 to infinity of t^ nus dt then since gamma + 1 is factorial then we obtain that factorial is integral from 0 to infinity t^ nus so factorial is something as gamma + 1 established already. So we write the integrant which is t^ e^ minus and e^ t^ nus can then be written as e^ you know if you carry if you carry this on top of this t^ minus now so you can have lin minus here all right and then thus we now have factorial to be integral from 0 to infinity of e^ minus dt then we and scale the variable. Now to scale the variable we just introduce the fact that is equal to nx. If is then dt dx is So that means dt is dx. So anyway you see dt you put dx. So we can then substitute. We know that factorial now is equal to integral from 0 to infinity of e^ lin nx - nx dx because now is nx. We just substitute that. So we expand the algorithm. So lin nx is simply lin plus lin So hence we have factorial which is equal to integral from 0 to infinity^ lin + lin - nx dx. So if you distribute the now so factorial becomes integral from 0 to infinity lin plus lin here minus like that. So we can separate factors. So if you separate the factors then you have that. So you bring out all the constants. So you have because you know this one now anything that doesn't involve you can move it out. So E^ you can bring that out is there already you bring that out but the part containing that's e^ lin - nx you keep that under here because the variable we are dealing with is so that we and since we know that e^ is n^ So e^ is as good as n^ So we obtain that factorial is n^ + 1 because * n^ is simply n^ + 1 integral from 0 to infinity u^ lin - dx right here and then we rewrite that factorial is n^ + 1 integral from 0 to infinity e^ lin - So you're factorizing here now dx then we define the face function. So we define that of is lin - So this lin - right here. So then we have factorial to be n^ + 1 integral from 0 to infinity e^ of dx. So for large now so when the is very big the dominant contribution comes from the maximum of the maximum of fx for large values of So we then find the maximum. So to find the maximum we need to differentiate right frime of of you know we have of So frime of will just be 1 /x -1. So if you differentiate so and then we can set frime of to zero. let's say how did of come in here. Okay of originally was lin - right. So if you differentiate lin - we get 1 /x - 1. That's what we have here. So to find the maximum we we set we equate this to zero. So we have 1 /x - 1= 0. And that's if you multiply through by that's like 1 - x= 0. That means is equal to 1. So if you compute the second derivative, so that's 1 - 1x^2. So if you evaluate that at x= 1, we get frime of 1= - 1 and that is less than zero. That shows it's maximum point. So if in case you're confused about this, you can check my calculus playlist to see to learn about maximum and minimum points like that. So you get function differentiate equal to zero. Get the values. Those values are the critical values. And now evaluate them in the second derivative. Negative ones are maximum points. positive ones are minimum points. The ones equal to are inflection points. So therefore we say is equal to one is the point of maximum contribution here. So what do we then do? We now go for Taylor expansion around the maximum. So you remember Taylor and Mclloren series think we treated that under one of the previous playlist is it okay that must be yeah mean under under different circumstances especially under numerical the scientific computation with Python think so tell expansion around the maximum now so expand ofx near x= 1 so using the expansion you have ofx= of 1 + frime of 1 into - 1 + 1 / 2 frime of 1 into - 1^ 2 plus all that. So if you compute each term now first of 1 is 1 - 1 which is 1 is 0. So 0 - 1 is - 1. Next frime of one. So substitute you know differentiate 1 that's 1x - 1. frime of 1 is 0. Next frime of 1 is - 1. So if you just use the function the way it is. Hence frime of is approximately -1 - 1 / 2 - 1 2. Therefore you discover that the exponent of is approximately e^ into - 1 -/ - 1^ 2 and so on. If you separate the factors then you have e^ of approximately e^ - right e^ - into - 1 all 2. Now if you approximate the integral again you substitute into the integral factorial is approximately n^ + 1 minus integral from 0 to infinity minus - 1 / 2 dx since the gshian is sharply picked near x= 1 for large we extend the limits so to 0 integral from 0 to infinity - - 1 2 dx which is approximately - 8us infinity to infinity of - - 1 / 2 dx thus factorial is now approximately n^ + 1 - integral - infinity to infinity e^ - into - 1 / 2 dx. So if you evaluate the gaussian this is lengthy thing right evaluate the gshian integral. Now then we say let be square root of into - 1. So that du is root of dx and hence dx is du over root of So if you substitute that we have integral from minus infinity - into - 1 2 dx = 1 roo of integral from minus infinity to to infinity of - 2 du. So using the standard gshian integral this ends up being roo of 2 pi you know just like very close to what we did with square root or gamma half right so therefore we have this whole expression being equal to roo of 2 pi / all together. So the final simplification then comes that like this factori is approximately n^ + 1 - roo of 2 simplify simplify powers of now so you have n^ + 1 dot* you know you have root here 1 / roo and one whole thing is n^ + 1 / 2 hence factori is approximately square root of 2 pi you know the square root of 2 pi from here now multiplied by n^ + 1 + n^ + half then e^ minus that you have here. Then if you factor that n^ + half is n^ half. So if you put all of that together then you have square root of coming to this place and then / e^ So and that's where you get the stelling formula from. So that factorial for very large numbers is approximately roo of 2 pi into / all^ So then talking about the gamma function form now we say since factorial is gamma + 1 we can replace with So to obtain gamma to be approximately square root of 2 pi because gamma functions here we are talking about it about complex numbers in general. So you have gamma 2 pi z^ minus/ e^ minus for large So example now you want to approximate 8 factorial. So using sterling for 8 factorial right we just say 8 factorial is already getting big right. So you have 8 factorial equals is approximately square root of 16 pi because now you have is 8. So 2 * 8. So you have 16 pi then okay yeah that's square root of 2 pi then you have power okay think we're using this general one now now is 8 right then 8 / e^ 8 yeah so if you compute that you have 16 square root of 16 pi is approximately 7.089 08 9 and then 8 / e^ 8 5765. So 8 factorial is then like 7.089 * 5765 and 8 factorial then gives you 4861. Now the actual value of 8 factorial is 43 320. So the approximation is very is as close as possible here. But when the number gets bigger the it gets more accurate for sure. So don't forget the stelling formula for approximating big factorials. So because if you have 100 factorial for instance, you know, imagine having to say 1 * 2 * 3 * 4 * 5 * 6 * 7 until you get to 100. That's long distance. So instead of doing that, you can just fix up the formulas the formula here, you know, just fix it up and do your thing. So you get the result before somebody's is multiplying all of that. So let's talk about the diagramama function. The diagramama function is logarithmic derivative of gamma. So you have PH of equals DDZ of lin gamma So equivalently PH of is actually when you differentiate this and that's like when you logarithmic function you have five gamma prime of over gamma of So the diagram function appears in harmonic sum statistical estimation and quantum field theory. So then you have diagrammma identities. So for integers ph of is sub - 1 minus gamma where of is the harmonic number and gamma is the oil constant. So example five of 1 is minus gamma for instance because here that's is one. So of 1 - 1 that's not which can be taken to be zero and this is minus one right here. Then you have the poly gamma functions. So higher derivatives are called poly gamma functions. So 5^ of is + 1 / dz + 1 lin So the first polyma function of course is 51 of which is called tri gamma function. So you have tri gamma series given like this. The tri gamma function of the series representation 51 of which is summation from k= 0 to infinity of 1 / + raised to power two. And then you have example one here. imagine you want to evaluate gamma 7 / 2. We know gamma 7 / 2 is the same thing as 5 /2 gamma 5 /2 and then gamma 5 / 2 here is you know 5 /2 is already here gamma 5 / 2 is now 3 over 2 gamma 3 over2. So you keep breaking it down until you get something you can get value for and you know the the value is gamma half is root pi. So gamma 3 over 2 now is half gamma half. So gamma half you don't need to break it further because gamma half is already square root of pi. So you can then say 5 * 3 * 1 that's 15 2 * 2 * 2 that's 8. Then gamma half is roo pi. So gamma 7 / 2 is 15 / 8. So example two now you want to deal with gamma 1 / 4 gamma 3 over 4. So that may not you don't you don't you probably don't know any expression where gamma 1 / 4 is you don't know the value for gamma 1 / 4. But we have reflection formula we have duplication formula which you can revert to. So using the reflection formula you know gamma gamma 1 - is / sin / since is 1 / 4 so you have gamma gamma 3 / 4 right here and that's simply equal to / sin / 4 sin / 4 is sin 45 right that's 2 that's yeah think that's roo2 or so you have sin pi / 4 alone to be roo2 /2 so that means you have / 2 over2 which is / that's 2 pi over 2 if you evaluate that at the end of it just pi 2 for gamma 1 / 4 gamma 3 over 4. So don't forget the in addition to the fact that gamma + 1 is gamma don't also forget the reflection formula and the duplication formula. So we can do some python codes to establish some facts. So if you want basic gamma computation and you want to calculate gamma 5 gamma 0.5 gamma 2.5 just import special just from cypad special import gamma then you just evaluate and print directly. So you have all these values. So gamma 5 of course that's 4 factorial which is 4 * 3 * 2 which is 24. Then you have gamma 0.5 which found to be square root of pi and gamma 5 / 2 think gamma 5 / 2 is 3 2 3 / 2 gamma 3 /2 and then we just go on and we get 1.32 94 93 and so on and so forth. Now for diagram gamma that's the the integral of the integral of the log of gamma right mean the derivative of the log of gamma we have this values diagram gamma 1 is this di that gamma 5 is that then we have the poly gamma also you have poly gamma 1 comma 1 you get that then you can also plot gamma function so to plot gamma function which we did under scientific computation with python so this is what that looks like so when you plot gamma function so see the process - 4.925. So within very short range because it's can be quite wide. So you have this whole thing this gamma function. Now then let's talk about some applications of gamma function. The gamma function appears in many areas like in probability and statistics. You have gamma distribution, you have better distribution. In the next video we'll talk about better distribution and you see how it's connected to gamma distribution. Then you have square distribution, student distribution. Then you have complex analysis. You have it in areas like residue calculus, melen transforms and zita functions. In physics you have quantum mechanics, statistical mechanics and fman integrals. Then for geometry you have the volume of an dimensional sphere which is sub / of is pi n^ 2 r^ gamma / 2 + 1. Then in summary we see that we have some important formulas. You have the oiler integral for gamma function that's gamma of z= integral from 0 to infinity of t^ - 1 e^ - dt. That's the fundamental thing from where we derive the fact that functional equation is the same thing as gamma + 1 equals gamma And we have the reflection formula which tells us that gamma gamma 1 - is the same thing as / sin pi Then you have the duplication formula that gamma gamma + half is 2^ minus 2^ 1 - 2 roo pi gamma 2 Then you have the residue formula. Residue gamma - - 1^ / factorial. And then you have the stelling approximation gamma is roughly roo of 2 pi z^us alus and you have the diagram function of which is gamma gamma prime over gamma So we have practice problems and as usual going to solve two of them. So we want to evaluate gamma 6. Of course gamma 6 you know that to be 5 factorial which is 120. You can compute gamma 9 /2. So all you just do is you do 7 gamma 7 over 2 gamma 7 / 2. So you now have 7 / 2 * so since you know gamma 7 over 2 is 5 over 2 gamma 7 5 /2. You keep going like that until you get to gamma half and you multiply out. Then show that gamma 2 is one using the oiler integral. So you just fix two for you just fix two into this expression. So zena is you know just fix two here and mod and you know do integration by part or just integrate if possible directly and you get your values. So use the functional equation to compute gammaus 3 /2. Of course we can use gamma gamma + 1= gamma to establish this. Then you want to verify that gamma 3.5 is 2.5 gamma 2.5. Of course, that's correct because gamma 2.5 itself is actually gamma gamma 1.5 gamma 1.5 think. Yeah. And then we continue until we get the 0.5 gamma 0.5 and we know gamma 0.5 to be square root of pi. Evaluate the improper integral. So this can easily be done because this is t^ minus Then evaluate this also. Prove that gamma + 3 zed + 1 gamma that's possible also then using the reflection formula you can compute this can also evaluate this then use the duplication formula to simplify you can do this just fix the values into the formula find all the poles of this compute the residue of this compute the residue of this approximate 15 factorizing stings approximation then you want to show that limit as approaches infinity for gamma + 1 / gamma is one of course that's possible ble to show of course because we already know these two are basically the same technically. So evaluate five of 2 given 5 is - 1 - gamma that's like 2 - h1 - gamma then compute 5 of 4. Then you want to show that the tri gamma series summation from k= 0 to infinity of 1 / + 1 + all 2 is 2 / 6. Then using vn / equ= this. Now you want to comput the volume of the fourdimensional unit sphere. So let's go to solve two problems here. I'm taking care of problems 9 and 15. 9 is about using this reflection formula to compute gamma 1 / 3 gamma 2 over 3 and 15 is to approximate 15 factorial using sterling's approximation. So let's go for those and bring this home. Okay. So, guess need to change here. Let's go for something on the bright side. Let's go for this. Yeah. So, problem problem nine. Now, problem nine. So using using the reflection formula using the reflection formula compute compute gamma 1 / 3 gamma 2 over 3. Okay. So solution we have using all reflection formula right we know that gamma gamma 1 gamma gamma 1 - is the same thing as pi all over sin pi already. So that means that so now is 1 / 3. Okay. So for z= 1 / 3 we know that 1 - will be 1 1 - 1 / 3 which is 2 / 3. So it means that is simply 1 / 3 in this case. So if you substitute now we then have gamma 1 / 3 gamma 2 / 3 to be the same thing as / sin / That's right? Yeah. Pi That's * 1 / 3. That's what will give us this just like what we've seen here. So that means we have pi / sin / 3. Sin / 3 is sin 60° and sin 60° is roo3 /2. So that's all over 3 / 2. That's sin 60 3 / 2. So that means we have 2 pi all over 3. So we can have this this way or we can rationalize. So that's 2i all over3 * roo3 all over roo3. So that means we have 23 pi or to avoid confusion 2 pi roo3 all over 3. Okay. Roo3 * roo3 is 3. So we can have this this way. Yeah. Or better we can we can leave it this way also. So that's problem problem nine right there. So let's go for problem 15. That's the one with stelling number problem 15. Problem 15 says to approximate approximate 15 factorial using Sterling's approximation. Sterling's approximation. Okay. So here we have stelling approximation is this factorial is approximately roo of 2 pi then / e^ So that's all we need here. So generally here we know that is equal to 15. So since is 15 we just substitute. So that means 15 factorial is approximately roo of 2 right that's 2 * 15 into 15 all over rais^ 15 right here. So that means that's approximately square root of 30 pi square root of 30 pi and then we have 15 / 15 / rais^ 15 / e^ 15. So yeah, like to use Yeah, we can even use Google for this, right? Or let me use let's use Desimos. Let's use Desmos and see what happens. Desmos. Yeah. So we go go for the graphing stuff. So we need square roots. We need square roots of 30 *. So that's 9.708. 9.708. So this is 9.708* 15 / Let's do 15 / 15 / That's 5. That's 5.518. So 5.518^ 15. So that's approximately 9.708 time 5.518^ 15. So let's do that. So all this now raised to power 15. Okay. Let me just go ahead. raised to power raised to power 15. So that's 1.33 1.33 1.33 95 * 10^ 11 1 3 3 95 * 10^ 11. Okay, that's what we have there. So at the end of the day this one is approximately we multiply everything out we have 1 15 factorial right is approximately 1 1.3 * 10^ 12. So that's what that is. But what's the real what's the real thing? So we can just punch that straight and see 15 factorial. So that's 15 factorial that's 1 307 blah blah blah * 10^ 12. So that's pretty close. Okay. So the real thing is the real 15 factorial. So to check if how close we are or we are close enough believe that's one 15 factorial is 137 1 137 6743 0 0 that's 15 factorial that's close enough because this is same thing as 1.3077 3077 * 10^ 1 2 3 4 5 6 7 8 9 10 11 12. So good enough. Yeah. So with that we come to the end of solving the problems attached to this. So don't forget check out the problems again and see how well you can handle them. So you have one to four here. In fact, 1 to 5, then 6 to 10, then 11 to 5, 11 to 16, in fact, and then the rest. So, try your hands on them and let's see how helpful this is for you. Let me know how helpful this is. And if there's something else you let me try out, feel very free to let me know. If you have subscribed to this channel already, thank you very much for doing that. And if you haven't subscribed, question is, what exactly are you waiting for? Why not go ahead and subscribe right now? hit the notification bell so you can always get alerted each time new video is released. Having done that, you can also become member of the channel by clicking on join. That gives you special privileges you find out when you click. you know, ultimately don't forget to comment, like, and share so that other people can have access to the great content have going on here. Till come your way again, keep doing maths, right? Watch out for better function in the next video. Bye.