 Another type of indeterminate equation is a quadratic indeterminate. An important type is known as Pell's equation, and this type of equation actually has nothing to do with John Pell, an English mathematician. These are equations of the form nx squared plus 1 equals y squared, where n is a non-square integer. And the goal is to find integer solutions x and y. Ramakuta also gave his general solution. To solve this type of problem, Ramakuta first found a solution to a related problem. We'll illustrate by solving 7x squared plus 1 equals y squared. So the first step in solving this problem is to find values x, y, and k, where 7x squared plus k is equal to y squared. And the idea here is that we can choose x to be anything, and k is whatever we need to make the sum a square. So for example, we might let x equals 1, and so we want 7 times 1 squared plus something to be a square number. So let's think about that. And here we might observe that if we add 2, the result is 9, which is a square number, which gives us k equals 2, y equals 3. And it'll be useful to identify the three terms here. There's our first number, 1. Our last number, 3. And our additive, which in this case is 2. Ramakuta then says, set these down twice. It'll also be useful to have this multiplier handy. So the general process is going to be this. We're going to find a new first, last, and additive. And from those first, last, and additives, we'll get a new solution to a similar equation, and hopefully we'll be able to convert that into a solution to the original equation. To do that, Ramakuta directs us to do the following. We're going to find a new first from the Thunderbolt products. That's the cross products of the most recent, first, and last. So here are cross products 1 times 3, and 3 times 1, and we'll add those to get 6, which is our new first. Next, we'll form a new additive, and this will be the product of the two most recent additives. So that'll be 2 times 2, or 4. And then finally, we'll form this new last, and this new last is going to be the product of the two firsts with the multiplier, and added to the product of the two lasts. So that's 7 times 1 times 1, plus 3 times 3, or 16. And what's important here is now we have a new first, last, and additive, and this gives us a new solution to nx squared plus k equals y squared. In particular, we have 7 times 6 squared plus 4 equals 16 squared. Now you might say, well, that's great, but I was trying to find a solution to 7x squared plus 1, not 7x squared plus 4. So how can we use this to find a solution? So the thing to recognize here is that if the new additive is a perfect square, whose root divides the first and last, we can use it to find a new solution. So first, our additive is a perfect square, but wait, there's more. Because the square root divides both 6 and 16, we could divide through by 2 squared, and that's going to give us, and that gives us a solution, 7 times 3 squared plus 1 equals 8 squared, and there's a solution. Now in a kind and gentle universe, we'd always get a solution after one step. We don't live in that universe. But because Brahma Gupta gives this as an algorithm, we could always repeat the process and try again. For example, let's try to solve 5x squared plus 1 equals y squared. So we want to find values that solve an equation of the form 5x squared plus k equals y squared, and we might try x equal to 1, and so we have 5 times 1 squared, and we'd like to add something that will give us a perfect square. So we might add, well, how about 4? If we add 4, we get 3 squared. So we'll set these down twice, our first, last, additive, and our multiplier. We'll find a new first from our Thunderbolt products. 1 times 3 plus 3 times 1. Our new additive is the product of the two additives, and our new last is going to be 5 times the product of the firsts plus the product of the lasts. And that gives us a new solution, and we see that 5 times 6 squared plus 16 does in fact give us 14 squared. And while this is a new solution to an equation of this form, there's a problem. While 16 is 4 squared, neither 6 nor 14 is divisible by 4. Fortunately, we can apply the process again. So we repeat. So it's useful to keep in mind that we really only care about the most recent two lines, so we'll ignore this first row of numbers. And now we can find a new first by finding the sum of the Thunderbolt products. 1 times 14 plus 3 times 6. The new additive, the product of the two additives, and the new last, 5 times the product of the firsts plus the product of the lasts. And again, we have a new solution, 5 times 32 squared plus 64 gives us 72 squared. And notice that 64 is 8 squared, and both 32 and 72 are divisible by 8. Which means we can divide by 8 squared, and that gives us a solution to the original equation. Because Brahma Gupta's procedure is iterative, once we've found one solution, we can continue to apply the procedure to find other solutions. For example, since 5 times 4 squared plus 1 equals 9 squared, which is the solution we've already found, we can set these down twice, find a new first, find a new additive, and find a new last. And notice that since our additives are 1, their product is going to be 1, and so this gives us another solution, 5 times 72 squared plus 1 equals 161 squared.