IT103: Algebra

Module 5: Polynomial and Rational Functions

R Batzinger

2024-11-25

Midterm Grades

Grades vs Attendance

Periodicity of a pendulum

\[\eqalign{T &=& 2\pi \sqrt{\frac{L}{g}}\\ \frac{T}{2\pi} &=& \sqrt{\frac{L}{g}}\\ \frac{T^2}{2^2\pi^2} &=& \frac{L}{g}\\ g &=& \frac{4\pi^2L}{T^2}\\ }\]

Log

\[\eqalign{10^0&=&1;& \log_{10}(1)&=&0\\ 10^1&=&10;& \log_{10}(10)&=&1\\ 10^2&=&100;& \log_{10}(100)&=&2\\ 10^3&=&1000;& \log_{10}(1000)&=&3\\ }\]

Changing the base

\[\eqalign{2^6&=&64;& \log_2(64) &=&6\\ 4^3&=&64;& \log_4(64) &=&3\\ 8^2&=&64;& \log_8(64) &=&2\\ 16^{1.5}&=&64;& \log_{16}(64) &=&1.5\\ 32^{1.2}&=&64;& \log_{32}(64) &=&1.2\\ }\]

Graphics

Graphics log

Multiplication of numbers with exponents

\[\small\eqalign{100 \times 1000 &=& 100000;&10^2 \times 10^3= 10^5\\ 2\times 3&=&6;& 10^{0.30103}\times 10^{0.47712}= 10^{0.77815}\\ 20\times 30&=&600;& 10^{1.30103}\times 10^{1.47712}= 10^{2.77815}\\ }\]

Sliderule

Multiplication by Slide rule: 2 x 3

Sliderule simulator

Exponential curves

Progresses to a limit

\[y=-30e^{-0.09x}+30\]

\[y=30e^{-0.09x} +35\]

Infinite Growth \[y=30e^{0.09x} +2\]

\[y=-30e^{0.09x} -2\]

Rules of exponents

  • Negative exponent

\[b^{-n} = \frac{1}{b^n}\] * Zero exponent

\[b^0 = 1\]

  • Product rule

\[b^m \cdot b^n = b^{(m+n)}\]

  • Power Rule

\[\left(b^m\right)^n = b^{(m\cdot n)}\]

  • Quotient Rule

\[\frac{b^m}{b^n} = b^{m-n}\]

Exercises

\[\left(\frac{x}{y}\right)^3(x\cdot y)^2\] \[\frac{-35x^2y^4}{5x^6y^{-8}}\] \[\sqrt{3(-3x^2y^4)^3}\]

Graphs

Dataset

          a           b           c 
25.70331052  0.09737727  4.25726243 

Surge Function

\[y=20x^{3}e^{-0.5x}\]

Logistic function

\[y=20x^{3}e^{-0.5x}\]

S Growth

  • ( L ) is the maximum value of the curve (the upper asymptote),
  • ( e ) is the base of the natural logarithm,
  • ( k ) is the growth rate,
  • ( t ) is time,
  • ( t_0 ) is the time at which the curve’s midpoint occurs.

\[f(t) = \frac{L}{1+e^{-k(t-t_0)}}\]

S curve

Temperature Formula

\[\eqalign{C&=&\frac{5}{9}(F-32)\\ \frac{9}{5}C&=&F-32\\ \left(\frac{9}{5}C\right) +32&=& F\\}\]

Aging Fraction

  • R = ratio of* traveller time to Erth time
  • c = speed of light (299,792,458 m/s)
  • v = speed of traveller

\[\eqalign{R&=&\sqrt{1-\left(\frac{v}{c}\right)}\\ R^2 &=& 1-\left(\frac{v}{c}\right) \\ \left(R^2-1\right) &=&-\frac{v}{c} \\ c\left(1-R^2\right) &=&v \\ }\]

5.1 Quadratic Functions

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

Max/Min (Axis of symetry)

\[x_m =\frac{b}{2a}\]

5.2 Power Functions and Polynomial Functions

Power function

Power Functions

  • Consist of only one term.   *Exponents can be any real number (positive, negative, integer, or fractional).

  • Examples:

\[\eqalign{f(x) &=& 2x^3\\ f(x) &=& x^{-2}\\ f(x) &=& 5x^{1/2}\\}\]

Exponent to model population

  • Canada:

\[\eqalign{P &=& 32.2 e^{0.003t}\\ \ln(P) &=& \ln(32.2 e^{0.003t})\\ \ln(P) &=& \ln(32.2)+0.003t\\ \frac{\ln\left(\frac{P}{32.2}\right)}{0.003} &=& t\\ }\]

  • Uganda:

\[P = 25.6e^{0.03t}\]

Inverted function

\[\eqalign{P &=& 25.6 e^{0.03t}\\ \frac{P}{25.6} &=& e^{0.03t}\\ \ln\left(\frac{P}{25.6}\right) &=& 0.03t\\ \frac{\ln\left(\frac{P}{25.6}\right)}{0.03} &=& t\\ }\]

Series

\[\eqalign{a_n &=& 2^n\quad\quad (direct)\\ a_{n+1} &=& 2\cdot a_n \quad (recursive)\\ }\] \[\matrix{a_n & 2^n\\ 0 & 1\\ 1 & 2 \\ 2 & 4 \\ 3 & 8 \\ 4 & 16\\ 5 & 32\\ }\]

          a           b           c 
25.70331052  0.09737727  4.25726243 

Arithmetic Series

\[\eqalign{Direct:& a_n &=& 2\cdot n\\ Recursive: & a_{n+1} &=& 2 + a_n\\ Generic: & && a_1, a_1 + d, a_1+2d, a_1+3d,a_1 +4d\\ }\]

\[\small\matrix{Sequence: & 0 &\underbrace{}& 2&\underbrace{}& 4 &\underbrace{}& 6 &\underbrace{}& 8 &\underbrace{}& 10\\ Difference: &&2 &&2 &&2 &&2 &&2&\\ }\]

Geometric Series

\[\eqalign{Direct: & a_n &=& 2^n\quad\quad (direct)\\ Recursive:&a_{n+1} &=& 2\cdot a_n \quad (recursive)\\ Generic: & && a_1 r^0, a_1 r^1, a_1 r^2, a_1 r^3, a_1 r^4\\ }\]

\[\matrix{a_n & 2^n & ratio\\ 0 & 1 & 2\\ 1 & 2 & 2\\ 2 & 4 & 2\\ 3 & 8 & 2\\ 4 & 16 & 2\\ 5 & 32 & \\ }\]

What is wrong here?

There was a mistake in the last review example posed.

\[Series: 3, 9,27,81\] \[Ratios: \frac{9}{3} = \frac{27}{9}=\frac{81}{27} = 3\]

\[Sum = 3+9+27+81 = 120= \frac{3(1-81)}{1-3}= \frac{240}{2}\]

The key to the correction:

  1. Error in the formula used : \((1-r^n)/(1-r)\) should have been \(a_0(1-r^n)/(1-r)\)
  2. Error in the size of n: \(5\) instead of \(4\) (If the series was \(1,3,9,27,81\), everything would have worked just fine, as sum was 121.)

Mystery series 1

\[\matrix{sequence&1,&\underbrace{}&3,&\underbrace{}&7,&\underbrace{}&15,&\underbrace{}&31\\ difference&&2&&4&&8&&16&\\}\]

\[\eqalign{direct:& a_n &=&{2^n} -1\\ recursive:&a_{n+1} &=& a_n + 2\cdot (a_{n} - a_{n-1})\\}\]

Fibonacci Sequence

\[\tiny\matrix{sequence:&1&\underbrace{}&1&\underbrace{}&2&\underbrace{}&3&\underbrace{}&5&\underbrace{}&8&\underbrace{}&13&\underbrace{}&21\\ difference:&&0&&1&&1&&2&&3&&5&&8&\\}\]

\[\eqalign{recursive&a_0 &=& 1\\ &a_1 &=& 1\\ &a_{n+1} &=& a_{n} + a_{n-1}\\ direct:& a_{n} &=&\frac{\left(\phi^n - \left(1-\phi\right)^n\right)}{\sqrt{5}} }\]

where \(\phi\) = the Golden ratio \((1.6180339887)\)

Mystery series

Series data

\[\small 12, 27, 58, 111, 192, 307, 462, 663, 916, 1227\] Table of difference

\[\begin{matrix}series & dif_1 & dif_2 & dif_3 \\ 12 & 15 & 16 & 6\\ 27 & 31 & 22 & 6\\ 58 & 53 & 28 & 6\\ 111 & 81 & 344 &6\\ 192 & 115 & 40 & 6 \\ 307 & 155 & 46 &6 \\ 462 &201 &52 &6 & \\ 663 & 253 & 58 & \\ 916 & 311 & & \\ 1227& & & \\ \end{matrix}\]

Suggested model:

\[y = ax^3 + bx^2 + cx + d\]

Linear algebra

\[\left[\begin{matrix} 1 & 1 &1&1\\ 8 & 4& 2&1\\ 27 & 9 &3&1\\ 64 &16 & 4 &1\\ \end{matrix}\right] \left[\begin{matrix}a \\ b \\c \\ d \\\end{matrix}\right]=\left[\begin{matrix} 12\\ 27\\ 58\\ 111\\ \end{matrix}\right]\]

Linear solution

\[\left[\begin{matrix} 1 & 0 &0&0\\ 0 & 1& 0&0\\ 0 & 0 &1&0\\ 0 &0 & 0 &1\\ \end{matrix}\right]\left[\begin{matrix}a \\ b \\c \\ d \\\end{matrix}\right]=\left[\begin{matrix} 1\\ 2\\ 2\\ 7\\ \end{matrix}\right]\]

Suggested solution

\[y = x^3 + 2x^2 + 2x + 7\]

Comparison to series to calculations

\[original = \small 12, 27, 58, 111, 192, 307, 462, 663, 916, 1227\]

\[calculated =\small 12, 27, 58, 111, 192, 307, 462, 663, 916, 1227, 1602, 2047, 2568, 3171, 3862, 4647, 5532, 6523, 7626, 8847\]

Another example

Data of the Series

\[\left[-6, 0, 10, 24, 42, 64, 90, 120, 154, 192\right]\]

Difference Table

\[\begin{matrix} series & dif & dif_2\\ -6 & 6 & 4\\ 0 & 10 & 4\\ 10 & 14 & 4\\ 24 & 18 & 4\\ 42 & 22 & 4\\ 64 & 26 & 4\\ 90 & 30 & 4\\ 120 & 34 & 4\\ 154 & 38 & NA\\ 192 & NA & NA\\ \end{matrix}\]

Suggested model

\[y = ax^2 + bx + c\]

Linear model

\[\left[\begin{matrix} 1 &1 &1\\ 4 &2 &1\\ 9 &3 &1\\ \end{matrix}\right] \left[\begin{matrix} a\\ b\\ c\\ \end{matrix}\right] = \left[\begin{matrix} -6\\ 0\\ 10\\ \end{matrix}\right]\]

Gaussian elimination and back substitution

Initial Data

\[\begin{matrix} 1 & 1 & 1 & -6 \\ 4 & 2 & 1 & 0 \\ 9 & 3 & 1 & 10 \\ \end{matrix}\]

Swap R1 and R3

\[\begin{matrix} 9 & 3 & 1 & 10\\ 4 & 2 & 1 & 0 \\ 1 & 1 & 1 & -6 \\ \end{matrix}\]

R1 * 1/9

\[\begin{matrix} 1 & 1/3 & 1/9 & 10/9 \\ 4 & 2 & 1 & 0 \\ 1 & 1 & 1 & -6 \\ \end{matrix}\]

R2-(R1*4)

\[\begin{matrix} 1 & 1/3 & 1/9 & 10/9 \\ 0 & 2/3 & 5/9 & -40/9\\ 1 & 1 & 1 & -6 \\ \end{matrix}\]

R3 - R1

\[\begin{matrix} 1 & 1/3 & 1/9 & 10/9 \\ 0 & 2/3 & 5/9 & -40/9\\ 0 & 2/3 & 8/9 & -64/9\\ \end{matrix}\]

R2 * 3/2

\[\begin{matrix} 1 & 1/3 & 1/9 & 10/9 \\ 0 & 1 & 5/6 & -20/3 \\ 0 & 2/3 & 8/9 & -64/9\\ \end{matrix}\]

R1-(R2 * 1/3)

\[\begin{matrix} 1 & 0 & -1/6 & 10/3 \\ 0 & 1 & 5/6 & -20/3 \\ 0 & 2/3 & 8/9 & -64/9 \\ \end{matrix}\]

R3 - (R2* 2/3)

\[\begin{matrix} 1 & 0 & -1/6 & 10/3 \\ 0 & 1 & 5/6 & -20/3 \\ 0 & 0 & 1/3 & -8/3 \\ \end{matrix}\]

R3 * 3

\[\begin{matrix} 1 & 0 & -1/6 & 10/3 \\ 0 & 1 & 5/6 & -20/3 \\ 0 & 0 & 1 & -8\\ \end{matrix}\]

R1 +(R3 * 1/6)

\[\begin{matrix} 1 & 0 & 0 & 2 \\ 0 & 1 & 5/6 & -20/3 \\ 0 & 0 & 1 & -8\\ \end{matrix}\]

R2 - (R3 * 5/6)

\[\begin{matrix} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & -8\\ \end{matrix}\]

Suggested formula

\[y = 2x^2 -8\]

Comparison

\[original = \tiny\left[-6, 0, 10, 24, 42, 64, 90, 120, 154, 192\right]\] \[calculated=\tiny\left[ -6, 0, 10, 24, 42, 64, 90, 120, 154, 192, 234, 280, 330, 384, 442, 504, 570, 640, 714, 792\right]\]

Adding elements of a algebric series

\[\small\eqalign{s &=&a_1 + (a_1+d) + (a_1+2d) +...+(a_n-2d)+(a_n-d)+(a_n)\\ &=&a_n+ (a_n-d) + (a_n-2d) +...+(a_1+2d)+(a_1+d)+(a_1)\\ 2s &=&n(a_1+a_n)\\ s &=& \frac{n(a_1 +a_n)}{2}\\ }\]

Sum of geometric series

\[\eqalign{ S_n &=&a_1 + a_1 r + a_1 r^2 + a_1 r^{n-1}\\ - S_n r &=&-1\left(a_1 r + a_1 r^2 + a_1 r^3 + a_1 r^{n}\right)\\ \hline (1-r)S_n &=& a_1 - a_1 r^n\\ \\ S_n &=& \frac{a_1(1-r^n)}{1-r}\\ }\]

Examples

\[\eqalign{S_n &=& 1000 + 500 + 250 + 125 = 1875\\ &=& 1000 + 1000 \left(\frac{1}{2} \right) + 1000 \left(\frac{1}{2}\right)^2 + 1000 \left(\frac{1}{2}\right)^3 \\ &=& \frac{a_1 (1-r^n)}{1-r} = \frac{1000 \left(1-\left(\frac{1}{2}\right)^4\right)}{1-\frac{1}{2}}\\ &=& \frac{1000\left(\frac{16-1}{16}\right)}{\frac{1}{2}} = 2000 \frac{15}{16} = 1875\\ }\]

\[\eqalign{S_n &=& 3 + 6 + 12 + 24 = 45\\ &=& 3 + 3 \left(2\right) + 3 \left(2^2\right) + 3 \left(2^3\right) \\ &=& \frac{a_1 \left(1-r^n\right)}{1-r} = \frac{3 \left(1- 2^4\right)}{1-2}\\ &=& \frac{3\left(1-16\right)}{-1} = 3 \cdot 15 = 45\\ }\]

Sum of squares

\[s=1 + 4+ 9 + 16 + 25 + 36 + 49 + 64=204\] \[s=(n)(n+1)(2n+1)/6=8\cdot9(2\cdot 8+1)=204\]

Calculating Pi Using an Infinite Series

Gregory-Leibniz series

\[\small\pi = \frac{4}{1}-\frac{4}{3}+\frac{4}{5}-\frac{4}{7}+\frac{4}{9}-\frac{4}{11}+\frac{4}{13}-\frac{4}{15} + \frac{-1^{n+1} 4}{1+2^{n-1}}\]

Nilakantha series

\[\pi = 3 + \frac{4}{2\times3\times4} - \frac{4}{4\times5\times6} + \frac{4}{6\times7\times8} - \dots\]

Calculating the value of e

\[e = 1+ \frac{1}{1!}+ \frac{1}{2!}+ \frac{1}{3!}+ \frac{1}{4!} + \dots\]

Orders of magnitude

Trigonometry

\[\eqalign{\pi&=&\frac{\pi}{2} + a + b \\ \frac{\pi}{2}&=& a + b \\ \frac{\pi}{2} -a&=& b \\ }\]

Making graphics

Please remember to add:

  • Axis labels
  • x and y scale

Graphic transitions

[1] "-1-"
     [,1] [,2] [,3]
[1,]    1    0    0
[2,]    0    1    0
[3,]    0    0    1
     [,1] [,2] [,3]
[1,]    1    1    1
[2,]    3    0    0
[3,]    0    0    6
[1] "-2-"
     [,1] [,2] [,3]
[1,]    1    0    0
[2,]    0    0    2
[3,]    0    1    0
     [,1] [,2] [,3]
[1,]    1    1    1
[2,]    0    0   12
[3,]    3    0    0
[1] "-3-"
     [,1] [,2] [,3]
[1,]    1    0    0
[2,]    0    0    1
[3,]    0    2    0
     [,1] [,2] [,3]
[1,]    1    1    1
[2,]    0    0    6
[3,]    6    0    0
[1] "-4-"
     [,1] [,2] [,3]
[1,]    1    0    0
[2,]    0    1    1
[3,]    0    0    1
     [,1] [,2] [,3]
[1,]    1    1    1
[2,]    3    0    6
[3,]    0    0    6