okay as we all know this right here is the Pythagorean theorem a^2+b^2=c^2 where a b c
are just the sides of a right triangle and c is the longest side namely hypotenuse and
that's pretty cute however we are all adults now so let's do something more challenging
and to make it more challenging one easy way is say okay i want abc to be whole numbers only
can we still make that happen yes because i know you guys noticed i gave you guys two
examples right here already the first one is 3 squared plus 4 squared is equal to 5
squared and the second one is 5 squared plus 12 squared is equal to 13 squared
whenever these kind of things happen we say that 3 4 5 is an example of what we call the pythagorean
triple because 3 4 5 there are whole numbers and they satisfy the pythagorean theorem likewise 5
12 13 is also an example of a pythagorean triple and the truth is we have infinitely many of these
paths algorithm zero pythagorean triples but the question is how can we find them though
keep in mind this equation has three unknowns so it's not easy to just guess and check and make it
work you can try and leave a comment down below to see how easy you think that will be but i'll give
you guys a better strategy wouldn't it be nice if we can have a generator to help us generate
a b and c and there are whole numbers and they satisfy this first that'd be so nice isn't it
so i will show you guys how to do that in this video so let's focus on this right here first
on the left hand side this is the sum of two squares it's actually not easy for us to work with
because i cannot factor that without using complex numbers but it's okay because i can actually move
one of this to the right hand side and i will be working with the difference of two squares instead
so that's going to happen let me move this to the right hand side so i will have a squared equals to
c squared minus b squared and now notice i can factor this out nicely right
and this is the same as a squared equals to c minus b times c plus b
that's pretty much it and that's pretty cute and now the question is so what well
a square is no a times a so it has two factors the right hand side also has two factors
let's try to balance things out a little bit what i mean by that is i'm actually going to bring one
of the a to the other side and likewise bring one of these factors to the other side balance things
out all right and you can bring one of these whatever you want but let me just say this to the
other side and i can do so if i divide both sides by c minus b so let me divide that on both sides
and in the meantime i'll divide the a so that this end will be canceled so d by a like this
now let's see on the right hand side we have a over c minus b
and this is equal to the right hand side is c plus b over a so that's pretty nice
but what can we do next
this right here remember a b and c they are all whole numbers so when you have a whole number
divided by a whole number this is going to be a rational number right
therefore why don't we just make this to be a rational number i am going to set this to be
a rational number in the following form and usually when people say hey this is a rational
number we say that's a over b but we have a and b already so let me pick something else let me say
m over n you can of course you can do whatever you want and n and and they are all whole numbers
and depends if you are still talking about geometry because you are still referring abc
to be the size of a right triangle or if you are doing number theory that abc maybe they can be
negative as well so up to you so i'll just say abc can be integers in general but it depends on you
all right now what notice i have this is equal to m over n likewise this is equal to m over n
and you see i come up with two new unknowns mmm our goal right here is that i want to write a b
and c they are all in terms of n and n hopefully later on i can just assign some value to m
m and then i can generate a b and c that's the idea so let's make that happen and we can do so by
first make this is equal to that first so we will have a over c minus b this is equal to m over n
and likewise this is equal to that c plus b over a this is equal to m over n
of course hmm what's next though notice this right here is actually preferred it because we just have
the a in the denominator so why don't we make that happen for the top as well and we can achieve that
by just taking the reciprocals on both sides here we will have c minus b over a to b and over m
just take the reciprocals right and now we'll be working with this and that and the idea of having
a on the denominator is better it's because then we can split the fractions so let's go ahead and
continue right here on the top for the first equation here we can just do c over a and then
minus b over a and this is equal to n over m and secondly we do the same c over a plus b over a
this right here is equal to m over n and notice the beauty of this is that this and that are the
same now i can just add these two equations up together and i can cancel them out right
so let's do that we add c over a plus c over a is of course just two of them so two c over a
and this and that will be gone so this is equal to i'm going to add this up and of course i will just
get a common denominator first let me multiply the n and n here and the m and m here so when you add
them up on the top i get n squared plus m squared and then over the same denominator which is mn
and i want to make this id cleaner so i can just divide both sides by 2 right so c over a equals to
allow me to write the m square first m square right and then plus n squared and then
2 right here 2 m n just like that so this is great and now let's do the same but this time i want to
get rid of this term i can do so by multiplying the top by negative 1 like this or you can just
look at this as this minus that right up to u and let's see what we are going to get from here
so i'm just doing this minus that so this and that cancel and then this minus minus becomes plus
so i end up with 2 b over a this time we are doing this minus that so we will have m squared
minus n squared and then on the denominator is still m n like this
and lastly of course let's divide the two on both sides so we will actually have similar form to the
hat finally we have b over a equals to m squared over n squared over 2 m n like this and now
here is the deal take a look i have a and a in the denominators and notice both of them they have the
2m n on the denominator so there must be some kind of connection huh that's great and here's the deal
when you have two fractions equal to each other the easiest solution is you just take the top
to be top and then the bottom to be at the bottom and the reason i say that's the easiest solution
because that's not the only way for example when you have x over y if this is equal to one half
the easiest way to do this is you just take x to be 1 and y to b2 but that's not the only
way because you can say x is 3 and y is 6 that will still work right so that's what i'm saying
the easiest way to do this is just to take the top to be top bottom to be bottom anyway i'm
just going to tell you guys that we can take the following let me write down a first a is 2 m n
and notice this equation right here also agrees h will be 2 mn so we are on the right track
next we have b i will take that to be that which is m squared minus n squared and lastly right here
we have c which is equal to m square plus n square how wonderful is this because there are two things
you know first of all we did isolate the a b and c and then they are all in terms of m n in another
word you can just assign some values to m n and then these formulas will help you to generate
a b c pass algorithm triple and then the second thing is that you can also verify this on your
own if you square this and then you add it with the square of that you are going to get
this square this right here is guaranteed to be a pythagorean triple right it's going to satisfy the
pythagorean zero as long as you pick m and to be whole numbers you'll get a nice pasta gram triple
and of course it depends if you're still talking about triangles or not because if you're still
talking about triangles then abc they have to be positive but if you're just looking at this as a
number theory question and you are allowing a and b and c to be negative that's fine too up to you
anyway before we go let's do a quick example i am just going to take let me say m to b 3 and n to b
2 right and you can do whatever you want seriously but yeah this is what
i want to do anyway let's see what kind of perception triple that we are going to get
a based on this we get 2 times m which is 2 times 3 and then times m which is another 2 right here
2 times 3 is 6 times 2 is 12. and next take b to be m squared minus n squared which is 3 squared
minus 2 squared and you work this out that's 9 minus 4 which is 5.
lastly c you guys know should be 13 because that's one of that but i know i'll work this
out for you guys 3 squared plus 2 squared this right here is equal to 13 because i told you
this square plus that square is equal to this square right so this is the particular
triple that i got based on the choice of m m right here and you guys can have fun with this formulas
just pick some values for m and that you like and work out the abc values and leave a comment
down below and let us know which of the past echoing triple that you produce anyway this is it