## An algorithm for calculating the square root of a number

How do you find the square root of a number? You use a calculator, of course! But what if you can’t find your calculator? Did you know there’s an algorithm that will allow you to derive a square root of a number? My dad taught it to me a long time ago before calculators were around. It would surprise me if anyone you know under the age of 40 has ever seen it. It’s a slow, painstaking process, so only use it if you have a lot of time to waste. Frankly, I’d recommend waiting until you get a new calculator, but in case you’re interested, here it is. It’s easiest to explain with an example. Let’s find the square root of 300. Because we want to calculate some digits after the decimal point, we will write it as 300.0000

$\sqrt{300.0000}$

The first step is to separate the digits into groups of two. Starting from the decimal point, mark off each pair of digits. If there are an odd number of digits to the left of the decimal point, the leftmost digit will be a single digit and not a pair. Then start from the decimal point again and count off the digits to the right by twos. In our example, the “3” in 300 is a single digit and all the others are pairs.

Now we are ready to calculate. Our first digit is a three. We find the largest integer whose square is less than this number. Since 12 = 1 < 3 and 22 = 4 >3, our number is 1. We place a 1 above the 3, just like we are doing a long division problem.

Next, copy this digit on the line below the 300.

This next step looks a lot like a long division problem. Multiply the (red) 1 by the (tan) 1 and put the product under the 3. Then subtract, and bring down the next two digits. Our example will look like this:

Now it gets a little strange. Take the (red) number above the 300 and double it. Write this number on the next line down on the left and add an underscore. 1 doubled is 2, so our example now looks like this:

The underscore is a place holder for an unknown digit. We need to find a single digit that we will place above the line (over the “00”) and in the placeholder. We want the product of these two numbers to be as large as possible without being larger than the current remainder. Let’s say we decide the digit is 6. Then 6 ·26 = 156. If the digit is 7, then 7 ·27 = 189. If the digit is 8, then 8 ·28 = 224. This is larger than 200, so our digit is 7. We place it above the radical and in the placeholder as shown below. Do the multiplication and subtraction as before. Write the remainder and bring down the next two digits. Our example now looks like this:

Now we repeat this process over and over for each new digit. Double the number above the radical and add a placeholder. 17 ·2 = 34, so our problem now looks like this:

Again, we need a digit above the line and in the placeholder so that the product is less than the remainder. 3·343 = 1029 < 1100.   4·344 = 1376 >1100. So the digit we want is 3. Do the multiplication and subtraction and bring down the next two digits. Our example looks like this:

Let’s do it one more time. Double the number over the radical and add a placeholder:

The next digit we need is a 2. (2·3462 = 6924 < 7100; while 3·3463 = 10389 > 7100). Multiply and subtract and bring down the next two digits.

17.32 is a pretty good approximation of the square root of 300. You can repeat this process as often as you want to get even more digits in your solution. The next number we would write on the left would be 3464_. You can see that the number on the left gets bigger with each step, so the process gets pretty unwieldy. If you need more than three or four digits in your square root, make sure you have a lot of paper, or go find that calculator!

## Factoring ax² + bx + c, part 2

In my last post, I showed you a procedure for how to factor a quadratic when the leading coefficient is not equal to 1. Here I refine that method slightly with a short cut that makes your work even quicker. However, this method is a bit more difficult—if you are not really good at mental calculations, you will need to practice this a few times to get it down. To compare methods, I’ll use the same quadratic we factored in the last post.

Problem: Factor $12x^2+4x-5$

1. Our first step is the same as in the previous method—we need to find two numbers that multiply together to give $60$ (that’s $12*-5$) and add together to give $+4$. Of course, those numbers are the same as they were in the last post: $+10$ and $-6$.
……
2. Now here’s the shortcut. Divide both of these numbers by the leading coefficient, $12$. That gives two fractions:
…..
….. $\dfrac{10}{12} \;\; \text{and } \dfrac{-6}{12}$
…..
3. Next, simplify the fractions if possible. In our example, we get
…..
….. $\dfrac{5}{6} \;\; \text{and } \dfrac{-1}{2}$
…..
4. In each fraction, the denominator is the coefficient of the x term in our factor and the numerator is the constant term. So our two factors must be $6x+5$ and $2x-1$. See the diagram below:

## Factoring ax² + bx + c

You probably have a lot of experience factoring quadratics of the form $x^2+bx+c$. (That is, where $a$, the coefficient on the $x^2$ term is equal to $1$.) But what do you do when $a$ isn’t $1$? For example, let’s factor $12x^2+4x-5$. You may have been taught a trial-and-error technique where you look for all the numbers that multiply to give $12x^2$ and combine them with all the numbers that multiply to give $5$ and test each one to see which gives the correct middle term. But there’s a simple algorithm that takes all the guesswork out. I’ll show you the procedure with an example.

Problem: Factor $12x^2+4x-5$

1. Similar to the case where $a=1$, look for two numbers that multiply together to give $a \cdot c$ (in our example, $12 \cdot -5=-60$) and add together to give $b$ (i.e., $+4$ in our example). [Actually, you can see that this is just like the $a=1$ case, because there you were looking for two numbers that multiply together to give $c$, but when $a=1$, $a \cdot c=c$…] For our example, those numbers are $+10$ and $-6 \\$.
…..
2. Bring down the first term without changing it:
…..
….. $12x^2$
…..
3. Write the linear term as a sum or difference using the two numbers you found in step A.:
…..
….. $12x^2$ $+10x-6x$
…..
(Don’t worry about which term comes first. As it turns out, you can write these two terms in either order.)
…..
4. Bring down the last term without changing it:
…..
…..$12x^2$ $+10x-6x$ $- \; 5$
…..
5. Now comes the magic. Look at the first two terms only from step D (cover up the last two terms if that helps you) and factor them:
…..
….. $2x$ $\!\!(6x+5)$
…..
6. Now look at the last two terms in step D (again, cover the first two terms if that helps you) and factor them. And this is very important: if the $x$ term has a minus sign on it, always factor out the minus sign:
…..
….. $2x$ $\!\! (6x+5)$ $- \; 1$ $\!\! (6x+5)$
…..
(Note that if nothing factors out of the last two terms, write a $1$ (you can always factor $1$ out of any term).
…..
7. Are the two expressions in the parentheses the same? They have to be. If they’re not, you’ve done something wrong. That’s one of the factors in your answer. The other factor is made up of the numbers outside the parentheses:
…..
….. $(2x-1)$ $\!\! (6x+5)$

Tada! I’ll leave it to you to show that if you had written the linear terms in step C in the reverse order, you’d get the same answer.

## Completing the square

Are you an expert at completing the square? This is an important skill that is not nearly as difficult as a lot of students think it is. If you master just a couple of rules, you will be able to complete squares like a pro.

Let’s start with an explanation. Since we complete the square in algebra and not in geometry, exactly where is the square we are completing? This confuses many students and is probably the reason why they are frightened unnecessarily by the process. But it’s actually pretty simple. Let’s say we have the following expression:

$(x-3)^2$

This is obviously the square of $(x-3)$, and so we call it a perfect square. If we expand the expression into $x^2-6x+9$, we recognize that it is still a perfect square. Any trinomial of the form $ax^2+bx+c$ is a perfect square if it is the square of a binomial expression.

When we have an expression such as $x^2-6x$, we look for a number we can add to make it a perfect square of a binomial. In this case, adding $9$ to $x^2-6x$ to get $x^2-6x+9$ gives us the square of $x-3$. Therefore we have completed the square. That’s all the expression means!

Completing the square is actually quite easy in most cases. Because $(x+a)^2=x^2+2ax+a^2$, anytime we have an expression of the form $x^2+2ax$, all we need to do is add $a^2$. You can do this in two quick steps:

1. Take the coefficient on the $x$ term and divide it by $2$.
2. Square this number and add it to the end.

For example:

• $x^2+8x$: Divide the $8$ by $2$ (you get $4$) and square it (you get $16$), so the completed square is $x^2+8x \; +$ $16$
• $x^2-12x$: Divide the $-12$ by $2$ (you get $-6$) and square it (you get $36$), so the completed square is $x^2-12x \; +$ $36$
• $x^2+9x$: Divide the $9$ by $2$ (you get $\frac{9}{2}$) and square it (you get $\frac{81}{4}$), so the completed square is $x^2+9x \; +$ $\frac{81}{4}$
• $x^2-13x$: Divide the $-13$ by $2$ (you get $\frac{-13}{2}$) and square it (you get $\frac{169}{4}$), so the completed square is $x^2-13x \; +$ $\frac{169}{4}$

Next you write the factor as a square. The factor is always of the form $(x+a)^2$ or $(x-a)^2$ where the value of $a$ is the number that you squared. For the four examples above:

• $x^2+8x \; +$ $16$ $= (x$ $+ \; 4$ $)^2$
• $x^2-12x \; +$ $36$ $= (x$ $- \; 6$ $)^2$
• $x^2+9x \; +$ $\frac{81}{4}$ $= (x$ $+ \; \frac{9}{2}$ $)^2$
• $x^2-13x \; +$ $\frac{169}{4}$ $= (x$ $- \; \frac{13}{2}$ $)^2$

What if your expression starts with $ax^2$ where $a$ is not equal to $1$? Then you have to factor the $a$ out of both terms before you complete the steps above. It can appear very complicated, but the process is the same every time. Here are some examples:

• $2x^2+8x=2(x^2+4x) \rightarrow 2(x^2+4x+4)=2(x+2)^2$
• $4x^2-12x=4(x^2-3x) \rightarrow 4(x^2-3x+ \frac{9}{4}) = 4(x- \frac{3}{2})^2$
• $2x^2+9x=2(x^2+ \frac{9}{2}x) \rightarrow 2(x^2+ \frac{9}{2}x+ \frac{81}{16}) = 2(x+ \frac{9}{4})^2$
• $3x^2-13x=3(x^2- \frac{13}{3}x) \rightarrow 3(x^2- \frac{13}{3}x+ \frac{169}{36})=3(x- \frac{13}{6})^2$

## Divisibility rules

You always need to simplify fractions and radicals before you box your final answer. In order to simplify these, you need to be able to factor integers. There was a teacher at my middle school who urged his students to “learn your gozintas!” In other words, know whether a number goes into the number you are factoring. Now that calculators are so common, many students today don’t think they need to learn their gozintas. However, the divisibility rules for the first six prime numbers are so easy to learn, you will benefit from knowing them.

 A number is divisible by ___ if: Examples 2 Last digit is 0, 2, 4, 6, 8 478 ends in 8, so it is divisible by 2. 8349 doesn’t end in 0, 2, 4, 6 or 8 so it is not divisible by 2. 3 Sum of digits is divisible by 3 8349 is divisible by 3 because 8+3+4+9 = 24 which is divisible by 3. [See note below.] 1450 is not divisible by 3 because 1+4+5+0 = 10 which is not divisible by 3. 5 Last digit is 0, 5 1450 is divisible by 5. 3157 is not divisible by 5. 7 Twice the last digit subtracted from the remaining digits is divisible by 7 (Take the last digit and double it. Subtract this from the original number after the last digit is removed.) 3157 is divisible by 7 because 315 – 2*7 = 315-14 = 301 which is divisible by 7. [See note below.] 4563 is not divisible by 7 because 456 – 2*3 = 456 – 6 = 450 which is not divisible by 7. 9 Sum of digits is divisible by 9 4563 is divisible by 9 because 4+5+6+3 = 18 which is divisible by 9. [See note below.] 90827 is not divisible by 9 because 9+0+8+2+7 = 26 which is not divisible by 9. 11 Sum of odd digits – sum of even digits is divisible by 11 (Here, odd and even digits refer to their place in the number, not their value. For example, if you have a 9 digit number, add the 1st, 3rd, 5th, 7th and 9th digits and subtract the sum of the 2nd, 4th, 6th and 8th digits. If this number is divisible by 11, the original number is divisible by 11.) 90827 is divisible by 11 because (9+8+7) – (0+2) = 24 – 2 = 22 which is divisible by 11. [See note below.] 478 is not divisible by 11 because (4+8)-7 = 5 which is not divisible by 11.

Note: What if you do the test for divisibility by 3, 7, 9 or 11, but you don’t know whether the number you obtained is divisible by the number you are testing? Then just do the test again. Let’s test a large number to see how this works.

Example 1: Is 999,999 divisible by 3 or by 9?

9+9+9+9+9+9 = 54. And 5+4 = 9. So 999,999 is divisible by 3 and by 9.

Example 2: Is 999,999 divisible by 7?

99,999 – 18 = 99,981. And 9998 – 2 = 9986. And 998 – 12 = 986. And 98 – 12 = 84. And 8 – 8 = 0, which is divisible by 7. So 99,999 is divisible by 7! (And so are 99,981 and 9986 and 986 and 84!)

No matter how large your original number, you can just keep repeating the test until you know your answer for certain.

## Simplifying “3-stack” and “4-stack” fractions

I had a physics student a number of years ago who worked a complicated problem and ended up with the following (I’ve changed the actual numbers to make our work here easier to follow):

$\dfrac{(2)(3)}{4}=\dfrac{(5)(6)(7)B}{(8)(9)}$

Of course, his next step was to solve for B. It should be clear to you, as it was to him, that he needed to multiply both sides by 8 and 9 and divide by 5, 6 and 7. That is what he did. But this is how he wrote the solution:

$B= \dfrac{9 \cdot \left( \dfrac{ \left(\dfrac{ 8 \cdot \left( \dfrac{(2)(3)}{4} \right)}{5} \right)}{6} \right)}{7}$

His expression was totally correct, and he found the correct value of B, but he made the problem so much harder than he needed to. He created a fraction with five different stacks in it and he needed all those parentheses to keep track of which number was a numerator and which was a denominator.

This is an extreme case of what I see so many students do: they create “3-stack” and “4-stack” fractions all the time when they are simplifying problems. Let’s look at two examples. I’ll solve them with “bad” solutions and then with much smarter solutions (I don’t simplify the answers here because I want to focus on the first step of the solution):

Example 1. Solve:

$3x= \dfrac{2}{5}$

$x= \dfrac{\dfrac{2}{5}}{3}$

Smarter solution:

$x= \dfrac{2}{5 \cdot 3}$

Example 2. Solve:

$\dfrac{4}{7}x=\dfrac{2}{5}$

$x= \dfrac{\dfrac{2}{5}}{\dfrac{4}{7}}$

Smarter solution:

$x= \dfrac{2 \cdot 7}{5 \cdot 4}$

You can see that the smarter solutions are simpler to read and easier to simplify.

It is easy to train yourself to write answers as “2-stack” fractions if you remember one simple rule:

Respect the vinculum.

Um, respect the what?!?

The vinculum. When you write a fraction, the horizontal line that separates the numerator from the denominator is called the vinculum. No one ever talks about it, but it’s a very powerful symbol. It tells you to multiply by every number that is above it and divide by every number that is below it. And it’s as easy as that. So when you are simplifying expressions like the ones in the two examples above or the more complicated example at the beginning of this post, all you need to do is to put numbers that are multiplied above the vinculum and numbers that are divided below the vinculum. And what happens if you are multiplying or diving by a fraction? Then put the numerator on top and the denominator on the bottom if you are multiplying. Flip the fraction over first if you’re dividing (as I did in Example 2). When you do this, you will end up with a 2-stack fraction that can be easily evaluated. Let’s look at the original problem again:

$\dfrac{(2)(3)}{4}=\dfrac{(5)(6)(7)B}{(8)(9)}$

To solve for B, you will multiply by 8 and 9, so they go on top. And you will divide by 5, 6 and 7, so they go on the bottom. In one step, you’ve solved for B as follows:

$B= \dfrac{2 \cdot 3 \cdot 8 \cdot 9}{5 \cdot 6 \cdot 7}$

Compare that to the monstrosity at the beginning. So much easier!

P.S. You don’t really have to remember the name “vinculum”. Most people don’t know what the line is called and don’t care. Chances are good your math teacher doesn’t even know the term. To make things even more bizarre, when you write a fraction with a slash instead of a horizontal line like this—2/3 – the slash is called a “virgule”.  Most people don’t know that one and don’t care about it either. All you have to remember is that the horizontal line in a fraction tells you to multiply on top and divide on the bottom.

## Factoring the difference of two squares

You will spend a lot of time in algebra (and courses beyond) factoring polynomials into linear and quadratic terms. There are some special polynomials that occur so frequently that you should recognize them on sight so that you know the method for factoring them. The most common is the binomial of the form $a^2-b^2$. This is called the difference of two squares because both terms are perfect squares and you are subtracting (finding the difference between) the two terms.

Some examples of this binomial are $x^2-4$, $9x^4-16y^2$ and $121y^2z^2-25w^4a^6b^{12}$. Note that in each case, both terms are perfect squares.

It is very easy to factor these expressions—you can do it by inspection. The rule is simple and you must memorize it: $a^2-b^2=(a+b)(a-b)$. Once you determine that an expression is the difference of two squares, you can write out its factors immediately. Let’s see how it works with the three examples given above:

$x^2-4=(x+2)(x-2)$

$9x^4-16y^2=(3x^2+4y)(3x^2-4y)$

$121y^2z^2-25w^4a^6b^{12}=(11yz+5w^2a^3b^6)(11yz-5w^2a^3b^6)$

It’s really that easy once you learn the format. Of course it doesn’t matter what order you write the two factors, so $x^2-4=(x-2)(x+2)$ is also correct.

One other important point: this factoring rule works in reverse, too! If you have to distribute (multiply out) two factors and you see they are in the form of $(a+b)(a-b)$, you should recognize that this gives the difference of two squares: $a^2-b^2$. You can do this immediately, without multiplying out every term. Learning this formula will save you lots of time.

## The Most Common Factoring Mistake

I am surprised (and a little disappointed) every year when one of my students tries to simplify a polynomial fraction by cancelling out terms that can’t be cancelled out. For example, when faced with

$\dfrac{3x+7}{2x-5}$

inevitably, a student will ask me, “Can I cancel out the x’s like this?”

Tears well up in my eyes as I explain that no, the x’s do not cancel. I explain patiently why the x’s do not cancel. And very often, the next time I work with that student, he or she will try to cancel out the x’s again. This is the most common factoring mistake I see students make, and it’s not limited to Algebra students. I’ve even seen Calculus student make this error. That usually makes me sob quite loudly.

If you would like to keep me from crying, then you need to learn how to simplify polynomial fractions. It’s quite simple once you understand that terms that are added do not cancel out. Only factors that are multiplied together can cancel. Let’s start by looking at a fraction with numbers and no variables.

$\dfrac{210}{462}$

Can this be simplified? Of course. Most students will divide the top and bottom by 2, then by 3, and then by 7, as follows:

$\dfrac{210}{462}=\dfrac{105}{231}=\dfrac{35}{77}=\dfrac{5}{11}$

This is correct. But why can you cancel out a 2 and a 3 and a 7? It’s because they are factors of the numerator and the denominator. Let’s do the same problem by completely factoring the top and bottom first:

$\dfrac{210}{462}=\dfrac{2\cdot 3 \cdot 5 \cdot 7}{2 \cdot 3 \cdot 7 \cdot 11}=\dfrac{5}{11}$

When you write it out like this, you can see that the 2’s cancel, the 3’s cancel, and the 7’s cancel. And they cancel only because they are factors.

Now let’s try to simplify some polynomial fractions. Start by factoring the numerator and denominator completely, then any like factors will cancel:

$\dfrac{2x-4}{6x+14}=\dfrac{2(x-2)}{2(x+7)}=\dfrac{x-2}{x+7}$

$\dfrac{4x+8}{12x+24}=\dfrac{4(x+2)}{12(x+2)}=\dfrac{4}{12}=\dfrac{1}{3}$

$\dfrac{x^2-1}{x^2+4x+3}=\dfrac{(x+1)(x-1)}{(x+1)(x+3)}=\dfrac{x-1}{x+3}$

## Scientific notation on your calculator

To express numbers in scientific notation on your calculator, you should always use the EE key (EXP key on some calculators). Some calculators will insert a small capital E, others will display the exponents on the far right side of your calculator display. Remember that the E means “times ten to the…”. You should never write scientific notation numbers on your calculator with the caret key (such as 3.1 x 10^4).

Note that a number like (2.3)4 is not in scientific notation! It is not the same number as 2.3 x 104. The number in red is equal to 2.3 x 2.3 x 2.3 x 2.3. The number in blue is equal to 2.3 x 10,000. So for a number like (2.3)4, do not use the EE key.

Most scientific and graphing calculators let you change the display back and forth between regular notation and scientific notation. If you learn how to use this feature, you don’t have to count zeroes when you get an answer like 0.00000571. Just convert to scientific notation and the calculator tells you the number is 5.71 x 10-6.