IT103 Algebra

Unit 5: Linear Algebra

R Batzinger

2025-07-31

Solving Quadratic Equations

Factor the equation:

\[\eqalign{x^2 + ax + b &=& 0\cr a &=& A+B\cr b &=& AB\cr \cr x^2 + (A+B)x + (AB) &=& 0\cr (x+A)(x+B) &=& 0\cr \cr x &=&(-A,-B)\cr}\]

\[\eqalign{\cr x^2 -6x+5&=&0\cr x^2 + (-1-5)x + (-1)(-5)&=& 0\cr (x-1)(x-5) &=& 0\cr x &=& (1,5)}\]

Completing the square:

\[(x+A)^2 = x^2 + 2Ax+ A^2\]

\[\eqalign{x^2 + ax + b &=& 0\cr x^2 + ax+ \left(\frac{a}{2}\right)^2 &=& \left(\frac{a}{2}\right)^2 -b\cr (x+\frac{a}{2})^2 &=& \left(\frac{a}{2}\right)^2 -b\cr \sqrt{\left(x+\frac{a}{2}\right)^2} &=& \sqrt{\left(\frac{a}{2}\right)^2 -b}\cr x+\frac{a}{2} &=& \pm \sqrt{\left(\frac{a}{2}\right)^2 -b}\cr x&=& \frac{-a}{2}\pm \sqrt{\left(\frac{a}{2}\right)^2 -b}\cr}\] \[\eqalign{ x^2 -6x+5&=&0\cr x^2 -6x+ 9&=& 9-5\cr (x -3)^2&=& 4\cr \sqrt{(x -3)^2}&=& \sqrt{4}\cr x -3 &=& \pm 2\cr x &=& 3 \pm 2\cr x &=& (1,5) }\]

Quadratic Equation

\[\eqalign{ax^2 +bx +a &=& 0\cr x &=& \frac{-b\pm\sqrt{b^2 -4ac}}{2a} }\]

\[\eqalign{x^2-6x+5&=&0\cr x&=&\frac{-(-6)\pm\sqrt{-6^2 - 4(1)(5)}}{(2)(1)}\cr &=&\frac{6\pm\sqrt{36 - 20)}}{2}\cr &=&\frac{6\pm\sqrt{16}}{2}\cr &=&\frac{6\pm 4}{2}=3\pm 2 = (1,5)\cr }\]

Matrices

Matrix Transposition

\[\left[\matrix{4&1\cr 3&2\cr 2&3\cr}\right]^\prime =\left[\matrix{4&3&2\cr 1&2&3\cr}\right]\]

Scalar Matrix Addition

\[5 + A = B\] \[\small5+\left[\matrix{4&1\cr 3&2\cr 2&3\cr}\right] = \left[\matrix{9&6\cr 8&7\cr 7&8\cr}\right]\]

\[A+ 5 = B\]

\[\small\left[\matrix{4&1\cr 3&2\cr 2&3\cr}\right]+5 = \left[\matrix{9&6\cr 8&7\cr 7&8\cr}\right]\]

Scalar Matrix Multiplication

\[3\times A = B\] \[\small3\times\left[\matrix{4&1\cr 3&2\cr 2&3\cr}\right] = \left[\matrix{12&3\cr 9&6\cr 6&9\cr}\right]\]

\[A\times 3 = B\] \[\small\left[\matrix{4&1\cr 3&2\cr 2&3\cr}\right]\times 3 = \left[\matrix{12&3\cr 9&6\cr 6&9\cr}\right]\]

Matrix Addition

\[A+B = C\]

\[\small\left[\matrix{1&4\cr 2&5\cr 3&6\cr}\right]+ \left[\matrix{5&6\cr 4&7\cr 3&8\cr}\right] = \left[\matrix{6&10\cr 6&12\cr 6&14\cr}\right]\]

\[B + A = C\] \[\small\left[\matrix{5&6\cr 4&7\cr 3&8\cr}\right]+ \left[\matrix{1&4\cr 2&5\cr 3&6\cr}\right] = \left[\matrix{6&10\cr 6&12\cr 6&14\cr}\right]\]

Matrix Multiplication

\[\small\eqalign{\left[\matrix{4&3&2\cr}\right] \left[\matrix{1\cr 2\cr 3\cr}\right] & =& \left[\matrix{4\times1+3\times2+2\times3\cr}\right]\cr &=&\left[\matrix{4+6+6\cr}\right]\cr &=&\left[\matrix{16\cr}\right]\cr }\]

Matrix Multiplication

\[\tiny\eqalign{\left[\matrix{4&3&2\cr 1&2&3\cr}\right]\left[\matrix{1&4\cr 2&5\cr 3&6\cr}\right] & =& \left[\matrix{4\times1+3\times2+2\times3&4\times4+3\times5+2\times6\cr 1\times1+2\times2+3\times3&1\times4+2\times5+3\times6\cr} \right]\cr &=&\left[\matrix{4+6+6&16+15+12\cr 1+4+9&4+10+18\cr}\right]\cr &=&\left[\matrix{16&43\cr 14&32\cr}\right]\cr }\]

Modelling Multiple Equations

\[\small\eqalign{ 5x +2y&=& 9\cr 3x + 5y&=&13\cr }\]

\[\small\downarrow\]

\[\small\left[\matrix{5&2\cr 3& 5\cr}\right]\left[\matrix{x\cr y\cr}\right] = \left[\matrix{9\cr 13\cr}\right]\]

\[\small\downarrow\]

\[\small\left[\matrix{5&2 & 9\cr 3&5&13\cr}\right]\]

Solving a system of equations

\[\small\left[\matrix{5&2 & 9\cr 3&5&13\cr}\right]\] \[\small\left\downarrow R1 = \frac{R1}{5}\right.\kern -40pt\] \[\small\left[\matrix{1&\frac{2}{5} & \frac{9}{5}\cr 3&5&13\cr}\right]\]

\[\small\left\downarrow R2 = R2- 3R1\right.\kern-50pt\] \[\small\left[\matrix{1&\frac{2}{5} & \frac{9}{5}\cr 0&\frac{19}{5}&\frac{38}{5}\cr}\right]\] \[\small\left\downarrow R2 = R2\times \frac{5}{19}\right.\kern-50pt\] \[\small\left[\matrix{1&\frac{2}{5} & \frac{9}{5}\cr 0&1&2\cr}\right]\] \[\small\left\downarrow R1 = R1-R2\times \frac{2}{5}\right.\kern-50pt\] \[\small\left[\matrix{1&0 & 1\cr 0&1&2\cr}\right]\] \[\downarrow\] \[x=1;\ y= 2\]

Balancing Chemical equations

\[w\cdot C_6H_{12}0_6 + x\cdot O_2 \rightarrow y\cdot CO_2 + z\cdot H_2O\]

\[\left\downarrow\eqalign{R2&=R1-6R1\\ R3 &= R3 -12R1\\ R4 &= R4-6R1\\ \\}\kern-40pt\right.\]

\[\left[\matrix{1&0&0&0&1\\ 0&2&-2&-1&-6\\ 0&0&-1&0&-6\\ 0&0&0&-2&-12\\ }\right]\]

\[\left\downarrow\eqalign{R2&=\frac{R2}{2}\\ R3&=-R3\\ R4&=\frac{R4}{-2}\\ \\}\kern-40pt\right.\]

\[\left[\matrix{1&0&0&0&1\\ 0&1&-1&\frac{-1}{2}&6\\ 0&0&1&0&6\\ 0&0&0&1&6\\ }\right]\]

\[\left\downarrow\eqalign{R2&=R2+R3+\frac{R4}{2}\\ \\}\kern-40pt\right.\]

\[\left[\matrix{1&0&0&0&1\\ 0&1&0&0&6\\ 0&0&1&0&6\\ 0&0&0&1&6\\ }\right]\] \[\downarrow\]

\[C_6H_{12}0_6 + 6 O_2 \rightarrow 6 CO_2 + 6 H_2O\]

Examples

Multiply

\[\left[\matrix{1&2&3\\ 2&1&1}\right]\left[\matrix{1&1\\ 2&2\\ 3&3\\}\right]\]

** Solve for x,y,z:

\[\eqalign{ 3x+y+4z &=&17\\ 1x+3y + 2z &=&13\\ 2x+2z&=&8\\}\]

}$$

Toilet paper

brand ply rolls freeRolls length price
Cellox 3 24 6 534 279
Cellox 3 32 8 712 399
Cellox 2 30 10 1172 309
Happy Price 2 20 0 360 124
Happy Price 2 30 0 906 299
Nice 3 24 6 1050 349
Nice 3 6 2 280 110
Scott 2 24 0 372 128
Scott 2 24 6 901.5 295
Scott 3 24 6 765.5 398
Scott 3 32 8 707 429
Zilk 1 24 0 360 124
Zilk 2 24 0 480 159
Zilk 3 32 8 608 385
Zilk 3 24 6 1050 299

Length vs Price

Regression Length vs Price


Call:
lm(formula = y ~ x)

Residuals:
   Min     1Q Median     3Q    Max 
-92.43 -62.38 -34.93  75.12 150.49 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept) 91.63228   60.88581   1.505  0.15623   
x            0.26433    0.08252   3.203  0.00692 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 88.53 on 13 degrees of freedom
Multiple R-squared:  0.4411,    Adjusted R-squared:  0.3981 
F-statistic: 10.26 on 1 and 13 DF,  p-value: 0.006924

Length vs Price (adjusted for ply)

Regression Length vs Price adjusted for ply


Call:
lm(formula = y ~ x)

Residuals:
     Min       1Q   Median       3Q      Max 
-124.237  -41.440   -4.086   42.289  114.619 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 90.00215   42.59714   2.113 0.054523 .  
x            0.10579    0.02226   4.752 0.000378 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 71.58 on 13 degrees of freedom
Multiple R-squared:  0.6347,    Adjusted R-squared:  0.6066 
F-statistic: 22.59 on 1 and 13 DF,  p-value: 0.0003777