Salta al contenuto
Note per Studenti Systems of Linear Equations Report

Systems of Linear Equations

In questa pagina 6

1. Linear equations

Definition. Let a,b,c∈Ra,b,c\in\mathbb{R} be fixed. An equation ax+by=cax+by=c is a linear equation in the variables (unknowns) x,yx,y. More generally a1x1+⋯+anxn=ba_1x_1+\dots+a_nx_n=b is a linear equation in x1,…,xnx_1,\dots,x_n. The real numbers a1,…,ana_1,\dots,a_n are the coefficients, bb is the constant term. The solution set consists of all ordered tuples (r1,…,rn)(r_1,\dots,r_n) of numbers such that substituting xi=rix_i=r_i makes the equation true: a1r1+⋯+anrn=ba_1r_1+\dots+a_nr_n=b.

The word "linear" comes from the geometry of the solution sets.

Example. The equation 4x−2y=34x-2y=3 (coefficients 44 and −2-2, constant term 33). Subtract 4x4x: −2y=−4x+3-2y=-4x+3; divide by −2-2: y=2x−32y=2x-\tfrac32. Each step is an equivalence (one equation holds precisely if the next holds), so the solution set is {(x, 2x−32) ∣ x∈R},\{(x,\ 2x-\tfrac32)\ \mid\ x\in\mathbb{R}\}, an infinite set: a straight line in the plane.

In general ax+by=cax+by=c with a≠0a\ne0 or b≠0b\ne0 has a line as solution set. If a=b=0a=b=0 see the worked exercise in Section 6.

Remark (fields). Above we had to divide by −2-2, i.e. we needed the rational number 32\tfrac32. R\mathbb{R} and Q\mathbb{Q} are fieldssets in which one can add, subtract, multiply and divide by nonzero numbers with the usual rules, and so is C\mathbb{C} (see Complex NumbersComplex numbers are pairs a+ib with i^2=-1; they have a conjugate, an absolute value, a trigonometric form where multiplication adds arguments, every non-constant polynomial has a root in them, and exp(ib)=cos b+i sin b.Complex Numbers →). The integers Z\mathbb{Z} are not a field; solving linear systems over Z\mathbb{Z} is harder. This course works over R\mathbb{R}, except for eigenvalues, where complex numbers are unavoidable.

Remark (non-linear equations). Equations such as x2+4y3=5x^2+4y^3=5 or log⁡x+4sin⁡x=0\log x+4\sin x=0 are not studied in linear algebra; linear algebra still helps through linear approximations (the derivative is the best linear approximation of a differentiable function).

2. Systems of linear equations

Definition. A system of linear equations (linear system, system) is a collection of linear equations in the same variables. We look for the tuples satisfying all equations at once.

Example (unique solution). The system x+y=4,x−y=1.x+y=4,\qquad x-y=1 . Solve the first equation for xx: x=−y+4x=-y+4. Substitute into the second: (−y+4)−y=1(-y+4)-y=1, i.e. −2y+4=1-2y+4=1, −2y=−3-2y=-3, y=32y=\tfrac32. Back-substituting: x=−32+4=52x=-\tfrac32+4=\tfrac52. Each equation holds precisely if the preceding one holds, so the solution set is the single element {(52,32)}\{(\tfrac52,\tfrac32)\}.

Geometrically, each equation is a line, and two non-parallel lines meet in exactly one point.

Example (no solution). The system x+y=4x+y=4, x+y=1x+y=1 has no solution: the two lines are parallel and distinct.

Example (infinitely many solutions). The system x+y=4x+y=4, 2x+2y=82x+2y=8 has the solutions (x, 4−x)(x,\,4-x) with x∈Rx\in\mathbb{R} arbitrary. Geometrically the same line is intersected with itself; one equation is redundant, and the solution set of the system equals that of either equation.

Summary. The solution set of ax+by=cax+by=c is a line (unless a=b=0a=b=0). The solution set of a system of two such equations can take exactly three forms:

number of solutions geometric explanation
exactly one the unique intersection point of two non-parallel lines
none two distinct parallel lines do not intersect
infinitely many a line intersects itself in infinitely many points

Definition. A homogeneous linear system is one in which all constant terms are 00 (b1=⋯=bm=0b_1=\dots=b_m=0 in the notation below).

Remark. A homogeneous system always has at least one solution, (x1=0,…,xn=0)(x_1=0,\dots,x_n=0), the trivial solution.

3. Elementary operations

Geometric intuition is of limited use with three variables and hardly any with four or more, so we develop systematic techniques.

Definition. Two linear systems are equivalent if they have the same solution set.

For example the system x+y=4x+y=4, x−y=1x-y=1 is equivalent to x=52x=\tfrac52, y=32y=\tfrac32, from which the solution can be read off directly. The purpose of elementary operations is to turn a system into an equivalent one whose solutions can be read off.

Definition (elementary operations). On a linear system:

  1. interchange two equations;
  2. multiply one equation by a non-zero number;
  3. add a multiple of one equation to a different equation.

Theorem. A linear system is equivalent to (has the same solutions as) any system obtained from it by any number of elementary operations. (The source proves this later, once matrices are available; it is simple to grasp and extremely useful in practice.)

Example. Solve x+2z=1,−2x−3z=−1,2y=2.x+2z=1,\qquad -2x-3z=-1,\qquad 2y=2.

  1. Add twice the first equation to the second (operation 3): x+2z=1, z=1, 2y=2x+2z=1,\ z=1,\ 2y=2.
  2. Interchange the second and third equations (operation 1): x+2z=1, 2y=2, z=1x+2z=1,\ 2y=2,\ z=1.
  3. Multiply the second equation by 12\tfrac12 (operation 2): x+2z=1, y=1, z=1x+2z=1,\ y=1,\ z=1.
  4. Add (−2)(-2) times the third equation to the first (operation 3): x=−1, y=1, z=1x=-1,\ y=1,\ z=1.

By the theorem the original system has exactly this one solution: (x,y,z)=(−1,1,1)(x,y,z)=(-1,1,1).

4. Matrices

Matrices help with the bookkeeping.

Definition. A matrix is a rectangular array of numbers. It is an m×nm\times n-matrix (mm-by-nn) if it has mm rows and nn columns; if m=nm=n it is square. A 1×n1\times n-matrix is a row vector, an m×1m\times1-matrix a column vector.

Examples. Matrices are denoted by capital letters: A=(3−407) (2×2),B=(120−103) (2×3),C=(120−103) (3×2).A=\begin{pmatrix}3&-4\\0&7\end{pmatrix}\ (2\times2),\qquad B=\begin{pmatrix}1&2&0\\-1&0&3\end{pmatrix}\ (2\times3),\qquad C=\begin{pmatrix}1&2\\0&-1\\0&3\end{pmatrix}\ (3\times2). Entries may be variables: (x1x2)\begin{pmatrix}x_1\\x_2\end{pmatrix} is a column vector (2×12\times1), (x1x2)\begin{pmatrix}x_1&x_2\end{pmatrix} a row vector (1×21\times2).

Notation. A matrix with unspecified entries is written A=(a11a12…a1na21a22…a2n⋮⋮⋮am1am2…amn)=(aij)i=1,…,m; j=1,…,n.A=\begin{pmatrix}a_{11}&a_{12}&\dots&a_{1n}\\a_{21}&a_{22}&\dots&a_{2n}\\\vdots&\vdots&&\vdots\\a_{m1}&a_{m2}&\dots&a_{mn}\end{pmatrix}=(a_{ij})_{i=1,\dots,m;\ j=1,\dots,n}. The number aija_{ij} is the entry in the ii-th row and jj-th column.

Definition (augmented matrix). For the linear system a11x1+a12x2+⋯+a1nxn=b1a21x1+a22x2+⋯+a2nxn=b2  ⋮am1x1+am2x2+⋯+amnxn=bm\begin{aligned}a_{11}x_1+a_{12}x_2+\dots+a_{1n}x_n&=b_1\\a_{21}x_1+a_{22}x_2+\dots+a_{2n}x_n&=b_2\\&\ \,\vdots\\a_{m1}x_1+a_{m2}x_2+\dots+a_{mn}x_n&=b_m\end{aligned} (mm equations, unknowns x1,…,xnx_1,\dots,x_n, coefficients aija_{ij}, constants b1,…,bmb_1,\dots,b_m) the associated (augmented) matrix is the m×(n+1)m\times(n+1)-matrix (a11a12…a1nb1a21a22…a2nb2⋮⋮⋮am1am2…amnbm).\left(\begin{array}{cccc|c}a_{11}&a_{12}&\dots&a_{1n}&b_1\\a_{21}&a_{22}&\dots&a_{2n}&b_2\\\vdots&&&\vdots&\vdots\\a_{m1}&a_{m2}&\dots&a_{mn}&b_m\end{array}\right). The vertical bar only reminds us that the last column holds the constants. The matrix records coefficients and constants and suppresses the variables.

Example. The system x+y=4x+y=4, x−y=1x-y=1 has the associated matrix (1141−11)\left(\begin{array}{cc|c}1&1&4\\1&-1&1\end{array}\right).

The process can be reversed: every m×(n+1)m\times(n+1)-matrix defines a linear system. For example (120103)\left(\begin{array}{cc|c}1&2&0\\1&0&3\end{array}\right) gives x+2y=0x+2y=0, x=3x=3.

5. Gaussian elimination

The theorem on elementary operations does not tell us how to simplify a system (arbitrary operations may not simplify it). Gaussian elimination is an algorithm that is guaranteed to give the simplest equivalent form. We phrase it for matrices first.

Definition (row-echelon form). A matrix is in row-echelon form if:

  1. zero rows (rows of only zeros), if any, are at the bottom;
  2. in a non-zero row, the first non-zero entry from the left is a 11, the leading 1;
  3. each leading 1 is to the right of all leading 1's in the rows above it.

If in addition each leading 1 is the only non-zero entry in its column, the matrix is in reduced row-echelon form.

Schematically (the stars are arbitrary numbers; for the reduced form all starred entries in the columns of the leading 1's must also be 00):

 0 1 * * 0 * * ...
 0 0 0 0 1 * * ...        staircase of leading 1's,
 0 0 0 0 0 0 1 ...        moving to the right as one goes down;
 0 0 0 0 0 0 0 ...        zero rows at the bottom

Definition (elementary row operations). On a matrix:

  1. interchange two rows;
  2. multiply a row by a non-zero number;
  3. add a multiple of a row to a different row.

Method (Gaussian algorithm). Every matrix can be brought to reduced row-echelon form by a sequence of elementary row operations:

  1. If the matrix consists only of zeros, stop (it is in reduced row-echelon form).
  2. Otherwise find the first column from the left with a non-zero entry aa. Interchange rows so that a row with this entry is at the top.
  3. Multiply the new top row by 1a\tfrac1a (possible since a≠0a\ne0), so that it has a leading 1.
  4. Add suitable multiples of the first row to the remaining rows so that all entries below the leading 1 are 00.

Now the first row is not touched anymore, and steps 1-4 are applied to the matrix of the remaining rows. This produces a (possibly not reduced) row-echelon form. Finally add suitable multiples of rows with leading 1's to the rows above them, starting from the bottom, to obtain the reduced form.

Example. Apply the algorithm to (12−57−2−14−254−1311).\begin{pmatrix}1&2&-5&7\\-2&-1&4&-2\\5&4&-13&11\end{pmatrix}.

  • Steps 2 and 3 change nothing (the top-left entry is already 11). Step 4: add 2×2\times row 1 to row 2 and −5×-5\times row 1 to row 3: (12−5703−6120−612−24).\begin{pmatrix}1&2&-5&7\\0&3&-6&12\\0&-6&12&-24\end{pmatrix}.
  • Restrict to rows 2 and 3. The first non-zero column is column 2, with a=3a=3 already in the top position; multiply row 2 by 13\tfrac13: (12−5701−240−612−24).\begin{pmatrix}1&2&-5&7\\0&1&-2&4\\0&-6&12&-24\end{pmatrix}.
  • Step 4: add 6×6\times row 2 to row 3: (12−5701−240000).\begin{pmatrix}1&2&-5&7\\0&1&-2&4\\0&0&0&0\end{pmatrix}. Now only a zero row remains, so the algorithm stops: this is row-echelon form, but not reduced.
  • To reduce, add −2×-2\times row 2 to row 1: (10−1−101−240000).\begin{pmatrix}1&0&-1&-1\\0&1&-2&4\\0&0&0&0\end{pmatrix}.

Method (solving a linear system).

  1. Form the augmented matrix.
  2. Apply Gaussian elimination to get a reduced row-echelon matrix.
  3. If a row of the form (00…0∣1)\begin{pmatrix}0&0&\dots&0&\mid&1\end{pmatrix} occurs (it says 0=10=1), the system has no solutions.
  4. Otherwise call the variables whose columns contain no leading 1 the free variables; they can take arbitrary real values. The variables whose columns contain a leading 1 (leading variables) are uniquely determined by the free ones: solve the equations of the echelon matrix for them.

Example. The system x+2y−5z=7,−2x−y+4z=−2,5x+4y−13z=11x+2y-5z=7,\qquad -2x-y+4z=-2,\qquad 5x+4y-13z=11 has the augmented matrix of the previous example. By the theorem on elementary operations it is equivalent to the system of the reduced matrix: x−z=−1,y−2z=4,0=0.x-z=-1,\qquad y-2z=4,\qquad 0=0 . The leading variables are x,yx,y; zz is free. Then y=4+2zy=4+2z and x=−1+zx=-1+z, so the solution set consists of the triples (x,y,z)=(−1+z, 4+2z, z),z∈R arbitrary.(x,y,z)=(-1+z,\ 4+2z,\ z),\qquad z\in\mathbb{R}\text{ arbitrary}. (Check: substituting into the first equation gives −1+z+8+4z−5z=7-1+z+8+4z-5z=7.)

6. Worked exercises

The equation ax+by=cax+by=c in all cases. If a≠0a\ne0 or b≠0b\ne0 there are infinitely many solutions: for a≠0a\ne0 subtract byby and divide by aa, so x=c−byax=\frac{c-by}{a} and (c−bya, y)(\frac{c-by}a,\,y) is a solution for every y∈Ry\in\mathbb{R}; similarly for b≠0b\ne0. If a=b=0a=b=0: for c=0c=0 the equation 0x+0y=00x+0y=0 is true for every pair, so all of R2\mathbb{R}^2 is the solution set (infinitely many solutions); for c≠0c\ne0 the left-hand side is always 0≠c0\ne c, so there is no solution.

One or two variables. The equation x=3x=3 in one variable has the solution set {3}⊂R\{3\}\subset\mathbb{R}, a point. Read as x+0⋅y=3x+0\cdot y=3 in the unknowns x,yx,y it has the solution set {(3,y)∣y∈R}⊂R2\{(3,y)\mid y\in\mathbb{R}\}\subset\mathbb{R}^2, the vertical line x=3x=3: adding a variable adds a dimension of solutions.

The three basic systems in matrix form.

  • x+y=4x+y=4, x−y=1x-y=1: (1141−11)→(1140−2−3)→(1140132)→(10520132)\left(\begin{array}{cc|c}1&1&4\\1&-1&1\end{array}\right)\to\left(\begin{array}{cc|c}1&1&4\\0&-2&-3\end{array}\right)\to\left(\begin{array}{cc|c}1&1&4\\0&1&\frac32\end{array}\right)\to\left(\begin{array}{cc|c}1&0&\frac52\\0&1&\frac32\end{array}\right): unique solution (52,32)(\frac52,\frac32).
  • x+y=4x+y=4, x+y=1x+y=1: (114111)→(11400−3)→(114001)\left(\begin{array}{cc|c}1&1&4\\1&1&1\end{array}\right)\to\left(\begin{array}{cc|c}1&1&4\\0&0&-3\end{array}\right)\to\left(\begin{array}{cc|c}1&1&4\\0&0&1\end{array}\right): the last row says 0=10=1, no solution.
  • x+y=4x+y=4, 2x+2y=82x+2y=8: (114228)→(114000)\left(\begin{array}{cc|c}1&1&4\\2&2&8\end{array}\right)\to\left(\begin{array}{cc|c}1&1&4\\0&0&0\end{array}\right): xx is leading, yy free, solution set {(4−t, t)∣t∈R}\{(4-t,\,t)\mid t\in\mathbb{R}\}.

A system with a parameter. Solve x+y=1x+y=1, x−y=bx-y=b with b∈Rb\in\mathbb{R}: (1111−1b)→(1110−2b−1)→(111011−b2)→(101+b2011−b2).\left(\begin{array}{cc|c}1&1&1\\1&-1&b\end{array}\right)\to\left(\begin{array}{cc|c}1&1&1\\0&-2&b-1\end{array}\right)\to\left(\begin{array}{cc|c}1&1&1\\0&1&\frac{1-b}2\end{array}\right)\to\left(\begin{array}{cc|c}1&0&\frac{1+b}2\\0&1&\frac{1-b}2\end{array}\right). Both variables are leading, so for every bb the unique solution is x=1+b2x=\frac{1+b}2, y=1−b2y=\frac{1-b}2. Geometrically x+y=1x+y=1 is a fixed line of slope −1-1, and x−y=bx-y=b is a family of parallel lines of slope 11 (changing bb shifts the line); since the slopes differ, the lines always meet in exactly one point.

Next: Vector SpacesVector spaces are sets with a sum and a scalar multiplication satisfying eight rules, with R^n, polynomials, direct sums and quotients as examples; subspaces, spans, linear combinations and linear independence are the tools to describe them.Vector Spaces →.

Versione ripasso

Definitions.

  • Linear equation a1x1+⋯+anxn=ba_1x_1+\dots+a_nx_n=b (coefficients aia_i, constant term bb); linear system = several such equations in the same unknowns; homogeneous if all constants are 00 (then (0,…,0)(0,\dots,0), the trivial solution, always solves it). Equivalent systems have the same solution set.
  • Over a fielda set with addition, subtraction, multiplication and division by nonzero elements (R,Q,C\mathbb{R},\mathbb{Q},\mathbb{C}) we can divide by nonzero numbers; Z\mathbb{Z} is not a field.
  • A solution set (two unknowns, two equations) is: one point, empty, or a whole line (infinitely many).

Elementary operations (on equations, or on rows of the matrix): (1) swap two; (2) multiply one by a non-zero number; (3) add a multiple of one to a different one. They preserve the solution set (Theorem: equivalent systems).

Matrices. m×nm\times n: mm rows, nn columns; aija_{ij} = row ii, column jj. The augmented matrix (A∣b)(A\mid b) of a system has the coefficients and the constants in the last column.

Echelon forms.

  • Row-echelon: zero rows at the bottom; first non-zero entry of each non-zero row is a leading 1; leading 1's move strictly to the right going down.
  • Reduced: additionally each leading 1 is the only non-zero entry of its column.

Gaussian algorithm. Find the first non-zero column, bring a non-zero entry aa to the top, multiply that row by 1a\tfrac1a, clear the entries below; repeat on the remaining rows; finally clear entries above the leading 1's, from the bottom up.

Solving a system.

  1. Augmented matrix, then reduced row-echelon form.
  2. A row (0 … 0∣1)(0\ \dots\ 0\mid1) means no solution.
  3. Otherwise: columns without a leading 1 are free variables (arbitrary real parameters); the leading variables are expressed through them. No free variables means a unique solution.

Key examples. x+y=4, x−y=1x+y=4,\ x-y=1 gives (52,32)(\frac52,\frac32); x+y=4, x+y=1x+y=4,\ x+y=1 gives none; x+y=4, 2x+2y=8x+y=4,\ 2x+2y=8 gives (4−t,t)(4-t,t). A 3×33\times3 system with one free variable zz: solution (−1+z, 4+2z, z)(-1+z,\,4+2z,\,z).

Typical mistakes.

  • Multiplying a row by 00 (operation 2 requires non-zero) or adding a multiple of a row to itself (operation 3 requires a different row).
  • Forgetting that a row 0=00=0 is harmless but 0=10=1 kills the system.
  • Reading free variables off the rows instead of the columns without leading 1.
  • Calling a row-echelon matrix "reduced" before clearing the entries above the leading 1's.

Teoria collegata