Week 11 Notes
Linear Equations
A linear equation is an equation where all of the variables are to the first power.
Single Variable Linear Equations
The simplest type of linear equation is one with a single variable. Here's an example: $$2x+5=4x+2$$How do you solve these?
- Move all of the \(x\) terms to the left side.
- Move all of the constant terms to the right side.
- Divide both sides by the coefficient of the \(x\) term.
Applying this procedure to the example above gives us $$2x-4x+5=2$$$$-2x=2-5$$$$-2x=-3$$$$x=1.5$$
This method of solving a linear equation is called isolation, as we are isolating the \(x\) variable on the left and putting everything else on the right. This method will be useful in the next section as well.
Multivariate Linear Equations
Now, suppose we have a linear equation with multiple variables$$4x+5y=10$$How do we solve this? Well, we can't, as there are multiple solutions. Whenever we have \(n\) equations and \(m\) variables, with \(m>n\), we can't solve the system of equations.
However, we can apply our isolation trick. Let's isolate \(x\) as per our method above. $$4x=10-5y$$$$x=2.5-1.25y$$
This allows us to calculate the corresponding \(x\) value for any \(y\) value.
Now suppose we have two equations: $$4x+5y=10$$$$6x+5y=60$$How do we solve here?
Solving systems with substitution
Let's isolate \(x\) in the first equation to get $$x=2.5-1.25y$$Now, we have a formula for \(x\) in terms of \(y\). We can replace \(x\) in the second equation with \(2.5-1.25y\).
$$6(2.5-1.25y)+5y=60$$$$15-7.5y+5y=60$$$$-2.5y=45$$$$y=-18$$Now we know the value for \(y\), so we can substitute it in to compute \(x\)$$4x+5(-18)=10$$$$4x=100$$$$x=25$$
This method of solving linear equations is called substitution. To review, here's how it works:
- Given \(n\) equations with \(m\lt n\) variables, take the equation with the least unique variables, and isolate one of them
- Substitute the right hand side of the equation for the variable in all other equations.
- Now you have \(n-1\) eqations with \(m-1\lt n-1\) variables. Repeat the above steps until you reach \(1\) variable.
- Solve for the remaining variable
- Go backwards and calculate each of the variables from the previous.
Let's do an example to show how it works
The great part about substitution is that if the system has an answer, substitution will give it to you. The bad part is that it can take a very long time, especially for larger systems. Thus, we use a different technique to simplify systems a bit quicker.
Solving systems with Elimination
Let's revist the system we just solved: $$2x+y+z=5$$$$x+3y+4z=12$$$$5x+10y+z=15$$Our goal is to get rid of a variable to simplify the solving. Here's how we can do that.
Suppose in equation \(a\), the coefficient of variable \(x\) is \(c\), and in equation \(b\), the coefficient is \(d\). Then, multiply \(a\) by \(d\) and \(b\) by \(-c\) and add the two equations together. The \(x\) terms will cancel out.
Let's apply this to the first two equations. Multiplying the second equation by \(-2\) gives us \(-2x-6y-8z=-24\). Adding it to the first equation gives us \(-5y-7z=-19\).
Elimination is in general a faster method for simplifying systems of equations, although choosing the equations that minimize the multiplication will help you solve equations much faster.
Occasionally, you may see some patterns that make solving even faster.
Polynomials
Linear equations are nice and simple because they only involve variables to the first power. Polynomials, on the other hand, can have variables to any power. In these notes, we'll only deal with polynomials in a single variable. In other words, our polynomials will look like this:$$p(x)=a_nx^n+a_{n-1}x^{n-1}+\ldots+a_0$$
Polynomial Division
Like numbers, we can divide polynomials. Here's an example.
The example above should be quite familiar to you, as it is essentially the same process as long division for integers.
Notice that the degree of the remainder in the example above (\(8\)) is less than the divisor (\(x-3\)). This isn't a coincidence. The same way that the remainder of the division \(n/k\) is less than \(k\) (assuming \(k>0\)), the degree of the remainder when dividing by polynomials is less than the degree of the divisor.
More importantly, given polynomials \(p\) and \(d\), with \(q\) the quotient when \(p\) is divided by \(d\), and \(r\) the remainder polynomial, we have the following equation:$$p=q\cdot d+r$$In the example above, we have $$x^3-2x^2-4=(x^2+x+3)(x-3)+8$$This is called quotient form.
Polynomial Roots
Given a polynomial \(p(x)\), a root \(y\) of \(p\) is a number such that \(p(y)=0\). How many roots does \(p\) have? How can we find them?
And for any degree \(n\) polynomial \(p\), if \(y\) is a root of \(p\), then \(p(x)=q(x)\cdot(x-y)\). \(q(x)\) has degree at most \(n-1\), so it has at most \(n-1\) roots. So, \(p\) has all of \(q\)'s roots and \(y\), so it has at most \(n\) roots.
The above two results tell us that if \(p\) is a degree \(n\geq0\) polynomial with roots \(x_1,\ldots,x_n\), then there exists a real number \(a\neq0\) such that $$p(x)=a\cdot\prod\limits_{i=1}^n(x-x_i)$$We call this the factorization of \(p\).
Quadratic Polynomials
Quadratic Polynomials are polynomials of degree \(2\). In other words, they are of the form \(ax^2+bx+c\). We can find the roots as follows.
We call the value \(b^2-4ac\) the discriminant of the quadratic polynomial. If it is positive, the polynomial has \(2\) real roots. If it is zero, it has \(1\) real root. Otherwise, it has \(0\) real roots. A classic application of the discriminant is the following theorem.
The quadratic formula gives us a way of finding the factorization of any quadratic. Similarly, there are formulas for finding the factorization of cubics (degree 3) and quartics (degree 4) called Cardano's Formulas, but these formulas are tedious, and not worth remembering.
Vieta's Formulas
As noted in the previous section, finding roots of quadratic polynomials is already hard, but the higher the degree is, the harder it gets. So are there ways of interacting with roots without directly calculating them? The answer is yes!
Elementary Symmetric Polynomials
Given a polynomial \(p\) with degree \(n\) and \(n\) roots \(x_1,\ldots,x_n\), the elementary symmetric polynomials are the following polynomials:$$S_1=x_1+x_2+\ldots+x_n$$$$S_2=x_1x_2+x_1x_3+\ldots+x_2x_3+\ldots+x_{n-1}x_n$$$$\vdots$$$$S_n=x_1x_2\ldots x_n$$In other words, the \(i\)th elementary symmetric polynomial is the polynomial that sums all the possible products of \(i\) of the \(n\) roots.
Any symmetric polynomial \(q(x_1,\ldots,x_n)\) (symmetric meaning that the order of inputs doesn't matter) can be written in terms of elementary symmetric polynomials. Here are some examples for \(n=2\):$$x_1^2+x_2^2=(x_1+x_2)^2-2x_1x_2=S_1^2-2S_2$$$$x_1^3+x_2^3=S_1^3-3S_1S_2$$
Why are these polynomials useful?
In other words, just by looking at a polynomial, you know the values of all of the elementary symmetric polynomials on the roots!
Vieta's formulas imply another very useful theorem.
Diophantine Equations
Often, we are interested in polynomial equations, but want to only find integer solutions to them. We call these equations Diophantine Equations. In general, these equations are extremely challenging to solve. However, there are some special types of Diophantine equations which are more easily solvable.
A good example of such a Diophantine equation is known as Simon's Favorite Factoring Trick, which is the following simple observation:$$(x+i)(y+j)=xy+jx+iy+ij$$In particular, \(xy+x+y+1=(x+1)(y+1)\) and \(xy-x-y+1=(x-1)(y-1)\). We can use this observation to factor equations of the form \(Axy+Bx+Cy=D\).
Another useful Diophantine equation is Pell's Equation, which is of the form \(x^2-dy^2=1\) for some positive integer \(d\) which is not a perfect square. Then, the following theorem holds.
Challenge: Polynomial Rings
In the previous section, we noted the similarity between long division in the integers and in the set of polynomials. And, we also defined what it means to compute the remainder when one polynomial is divided by the other. Using these ideas, we can define mods for polynomials.
But before that, a bit of notation. \(\mathbb N\) is the set of natural numbers, \(\mathbb Z\) is the set of integers, \(\mathbb Q\) the set of rational numbers, and \(\mathbb R\) the set of real numbers.
Given a set \(S\), the notation \(S[x]\) refers to the set of polynomials where the coefficients belong to \(S\) and the variable is \(x\).
Defining mods
In Week 8, we consider the integers \(\mathbb Z\) mod some natural number \(n\). When we want to write the integers modulo \(n\), we write \(\mathbb Z/(n)\). Essentially, we are dividing the integers into \(n\) pieces, hence the notation.
We'll use similar notation for polynomials. Given some modulus \(r(x)\), we say that \(p(x)\equiv q(x)\bmod r(x)\) if \(p(x)-q(x)\) is a multiple of \(r(x)\), or equivalently, if \(p(x)\) and \(q(x)\) have the same remainder when divided by \(r(x)\).
We'll write this set as \(\mathbb R[x]/(r(x))\), which means the set of polynomials with real coefficients, modulo \(r(x)\).
Building interesting mod sets
Let's think about the natural numbers for a moment. The polynomial \(x+1\) is an element of the set \(\mathbb N[x]\), but it has no roots in the natural numbers. In fact, it's only root is in the integers, notably \(-1\). Because of this, we expand the space of natural numbers to include the integers.
Similarly, the polynomial \(qx+p\) is an element of the set \(\mathbb Z[x]\), but unless \(q\) is a divisor of \(p\), it has no roots in the integers. For example \(2x-1\) has no roots in the integers. So, we are motivated to expand the space of integers to the rational numbers.
In both of these examples, we found polynomials that didn't have roots, and then added new numbers to ensure that the polynomials have roots. But why are we allowed to do this?
It's all thanks to mods! Let me show you why.
Let's take our example from earlier. \(2x-1\) is a integer polynomial, but it has no roots in the integers. How do we create a root? Simple. Consider the space \(\mathbb Z[x]/(2x-1)\). In this space, we have all of our integers, but \(x\) is defined so that \(2x-1\equiv0\). In other words, \(x\equiv\frac12\)!
So, \(\mathbb Z[x]/(2x-1)\) is the space we get when we take the integers, and add \(\frac12\) (and all of its integer multiples). We can do the same thing with \(3x-1,\;5x-1\), etc, to add all of the fractions to \(\mathbb Z\). Doing this for all the possible denominators creates the rational numbers.
That's cool! But we can actually go even further. In \(\mathbb R[i]\), there are several polynomials without real roots. For example, \(i^2+1\).
So let's apply our technique again! Let's consider the space \(\mathbb R[i]/(i^2+1)\). This space has all of the real numbers, but it also has a number \(i\), with the property that \(i^2+1\equiv0\), or in other words, \(i^2\equiv-1\).
Ring a bell yet? These are the complex numbers! In fact, this is how they are defined. The complex numbers are just a mod set.
Now you may be wondering, can we go even further? Can we find more polynomials with no roots in the complex numbers, and add them in to make an even bigger space? The answer is no.
The complex numbers are special because they have a property called algebraic closure. In other words, every polynomial has a root. So, our fun little game ends with the complex numbers.