Download pdf - Emacs a 072006 Mark

Transcript
  • Elements

    of

    Matrix Modeling and Computing

    with

    MATLAB

    Robert E. WhiteDepartment of Mathematics

    North Carolina State [email protected]

    Updated on 07-20-06.Copyright: CRC/Chapman Press a Division of

    Taylor and Francis Group

  • Contents

    List of Figures vii

    List of Tables xi

    Preface xiii

    Introduction xv

    1 Vectors in the Plane 11.1 Floating Point and Complex Numbers . . . . . . . . . . . . . . . 11.2 Complex Valued Functions . . . . . . . . . . . . . . . . . . . . . 101.3 Vectors in R2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.4 Dot Product and Work . . . . . . . . . . . . . . . . . . . . . . . . 271.5 Lines and Curves in R2 and C . . . . . . . . . . . . . . . . . . . . 38

    2 Vectors in Space 472.1 Vectors and Dot Product . . . . . . . . . . . . . . . . . . . . . . 472.2 Cross and Box Products . . . . . . . . . . . . . . . . . . . . . . . 562.3 Lines and Curves in R3 . . . . . . . . . . . . . . . . . . . . . . . 672.4 Planes in R3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762.5 Extensions to R . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    3 Ax = d: Unique Solution 953.1 Matrix Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953.2 Matrix Products . . . . . . . . . . . . . . . . . . . . . . . . . . . 1053.3 Special Cases of Ax = d . . . . . . . . . . . . . . . . . . . . . . . 1173.4 Row Operations and Gauss Elimination . . . . . . . . . . . . . . 1273.5 Inverse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 1383.6 Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . 1493.7 Determinants and Cramers Rule . . . . . . . . . . . . . . . . . . 159

    4 Ax = d: Least Squares Solution 1714.1 Curve Fitting to Data . . . . . . . . . . . . . . . . . . . . . . . . 1714.2 Normal Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 182

    v

  • vi CONTENTS

    4.3 Multilinear Data Fitting . . . . . . . . . . . . . . . . . . . . . . . 1914.4 Parameter Identification . . . . . . . . . . . . . . . . . . . . . . . 199

    5 Ax = d: Multiple Solutions 2095.1 Subspaces and Solutions in R3 . . . . . . . . . . . . . . . . . . . 2095.2 Row Echelon Form . . . . . . . . . . . . . . . . . . . . . . . . . . 2205.3 Nullspaces and Equilibrium Equations . . . . . . . . . . . . . . . 230

    6 Linear Initial Value Problems 2436.1 First Order Linear . . . . . . . . . . . . . . . . . . . . . . . . . . 2436.2 Second Order Linear . . . . . . . . . . . . . . . . . . . . . . . . . 2506.3 Homogeneous and Complex Solution . . . . . . . . . . . . . . . . 2576.4 Nonhomogeneous Di erential Equations . . . . . . . . . . . . . . 2636.5 System Form of Linear Second Order . . . . . . . . . . . . . . . . 272

    7 Eigenvalues and Di erential Equations 2817.1 Solution of x0 = x by Elimination . . . . . . . . . . . . . . . . . 2817.2 Real Eigenvalues and Eigenvectors . . . . . . . . . . . . . . . . . 2897.3 Solution of x0 = x+ f( ) . . . . . . . . . . . . . . . . . . . . . . 296

    8 Image Processing in Space Domain 3118.1 Matrices and Images . . . . . . . . . . . . . . . . . . . . . . . . . 3118.2 Contrast and Histograms . . . . . . . . . . . . . . . . . . . . . . 3218.3 Blurring and Sharpening . . . . . . . . . . . . . . . . . . . . . . . 331

    9 Image Processing in Frequency Domain 3439.1 Laplace and Fourier Transforms . . . . . . . . . . . . . . . . . . . 3439.2 Properties of DFT . . . . . . . . . . . . . . . . . . . . . . . . . . 3519.3 DFT in R R . . . . . . . . . . . . . . . . . . . . . . . . . . . 3619.4 Frequency Filters in R R . . . . . . . . . . . . . . . . . . . . 370

    A Solutions to Odd Exercises 381

    Bibliography 397

    Index 399

  • List of Figures

    1.1.1 Complex Numbers as Arrows . . . . . . . . . . . . . . . . . . . . 41.1.2 Norm( 2) and Angle( 2) . . . . . . . . . . . . . . . . . . . . . . 71.2.1 A ne, Square and Square Root of z . . . . . . . . . . . . . . . . 131.2.2 Solutions of 12 = 1 . . . . . . . . . . . . . . . . . . . . . . . . . 171.3.1 A Vector in the Plane . . . . . . . . . . . . . . . . . . . . . . . . 201.3.2 2 = 2 + 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.3.3 2 = 2 + 2 2 cos( ) . . . . . . . . . . . . . . . . . . . . . . 22

    1.3.4 + and . . . . . . . . . . . . . . . . . . . . . . . 231.4.1 Trigonometric Identity and Dot Product . . . . . . . . . . . . . 311.4.2 Area and Dot Product . . . . . . . . . . . . . . . . . . . . . . . 331.4.3 Linearly Independent Vectors . . . . . . . . . . . . . . . . . . . . 341.4.4 Work and a Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . 351.4.5 Torque on a Wheel . . . . . . . . . . . . . . . . . . . . . . . . . 351.4.6 Work with Independent Paths . . . . . . . . . . . . . . . . . . . 361.5.1 Line Given a Point and Direction . . . . . . . . . . . . . . . . . 391.5.2 Minimum Distance of Point to a Line . . . . . . . . . . . . . . . 411.5.3 Cycloid and Wheel . . . . . . . . . . . . . . . . . . . . . . . . . 431.5.4 Cycloid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441.5.5 Two-tone Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    2.1.1 Point in Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.1.2 Vector in Space . . . . . . . . . . . . . . . . . . . . . . . . . . . 492.1.3 Vector Addition in Space . . . . . . . . . . . . . . . . . . . . . . 502.2.1 Unit Vector Cross Products . . . . . . . . . . . . . . . . . . . . . 582.2.2 Projected Area . . . . . . . . . . . . . . . . . . . . . . . . . . . 582.2.3 Box Product and Volume . . . . . . . . . . . . . . . . . . . . . . 642.2.4 Determinant and Volume . . . . . . . . . . . . . . . . . . . . . . 652.3.1 Vector Equation and Minimum Distance . . . . . . . . . . . . . 682.3.2 Distance between Two Lines . . . . . . . . . . . . . . . . . . . . 712.3.3 Helix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732.3.4 Projectile in Space . . . . . . . . . . . . . . . . . . . . . . . . . . 752.4.1 Normal and Point . . . . . . . . . . . . . . . . . . . . . . . . . . 772.4.2 Three Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

    vii

  • viii LIST OF FIGURES

    2.4.3 Linear Combination of Vectors . . . . . . . . . . . . . . . . . . . 792.4.4 Minimum Distance to a Plane . . . . . . . . . . . . . . . . . . . 812.5.1 Mesh of Image Matrix . . . . . . . . . . . . . . . . . . . . . . . . 922.5.2 Imwrite of Image Matrix . . . . . . . . . . . . . . . . . . . . . . 922.5.3 Negative Image Matrix . . . . . . . . . . . . . . . . . . . . . . . 92

    3.1.1 Box with Fixed Volume . . . . . . . . . . . . . . . . . . . . . . . 1013.1.2 Cost of a Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023.1.3 Two-bar Truss . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023.1.4 Two-loop Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033.2.1 Heat Conduction in a Wire . . . . . . . . . . . . . . . . . . . . . 1123.2.2 Steady State Heat Di usion . . . . . . . . . . . . . . . . . . . . 1143.3.1 Temperature in Wire with Current . . . . . . . . . . . . . . . . . 1253.4.1 Six-bar Truss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343.5.1 Five-bar Truss . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1493.6.1 Three-loop Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 1553.6.2 Potential in a Single-loop Circuit . . . . . . . . . . . . . . . . . . 1563.7.1 Three-tank Mixing . . . . . . . . . . . . . . . . . . . . . . . . . . 167

    4.1.1 Sales Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1744.1.2 Least Squares Function for Sales Data . . . . . . . . . . . . . . . 1764.1.3 Radioactive Decay . . . . . . . . . . . . . . . . . . . . . . . . . . 1794.2.1 World Population Prediction . . . . . . . . . . . . . . . . . . . . 1884.4.1 US Population and Logistic Model . . . . . . . . . . . . . . . . . 2044.4.2 Temperature Data and Curve Fit . . . . . . . . . . . . . . . . . 207

    5.3.1 Bar e with Four Forces . . . . . . . . . . . . . . . . . . . . . . . 2375.3.2 Fluid Flow in Four Cells . . . . . . . . . . . . . . . . . . . . . . 239

    6.2.1 Mass-Spring System . . . . . . . . . . . . . . . . . . . . . . . . . 2516.3.1 Variable Damped Mass-Spring . . . . . . . . . . . . . . . . . . . 2636.4.1 Forced Mass-Spring . . . . . . . . . . . . . . . . . . . . . . . . . 2716.5.1 Series LRC Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . 2736.5.2 Tuned Circuit with Modulated Signal . . . . . . . . . . . . . . . 279

    7.3.1 Heat Di usion in Thin Wire . . . . . . . . . . . . . . . . . . . . 308

    8.1.1 Pollen Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3128.1.2 Enhanced Pollen Image . . . . . . . . . . . . . . . . . . . . . . . 3128.1.3 Aerial Photo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3138.1.4 Enhanced Aerial Photo . . . . . . . . . . . . . . . . . . . . . . . 3138.1.5 Mars Rover Photo . . . . . . . . . . . . . . . . . . . . . . . . . . 3148.1.6 Enhanced Mars Rover Photo . . . . . . . . . . . . . . . . . . . . 3148.1.7 Moon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3158.1.8 Sharper Moon Image . . . . . . . . . . . . . . . . . . . . . . . . 3158.1.9 Plot of the Matrix C . . . . . . . . . . . . . . . . . . . . . . . . 317

  • LIST OF FIGURES ix

    8.1.10 Image of Letter C . . . . . . . . . . . . . . . . . . . . . . . . . 3178.1.11 Negative Image . . . . . . . . . . . . . . . . . . . . . . . . . . . 3188.1.12 Matrix NCSU . . . . . . . . . . . . . . . . . . . . . . . . . . . 3188.1.13 Image of NCSU . . . . . . . . . . . . . . . . . . . . . . . . . . 3198.1.14 Negative Image of NCSU . . . . . . . . . . . . . . . . . . . . . 3198.1.15 Center Grain in Pollen . . . . . . . . . . . . . . . . . . . . . . . 3208.2.1 Histogram of Pollen Image . . . . . . . . . . . . . . . . . . . . . 3228.2.2 Histogram of Lighter Pollen Image . . . . . . . . . . . . . . . . . 3248.2.3 Lighter Pollen Image . . . . . . . . . . . . . . . . . . . . . . . . 3258.2.4 Piecewise Linear Function . . . . . . . . . . . . . . . . . . . . . 3268.2.5 Histogram for Enhanced Pollen Image . . . . . . . . . . . . . . . 3288.2.6 Higher Contrast Pollen Image . . . . . . . . . . . . . . . . . . . 3288.2.7 Mars Rover Image Using Power 1/2 . . . . . . . . . . . . . . . . 3308.2.8 Mars Rover Image Using Power 2 . . . . . . . . . . . . . . . . . 3308.3.1 Deblurred 1D Image . . . . . . . . . . . . . . . . . . . . . . . . . 3348.3.2 Original NCSU . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3368.3.3 Blurred NCSU . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3368.3.4 Deblurred NCSU . . . . . . . . . . . . . . . . . . . . . . . . . . . 3378.3.5 Increased Contrast Pollen . . . . . . . . . . . . . . . . . . . . . . 3388.3.6 Brighter and Sharper Pollen . . . . . . . . . . . . . . . . . . . . 3398.3.7 Original Moon Image . . . . . . . . . . . . . . . . . . . . . . . . 3408.3.8 Brightened and Sharpened . . . . . . . . . . . . . . . . . . . . . 341

    9.2.1 DFT of Sine and Cosine . . . . . . . . . . . . . . . . . . . . . . . 3549.2.2 Noisy Sine Function . . . . . . . . . . . . . . . . . . . . . . . . . 3599.2.3 Filtered Sine Image . . . . . . . . . . . . . . . . . . . . . . . . . 3609.3.1 2D DFT of Sine and Cosine . . . . . . . . . . . . . . . . . . . . 3649.3.2 Noisy 2D Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . 3679.3.3 Mesh Plot of Noisy Sine Wave . . . . . . . . . . . . . . . . . . . 3689.3.4 DFT of Noisy Sine Wave . . . . . . . . . . . . . . . . . . . . . . 3689.3.5 Low-pass Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . 3699.3.6 Filtered DFT of Sine Wave . . . . . . . . . . . . . . . . . . . . . 3699.3.7 Filtered Sine Wave . . . . . . . . . . . . . . . . . . . . . . . . . . 3709.4.1 Noisy NCSU Image . . . . . . . . . . . . . . . . . . . . . . . . . 3729.4.2 Low-pass Filtering of NCSU . . . . . . . . . . . . . . . . . . . . 3739.4.3 Ideal Low-pass NCSU . . . . . . . . . . . . . . . . . . . . . . . . 3739.4.4 Band-reject Filtering of NCSU . . . . . . . . . . . . . . . . . . . 3749.4.5 Band-reject Filtered NCSU . . . . . . . . . . . . . . . . . . . . . 3749.4.6 Light and Noisy Aerial Image . . . . . . . . . . . . . . . . . . . 3769.4.7 Filtering Aerial Image . . . . . . . . . . . . . . . . . . . . . . . . 3769.4.8 Filtered Aerial Image . . . . . . . . . . . . . . . . . . . . . . . . 3779.4.9 Micro Chip Image . . . . . . . . . . . . . . . . . . . . . . . . . . 3789.4.10 Sharpening of Micro Chip Image . . . . . . . . . . . . . . . . . 3789.4.11 Sharpened Micro Chip Image . . . . . . . . . . . . . . . . . . . 379

  • List of Tables

    4.1.1 Computer Sales Data . . . . . . . . . . . . . . . . . . . . . . . . 1734.1.2 World Population Data . . . . . . . . . . . . . . . . . . . . . . . 1744.1.3 Radioactive Decay Data . . . . . . . . . . . . . . . . . . . . . . . 1784.3.1 Multlinear Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 1914.3.2 Price Data for Three Markets . . . . . . . . . . . . . . . . . . . . 1934.3.3 Home Appraisal Data . . . . . . . . . . . . . . . . . . . . . . . . 1954.3.4 Three-tank Mixing Data . . . . . . . . . . . . . . . . . . . . . . . 1974.4.1 US Population Data . . . . . . . . . . . . . . . . . . . . . . . . . 2024.4.2 Temperature Data . . . . . . . . . . . . . . . . . . . . . . . . . . 205

    xi

  • Preface

    An important objective of this book is to provide "math-on-time" for secondyear students of science and engineering. The student should have had onesemester of calculus. The student most likely would take this matrix courseconcurrently with the second semester of calculus or would use this text for in-dependent study of these important topics. This text fills in often missed topicsin the first year of calculus including complex numbers and functions, matri-ces, algebraic systems, curve fitting, elements of linear di erential equations,transform methods and some computation tools.

    Chapters one and two have introductory material on complex numbers, 2Dand 3D vectors and their products, which are often covered in the beginning ofmultivariable calculus. Here a connection is established between the geometricand algebraic approaches to these topics. This is continued into chapters three,four and five where higher order algebraic systems are solved via row operations,inverse matrices and LU factorizations. Linearly independent vectors and sub-spaces are used to solve over and under determined systems. Chapters six andseven describe first and second order linear di erential equations and introduceeigenvalues and eigenvectors for the solution of linear systems of initial valueproblems. The last two chapters use transform methods to filter distorted im-ages or signals. The discrete Fourier transform is introduced via the continuousversions of the Laplace and Fourier transforms. The discrete Fourier transformproperties are derived from the Fourier matrix representation and are used todo image filtering in the frequency domain.

    The first five chapters can be used as a two-credit course (28 50-minuteclasses). Among the nine chapters there is more than enough material for athree-credit course. This three-credit matrix course when coupled with a nine-or ten-credit calculus sequence can serve as a more "diverse" alternative to thetraditional twelve-credit calculus sequence. The twelve-credit calculus sequencecan be adapted to this alternative by reducing the precalculus, moving some of2D and 3D vectors and di erential equations into the matrix course, and usingcomputing tools to do the complicated computations and graphing.

    Most sections have some applications, which should indicate the utility of themathematics being studied. Seven basic applications are developed in varioussections of the text and include circuits, trusses, mixing tanks, heat conduc-tion, data modeling, motion of a mass and image filters. The applications are

    xiii

  • xiv PREFACE

    developed from very simple models to more complex models. The reader canlocate sections pretaining to a particular application by using the index.

    MATLABRis used to do some of the more complicated computations. Al-

    though the primary focus is to develop by-hand calculation skills, most sec-tions at the end have some MATLAB calculations. The MATLAB m-files usedin the text are listed in the index and are included in the books Web site:http://www4.ncsu.edu/~white. The approach to using computing tools in-cludes: first, learn the math and by-hand calculations; second, use a computingtool to confirm the by-hand calculations; third, use the computing tool to domore complicated calculations and applications.I hope this book will precipitate discussions concerning the core mathemat-

    ical course work that scientists and engineers are required to study. Discretemodels and computing have become more common, and this has increased theneed for additional study of matrix computation, and numerical and linear al-gebra. The precise topics, skills, theory and appropriate times to teach theseare certainly open for discussion. The matrix algebra topics in this book area small subset of most upper level linear algebra courses, which should be en-hanced and taken by a number of students. This book attempts to make abridge from two- and three-variable problems to more realistic problems withmore variables, but it emphasizes skills more than theory.I thank my colleagues who have contributed to many discussions about the

    content of this text. And, many thanks go to my personal friends and Liz Whitewho have listened to me emote during the last year.

    Bob White

    MATLAB is a registered trademark of The MathWorks, Inc. For productinformation, please contact:

    The MathWorks, Inc.3 Apple Hill Drive

    Natick, MA 01760-2098 USATel: 508-647-7000Fax: 508-647-7001

    E-mail: [email protected]: www.mathworks.com http://www.mathworks.com/ .

  • Introduction

    One can view an matrix as a table of objects with rows and columns.The objects are usually real or complex numbers, but they could be charactersor records of information. A simple example is data for the last 12 months ofcar sales where there are = 12 rows and = 2 columns. The first columnwill have the months number and the second column will have the number ofcars sold in the corresponding month. By examining the data one would liketo make a prediction about futures sales. This is where the modeling enters.If the graph of the sales versus months "looks" like a straight line, then thedata may be modeled by a linear function of time = b + . The slope band intercept must be chosen so that the computed sales are "close" to thecar sales data. This is done by appropriate manipulations of the two columnvectors and computing a solution of the resulting system of algebraic equations.Once b and have been found, the predicted sales for larger than 12 caneasily be calculated by evaluating the linear function. The modeling process iscomplicated by incorrect sales data, changing prices and other models such asa parabolic function of time.

    This text examines a variety of applications, which have matrix models andoften have algebraic systems that must be solved either by-hand calculationsor using a computing tool. Applications to projectiles, circuits, mixing tanks,trusses, heat conduction, motion of a mass, curve fitting and image enhancementwill be initially modeled in very simple ways and then revisited so as to makethe model more accurate. This is typical of the modeling process where there isan application, a model, mathematical method, computations and assessmentof the results. Then this cycle is repeated so as to enhance the applicationsmodel.

    The first two chapters deal with problems in two- and three-dimensionalspace where the matrices have no more than three rows or columns. Heregeometric insight can be used to understand the models. In Section 2.5 theextension to higher dimensions is indicated for vectors and matrices, solutionto larger algebraic systems, more complicated curve fitting, time dependentproblems with systems of di erential equations and image modeling. Chaptersthree, four and five have the basic matrix methods that are required to solvesystems in higher dimensions. Chapters six and seven contain time dependentmodels and introduce linear systems of di erential equations. The last two

    xv

  • xvi INTRODUCTION

    chapters are an introduction to image and signal processing.Most sections have some by-hand matrix calculations in the numbered ex-

    amples, some applications and some MATLAB computations, see [4] and [6].The focus is on the by-hand calculations, and one should carefully study thenumbered examples. Each numbered example usually has two exercises associ-ated with it. There are also additional exercises, which may fill in some parts ofthe text, be related to applications or use MATLAB. This text is not intended tobe a tutorial on MATLAB, but there are a number of short codes that may helpyou understand the topics being discussed. The by-hand calculations should bedone, and MATLAB should be used to confirm these calculations. This will giveyou confidence in both your understanding of the by-hand matrix computationand the use of MATLAB. Larger dimensional problems can easily be done usingMATLAB or other computer software.The following matrices are used in Chapters 3, 4, 5 and 9, and they can

    be generalized to larger matrices enabling one to cross the bridge from modelswith few variables to many variables.

    =0 0 00 0 00 0 0

    =1 0 00 1 00 0 1

    32( 3) =1 0 00 1 00 3 1

    =1 7 100 2 40 0 3

    [ ] =2 1 0 2001 2 1 00 1 2 70

    [ b] = 1 1 0 2000 3 2 1 1000 0 4 3 410 3

    =

    2 1 0 01 2 1 00 1 2 10 0 1 2

    1 = (1 10)

    8 6 4 26 12 8 44 8 12 62 4 6 8

    =

    1 12 13 14 1

    =1 2 3 4 50 0 1 2 10 0 0 0 0

    F4 =

    1 1 1 11 2 3

    1 2 1 2

    1 3 2

  • Chapter 1

    Vectors in the Plane

    This chapter contains geometric and algebraic descriptions of objects in twodimensional space, R2 and in the complex plane, C. The objects include vec-tors, lines, complex valued functions and some curves. Fundamental operationsinclude vector addition and dot product. The basic properties of complex num-bers and complex valued functions are introduced. Applications to navigation,work, torque, areas and signal representation via phasors are given.

    1.1 Floating Point and Complex Numbers

    In this section we first discuss the integers and rational numbers. The floatingpoint numbers, which are used in computers, are a finite subset of the rationalnumbers. The real and complex numbers are natural extensions of these. Thecomplex numbers also can be represented by directed line segments or vectors inthe plane. Although initially complex numbers may appear to be of questionablevalue, they will be used extensively in the chapters on di erential equations andimage processing.

    1.1.1 Rational Numbers

    The integers are the set of whole numbers and include both positive, negativeand zero

    Z { 2 1 0 1 2 }

    The addition and product of two integers are also integers. Any integer canbe uniquely factored into a product of prime numbers (an integer that is onlydivisible by itself and one). For example, 90 = 513221

    The rational numbers are fractions of integers where is not zero andand are integers

    Q { : Z 6= 0}

    1

  • 2 CHAPTER 1. VECTORS IN THE PLANE

    The set of rational numbers has a countable but infinite number of elements.Also, the addition and product of two rational numbers are rational numbers.

    1.1.2 Real Numbers

    Any real number is approximated by a sequence of rational numbers. Tradi-tionally, one uses a base ten decimal expansion with Z and 0 10

    = ( 1 )10

    ( 1 10 + + 10 + )10

    This expansion is either a bounded increasing or decreasing sequence of rationalnumbers and, therefore, by the completeness axiom for the real numbers it mustconverge.

    R {( 1 10 + + 10 + )10 : Z 0 10}

    Real numbers contain the rational numbers, but not all real numbers arerational. For example, consider = 31 2 where 3 is a prime number. If werea rational number, then = giving 3 = 2 2 and 31 2 = 2. Theleft side has an odd number of prime factors 3, and the right side has an evennumber of prime factors 3. This contradicts the unique factorization propertyand, hence, cannot be a rational number.

    1.1.3 Floating Point Numbers

    Computers use a finite subset of the rational numbers to approximate any realnumber. This set of numbers may depend on the computer being used. How-ever, they do have the same general form and are called floating point num-bers. Any real number can be represented by an infinite decimal expansion= ( 1 )10 , and by truncating this we can define the chopped

    floating point numbers.Let be any real number and denote a floating point number by

    ( ) = 1 10

    ( 1 10 + + 10 )10

    This is a floating point number with base equal to 10 where 1 is not equalto zero, are integers between 0 and 9, the exponent is an integer betweengiven integers and and is a positive integer called the precision of thefloating point system

    F {( 1 10 + + 10 )10 : 1 6= 0 0 10 0 }

    Associated with each real number, , and its floating point approximatenumber, ( ), is the floating point error, ( ) . This error decreases asthe precision, , increases. Each computer calculation has some floating point

  • 1.1. FLOATING POINT AND COMPLEX NUMBERS 3

    error. Moreover, as additional floating point calculations are done, there maybe an accumulation of these floating point errors.

    Example 1.1.1. Let = 1 5378 and ( ) = 0 154 101 where = 3. Thefloating point error is

    ( ) = 0022

    The error will accumulate with any further operations containing ( ), forexample, ( )2 = 237 101 and

    ( )2 2 = 2 37 2 36482884 = 00517116

    Repeated calculations using floating point numbers can accumulate to signifi-cant errors.

    1.1.4 Complex Numbers

    Any real number times itself must be positive unless it is zero. The square rootof any negative number cannot be positive and, therefore, not a real number!The set of complex numbers is defined to be real numbers plus another realnumber times ( 1)1 2

    C { + : R and = ( 1)1 2}

    If C then real( ) = is called the real part and imag( ) = is called theimaginary part. Two complex numbers are equal if and only if both the realand imaginary parts are equal.Complex numbers are often represented graphically where the real part is

    located on the horizontal axis and the imaginary part is located on the verticalaxis. The complex number is then either viewed as point in the complex planeor as directed line segment or arrow from the origin 0+ 0 to the complex point= + Figure 1.1.1 illustrates this for = 2 + 1 One point of confusion

    concerns the starting point of the arrow, which is the origin, but often the arrowis moved parallel to its original position, as is illustrated by the top dashed arrowin Figure 1.1.1 that is parallel to This is done to depict addition of two arrowsby placing the beginning of the arrow at the end of another arrow.There are several important operations: conjugate of , modulus of , addi-

    tion, subtraction, product and division. The conjugate of is another complexnumber formed by the reflection of about the real axis. The modulus of isthe length of the vector. The algebraic operations are defined in the naturalway by using 2 = 1

    Definitions 1.1.1. Attributes of complex numbers = + and = +

    if and only if = and =

    or ( ) ,

    | | ( 2 + 2)1 2 or norm or modulus of and

    arg( ) arctan( ) or argument or angle of

  • 4 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.1.1: Complex Numbers as Arrows

    Definition 1.1.2. The polar representation of a complex number with =arg( ) is

    = | | (cos( ) + sin( )

    Example 1.1.2. Let = 3 + . Then= 3 , 3 = 3 3 + 3 and | | = 41 2 = 2.

    Also, ( ) = arctan(1 3) = 6 and

    = 2(cos( 6) + sin( 6))

    Solving equations with unknown complex numbers = + requires oneto find two real numbers and So, there must be two real equations, whichcan be found by setting equal the real and imaginary parts of a given complexequation. For example, consider the linear complex equation

    + 7 + 2 = 3 + 4

    This is equivalent to equating the real and imaginary parts

    real( + 7 + 2 ) = 3 and

    imag ( + 7 + 2 ) = 4

    Addition of complex numbers is defined by adding the real and imaginary parts,+7+2 = ( + )+ 7+ 2 = ( + 7)+ ( + 2) and, then, the above two real

  • 1.1. FLOATING POINT AND COMPLEX NUMBERS 5

    equations are

    + 7 = 3 and

    + 2 = 4

    Thus, the complex solution of + 7 + 2 = 3 + 4 is = 4 + 2

    Definitions 1.1.3. Operations with complex numbers = + and = +

    ( ) + ( )

    ( + )( + ) = ( ) + ( + ) and

    +

    +=

    +

    +=

    +2 + 2

    +2 + 2

    Example 1.1.3. Let = 2 + and = 1 + 3 Then= 1 + 7 , = 5 101 2 5 101 2 and

    2 5 = (4 + 2 ) (5 + 15 ) = 1 13

    Example 1.1.4. Let = (2 3) + sin(2 3) Note the modulus is one sothat the angle between the vector and the real axis is 2 3 Compute 3

    3 = ( 1 2 + 3 2 )3

    = ( 1 2 + 3 2 )2( 1 2 + 3 2 )= ( 1 2 3 2 )( 1 2 + 3 2 )= 1

    Example 1.1.5. The modulus can be computed as the square root of theproduct of the complex number and the conjugate of the complex number

    | |2 = = ( + )( ) = 2 + 2

    This is useful in expressing ratios of complex number in terms of real andimaginary parts

    1 +

    3 + 2=

    1 +

    3 + 2

    3 2

    3 2

    =(3 + 2) + (3 2)

    32 + 22

    =5

    14+1

    14

    The zero complex number has a zero real and imaginary parts, and wesimply write 0 = 0 + 0 The unit complex number has real part equal to one,imaginary part equal to zero, and we write 1 = 1+ 0 The multiplicative inverseof a non-zero complex number = + is another complex number

    1 =1

    +

    =2 + 2

    +2 + 2

  • 6 CHAPTER 1. VECTORS IN THE PLANE

    The following eleven algebraic properties are easily established. The first fiveproperties are the additive group properties, the next five are the multiplicativegroup properties for non-zero complex numbers and the last is the distributiveproperty.

    Theorem 1.1.1 (Field Properties of Complex Numbers) Let 1 2 CThen

    + C, + 0 = , + ( ) = 0, + = + ,+ ( 1 + 2) = ( + 1) + 2;C, 1 = , ( 1) = 1 when 6= 0, = ,( 1 2) = ( 1) 2;

    ( 1 + 2) = 1 + 2

    Example 1.1.6. This example illustrates how one can solve complex algebraicequations where we must solve for both the real and imaginary parts of anunknown complex number = + Here we use the above field properties

    1 + 4

    + 1= 2 +

    1 + 4 = (2 + )( + 1)

    = (2 + ) + (2 + )

    Now solve for

    =(1 + 4 ) (2 + )

    (2 + )

    =1 + 3

    2 +

    2

    2

    =1

    5+7

    5

    So, = 1 5, = 7 5, which is easy to verify

    1 + 4

    (1 5 + (7 5) ) + 1=

    5 + 20

    6 + 7

    =5 + 20

    6 + 7

    6 7

    6 7

    =170 + 85

    85= 2 +

    The complex numbers are extensions of the real numbers, and many ofthe algebraic and absolute value properties extend to the complex numbers.For example, if and are real numbers and | | is the absolute value, then| | = | | | |. When and are extended to complex numbers and absolutevalue is extended to the modulus of a complex number, then one can show

  • 1.1. FLOATING POINT AND COMPLEX NUMBERS 7

    Figure 1.1.2: Norm( 2) and Angle( 2)

    | | = | | | | In order to see this is true, let = + and = + and

    show | |2 = | |2 | |2:

    = ( + )( + ) = ( ) + ( + )

    | |2 = ( )2 + ( + )2

    = ( )2 2( )( ) + ( )2 +

    ( )2 + 2( )( ) + ( )2

    = 2( 2 + 2) + 2( 2 + 2)

    =2 + 2

    ( 2 + 2)

    = | |2| |

    2

    If = , then we could write this as2= | |

    2

    Another property of the product is arg( ) = arg( ) + arg( ), andthis with = is illustrated in Figure 1.1.2 Figure 1.1.2 was generated bythe MATLAB code complex_prod.m and command quiver.m to generate thevectors. The proof follows from the trigonometric identities

    cos( + ) = cos( ) cos( ) sin( ) sin( ) and

    sin( + ) = sin( ) cos( ) + cos( ) sin( )

  • 8 CHAPTER 1. VECTORS IN THE PLANE

    Let = | | (cos( ) + sin( )) and = | | (cos( ) + sin( )) so that

    = | | (cos( ) + sin( )) | | (cos( ) + sin( ))

    = | | | | (cos( ) cos( ) sin( ) sin( )) +

    (sin( ) cos( ) + cos( ) sin( ))

    = | | (cos( + ) + sin( + ))

    Additional properties are summarized in the following theorem.

    Theorem 1.1.2 (Norm Properties of Complex Numbers) Let C Then

    | | = | | | | arg( ) = arg( ) + arg( )| + | | |+ | | and| | = 0 if and only if = 0 + 0

    1.1.5 Complex Operations Using MATLAB

    MATLAB also uses i to represent the square root of minus one. The followingare some complex numbers and operations:

    z = 1 + i*2z =

    1.0000 + 2.0000iw = 2*z +1w =

    3.0000 + 4.0000iz^2ans =

    -3.0000 + 4.0000iw*zans =

    -5.0000 +10.0000iz/wans =

    0.4400 + 0.0800i.

    The MATLAB command quiver(x,y,dx,dy,s) produces a plot of a vector thatbegins at the point (x,y) and ends at the point (x+dx,y+dy), see Figure 1.1.2.The following graphs a vector representation of a complex number:

    z =1.0000 + 2.0000iplot(z,*)hold onquiver(0,0,real(z),imag(z),1)

    This produces a graph with the complex number marked by a *, and theninserts an arrow from the origin to the complex number. The MATLAB codecomplex_prod.m also illustrates this.

  • 1.1. FLOATING POINT AND COMPLEX NUMBERS 9

    1.1.6 Exercises

    1. Consider the real number 1 3.(a). Find (1 3) with base 10 and three digits, = 3.

    (b). Compute ( (1 3))2and the error = ( (1 3))

    2(1 3)2

    2. Let be prime number. Show 1 2 is not a rational number.3. Let = 7 and = 2 + 3(a). Graph , , and 2 + 3(b). Compute and

    4. Let = 2 + 3 and = 2 3(a). Graph , , and 2 + 3(b). Compute and

    5. For = cos(2 3) + sin(2 3) compute 1 + + 2

    6. For = cos(2 4) + sin(2 4) compute 1 + + 2 + 3

    7. Use the properties in Theorem 1.1.1 to solve for the complex number= +

    + 7 + 2 = 3 + 4

    8. Prove the remaining properties in Theorem 1.1.1.9. Find the real and imaginary parts of

    2 +

    3 7

    10. Find the real and imaginary parts of

    2 +

    10 + 7+ 5

    11. Solve for the complex number = +

    2 + 4

    += 7 +

    12. Solve for the complex number = +

    2 + 4

    2= 1 +

    13. Prove the remaining properties in Theorem 1.1.2.14. Does the quadratic formula hold when the coe cients and arecomplex numbers? You may wish to consider some special cases such as =1 = 0 and = One needs to be able to define the square root of a complexnumber!15. Use MATLAB and enter = 2 + 3 and = 2 3(a). Graph and(b). Compute and(c). Use quiver() to plot the vectors for and

    16. Consider the calculations in Figure 1.1.2 given by the MATLAB codecomplex_prod.m. Let = 3 + 1(a). Use by-hand calculations to find 2, 3, their norms and arguments.(b). Modify complex_prod.m to confirm your by-hand calculations.

  • 10 CHAPTER 1. VECTORS IN THE PLANE

    1.2 Complex Valued Functions

    Mappings from the complex numbers into the complex numbers can be viewedas functions from the plane into the plane. Several examples such as + or2 were introduced in the previous section and here additional functions willbe described. An important objective is to develop the Euler formula for theexponential function of an imaginary number

    = cos( ) + sin( )

    This formula is extremely useful and has applications to trigonometric iden-tities, the solution of algebraic and di erential equations, circuits and signalprocessing.

    1.2.1 Linear and Power Functions

    The linear complex function is

    ( ) = +

    The constants and are given complex numbers, and = + is any complexnumber where and are real numbers. This means

    ( ) = ( ) + ( ) where

    the functions ( ) and ( ) have real values. The solution of ( ) = =

    1 + 2 is equivalent to equating the real and imaginary parts and reduces tosolving two real equations for and

    ( ) = 1 and ( ) = 2 (1.2.1)

    Example 1.2.1. Consider solving ( ) = (1 + ) + 3 = 7 Let = +so that

    ( ) = (1 + )( + ) + 3

    = ( + 3) + ( + 1)

    Thus, ( ) = +3 and ( ) = + 1 In order to solve ( ) = 7 =0 + 7 equate the real and imaginary parts as in equation (1.2.1)

    + 3 = 0 and + 1 = 7

    This algebraic system can be solved by adding the two equations 2 + 2 = 7 sothat = 5 2 and = 11 2 Thus, the solution of ( ) = (1 + ) + 3 = 7is = 5 2 + (11 2) The solution can also be found by using the properties inTheorem 1.1.1

    = =7 (3 )

    1 +=

    3 + 8

    1 +=

    3 + 8

    1 +

    1

    1=5 + 11

    2

  • 1.2. COMPLEX VALUED FUNCTIONS 11

    The linear rational complex function is

    ( ) =+

    +

    where constants and are complex numbers.

    Example 1.2.2. Let = 1 = = 1 and = giving

    ( ) =+

    This function can be represented by two real valued functions ( ) and ( )

    ( ) =+

    =( + ) +

    ( + )

    =+ ( + 1)

    + ( 1)

    ( 1)

    ( 1)

    =2 + 2 12 + ( 1)2

    +2

    2 + ( 1)2

    = ( ) + ( )

    The solution of ( ) = 2 + can be found by equating the real and imaginaryparts ( ) = 2, ( ) = 1 and solving for and Or, one can use theproperties in Theorem 1.1.1 to find as follows:

    += 2 +

    + = (2 + )( ) = (2 + ) (2 + )

    (1 (2 + )) = (2 + )

    ( 1 ) = 3 + 1

    =1 + 3

    1 +

    1

    1=2 + 4

    2= 1 + 2

    A quadratic complex function is

    ( ) = 2 + +

    The coe cients , and are given complex numbers, and one would like tosolve ( ) = 2 + + = 0 In order to generalize the quadratic formulato the complex case, the square root of a complex number needs to be defined.Since the square root function is the inverse of the square function, let us focuson

    ( ) = 2

  • 12 CHAPTER 1. VECTORS IN THE PLANE

    In Section 1.1 we used the polar representation = | | (cos( ) + sin( )) andTheorem 1.1.2 with = to obtain

    2 = | |2 (cos(2 ) + sin(2 ))

    This suggests that the square root of complex number should be

    1 2 | |1 2 (cos( 2) + sin( 2)) (1.2.2)

    A complex square root function ( ) = = + must have complexvalues so that its square is

    ( )2 = ( + )2

    + = ( 2 2) + 2

    Thus, one must choose and such that = 2 2 and = 2 The use oftrigonometric identities confirms

    = | |1 2cos( 2) and = | |

    1 2sin( 2)

    are the solution of these two equations and, hence, equation (1.2.2) is correctfor the definition of square root of

    Example 1.2.3. Use equation (1.2.2) to find the square root of = 1 + 3 .The modulus of is 2 and the angle is 3 or 60 degrees so that = 2(cos( 3)+sin( 3)) Equation (1.2.2) gives

    (1 + 3 )1 2 = 21 2(cos( 6) + sin( 6))

    = 2( 3 2 + (1 2))

    =p3 2 + (1 2)

    Note the solution of the complex quadratic equation 2 = 1 + 3 is plus orminus this square root.

    Figure 1.2.1 illustrates the linear, square and square root functions of acomplex variable; this was generated by the MATLAB code complex_power.m.The complex numbers in the domain correspond to the domain semicircle withradius equal to three. The linear function has values in the complex plane wherethe domain semicircle has been doubled in radius and shifted to the right. Thesquare function has values in the complex plane where the domain semicirclehas been expanded in both the radial direction and in an angular direction toone complete circle of radius equal to three squared. The smallest curve depictsthe square root function. Now, the domain semicircle has been contracted inboth the radial and angular components to one half of the semicircle and withradius equal to the square root of three.

  • 1.2. COMPLEX VALUED FUNCTIONS 13

    Figure 1.2.1: A ne, Square and Square Root of z

    1.2.2 Exponential Function e

    The exponential function of a complex variable = + at first look is= + = . But, what is the meaning of ? Find functions ( ) and( ) such that

    = ( ) + ( )

    has properties similar to the exponential function of a real variable. Two prop-erties that one would like to hold are

    0 = 1 and (1.2.3)

    = (1.2.4)

    By equating the real and imaginary parts in equations (1.2.3) and (1.2.4) wehave

    (0) = 1 and (0) = 0 and (1.2.5)

    = and = (1.2.6)

    Note the ( ) = cos( ) and ( ) = sin( ) satisfy these equations.In order to justify using the exponential function to represent this complex

    valued function, use the power series expansions, which are studied in the second

  • 14 CHAPTER 1. VECTORS IN THE PLANE

    semester of calculus,

    = 1 + +2

    2!+

    3

    3!+

    4

    4!+

    5

    5!+

    cos( ) = 12

    2!+

    4

    4! and

    sin( ) =3

    3!+

    5

    5!

    Extend the exponential functions domain from the real numbers to the complexnumbers by replacing by

    = 1 + +( )2

    2!+( )3

    3!+( )4

    4!+( )5

    5!+

    = 1 +2

    2!

    3

    3!+

    4

    4!+

    5

    5!+

    = [12

    2!+

    4

    4! ] + [

    3

    3!+

    5

    5! ]

    = cos( ) + sin( )

    Definition 1.2.1. Eulers Formula is

    = cos( ) + sin( )

    The general complex exponential function is

    ( ) = = + = = (cos( ) + sin( ))

    Also, any complex variable = + can be represented by using =cos( )+ sin( ) where = arctan( ) This gives the exponential representationof a complex variable

    = +

    = | | (cos( ) + sin ( ))

    = | |

    1.2.3 Application to Trigonometric Identities

    Four consequences of Eulers formula are presented. First, since the cosine isan even function and the sine function is an odd function,

    = cos( ) + sin( )

    = cos( ) sin( )

    =

  • 1.2. COMPLEX VALUED FUNCTIONS 15

    Second, this leads to the representation of the cosine and sine functions

    cos( ) = ( + ) 2 and (1.2.7)

    sin( ) = ( ) (2 ). (1.2.8)

    Third, consider the product of and and use the trigonometric identitiesfor the sum of angles

    = (cos( ) + sin( ))(cos( ) + sin( ))

    = [cos( ) cos( ) sin( ) sin( )]

    + [sin( ) cos( ) + cos( ) sin( )]

    = cos( + ) + sin( + )

    = ( + )

    Fourth, another identity, which follows from the repeated use of = ( + )

    with = is de Moivres formula

    (cos( ) + sin( )) = ( )

    =

    = cos( ) + sin( ) (1.2.9)

    This formula for di erent choice of leads to a variety of trigonometric identi-ties. Equation (1.2.9) can be used to reduce computations with large exponents.

    Example 1.2.4. Use de Moivres formula to evaluate (3 + 4 )10. First, write3 + 4 in exponential form 3 + 4 = 5 where = tan 1(4 3) Second, useequation (1.2.9) with = 10 on the second factor

    (3 + 4 )10 = (5 )10

    = 510( )10

    = 510 10

    = 510(cos(10 ) + sin(10 ))

    = 510( 0 9885 + 0 1512 )

    1.2.4 Application to Solution of =

    Consider the case = 2 where the solution of 2 = is plus or minus the squareroot of Let = | | and

    (| | )1 2 = | |1 2 2

    The second solution is | |1 2 2 = | |1 2 2 2 2

    There should be solutions of = 1 In order to discover these, representone by 1 = 2 and, hence,

    11 = ( 2 )1 = 2

  • 16 CHAPTER 1. VECTORS IN THE PLANE

    This leads to all solutions = ( 2 ) = (2 ) where = 0 1 1They are solutions because

    = ( (2 ) )

    = (2 )

    = cos((2 ) ) + sin((2 ) )

    = 1

    Definition 1.2.2. Let = 0 1 1 Then (2 ) are solutions to = 1and are called the roots of unity.

    Example 1.2.5. Let = 3 and find the three solutions of 3 = 1 Here2 = 2 3 or 120 degrees. The three solutions are

    (2 3)0 = cos((2 3)0) + sin((2 3)0) = 1(2 3)1 = cos((2 3)1) + sin((2 3)1) = 0 5000 + 0 8660(2 3)2 = cos((2 3)2) + sin((2 3)2) = 0 5000 0 8660

    Another special case with = 12 is illustrated in Figure 1.2.2 where the 12vectors with radius equal to one are the solutions. The other 12 vectors haveincreasing moduli and have staggered angles

    (1 05 ( 2 (1+ 05) ))

    The figure was generated by the MATLAB code euler_form.m.The solution of the more general problem = is straightforward once

    the complex number is written in polar form

    = | | = | | 2

    = 1 = | |1

    ( 2 )1

    = | |1 2 (1.2.10)

    Define 2 and use the fact ( ) = 1 to obtain all solutions =1 where = 0 1 1 A summary of the above is given in the followingtheorem.

    Theorem 1.2.1 (Solutions of = ) Let 2 and = | | Thensatisfies = 1 = 1 and 1+ + + 1 = 0 Moreover, the solutions

    of = are given by = | |1

    = 1 where = 0 1 1

    Example 1.2.6. Let = 3 and find the three solutions of 3 = 1 + Here2 = 2 3 and = 1 + = 21 2 4 The three solutions are

    21 6 12 (2 3)0 = 21 6(cos( 12 + (2 3)0) + sin( 12 + (2 3)0))

    = 1 0842 + 0 2905

    21 6 12 (2 3)1 = 21 6(cos( 12 + (2 3)1) + sin( 12 + (2 3)1))

    = 0 7937 + 0 7937

    21 6 12 (2 3)2 = 21 6(cos( 12 + (2 3)2) + sin( 12 + (2 3)2))

    = 0 2905 1 0842

  • 1.2. COMPLEX VALUED FUNCTIONS 17

    Figure 1.2.2: Solutions of 12 = 1

    1.2.5 Complex Functions Using MATLAB

    Complex functions are evaluated using MATLAB as are real functions. Thecomputations in Example 1.2.6 are easy to do. The second solution is

    a = exp(i*2*pi/3)a =

    -0.5000 + 0.8660ib = 2^(1/6)*exp(i*pi/12)b =

    1.0842 + 0.2905ia*bans =

    -0.7937 + 0.7937iz = a*bz =

    -0.7937 + 0.7937iz^3ans =

    1.0000 + 1.0000i.

    The MATLAB code complex_power.m, see Figure 1.2.1, uses an implied loopto generate a row vector of values for the parameter Then a row vector ofcomplex values is computed to form the semicircle, which is to be the domainof three functions. Array operations given by are used to compute the

  • 18 CHAPTER 1. VECTORS IN THE PLANE

    square and square root functions. An array operation on a row vector producesanother row vector whose components are given by the operation. For example,if = [2 3] then 2 = [22 32]The MATLAB code euler_form.m, see Figure 1.2.2, uses a for-loop to gen-

    erate a sequence of vectors associated with the complex exponential functionraised to a variety of powers. The vectors are created by the MATLAB com-mand quiver(x,y,dx,dy,1), which graphs a vector beginning at the point ( )and ending at ( + + ).

    1.2.6 Exercises

    1. Let ( ) = (2 + ) + 7 + where = +(a). Find ( ) and ( ) such that ( ) = +(b). Find the solution of ( ) = 10 2

    2. Let ( ) = ( 3 + ) + 1 + 2 where = +(a). Find ( ) and ( ) such that ( ) = +(b). Find the solution of ( ) = 1 2

    3. Let ( ) = ( + 2 ) ( ) where = +(a). Find ( ) and ( ) such that ( ) = +(b). Find the solution of ( ) = 1 2

    4. Let ( ) = (2 + ) ( + ) where = +(a). Find ( ) and ( ) such that ( ) = +(b). Find the solution of ( ) = 1 + 2

    5. Use equation (1.2.2) to find the square root of 1 +6. Use equation (1.2.2) to find the square root of 1 + 37. Use the complex quadratic formula to solve 2 + + = 0(a). Solve the quadratic equation 2 + 2 = 0(b). Check your answer.

    8. Consider the completing square method of developing the quadratic for-mula.(a). Prove: if and are complex numbers and = 0 then either= 0 or = 0(b). Use this fact to derive the quadratic formula for complex numbers.

    9. Use de Moivres formula in equation (1.2.9) to compute (1 + )10

    10. Use de Moivres formula in equation (1.2.9) to compute (3 + 2 )7

    11. Use Theorem 1.2.1 to find all three solutions to 3 = 3 + 412. Use Theorem 1.2.1 to find all four solutions to 4 = 1 + 313. Let 2 Show satisfies = 1 = 1 and 1 + + +

    1 = 014. Use MATLAB to verify the third equation in Example 1.2.6.15. Use MATLAB to experiment with di erent size semicircles in the codecomplex_power.m.16. Use MATLAB to experiment with powers = 3 6 and 12 in the codeeuler_form.m.

  • 1.3. VECTORS IN R2 19

    1.3 Vectors in R2

    Complex numbers are represented either by ordered pairs of real numbers or asdirected line segments. The first number in the pair is the real part and thesecond number is the imaginary part. The directed line segment or arrow startsat the origin and ends at the complex point. There are a number of importantsimilar examples such as displacement in the plane of a mass, force acting ona mass as well as the velocity and acceleration of a mass. As in the complexnumbers, these quantities can be added, subtracted and scaled, and have lengthand angles.

    1.3.1 Vector Definition and Notations

    There are a number of notations of vectors. One is the unit vectors oftenused in physics textbooks. Other notations list the components in either a rowor a column. There is also some confusion about the di erence between a pointin a plane and a vector in a plane; often the notation is the same! Part of theproblem is the need to have vectors with more than two or three components,which will be considered after the first two chapters.

    Definition 1.3.1. A vector in R2 is an ordered list of two real numbers =[ 1 2]. One can visualize this by forming the directed line segment from theorigin point (0 0) to the point ( 1 2)

    Notation. Points in the plane R2 will be denoted by ( 1 2) and vectors willbe considered as either row or column vectors:

    = [ 1 2] denotes a row vector

    a = 12

    denotes a column vector

    a = [ 1 2] is called the transpose of the column vector a so that a =

    Example 1.3.1. The standard unit basis vectors are

    = [1 0] or e1 =10

    and

    = [0 1] or e2 =01

    Any vector can be represented as a linear combination of unit vectors. Forexample, if = [2 3], then either by row vectors

    = 2 + 3 or by column vectors

    a = 2e1 + 3e2

    These vectors are illustrated in Figure 1.3.1.

  • 20 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.3.1: A Vector in the Plane

    Movement of a mass in a plane involves displacement, velocity and forcevectors. If one moves a mass from the origin to a point ( 1 2) then there isdisplacement in both the horizontal and the vertical directions. This requirestwo numbers, and we agree to list the horizontal term first so that

    = [ 1 2] = displacement vector.

    In order to move an object, a force must be exerted on the mass, and thiswill also have horizontal and vertical components. By adjusting the size of thecomponents, the direction and magnitude of the force can be determined toobtain the desired motion. Let 1 be the force in the horizontal direction, 2be the vertical force and denote the force vector as

    = [ 1 2] = force vector.

    The resulting motion will have speeds in the horizontal and vertical directions.The velocity vector lists these speeds so that the velocity vector also has adirection and magnitude. The speed in the horizontal direction is 1 and whenthis is coupled with the vertical speed 2 we get a velocity vector

    = [ 1 2] = velocity vector.

    Newtons law of motion can be applied in both the horizontal and verticaldirections

    1 =1and 2 =

    2

  • 1.3. VECTORS IN R2 21

    Figure 1.3.2: 2 = 2 + 2

    The vector notation for Newtons law of motion is

    = [ 1 2]

    = [1 2

    ]

    = where

    = [1 2

    ] = acceleration vector.

    As in complex vectors there are operations with vectors such as addition,length and angles. Two very useful theorems are related to the length of aside of a triangle, which is opposite one of the angles. When the angle is 90degrees, the Pythagorean theorem gives a very useful relationship between thethree sides. There are number of proofs for the Pythagorean theorem, but thefollowing is a very nifty proof that is based on geometry. Consider Figure 1.3.2where the right triangle has sides of length and with being opposite the90 degree angle. The figure is drawn with larger than . The area of the bigsquare is squared, and it is the union of four identical triangles and a smallsquare

    2 = 4( 2) + ( )2

    = 2 + 2 2 + 2

    = 2 + 2

    Theorem 1.3.1 (Pythagorean) Consider a right triangle with sides a, b andc. If c is opposite the right angle, then

    2 = 2 + 2

  • 22 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.3.3: 2 = 2 + 2 2 cos( )

    An important consequence of the above, where sin( ) = and cos( ) =is the trigonometric identity

    1 = sin2( ) + cos2( )

    Another result pertains to the case when the angle is not 90 degrees as isillustrated in the triangle in Figure 1.3.3 where the triangle with sides andis a union of two right triangles. The left right triangle has base equal tocos( ) and height equal to sin( ) The other right triangle has the sameheight, but the base is cos( ) (assuming ) Therefore, applying thePythagorean theorem to the right triangle on the right side gives

    2 = ( sin( ))2 + ( cos( ))2

    = 2 sin2( ) + 2 2 cos( ) + 2 cos2( )

    = 2(sin2( ) + cos2( )) + 2 2 cos( )

    = 2 + 2 2 cos( )

    Theorem 1.3.2 (Cosine Law) Consider a triangle with sides a, b and c. If cis opposite the angle , then

    2 = 2 + 2 2 cos( )

    1.3.2 Vector Operations

    Vectors can be scaled, added and subtracted by either viewing the vectorsgeometrically or as symbolic objects. Figure 1.3.4 illustrates vector scaling by

    either elongating or shrinking the vector . Two vectors and can be

    added by moving vector parallel to its original position so that its beginningpoint is the end point of vector . The addition corresponds to the diagonal

    of the parallelogram formed by vectors and . If is added to , then

    the subtraction is the other diagonal from the end of to the end of

  • 1.3. VECTORS IN R2 23

    Figure 1.3.4: + and

    Definitions 1.3.2. Let = [ 1 2], = [ 1 2] and 0 = [0 0] be the zero

    vector. equals means both 1 = 1 and 2 = 2 The addition of twovectors is another vector whose components are the sum of the components ofthe two vectors

    + [ 1 + 1 2 + 2 ]

    Let be a real number. The scalar product of a vector is another vector whosecomponents are the scalar times the components of the vector

    [ 1 2 ]

    These operations are similar to those for complex numbers. However, it isimportant to note that vector products, which could be similar to complex prod-ucts, are not defined. There are special vector products called "dot", "cross","box" and "array" products, which will be introduced in the subsequent sec-tions. The following theorem lists some basic algebraic properties of the aboveoperations.

    Theorem 1.3.3 (Vector Space Properties) Let and be vectors andlet and be real numbers. Then the following rules hold

    + = + ( + ) + = + ( + )

    + 0 = and + ( ) = 0 ;

    ( + ) = + , ( ) = ( ) 1 = and

    ( + ) = +

  • 24 CHAPTER 1. VECTORS IN THE PLANE

    The proofs are straightforward. The proof of + = + uses thecommutative property for addition of real numbers

    + = [ 1 + 1 2 + 2 ]

    = [ 1 + 1 2 + 2 ]

    = +

    Example 1.3.2. Let = [2 4], = [ 1 2] and = 3 Then + = [1

    6] = [3 2] and = [ 3 6]

    Example 1.3.3. One can use the above basic properties to solve vector equa-

    tions for an unknown vector = [ 1 2] Suppose vectors and are given

    and must satisfy the vector equation + = . Solve this by adding thevector to both sides and use the algebraic rules

    ( + ) =

    ( + ) =

    + ( ) =

    =

    Definitions 1.3.3. Let = [ 1 2]. The length or Euclidean norm of thevector is given by the Pythagorean theorem

    k kq

    21 +

    22

    The angle of the vector is

    = arctan( 2 1)

    The unit vector in the direction of is

    k k=

    1

    k k

    The cosine law may be rewritten in terms of the norms of the vectors

    = and the angle between the vectors and 2 = k k2 + 2 2 k k cos( )This allows one to compute the angle between two given vectors. In fact, thiscan be simplified to easily compute cos( ) sin( ) and the area of the paral-lelogram formed by two vectors. In Section 1.4 this will be applied to thecomputation of work and torque.

  • 1.3. VECTORS IN R2 25

    Example 1.3.4. If = [2 4] and = [ 1 2] then = [3 2] 2 = 13 k k2 = 20 2 = 5 so that13 = 20 + 5 2 20 5 cos( )

    = 20 + 5 20 cos( )

    cos( ) = 12 20 = 3 5

    = cos 1(3 5) 53 13 degrees.

    The unit vector associated with is

    k k=[2 4]

    2 5= [1 5 2 5]

    1.3.3 Application to Navigation of an Aircraft

    A pilot wishes to fly northeast with a speed of 400 miles per hour. The meansthe desired velocity vector has length equal to 400 and the speed in the eastand north directions are equal. Let this desired velocity be the vector = [ 12] where k k = 400 and 1 = 2 0

    21 +

    21 = 400

    2

    Thus, 1 = 2 = 400 2 An added di culty is the wind velocity, which iscoming from the northwest and has a speed equal to 100 miles per hour. Let= [ 1 2] where k k = 100 and 1 = 2 0

    21 +

    21 = 100

    2

    Thus, 1 = 2 = 100 2 What should the heading velocity = [ 1 2]be so that the desired velocity is attained? The aircraft must be pointed northof northeast and have a speed larger than 400. The desired velocity is the

    resultant of the wind velocity and the heading velocity which means

    = +

    By the basic rules for vector operations

    =

    [ 1 2] = [400 2 400 2] [100 2 100 2]

    = [300 2 500 2]

    The speed of the aircraft should be =q(300 2)2 + (500 2)2 = 100 18 424 26and the angle from the east direction should be

    arctan((500 2) (300 2)) = arctan(5 3) 59 04 degrees

  • 26 CHAPTER 1. VECTORS IN THE PLANE

    1.3.4 Vectors Using MATLAB

    The vector notation in MATLAB is very similar to what has been used in thistext and uses square brackets to enclose both row and column vectors. Theoverhead arrow and bold notations are not used to distinguish row and columnvectors. A row vector such as = [2 5] is converted to a column vector byusing a prime, [2 5].

    a = [2 5]a =

    2 5e1 =[1 0]e1 =

    10

    e2 = [0 1]e2 =

    01

    aa = a(1)*e1 + a(2)*e2aa =

    25

    b = [-1 5]b =

    -1 5c = 2*a + 3*bc =

    1 25

    The MATLAB command quiver(x,y,dx,dy,s) can be used to graph vectorsstarting at the point ( ) and ending at the point ( + + ) and using= 1 The following generates a graph of the two vectors = [2 5] and

    = [ 1 3].

    quiver(0,0,2,5,1)hold onquiver(0,0,-1,3,1)

    1.3.5 Exercises

    1. Consider the vector = [2 5] Write it in and column forms.

    2. Consider the vector = [ 1 3] Write it in and column forms.

    3. Let = [2 5] and = [ 1 3]. Graph + and

    4. Let = [2 3] and = [ 1 5]. Graph 2 + and

    2

  • 1.4. DOT PRODUCT AND WORK 27

    5. Let = [2 5] and = [ 1 3]. Solve + =

    6. Let = [1 7] and = [ 1 3]. Solve 2 = +

    7. Consider Theorem 1.3.3. Prove ( + ) + = + ( + )

    8. Consider Theorem 1.3.3. Prove ( + ) = +9. Let = [1 7]. Compute k k, the angle and unit vector of10. Let = [1 3]. Compute k k, the angle and unit vector of

    11. Let = [2 5] and = [ 1 3]. Graph these vectors and use the cosinelaw to find the angle between them.

    12. Let = [1 2] and = [ 1 3]. Graph these vectors and use thecosine law to find the angle between them.13. Consider the aircraft heading problem. If the desired velocity is to thenortheast with speed 500 and the wind velocity has speed 120 and from thenorth, find the heading velocity.14. Consider the aircraft heading problem. If the desired velocity is to thenorthwest with speed 500 and the wind velocity has speed 120 and from theeast, find the heading velocity.

    15. Use MATLAB to compute 2 + and 2 where = [2

    3] and = [ 1 5]

    16. Use MATLAB to graph and where = [2 3] and = [ 1 5]

    1.4 Dot Product and Work

    In this section we continue the study of the parallelogram that is formed by

    two vectors and in the plane. The vector version of the cosine law allows

    one to compute cos( ) where is the angle between the vectors and Thiscalculation is important because it leads to a number of applications such asan easy derivation of trigonometric identities, area of the parallelogram andcalculation of work and torque in 2D and 3D space.

    1.4.1 Cosine Identity and Dot Product

    Let = [ 1 2] and = [ 1 2] have the angle between the vectors. Thevector version of the cosine law is 2 = k k2 + 2 2 k k cos( ) (1.4.1)By definition of vector subtraction and the norm 2 = ( 1 1)2 + ( 2 2)2

    = 21 2 1 1 +21 +

    22 2 2 2 +

    22

    = k k2+ 2 2( 1 1 + 2 2)

  • 28 CHAPTER 1. VECTORS IN THE PLANE

    Place this into the left side of equation (1.4.1) and cancel the norms

    k k2+ 2 2( 1 1 + 2 2) = k k2 + 2 2 k k cos( )

    2( 1 1 + 2 2) = 2 k k cos( )

    1 1 + 2 2 = k k cos( ) (1.4.2)

    Equation (1.4.2) is of fundamental importance. The left side is an easy calcu-lation, and the right side makes a connection with the geometry. At the end ofthis section an application will be given to work being done in a constant forcefield, which is independent of three possible paths.

    Theorem 1.4.1 (Cosine Identity) Let = [ 1 2] and = [ 1 2] be non-zero vectors and let be the angle between the two vectors. Then the cos( ) canbe computed by

    cos( ) =1 1 + 2 2

    k k

    Definition 1.4.1. The dot product of two vectors = [ 1 2] and = [ 1 2]is given by the real number on either side of equation (1.4.2). The following arecommon notations for the dot product of row or column vectors, respectively,

    1 1 + 2 2 = k k cos( ) or

    a b 1 1 + 2 2 = kak kbk cos( )

    The cosine identity can be restated as either

    cos( ) =

    k k or

    cos( ) =a b

    kak kbk.

    Also, the norm of a vector can be written as either

    k k2= or

    kak2 = a a

    Since 1 cos( ) 1 the inequality, which is called the Cauchy-Schwarzinequality, is

    k k or

    a b

    kak kbk

  • 1.4. DOT PRODUCT AND WORK 29

    Definitions 1.4.2. Let and be non-zero vectors. Two vectors are parallelif and only if they are multiples of each other, that is, there is a real number

    such that = Two vectors are perpendicular (also called orthogonal) if

    and only if the cos( ) is zero, that is, = a b = 0

    Example 1.4.1. Let = [2 3] and = [ 1 2]. Then k k2= 22+32 = 13 2 = ( 1)2 + 22 = 5 and = 2( 1) + 3(2) = 4

    cos( ) =

    k k = 413 5 = 465 and

    = cos 1

    4

    65

    60 26 degrees.

    Example 1.4.2. Consider the following three vectors written as column vectors

    a =23

    b =

    2233

    and c =

    64

    Vectors a and b are parallel because a =(1 11)b Vector a is perpendicular toc because the dot product a c = 2( 6) + 3(4) = 0 Also, b and c must beperpendicular. Consider a vector d whose first component is 2, but the secondcomponent is unknown. Choose the second component so that the vector dis perpendicular to vector a Let the vector d be represented by its transposed = [2 ] The vector d being perpendicular to a requires their dot productto be zero

    a d =2 3

    2 = 2(2) + 3 = 0

    Thus, = 4 3 and d = [2 4 3].

    Definition 1.4.3. The projection of onto is a vector with direction the

    same as and length equal to cos( )

    k k

    cos( ) =k k

    2

    The dot product has a number of interesting algebraic properties. One isthe order of the vectors does not change the value of the dot product.

    = 1 1 + 2 2

    = 1 1 + 2 2

    =

    Additional dot product properties listed in the following theorem are also easyto prove.

  • 30 CHAPTER 1. VECTORS IN THE PLANE

    Theorem 1.4.2 (Properties of Dot Product) Let be given vectorsand let be a real number. The dot product properties are

    = ( ) = ( )

    ( + ) = + and

    k k

    (Cauchy-Schwarz inequality).Since the norm of a vector can be written in terms of the dot product

    k k2=

    several important properties of a norm can be derived from the above dotproduct properties. The following norm properties are similar to the absolutevalue of a real number.

    Theorem 1.4.3 (Properties of Norm) Let and be given vectors and letbe a real number. The norm properties are

    k k 0; k k 0 if and only if = 0

    k k = | | k k and + k k+ (triangle inequality).The triangle inequality follows from the dot product properties + 2 = ( + ) ( + )

    = ( + ) + ( + )

    = + + +

    = k k2+ 2 +

    2k k

    2+ 2

    + 2

    Next apply the Cauchy-Schwarz inequality to get + 2 k k2 + 2 k k + 2= (k k+

    )21.4.2 Applications to Angles and Areas

    The dot product version of the cosine identity can be used to derive the formulafor the cosine of the sum of two angles

    cos( + ) = cos( ) cos( ) sin( ) sin( )

  • 1.4. DOT PRODUCT AND WORK 31

    Figure 1.4.1: Trigonometric Identity and Dot Product

    Choose two vectors as illustrated in Figure 1.4.1 where both vectors have unitlength. Then the first and second components are the cosine and sine of their

    angles. Let the vectors and have angles equal to and respectively,and let the vector be the reflection vector about the horizontal axis sothat

    = [cos( ) sin( )]

    = [cos( ) sin( )] and

    = [cos( ) sin( )]

    The angle between vectors and is ( ) = + and, therefore, byapplication of the cosine identity to the vectors and

    cos( + ) =

    k k k k

    =cos( ) cos( ) + sin( )( sin( ))

    1(1)

    Another application of the dot product is to the computation of the area ina parallelogram formed by two vectors, which is depicted in Figure 1.4.2. Herethe base of the parallelogram is the length of the vector k k, and the height

  • 32 CHAPTER 1. VECTORS IN THE PLANE

    of the parallelogram is sin( ) and, thus,

    ( )2 = (k k sin( ))2

    = (k k )2(1 cos2( ))

    Use the cosine identity for cos( ) to obtain

    ( )2 = (k k )2(1 (

    k k )2)

    = k k2 2 ( )2

    = ( 21 +22)(

    21 +

    22) ( 1 1 + 2 2)

    2

    = ( 1 2 1 2)2 (1.4.3)

    This formula may also be expressed using the determinant of a 2 2 matrixformed by the column vectors that define the parallelogram

    det([a b]) = det( 1 12 2

    ) 1 2 1 2

    Then equation (1.4.3) is

    ( )2 = (det([a b]))2

    Theorem 1.4.4 (Area Equivalence) Let two non-zero vectors be representedas column vectors a and b The area of the parallelogram formed by these vectorsbeing non-zero is equivalent to the vectors not being parallel. In symbolic terms,this means det([a b]) 6= 0 is equivalent to a 6= b for all non-zero real numbers. Moreover, area is equal to the absolute value of det([a b]).

    Another point of view generalizes to higher dimensional vectors. The matrixproduct may be written as a linear combination of the column vectors a and b

    1 1

    2 2

    =

    00

    1 + 12 + 2

    =

    00

    1

    2

    + 1

    2

    =

    00

    a+ b = 0

    Thus, the above are also equivalent to a+ b = 0 implies both and mustbe zero. Such vectors are called linearly independent, which will be studied in

  • 1.4. DOT PRODUCT AND WORK 33

    Figure 1.4.2: Area and Dot Product

    more detail in Section 5.1. In Figure 1.4.3 the area of the larger parallelogram,formed by the scaled vectors a and b is times the area of the smallerparallelogram. This follows from determinants

    det([ a b]) = det( 1 12 2

    )

    = 1 ( 2 ) 1 ( 2 )

    = det([a b])

    1.4.3 Applications to Work and Torque

    This application is concerned with moving a mass from one point in a planeto an other point in the plane. One can do this by using a ramp or using awheel. In the case of ramp the displacement vector is along the top of the rampand the force vector may not be parallel to the ramp, see Figure 1.4.4. For thewheel one must be able to apply a non-zero force tangent to the perimeter ofthe wheel, see Figure 1.4.5.

    The movement of an object up a ramp requires a force with both non-zerohorizontal and vertical components. In order to reduce the computation of workto the scalar formula, work equals distance times the force, we must find thecomponent of the force vector in the direction of the displacement vector. In

    Figure 1.4.4 this is cos( ) so that the work is cos( ) If the given

    vectors are and , then the work is computed by the cosine identity and

  • 34 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.4.3: Linearly Independent Vectors

    the dot product

    =

    For example, if the bottom edge of the ramp is 10 and the vertical part is 5,

    then = [10 5] Suppose the force vector is 100 in the horizontal direction and

    10 in the vertical direction so that = [100 10] Then the work is =10(100) + 5(10) = 1050For the rotation of a wheel the force vector may not be tangent to the

    wheel and so one must compute the component of the force acting in thisdirection. This computation, in contrast to the above work problem, uses thesine of the angle and not the cosine. Figure 1.4.5 reveals why this is the case.The scalar value for torque is the radius times the tangent component of the

    force k k sin( ) This value is related to plus or minus the area of the

    parallelogram formed by the radius vector and the force vector.

    1.4.4 Application to Work and Constant Force Vector

    Consider an object that is to be moved from one point in a plane to anotherpoint. Three possible paths are the direct path (path one in Figure 1.4.6), thehorizontal and then vertical (path two), and vertical and then horizontal (paththree). If the force vector is a constant vector, then we claim the work donewill be independent of the three paths. Let the direct path be the displacement

    vector = = [ 1 2] and the constant force vector be = = [ 1 2]Apply the cosine identity in equation (1.4.2)

    1 1 + 2 2 = cos( )

  • 1.4. DOT PRODUCT AND WORK 35

    Figure 1.4.4: Work and a Ramp

    Figure 1.4.5: Torque on a Wheel

  • 36 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.4.6: Work with Independent Paths

    The work along the direct path is cos( ) The work along the second

    path is 1 1 + 2 2, and the work along the third path is 2 2 + 1 1 which isthe same as path two because the addition of real numbers commutes. Thus,the work done is independent of the three paths taken for constant displacementand force vectors.

    1.4.5 Dot Product Using MATLAB

    The dot product of two vectors can be computed in two ways. The MATLABcommand dot(a,b) will do this if the vectors are both row or column vectors.If the vectors are both column vectors, then one can use the transpose versiona b and in MATLAB this would appear as 0 provided and were columnvectors.

    aa =

    2 1bb =

    1 -1dot(a,b)ans =

    1a*bans =

    2 -21 -1

    In the above and were initially row vectors so that 0 will be a columnvector times a row vector, which results in a 22 matrix. By transposing them

  • 1.4. DOT PRODUCT AND WORK 37

    to column vectors one can compute the dot product as a row vector times acolumn vector.

    cola = acola =

    21

    colb = bcolb =

    1-1

    colb*colaans =

    1

    1.4.6 Exercises

    1. Verify the cosine identity in equation (1.4.2) for

    = [ 3 1] and = [1 3]

    2. Verify the cosine identity in equation (1.4.2) for the vectors in columnform

    a =31

    and b =

    11

    3. Use the cosine identity in equation (1.4.2) to find the angle between thevectors in column form

    a =12

    and b =

    31

    4. Use the cosine identity in equation (1.4.2) to find the angle between the

    vectors = [2 1] and = [1 1]

    5. Find such that = [3 1] and = [ 1] are perpendicular.6. Find such that the following column vectors are perpendicular

    a =12

    and b =

    3

    7. Consider Theorem 1.4.2.(a). Prove ( ) = ( ) = ( )

    (b). Verify ( + ) = + for the vectors = [2 1],

    = [3 4] and = [1 1](c). What is the di erence between "prove" and "verify"?

    8. Consider Theorem 1.4.3. Prove the first three norm properties.

  • 38 CHAPTER 1. VECTORS IN THE PLANE

    9. Use the formula in equation (1.4.3) to compute the area of the parallel-ogram given by the column vectors

    a =12

    and b =

    31

    10. Use the formula in equation (1.4.3) to compute the area of the parallel-

    ogram given by the vectors = [2 1] and = [1 1]

    11. Let = [2 1] and = [1 1] Verify the area of the parallelogram

    given by the vectors 6 and 3 is 18 times the area of the parallelogram given

    by the vectors and12. Consider the work in moving an object up a ramp whose horizontal edge

    is 25 and vertical edge is 5. If the force vector is = [10 1] find the work.13. Consider the work in moving an object up a ramp that requires a forcevector with force of 3 in the horizontal direction and 1 in the vertical direction.If the displacement vector is = [30 6] find the work.

    14. Use MATLAB to compute the dot product of = [2 1] and = [3 4]15. Use MATLAB to compute the area of the parallelogram between =

    [1 2] and = [ 3 1]

    1.5 Lines and Curves in R2 and C

    In this section lines in the plane will be represented by three variations onalgebraic equations and three variations on vector equations. We will use thesedescriptions to find the point on a line that is closest to a given point not onthe line. One method uses calculus to solve the problem, and the other methoduses geometry to generate the same solution. Both these approaches can beused to solve more general applied problems. Finally, curves in the plane willbe described by parametric equations. An important class of curves related tosignal processing can be generated by Eulers formula and complex variables.

    1.5.1 Lines in the Plane

    The three most common algebraic representations of a line are the slope-intercept,the single equation and the parametric equations, respectively:

    = + or0

    0= (1.5.1)

    + + b = 0 or ( 0) + ( 0) = 0 (1.5.2)= 1 + 0, = 2 + 0 or

    0

    1=

    0

    2= (1.5.3)

    Example 1.5.1. Suppose a line contains the point (1 2) and satisfies theequation 3 + 4 11 = 0 Since = 1 and = 2 satisfies this equation, the

  • 1.5. LINES AND CURVES IN R2 AND C 39

    Figure 1.5.1: Line Given a Point and Direction

    point is in fact on the line. Solve the given equation for to get

    =3

    4+11

    4or

    2

    1=

    3

    4=

    In order to find the parametric equation (1.5.3), use the second form for theslope

    2

    1=

    3

    4or

    2

    3=

    1

    4=

    This means = 3 + 2 and = 4 + 1 Note there are other possible choicesfor the parameter such as = 2bThree vector representations are one point and a direction vector , two

    distinct points, and one point and a normal vector The first representationis given by the vector version of the parametric equations

    [ ] = [ 1 2] + [ 0 0]

    = + 0 (1.5.4)

    This is illustrated in Figure 1.5.1 where the direction vector and the point aregiven; the given point is ( 0 0) and the vector 0 starts at the origin and

    ends this given point. The vector in the figure depicts an extension of thegiven direction vector. Then any point on the line, represented by the vectorbeginning at the origin and ending at the point on the line, is a vector sum

    of and 0If two points are given on the line by ( 0 0) and ( 1 1), then consider the

    two vectors starting at the origin and ending at these points, 0 = [ 0 0] and

    1 = [ 1 1]. Then 1 0 is a vector that is parallel to the line and can

  • 40 CHAPTER 1. VECTORS IN THE PLANE

    be used as the direction vector

    = + 0

    = ( 1 0) + 0 (1.5.5)

    If a point and a normal vector are given, then the normal vector must beperpendicular to any vector parallel to the line. If and 0 are two vectorsthat are associated with two points on the line, then 0 and must beperpendicular so that

    ( 0) = 0 (1.5.6)

    This vector equation is related to the second version of the single equation(1.5.2) representation

    ( 0) + ( 0) = 0

    [ ] [ 0 0] = 0

    ( 0) = 0

    Example 1.5.2. Find the vector equation (1.5.4) for the line with point (2 1)and parallel to the vector [1 4]

    = + 0

    [ ] = [1 4] + [2 1] or

    = 1 + 2 and = 4 + 1

    One choice for a normal vector is = [4 1] because [1 4] = 0

    ( 0) = 0

    [4 1] [ 2 1] = 0

    4( 2) + ( 1)( 1) = 0

    4 7 = 0

    Although the equations look di erent, it is easy to verify that the parametricequations do satisfy this last single equation representation.

    1.5.2 Minimum Distance from a Point to a Line

    Let a line be represented by a direction vector and point ( 0 0) Let a point( 1 2) not be on this line. Let 0 = [ 0 0] and = [ 1 2] be the vectorsassociated with these two points. Any point on the line will then be a functionof the parameter

    ( ) = + 0

    The distance squared from the point not on the line and any point on the lineis a function of

    ( ) ( ( ) ) ( ( ) ) (1.5.7)

  • 1.5. LINES AND CURVES IN R2 AND C 41

    Figure 1.5.2: Minimum Distance of Point to a Line

    The objective is to find the value of = 0 so that

    ( 0) = min ( )

    This is illustrated in Figure 1.5.2.The first method for solving this minimization problem uses calculus. We

    will find = 0 so that

    ( 0) = 0 and2

    2( 0) 0

    In order to compute the derivatives, use the basic properties of the dot product

    ( ) = ( ( ) ) ( ( ) )

    = ( + 0 ) ( + 0 )

    = ( + 0 ) + ( + 0 ) ( 0 )

    = ( ) ( ) + 2( ) ( 0 ) + ( 0 ) ( 0 )

    = 2 + 2 ( 0 ) + ( 0 ) ( 0 )

    This is a quadratic function of whose derivatives are easily computed

    = 2 + 2 ( 0 ) and2

    2= 2 0

    Thus, the 0 where the first derivative is zero is

    0 = ( 0 )

  • 42 CHAPTER 1. VECTORS IN THE PLANE

    Since the second derivative is positive, the minimum distance is the square rootof ( ) evaluated at 0

    Example 1.5.3. Consider the line given by + 2 = 4 The line contains the

    points (0 2) and (4 0) and is parallel to = [4 2] If the point not on thisline is (2 5), then the vector associated with the point is = [2 5]

    0 = ( 0 )

    =[4 2] ([0 2] [2 5])

    [4 2] [4 2]

    =2

    20=1

    10

    The desired point on the line is ( 110) =110 + 0 =

    110 [4 2] + [0 2] =

    [0 2] = [ 4101810 ]

    For the geometric approach to this problem observe in Figure 1.5.2 thatvector from to ( 0) must be perpendicular to the given line. This means

    the direction vector of the line must be perpendicular to ( 0) Nowuse the dot product to obtain

    ( ( 0) ) = 0

    ( 0 + 0 ) = 0

    0 + ( 0 ) = 0

    and, hence, we get the same 0

    Theorem 1.5.1 (Minimum Distance to a Line) Let a given point, given by

    position vector , not be on a line ( ) = + 0 The distance squared ( )is defined by equation (1.5.7).

    ( 0) = min ( ) has solution 0 = ( 0 )

    Variations on this important result will be considered in Section 2.3 forlines in space, and in Section 4.2 for data fitting using "least squares." If 0 isthe zero vector and the other vectors are written as column vectors, then theminimization problem is solved by the solution of

    d d 0 = d p

    Here d is a column vector with two rows, and 0 is called a least squares solutionto d = p, which has two equations and one unknown.

  • 1.5. LINES AND CURVES IN R2 AND C 43

    Figure 1.5.3: Cycloid and Wheel

    1.5.3 Curves in the Plane and Phasors

    The parametric representation of a line has components that are linear polyno-mials of the parameter, + . If one or both of the component functions arenot linear polynomials, then the set of points will not be a line. For example,if = and = 2 then we have a parabola. In this case the position vectorsfor points on the parabola are = [ 2] Another example is a circle withradius where one representation is = cos( ) and = sin( ) The positionvector is = [ cos( ) sin( )] Complex variables and Eulers formula canalso describe this circle by = = cos( ) + sin( )

    A more complicated curve is the cycloid, which is the curve given by a pointon a wheel of radius as the wheel rolls in a straight line. As is illustrated inFigure 1.5.3, the position vector is given by

    = + +

    = [ 0] + [0 ] + [ sin( ) cos( )]

    = [ ( sin( )) (1 cos( )]

    The angle is the parameter, and it is given in radians so that the arclengthopposite the angle is Figure 1.5.4 depicts this curve with = 1 and wasgenerated by the MATLAB code cycloid.m.

    Eulers formula can be used to generate sine and cosine curves with di erentamplitudes, , frequencies, and phases, . By adding the associated complexnumbers one can easily generate very complicated signals such as a personsvoice. Consider just one tone and one sine function of time

    sin(2 + )

  • 44 CHAPTER 1. VECTORS IN THE PLANE

    Figure 1.5.4: Cycloid

    The sine function is the imaginary part of

    (2 + ) = 2

    At time = 0 this is , which is called a phasor where is the phase angle.In order to have more than one tone, additional frequencies must be used.Consider two possible tones

    1 sin(2 1 + 1) and 2 sin(2 2 + 2)

    The signal associated with these two is simply the addition of the two sinefunctions. In terms of complex variables this is the imaginary part of

    = 1(2 1 + 1) + 2

    (2 2 + 2)

    By letting time vary the complex variable will move in the complex plane, andone can plot its imaginary part as a function of time. This is illustrated inFigure 1.5.5, which was generated by the MATLAB code phasor.m.

    1.5.4 Curves Using MATLAB

    We will concentrate on graphing a curve by using parametric equations. If wehave values for the points on the curve and they are stored in two row vectorsof equal length, then the MATLAB command plot() can be used to generate agraph. For example, in the following two row vectors each with 4 componentsare created.

  • 1.5. LINES AND CURVES IN R2 AND C 45

    Figure 1.5.5: Two-tone Signal

    x = [1 2 3 4];y = [1 4 9 16];plot(x,y)

    The command plot(x,y) will generate a graph connecting the four points (1 1),(2 4), (3 9) and (4 16)If one needs to have more data points, then this can be done by for-loops

    or by implied loops called vector operations. The for-loops is more flexible,but it is slower. The following for-loop creates three row vectors that have 10components.

    for j = 1:10t(j) = j*.5;x(j) = t(j)+1;y(j) = t(j)^2;

    endplot(x,y)

    The following uses vector operations to generate the same graph. The MATLABcommand y = t.^2 is an array operation, which produces another row vectorwith the same number of components as the row vector t and whose componentsare the squares of those in t. For example, if t = [1 2 3], then t.^2 = [1 4 9].

    t = .5:.5:5;x = t + 1;y = t.^2;

  • 46 CHAPTER 1. VECTORS IN THE PLANE

    plot(x,y)

    The MATLAB code cycloid.m, see Figure 1.5.4, uses vector operations, and thecode phasor.m, see Figure 1.5.5, uses for-loops with a MATLAB command pauseso that one can step through the loop.

    1.5.5 Exercises

    1. Let 3 = 9(a). Find the slope-intercept equation.(b). Find the parametric equations.

    2. Let = 2 + 1 and = 3 2(a). Find the slope-intercept equation.(b). Find the single algebraic equation.

    3. Let the line contain the point (2 7) and be parallel to [1 1](a). Find the vector equation using a direction vector.(b). Find the parametric equations.

    4. Let the line contain the point (2 7) and be perpendicular to [1 1](a). Find the vector equation using a normal vector.(b). Find the single algebraic equation.

    5. Find the point on the line = [1 2] + [0 1] that is closest to thepoint (5 5)6. Find the point on the line given by = 2 + 2 and = + 1 that isclosest to the point (5 5)7. Use MATLAB to create a graph of the line given by = +2 and = 2with 0 58. Use MATLAB to create a graph of the curve given by = + 2 and= 2 2 with 0 3

    9. Use the MATLAB code cycloid.m to experiment with di erent wheels,= 0 5 1 and 2

    10. Use the MATLAB code phasor.m to experiment with a variety of theinputs:(a). Vary the frequencies.(b). Vary the amplitudes.(c). Vary the phase angles.

  • Chapter 2

    Vectors in Space

    Vectors in space are introduced, and the dot, cross and box products are stud-ied. Lines and planes are carefully described as well as extensions to higherdimensional space. Applications to work, torque, inventories and visualizationsare included.

    2.1 Vectors and Dot Product

    A point in space can be located in a number of ways, but here the Cartesiancoordinate system will be used. You may wish to visualize this from the interiorof a room looking down into the corner. The corner is the origin; the x-axis isthe intersection of the left wall and floor; the y-axis is the intersection of theright wall and the floor; the intersection of the left and right walls is the z-axis.This is illustrated in Figure 2.1.1. The point ( ) is located by movingunits in the x-axis, then moving units parallel to the y-axis, and movingunits parallel to the z-axis. The distance from the origin to the point is givenby two applications of the Pythagorean theorem to the right triangles in Figure2.1.1. Associated with the point ( ) is the position vector from the originto this point.

    Definition 2.1.1. A vector in R3 is an ordered list of three real numbers =[ 1 2 3]. One can visualize this by forming the directed line segment fromthe origin point (0 0 0) to the point ( 1 2 3)

    Notation. Points in R3 will be denoted by ( 1 2 3) and vectors will berepresented by either row or column vectors:

    = [ 1 2 3] indicates a row vector

    a =1

    2

    3

    indicates a column vector

    a = [ 1 2 3] is called the transpose of the column vector a so that a =

    47

  • 48 CHAPTER 2. VECTORS IN SPACE

    Figure 2.1.1: Point in Space

    Example 2.1.1. The standard unit basis vectors are

    = [1 0 0] or e1 =100

    ,

    = [0 1 0] or e2 =010

    and

    = [0 0 1] or e3 =001

    Any vector can be represented as a linear combination of unit basis vectors

    = [ 1 2 3] = 1 + 2 + 3 or

    a =1

    2

    3

    = 1e1 + 2e2 + 3e3

    For example, if = [2 3 4], then either by row vectors

    = 2 + 3 + 4 or by column vectors

    a = 2e1 + 3e2 + 4e3

    These vectors are depicted in Figure 2.1.2.The movement of a mass in space is described by vectors with three compo-

    nents such as displacement, force, velocity and acceleration vectors. Newtons

  • 2.1. VECTORS AND DOT PRODUCT 49

    Figure 2.1.2: Vector in Space

    law of motion in space can be derived by applying it to each of the three direc-tions

    1 =1

    2 =2and 3 =

    3

    where is the mass, = [ 1 2 3] is the force vector and = [ 1 2 3]is the velocity vector. In vector notation this means

    = [ 1 2 3]

    = [1 2 3

    ]

    = where

    = [1 2 3

    ] is the acceleration vector.

    2.1.1 Vector Operations

    Vectors can be scaled, added and subtracted by either viewing the vectorsgeometrically or as symbolic objects. Two non-parallel vectors in space forma plane in space so that the geometric approach to these operations is similarto vectors with two components. Figure 2.1.3 illustrates vector addition and

    scaling by either elongating or shrinking the vector. Two vectors and

    can be added by moving vector parallel to its original position so that its

  • 50 CHAPTER 2. VECTORS IN SPACE

    Figure 2.1.3: Vector Addition in Space

    beginning point is the end point of vector . The addition + corresponds

    to the diagonal of the parallelogram formed by vectors and . If is

    added to , then the subtraction is the other diagonal from the end of

    to the end of

    Definitions 2.1.2. Let = [ 1 2 3], = [ 1 2 3] and 0 = [0 0 0]

    be the zero vector. equals means 1 = 1, 2 = 2 and 3 = 3 Theaddition of two vectors is another vector whose components are the sum of thecomponents of the two vectors

    + [ 1 + 1 2 + 2 3 + 3 ]

    Let be a real number. The scalar product of a vector is another vector whosecomponents are the scalar times the components of the vector

    [ 1 2 3 ]

    The following theorem lists some basic algebraic properties of the above oper-ations for vectors in space R3 which are analogous to those in the plane R2.

  • 2.1. VECTORS AND DOT PRODUCT 51

    Theorem 2.1.1 (Vector Space Properties) Let and be vectors inR3and let and b


Recommended