 Welcome back. I hope you are looking forward to the interesting result that we are going to prove today which is that quadratic irrationals are the same numbers which are represented by the continued fraction expansions which keep repeating. But you notice that for root 3 we had 1 and then we had 1 2 1 2 1 2 being repeated. So, it is possible that your repetition may happen after some stage. So, these are called ultimately repeating continued fraction expansions or ultimately periodic. So, they become periodic ultimately after some stage they become periodic that is what we have and these numbers are going to represent what are called the quadratic irrationals. This is the concept that we saw in our last lecture. So, we have the quadratic irrationals which are the roots of this ax square plus bx plus c with abc being integers. The discriminant is a non-square positive integer and we also note that these have to be of the form x plus y root m. These are the quadratic irrationals we want to write them in terms of continued fraction expansions which keep repeating after a while. So, the concept is as follows. We look at the continued fraction expansion which is given in terms of a0, a1, a2 and so on. This is called ultimately periodic if you have that am plus n equals an for some m this m is fixed and for all n after some integer capital N. So, let us understand what we are having here. We have the integers a0 and then we have a1, then we have a2 and so on. We have a capital N. After this whatever integers whatever partial quotients that we have they keep repeating with this equation. So, that means an an plus 1 dot dot dot an plus 1 an an plus m minus 1 and the next one will be an plus m this is equal to an. So, you would have am plus 1 coming here again and so on after you get n plus m minus 1 you again have am and so on. This is what we mean by ultimately periodic continued fraction expansion. The continued fraction expansion from n onwards simply keeps repeating. So, instead of a capital N plus m you will have a capital N instead of a capital N plus m plus 1 you will have a capital N plus 1. So, the period is the number m. So, that every partial quotient is equal to the partial quotient which appears n steps after that but this periodicity will start after a stage. So, there is a capital N such that from the capital N stage onwards we have the periodicity for the partial quotients. This is what we have and these are called the ultimately periodic continued fraction expansions. What we are also going to assume is that in these expansions we do not have all an to be 0 because after all a rational number is given by a finite expansion and then you can assume that the corresponding an's are 0 but we will assume that there is no such situation that means some an has to be nonzero. It is an expansion which is which does not terminate and therefore it is going to represent an irrational number. This is going to be our assumption when we have these ai which go to infinity and n goes to infinity and we have ai then an are nonzero. This is our standing assumption therefore any such expansion will give you an irrational number. The result we want to prove is that whenever you have an ultimately periodic continued fraction you do get a quadratic irrational and also the converse of these two statement. We have cut this prove with this statement into two parts we will prove that ultimately continued periodic expansion gives you quadratic irrational and then we will prove that a quadratic irrational will come from an ultimately periodic continued fraction expansion. So, let us begin our proof. This proof is very interesting. So, let capital N and small m be as above. So, we have the periodicity which says that we have some real number theta which is given by a 0 and then we have a 1, a capital N and then we have this expansion of length m which is periodic. We can put this bar at any level we could have put it at n and then we could have removed the n plus 1 but I want to keep it at n plus 1 onwards. So, what this means is that we will have the expression a 0 plus 1 upon a 1 plus 1 upon dot dot dot plus 1 upon a capital N plus 1 upon theta n plus 1 and theta n plus 1 is same as theta n plus m plus 1. So, this is the periodicity that we are going to have because after a stage the expansion for theta n plus 1 which is a complete quotient. So, the a n plus 1 and so on those things that we obtained these are this is the continued fraction expansion for theta n plus 1 and this keeps repeating after n stages that means if you remove the first m integers first m partial quotients what you get from that point on is also going to be equal to theta n plus 1. Therefore, theta n plus 1 is same as the complete quotient theta n plus m plus 1. Now, we have an expression for the theta in terms of the complete quotients. So, theta capital N is P prime capital N plus m theta n plus m plus 1 plus P prime n plus m minus 1 upon Q prime capital N plus m theta n plus m plus 1 plus Q prime n plus m minus 1 where P prime and Q prime are here P j prime upon Q j prime are convergence for theta n. But using the periodicity we can replace all these numbers by theta n. So, we get theta n is some alpha theta n plus beta upon gamma theta n plus delta and note that gamma is a certain Q prime therefore, gamma will never be 0. So, this implies that gamma theta n square plus delta minus alpha into theta n minus beta is 0. So, our theta n which was a complete quotient for theta does satisfy a quadratic equation which is gamma x square gamma x square plus delta minus alpha x minus beta is satisfied equal to 0 is satisfied by theta capital N. So, theta capital N which is an irrational number because our continued fraction expansion does not terminate. So, theta capital N is an irrational number satisfying a quadratic hence theta capital N is a quadratic irrational. We wanted to prove that if something some continued fraction is ultimately periodic then it is quadratic irrational. What we have done is that if something is periodic on the nodes that it starts from the first place and gives you periodicity then it is quadratic irrational. We still have to prove that theta is quadratic irrational but that can now be proved because let theta n be x plus y root d for some x comma y rational numbers d in N and d being a non-square. If theta n satisfies a quadratic polynomial like this we can always remember this gamma delta minus alpha and minus beta these can be rational numbers but you can clear the denominator. You can take the LCM of the denominators and multiply the whole equation by that LCM to get your coefficients to be integers. So, we can assume that these coefficients are integer and therefore we get a form for our theta n in the form of x plus y root d where x and y are rational numbers and d is a natural number which is not a square and then what we do is as follows. So, recall once again the same result which will give us that theta can be now replaced in terms of the complete quotient theta n. So, theta has this form now theta n is of this form x plus y root d then we can write this as a plus b root d upon c plus e root d where a b c and e are rational numbers because I can write this as I can simplify this with p n x plus p n minus 2 p n minus 1 into y q n minus 1 x into plus q n minus 2 and p q n minus 1 into y we can write it in this form moreover this e that we have here is simply y into q n minus 1 q n minus 1 is non-zero y is also non-zero because x plus y root d is the irrational theta n therefore this e is not zero you can multiply this by a plus b root d upon c plus e root d by c minus e root d upon c minus e root d. What we have obtained in this way is some form as alpha plus beta root d for our number theta. So, theta is also of the form alpha plus beta root d this is a real number and because the continued fraction expansion does not terminate it is not a rational number and every number of this form alpha plus beta root d here alpha beta rational numbers because they are obtained from this expression. So, these are rational numbers and beta cannot be zero because we have that theta is not in q. So, theta is therefore a quadratic irrational. What we have proved is that if you have an ultimately periodic continued fraction expansion then the corresponding real number should satisfy a quadratic equation and moreover it cannot be a rational number. So, the thing that we have seen that root 2 has an ultimately periodic expansion 1 plus root 2 actually has a periodic expansion pure this is what is called a periodic continued fraction expansion root 3 has an ultimately periodic expansion and 1 plus root 5 by 2 also has a purely periodic expansion because that there the periodicity starts from 1 onwards there the periodicity starts on the nose. So, those are the ones and any such continued fraction expansion has to be a quadratic irrational that is what we have proved now. Now, we want to prove the other direction that if you start with any quadratic irrational it should have a continued fraction expansion which is ultimately periodic. So, suppose we start with a number theta which satisfies the equation a x square plus b x plus c equal to 0 with our usual conditions that a b c are integers b square minus 4 a c is positive and it is not a square and so on those are our usual conditions to say that this is a quadratic irrational. And now we want to find its continued fraction expansion and prove that it is ultimately periodic this proof is very interesting because we are going to use our things which we have done in binary quadratic forms I hope that you still remember those things. So, consider the binary form a x square plus b x y plus c y square let us call this form f this is a form which we have obtained simply from our equation a x square plus b x plus c we consider this binary form and of course note that f of x comma 1 is our equation. Now, the discriminant of our binary form is b square minus 4 a c let us call it d by our assumption this is a natural number and d is not a square. So, it is not in n square it is not a perfect square but it is a natural number. Now, once we are given this real number theta we can we assume that we can compute its continued fraction expansion. So, we have the convergence p n q n and so on then we know that the transformation x going to p n x plus p n minus 1 y and y going to q n x plus q n minus 1 y takes the form f to f n we are going to get a possibly different binary form f n. Now, there is one thing I would like to remind you we when we studied these theory of binary quadratic forms we also had the transformations which were taking one form to the other and among the transformations we allowed only those where the determinant was plus 1 here the determinant which is going to be p n q n minus 1 minus q n p n minus 1 can be plus or minus 1. So, these are not really the transformations that were allowed in our last theme. Therefore, we cannot say that f is equivalent to f n but the discriminant of f and discriminant of f n are still the same. Why is that this is because if you recall our binary quadratic form was obtained by writing a row vector then the 2 by 2 matrix corresponding to the binary form into a column vector and when we are switching this form to another form when we are applying a transformation the new matrix the new form will be given by a new matrix which will be obtained from the earlier matrix by putting transpose of the transformation then you have the old matrix times the transformation. So, you have something like p transpose afp and the determinant of our matrix of the binary form is the discriminant of is a multiple of the discriminant of the binary form. So, you had the matrix to be a b by 2 b by 2 c. So, therefore, the determinant will be ac minus b square by 4 and if you multiply this whole thing by minus 4 you get your discriminant. So, discriminant is minus 4 into the determinant but determinant remains the same because our transformation has determinant minus 1. So, when you have the transformation into the transformation transpose the determinants are going to cancel each other and so the determinant of the form fn which is the discriminant that is going to be the same as the discriminant of the form f. I suggest that you sit down and do this calculation with the forms and their matrices if this is still not clear to you. So, what we are going to use is that the discriminant of the new form remains the equal to the discriminant of the form you started with. So, therefore although you are getting these new forms fn their discriminants are all the same. Hence, the discriminants of fn will be equal to d this is something which is a very important observation. Now, we note that further we have the an's which are the coefficients of the form fn they will be obtained by pn comma qn and of course then cn minus 1 will be equal to an. Of course, cn will be equal to an minus 1 and we notice that an upon qn square which is f of pn by qn comma 1 you have the binary form which is a homogeneous polynomial in degree 2. Therefore, if you change the elements by a fixed multiple then you are going to get the square of the multiple out. So, the pn and qn both the variables are divided by qn to get pn by qn and 1 and what you get outside is qn square. So, an upon qn square is f of pn upon qn comma 1 but this is same as f of pn by qn comma 1 minus f of theta comma 1. This is because f of x comma 1 is our original equation a x square plus b x plus c original polynomial and theta satisfies this. So, f of theta comma 1 is 0 and therefore, we can adjust it in any way we want. So, we get that this is equal to an into so we get that this is equal to a pn by qn whole square. So, that is pn square by qn square minus theta square plus b into pn by qn minus theta. This is the equation a x square plus b x plus c where your x is pn by qn. This is the equation a x square plus b x plus c where your x is theta. The c will get cancelled the x square term will have this pn square by qn square minus theta square and the x term will have pn upon qn minus theta. So, we get that an upon qn square is equal to this term. Now, here we need to observe both these terms slightly carefully. So, we have that mod of theta square minus pn square upon qn square. This is equal to mod theta plus pn upon qn into theta minus pn upon qn. But theta minus pn upon qn is known to be less than or equal to 1 upon qn square. So, this is 1 upon qn square mod theta plus pn by qn and further this is. So, further the pn upon qn these are convergence to the number theta. So, that means these are very close to the number theta which means that if we take the number 2 into mod theta plus 1 then we are going to get something which is theta plus pn upon qn. pn upon qn is going to be perhaps smaller than or smaller than theta or bigger than theta. But in any case the distance from theta and pn by qn is very small. So, when you add those 2 things up and then take the modulus that is going to be less than 2 times modulus theta plus 1. So, we get that theta square minus pn square upon qn square is less than 1 upon qn square 2 mod theta plus 1 and this implies from our previous expression which we have here. So, we are going to use the expression for this and we also have the expression for this anyway. We get that mod an upon qn square is less than a times 2 mod theta plus 1. This is anyway bigger than 1. So, we can safely assume that this is less than this quantity plus mod b you had the theta minus pn by qn but that is always less than or equal to 1. So, we have that mod an this qn square is. So, coming from this part we have that there is a qn square in the denominator and we are going to get a qn square here. There is a qn square here which will all be cancelled to finally give us that mod an is less than 2 times mod theta plus 1 into mod a plus mod b. So, we have obtained an upper bound for modulus of an and this upper bound is independent of n that means the an are only finitely many their modulus is bounded. So, they are only finitely many furthermore we have that cn is also an minus 1. Therefore, cn are bounded hence an cn are bounded and so are bn because bn square minus 4 an cn is the discriminant which is a fixed quantity. So, there are finitely many choices for an finitely many choices for cn and finitely many choices for an. So, although it may appear that you have infinitely many binary forms ultimately we have only finitely many forms fn the all these forms fn are only finitely many furthermore the theta n's which are solutions fn x comma 1 equal to 0 are only finitely many. Once we have a binary form we put y equal to 1 and we get quadratic equations each quadratic can have at most 2 roots you have finitely many quadratics. So, there are finitely many roots therefore the thetas are finitely many but we are going to continue with the thetas. So, it will happen that you have theta 1, theta 2, theta 3, theta 4 you cannot keep getting different thetas in this way ultimately there will have to be a stage where theta l plus m is theta l. So, there exists l and m such that theta l plus m equal to theta l and that proves that we have. So, this will happen for all l after some stage n it may happen that you have some repetitions before that you have some complicated expressions before that but from some theta you will have to get the next theta to be the same and that is where you have the periodicity. So, what we have proved is that if you have a quadratic irrational then its continued fraction expansion has to be ultimately periodic. We are going to study these quadratic irrationals further and solve what are known as the Brahmagupta pale equations in the next lecture. So, I look forward to see you in those lectures as well. Thank you very much.