586
Linear Algebra for Computational Sciences and Engineering Ferrante Neri Second Edition

Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Linear Algebra for Computational Sciences and Engineering

Ferrante Neri

Second Edition

Page 2: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Linear Algebra for Computational Sciencesand Engineering

Page 3: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Ferrante Neri

Linear Algebra forComputational Sciencesand Engineering

Second Edition

Foreword by Alberto Grasso

123

Page 4: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Ferrante NeriSchool of Computer ScienceUniversity of NottinghamNottingham, UK

ISBN 978-3-030-21320-6 ISBN 978-3-030-21321-3 (eBook)https://doi.org/10.1007/978-3-030-21321-3

1st

© Springer Nature Switzerland AG 2019This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part ofthe material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,broadcasting, reproduction on microfilms or in any other physical way, and transmission or informationstorage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodologynow known or hereafter developed.The use of general descriptive names, registered names, trademarks, service marks, etc. in this publicationdoes not imply, even in the absence of a specific statement, that such names are exempt from the relevantprotective laws and regulations and therefore free for general use.The publisher, the authors, and the editors are safe to assume that the advice and information in this bookare believed to be true and accurate at the date of publication. Neither the publisher nor the authors orthe editors give a warranty, express or implied, with respect to the material contained herein or for anyerrors or omissions that may have been made. The publisher remains neutral with regard to jurisdictionalclaims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG.The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

edition: © Springer International Publishing Switzerland 2016

Page 5: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Счастье - это когда тебя понимают.

Happiness is to be understood.

– Георгий Полонский–(Доживём до понедельника)

– Georgi Polonsky –(We’ll Live Till Monday)

Page 6: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Foreword

Linear Algebra in Physics

The history of linear algebra can be viewed within the context of two importanttraditions.

The first tradition (within the history of mathematics) consists of the progres-sive broadening of the concept of number so to include not only positive integersbut also negative numbers, fractions and algebraic and transcendental irrationals.Moreover, the symbols in the equations became matrices, polynomials, sets and,permutations. Complex numbers and vector analysis belong to this tradition. Withinthe development of mathematics, the one was concerned not so much about solvingspecific equations but mostly about addressing general and fundamental questions.The latter were approached by extending the operations and the properties of sumand multiplication from integers to other linear algebraic structures. Different alge-braic structures (lattices and Boolean algebra) generalized other kinds of operations,thus allowing to optimize some non-linear mathematical problems. As a first exam-ple, lattices were generalizations of order relations on algebraic spaces, such as setinclusion in set theory and inequality in the familiar number systems (N, Z, Q, andR). As a second example, Boolean algebra generalized the operations of intersectionand union and the principle of duality (De Morgan’s relations), already valid in settheory, to formalize the logic and the propositions’ calculus. This approach to logicas an algebraic structure was much similar as the Descartes’ algebra approach tothe geometry. Set theory and logic have been further advanced in the past centuries.In particular, Hilbert attempted to build up mathematics by using symbolic logicin a way that could prove its consistency. On the other hand, Gödel proved that inany mathematical system, there will always be statements that can never be proveneither true or false.

The second tradition (within the history of physical science) consists of thesearch for mathematical entities and operations that represent aspects of the phys-ical reality. This tradition played a role in the Greek geometry’s bearing and itsfollowing application to physical problems. When observing the space around us,

vii

Page 7: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

viii Foreword

we always suppose the existence of a reference frame, identified with an ideal ‘rigidbody’, in the part of the universe in which the system we want to study evolves(e.g. a three axes system having the sun as their origin and direct versus three fixedstars). This is modelled in the so-called Euclidean affine space. A reference frame’schoice is purely descriptive at a purely kinematic level. Two reference frames haveto be intuitively considered distinct if the correspondent ‘rigid bodies’ are in relativemotion. Therefore, it is important to fix the links (linear transformations) betweenthe kinematic entities associated with the same motion but relatives to two differentreference frames (Galileo’s relativity).

In the seventeenth and eighteenth centuries, some physical entities needed a newrepresentation. This necessity made the above-mentioned two traditions convergeby adding quantities as velocity, force, momentum and acceleration (vectors) to thetraditional quantities as mass and time (scalars). Important ideas led to the vectors’major systems: the forces’ parallelogram concept by Galileo, the situations’ geom-etry and calculus concepts by Leibniz and by Newton and the complex numbers’geometrical representation. Kinematics studies the motion of bodies in space and intime independently on the causes which provoke it. In classical physics, the role oftime is reduced to that of a parametric independent variable. It needs also to choosea model for the body (or bodies) whose motion one wants to study. The fundamentaland simpler model is that of point (useful only if the body’s extension is smaller thanthe extension of its motion and of the other important physical quantities consideredin a particular problem). The motion of a point is represented by a curve in the tridi-mensional Euclidean affine space. A second fundamental model is the “rigid body”one, adopted for those extended bodies whose component particles do not changemutual distances during the motion.

Later developments in electricity, magnetism and optics further promoted theuse of vectors in mathematical physics. The nineteenth century marked the develop-ment of vector space methods, whose prototypes were the three-dimensional geo-metric extensive algebra by Grassmann and the algebra of quaternions by Hamiltonto, respectively, represent the orientation and rotation of a body in three dimen-sions. Thus, it was already clear how a simple algebra should meet the needs of thephysicists in order to efficiently describe objects in space and in time (in particu-lar their dynamical symmetries and the corresponding conservation laws) and theproperties of space-time itself. Furthermore, the principal characteristic of a simplealgebra had to be its linearity (or at most its multi-linearity). During the latter part ofthe nineteenth century, Gibbs based his three-dimensional vector algebra on someideas by Grassmann and by Hamilton, while Clifford united these systems into asingle geometric algebra (direct product of quaternions’ algebras). Afterwards, theEinstein’s description of the four-dimensional continuum space-time (special andgeneral relativity theories) required a tensor algebra. In the 1930s, Pauli and Diracintroduced Clifford algebra’s matrix representations for physical reasons: Pauli fordescribing the electron spin while Dirac for accommodating both the electron spinand the special relativity.

Each algebraic system is widely used in contemporary physics and is a funda-mental part of representing, interpreting and understanding the nature. Linearity in

Page 8: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Foreword ix

physics is principally supported by three ideas: Superposition Principle, DecouplingPrinciple and Symmetry Principle.

Superposition Principle. Let us suppose to have a linear problem where each Ok

is the fundamental output (linear response) of each basic input Ik. Then, both anarbitrary input as its own response can be written as a linear combination of thebasic ones, i.e. I = c1I1 + . . .+ ckIk and O = c1O1 + . . .+ ckOk.

Decoupling Principle. If a system of coupled differential equations (or differenceequations) involves a diagonalizable square matrix A, then it is useful to considernew variables x′k = Uxk with (k ∈ N;1≤ k ≤ n), where U is a unitary matrix and x′kis an orthogonal eigenvectors set (basis) of A. Rewriting the equations in terms ofthe x′k, one discovers that each eigenvector’s evolution is independent on the othersand that the form of each equation depends only on the corresponding eigenvalueof A. By solving the equations so to get each x′k as a function of time, it is alsopossible to get xk as a function of time (xk = U−1x′k) . When A is not diagonalizable(not normal), the resulting equations for x′ are not completely decoupled (Jordancanonical form), but are still relatively easy (of course, if one does not take intoaccount some deep problems related to the possible presence of resonances).

Symmetry Principle. If A is a diagonal matrix representing a linear transformationof a physical system’s state and x′k its eigenvectors’ set, each unitary transforma-tion satisfying the matrix equation UAU−1 = A (or UA = AU) is called “symmetrytransformation” for the considered physical system. Its deep meaning is to eventu-ally change each eigenvector without changing the whole set of eigenvectors andtheir corresponding eigenvalues.

Thus, special importance in computational physics is assumed by the standardmethods for solving systems of linear equations: the procedures suited for symmet-ric real matrices and the iterative methods converging fast when applied to matrixhaving its nonzero elements concentrated near the main diagonal (diagonally domi-nated matrix).

Physics has a very strong tradition about tending to focus on some essential as-pects while neglecting other important issues. For example, Galileo founded themechanics neglecting friction, despite its important effect on mechanics. The state-ment of Galileo’s inertia law (Newton’s first law, i.e. ‘An object not affected byforces moves with constant velocity’) is a pure abstraction, and it is approximatelyvalid. While modelling, a popular simplification has been for centuries the search ofa linear equation approximating the nature. Both ordinary and partial linear differ-ential equations appear through classical and quantum physics, and even where theequations are non-linear, linear approximations are extremely powerful. For exam-ple, thanks to Newton’s second law, much of classical physics is expressed in termsof second-order ordinary differential equations’ systems. If the force is a position’slinear function, the resulting equations are linear (m d2x

dt2 = −Ax, where A matrixnot depending on x). Every solution may be written as a linear combination of thespecial solutions (oscillation’s normal modes) coming from eigenvectors of the Amatrix. For non-linear problems near equilibrium, the force can always be expanded

Page 9: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

x Foreword

as a Taylor’s series, and the leading (linear) term is dominant for small oscillations.A detailed treatment of coupled small oscillations is possible by obtaining a diag-onal matrix of the coefficients in N coupled differential equations by finding theeigenvalues and the eigenvectors of the Lagrange’s equations for coupled oscilla-tors. In classical mechanics, another example of linearization consists of lookingfor the principal moments and principal axes of a solid body through solving theeigenvalues’ problem of a real symmetric matrix (inertia tensor). In the theory ofcontinua (e.g. hydrodynamics, diffusion and thermal conduction, acoustic, electro-magnetism), it is (sometimes) possible to convert a partial differential equation intoa system of linear equations by employing the finite difference formalism. That endsup with a diagonally dominated coefficients’ matrix. In particular, Maxwell’s equa-tions of electromagnetism have an infinite number of degrees of freedom (i.e. thevalue of the field at each point), but the Superposition Principle and the DecouplingPrinciple still apply. The response to an arbitrary input is obtained as the convolutionof a continuous basis of Dirac δ functions and the relevant Green’s function.

Even without the differential geometry’s more advanced applications, the basicconcepts of multilinear mapping and tensor are used not only in classical physics(e.g. inertia and electromagnetic field tensors) but also in engineering (e.g. dyadic).

In particle physics, it was important to analyse the problem of neutrino oscil-lations, formally related both to the Decoupling and the Superposition Principles.In this case, the three neutrino mass matrices are not diagonal and not normal inthe so-called gauge states’ basis. However, through a bi-unitary transformation (oneunitary transformation for each “parity” of the gauge states), it is possible to getthe eigenvalues and their own eigenvectors (mass states) which allow to render itdiagonal. After this transformation, it is possible to obtain the Gauge States as asuperposition (linear combination) of mass states.

Schrödinger’s linear equation governs the nonrelativistic quantum mechanics,and many problems are reduced to obtain a diagonal Hamiltonian operator. Besides,when studying the quantum angular momentum’s addition, one considers Clebsch-Gordon coefficients related to an unitary matrix that changes a basis in a finite-dimensional space.

In experimental physics and statistical mechanics (stochastic methods’ frame-work), researchers encounter symmetric, real positive definite and thus diagonaliz-able matrices (so-called covariance or dispersion matrix). The elements of a covari-ance matrix in the i, j positions are the covariances between ith and jth elementsof a random vector (i.e. a vector of random variables, each with finite variance).Intuitively, the variance’s notion is so generalized to multiple dimension.

The geometrical symmetry’s notion played an essential part in constructing sim-plified theories governing the motion of galaxies and the microstructure of matter(quarks’ motion confined inside the hadrons and leptons’ motion). It was not untilthe Einstein’s era that the discovery of the space-time symmetries of the funda-mental laws and the meaning of their relations to the conservation laws were fullyappreciated, for example, Lorentz transformations, Noether’s theorem and Weyl’scovariance. An object with a definite shape, size, location and orientation consti-tutes a state whose symmetry properties are to be studied. The higher its “degree of

Page 10: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Foreword xi

symmetry” (and the number of conditions defining the state is reduced), the greateris the number of transformations that leave the state of the object unchanged.

While developing some ideas by Lagrange, by Ruffini and by Abel (among oth-ers), Galois introduced important concepts in group theory. This study showed thatan equation of order n ≥ 5 cannot, in general, be solved by algebraic methods. Hedid this by showing that the functional relations among the roots of an equation havesymmetries under the permutations of roots. In the 1850s, Cayley showed that everyfinite group is isomorphic to a certain permutation group (e.g. the crystals’ geomet-rical symmetries are described in finite groups’ terms). Fifty years after Galois, Lieunified many disconnected methods of solving differential equations (evolved overabout two centuries) by introducing the concept of continuous transformation of agroup in the theory of differential equations. In the 1920s, Weyl and Wigner recog-nized that certain group theory’s methods could be used as a powerful analytical toolin quantum physics. In particular, the essential role played by Lie’s groups, e.g. ro-tation isomorphic groups SO(3) and SU (2), was first emphasized by Wigner. Theirideas have been used in many contemporary physics’ branches which range fromthe theory of solids to nuclear physics and particle physics. In classical dynamics,the invariance of the equations of motion of a particle under the Galilean transfor-mation is fundamental in Galileo’s relativity. The search for a linear transformationleaving “formally invariant” the Maxwell’s equations of electromagnetism led to thediscovery of a group of rotations in space-time (Lorentz transformation).

Frequently, it is important to understand why a symmetry of a system is ob-served to be broken. In physics, two different kinds of symmetry breakdown areconsidered. If two states of an object are different (e.g. by an angle or a simplephase rotation) but they have the same energy, one refers to ‘spontaneous symmetrybreaking’. In this sense, the underlying laws of a system maintain their form (La-grange’s equations are invariant) under a symmetry transformation, but the systemas a whole changes under such transformation by distinguishing between two ormore fundamental states. This kind of symmetry breaking, for example, character-izes the ferromagnetic and the superconductive phases, where the Lagrange function(or the Hamiltonian function, representing the energy of the system) is invariant un-der rotations (in the ferromagnetic phase) and under a complex scalar transformation(in the superconductive phase). On the contrary, if the Lagrange function is not in-variant under particular transformations, the so-called ‘explicit symmetry breaking’occurs. For example, this happens when an external magnetic field is applied to aparamagnet (Zeeman’s effect).

Finally, by developing the determinants through the permutations’ theory andthe related Levi-Civita symbol, one gains an important and easy calculation tool formodern differential geometry, with applications in engineering as well as in modernphysics. This is the case in general relativity, quantum gravity, and string theory.

We can therefore observe that the concepts of linearity and symmetry aided tosolve many physical problems. Unfortunately, not the entire physics can be straight-forwardly modelled by linear algebra. Moreover, the knowledge of the laws amongthe elementary constituents of a system does not implicate an understanding of theglobal behaviour. For example, it is not easy at all to deduce from the forces acting

Page 11: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

xii Foreword

between the water’s molecules because the ice is lighter than water. Statistical me-chanics, which was introduced between the end of the nineteenth century and thebeginning of the twentieth century (the work by Boltzmann and Gibbs), deals withthe problem of studying the behaviour of systems composed of many particles with-out determining each particle’s trajectory but by probabilistic methods. Perhaps, themost interesting result of statistical mechanics consists of the emergence of collec-tive behaviours: while the one cannot say whether the water is in the solid or liquidstate and which is the transition temperature by observing a small number of atoms,clear conclusions can be easily reached if a large number of atoms are observed(more precisely when the number of atoms tends to infinity). Phase transitions aretherefore created as a result of the collective behaviour of many components.

The latter is an example of a physical phenomenon which requires a mathemati-cal instrument different from linear algebra. Nonetheless, as mentioned above, linearalgebra and its understanding is one of the basic foundations for the study of physics.A physicist needs algebra either to model a phenomenon (e.g. classical mechanics)or to model a portion of phenomenon (e.g. ferromagnetic phenomena) or to use it asa basic tool to develop complex modern theories (e.g. quantum field theory).

This book provides the readers the basics of modern linear algebra. The bookis organized with the aim of communicating to a wide and diverse range of back-grounds and aims. The book can be of great use to students of mathematics, physics,computer science, and engineering as well as to researchers in applied scienceswho want to enhance their theoretical knowledge in algebra. Since a prior rigorousknowledge about the subject is not assumed, the reader may easily understand howlinear algebra aids in numerical calculations and problems in different and diversetopics of mathematics, physics, engineering and computer science.

I found this book a pleasant guide throughout linear algebra and an essentialvademecum for the modern researcher who needs to understand the theory buthas also to translate theoretical concepts into computational implementations. Theplethora of examples make the topics, even the most complex, easily accessible tothe most practical minds. My suggestion is to read this book, consult it when neededand enjoy it.

Catania, Italy Alberto GrassoApril 2016

Page 12: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Preface to the Second Edition

The first edition of this book has been tested in the classroom over three academicyears. As a result, I had the opportunity to reflect on my communication skills andteaching clarity.

Besides correcting the normal odd typos and minor mistakes, I decided to re-write many proofs which could be explained in a clearer and more friendly way.Every change to the book has been made by taking into great consideration thereactions of the students as well as their response in terms of learning. Many sectionsthroughout the book have been rephrased, some sections have been reformulated,and a better notation has been used. The second edition contains over 150 pages ofnew material, including theory, illustrations, pseudocodes and examples throughoutthe book summing up to more than 500.

New topics have been added in the chapters about matrices, vector spaces andlinear mapping. However, numerous additions have been included throughout thetext. The section about Euclidean spaces has been now removed from the chap-ter about vector spaces and placed in a separated introductory chapter about innerproduct spaces. Finally, a section at the end of the book showing the solutions to theexercises placed at the end of each chapter has been included.

In its new structure, this book is divided still into two parts: Part I illustrates basictopics in algebra, while Part II presents more advanced topics.

Part I is composed of six chapters. Chapter 1 introduces the basic notation, con-cepts and definitions in algebra and set theory. Chapter 2 describes theory and appli-cations about matrices. Chapter 3 analyses systems of linear equation by focussingon analytic theory as well as numerical methods. Chapter 4 introduces vectors witha reference to the three-dimensional space. Chapter 5 discusses complex numbersand polynomials as well as the fundamental theorem of algebra. Chapter 6 intro-duces the conics from the perspective of algebra and matrix theory.

Part II is composed of seven chapters. Chapter 7 introduces algebraic structuresand offers an introduction to group and ring theories. Chapter 8 analyses vectorspaces. Chapter 9 introduces inner product spaces with an emphasis on Euclideanspaces. Chapter 10 discusses linear mappings. Chapter 11 offers a gentle introduc-tion to complexity and algorithm theory. Chapter 12 introduces graph theory and

xiii

Page 13: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

xiv Preface to the Second Edition

presents it from the perspective of linear algebra. Finally, Chap. 13 provides an ex-ample on how all linear algebra studied in the previous chapters can be used inpractice in an example about electrical engineering.

In Appendix A, Boolean algebra is presented as an example of non-linear alge-bra. Appendix B outlines some proofs to theorems stated in the book chapters butwhere the proof was omitted since it required a knowledge of calculus and mathe-matical analysis which was beyond the scope of this book.

I feel that the book, in its current form, is a substantially improved version ofthe first edition. Although the overall book structure and style remained broadly thesame, the new way to present and illustrate the concept makes the book accessible toa broad audience, guiding them towards a higher education level of linear algebra.

As the final note, the second edition of this book has been prepared with theaim of making Algebra accessible and easily understandable to anybody who has aninterest in mathematics and wants to devote some effort to it.

Nottingham, UK Ferrante NeriApril 2019

Page 14: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Preface to the First Edition

Theory and practice are often seen as entities in opposition characterizing two dif-ferent aspects of the world knowledge. In reality, applied science is based on thetheoretical progress. On the other hand, the theoretical research often looks at theworld and practical necessities to be developed. This book is based on the idea thattheory and practice are not two disjointed worlds and that the knowledge is intercon-nected matter. In particular, this book presents, without compromising on mathemat-ical rigour, the main concepts of linear algebra from the viewpoint of the computerscientist, the engineer, and anybody who will need an in depth understanding of thesubject to let applied sciences progress. This book is oriented to researchers andgraduate students in applied sciences but is also organized as a textbook suitable tocourses of mathematics.

Books of algebra are either extremely formal, thus will not be enough intuitivefor a computer scientist/engineer, or trivial undergraduate textbooks, without an ad-equate mathematical rigour in proofs and definitions. “Linear Algebra for Computa-tional Sciences and Engineering” aims at maintaining a balance between rigour andintuition, attempting to provide the reader with examples, explanations, and prac-tical implications of every concept introduced and every statement proved. Whenappropriate, topics are also presented as algorithms with associated pseudocode. Onthe other hand, the book does not contain logical skips or intuitive explanations toreplace proofs.

The “narration” of this book is thought to flow as a story of (a part of) the math-ematical thinking. This story affected, century after century, our brain and broughtus to the modern technological discoveries. The origin of this knowledge evolutionis imagined to be originated in the stone age when some caveman/cavewoman hadthe necessity to assess how many objects he/she was observing. This conceptual-ization, happened at some point in our ancient history, has been the beginning ofmathematics, but also of logics, rational thinking, and somehow technology.

The story narrated in this book is organized into two parts composed of six chap-ters each, thus twelve in total. Part I illustrates basic topics in algebra which couldbe suitable for an introductory university module in Algebra while Part II presentsmore advanced topics that could be suitable for a more advance module. Further-

xv

Page 15: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

xvi Preface to the First Edition

more, this book can be read as a handbook for researchers in applied sciences as thedivision into topics allows an easy selection of a specific topic of interest.

Part I opens with Chap. 1 which introduces the basic concepts and definitions inalgebra and set theory. Definitions and notation in Chap. 1 are used in all the sub-sequent chapters. Chapter 2 deals with matrix algebra introducing definitions andtheorems. Chapter 3 continues the discussion about matrix algebra by explainingthe theoretical principles of systems of linear equations as well as illustrating someexact and approximate methods to solve them. Chapter 4, after having introducedvectors in an intuitive way as geometrical entities, progressively abstracts and gen-eralizes this concept leading to algebraic vectors which essentially require the solu-tion of systems of linear equations and are founded on matrix theory. The narrationabout vectors leads to Chap. 5 where complex numbers and polynomials are dis-cussed. Chapter 5 gently introduces algebraic structures by providing statement andinterpretation for the fundamental theorem of algebra. Most of knowledge achievedduring the first five chapters is proposed again in Chap. 6 where conics are intro-duced and explained. It is shown how a conic has, besides its geometrical meaning,an algebraic interpretation and is thus equivalent to a matrix.

In a symmetric way, Part II opens with an advanced introduction to algebra byillustrating basic algebraic structures in Chap. 7. Group and ring theories are intro-duced as well as the concept of field which constitutes the basics for Chap. 8 wherevector spaces are presented. Theory of vector spaces is described from a theoreticalviewpoint as well as with reference to their physical/geometrical meaning. Thesenotions are then used within Chap. 10 which deals with linear mappings, endomor-phism, and eigenvalues. In Chaps. 8 and 10 the connections with matrix and vectoralgebra is self-evident. The narration takes a break in Chap. 11 where some logi-cal instruments for understanding the final chapters are introduced. These conceptsare the basics of complexity theory. While introducing these concepts it is shownthat algebra is not only an abstract subject. On the contrary, the implementationof algebraic techniques has major practical implications which must be taken intoaccount. Some simple algebraic operations are revisited as instructions to be exe-cuted within a machine. Memory and operator representations are also discussed.Chapter 12 discusses graph theory and emphasizes the equivalence between a graphand a matrix/vector space. Finally Chap. 13 introduces electrical networks as alge-braic entities and shows how an engineering problem is the combination of multiplemathematical (in this case algebraic) problems. It is emphasized that the solutionof an electric network incorporates graph theory, vector space theory, matrix the-ory, complex numbers, and systems of linear equations, thus covering all the topicspresented within all the other chapters.

I would like express my gratitude to my long-standing friend Alberto Grassowho inspired me with precious comments and useful discussions. As a theoreticalphysicist, he offered me a different perspective of Algebra which is more thoroughlyexplained in the Foreword written directly by himself.

Furthermore, I would like to thank my colleagues of the Mathematics Team atDe Montfort University, especially Joanne Bacon, Michéle Wrightham, and FabioCaraffini for support and feedback.

Page 16: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Preface to the First Edition xvii

Last but not least, I wish to thank my parents, Vincenzo and Anna Maria, for thecontinued patience and encouragement during the writing of this book.

As a final note, I hope this book will be a source of inspiration for young minds.To the youngest readers who are approaching Mathematics for the first time withthe present book I would like to devote a thought. The study of Mathematics issimilar to running of a marathon: it requires intelligence, hard work, patience, anddetermination, where the latter three are as important as the first one. Understand-ing mathematics is a lifetime journey which does not contain short-cuts but can becompleted only mile by mile, if not step by step. Unlike the marathon, the studyof mathematics does not have a clear and natural finish line. However, it has theartificial finish lines that the society imposes to us such as an exam, the publicationof an article, a funding bid, a national research exercise etc. Like in a marathon,the study of mathematics contains easier and harder stretches, comfortable downhilland nasty uphill bends. In a marathon, like in the study of mathematics, the mostimportant point is the focus on the personal path, the passion towards the goal, andto persevere despite of the difficulties.

This book is meant to be a training guide towards an initial understanding oflinear and abstract algebra and possibly a first or complementary step towards betterresearch in Computational Sciences and Engineering.

I wish to readers a fruitful and enjoyable time reading this book.

Leicester, UK Ferrante NeriApril 2016

Page 17: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Contents

Part I Foundations of Linear Algebra

1 Basic Mathematical Thinking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Axiomatic System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.3 Basic Definitions in Set Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3.1 Order and Equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.5 Number Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.6 A Preliminary Introduction to Algebraic Structures . . . . . . . . . . . . . 17

2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.1 Numeric Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.2 Basic Definitions About Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222.3 Matrix Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.4 Determinant of a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2.4.1 Linear Dependence of Row and Column Vectorsof a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2.4.2 Properties of the Determinant . . . . . . . . . . . . . . . . . . . . . . . . . 372.4.3 Submatrices, Cofactors and Adjugate Matrices . . . . . . . . . . 412.4.4 Laplace Theorems on Determinants . . . . . . . . . . . . . . . . . . . . 44

2.5 Invertible Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462.6 Orthogonal Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542.7 Rank of a Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

3 Systems of Linear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753.1 Solution of a System of Linear Equations . . . . . . . . . . . . . . . . . . . . . 753.2 Homogeneous Systems of Linear Equations . . . . . . . . . . . . . . . . . . . 853.3 Direct Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

3.3.1 Gaussian Elimination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923.3.2 Pivoting Strategies and Computational Cost . . . . . . . . . . . . . 99

xix

Page 18: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

xx Contents

3.3.3 LU Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1023.3.4 Equivalence of Gaussian Elimination and LU

Factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083.4 Iterative Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

3.4.1 Jacobi’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1123.4.2 Gauss-Seidel’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1173.4.3 The Method of Successive Over Relaxation . . . . . . . . . . . . . 1213.4.4 Numerical Comparison Among the Methods and

Convergence Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

4 Geometric Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1334.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1334.2 Linear Dependence and Linear Independence . . . . . . . . . . . . . . . . . . 1384.3 Matrices of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1504.4 Bases of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1544.5 Products of Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

5 Complex Numbers and Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1695.1 Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1695.2 Complex Vectors, Matrices and Systems of Linear Equation . . . . . . 1775.3 Complex Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

5.3.1 Operations of Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . 1835.3.2 Roots of Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

5.4 Partial Fractions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

6 An Introduction to Geometric Algebra and Conics . . . . . . . . . . . . . . . . 2036.1 Basic Concepts: Lines in the Plane . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

6.1.1 Equations of the Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2036.1.2 Intersecting Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2066.1.3 Families of Straight Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

6.2 An Intuitive Introduction to the Conics . . . . . . . . . . . . . . . . . . . . . . . . 2116.3 Analytical Representation of a Conic . . . . . . . . . . . . . . . . . . . . . . . . . 2126.4 Simplified Representation of Conics . . . . . . . . . . . . . . . . . . . . . . . . . . 213

6.4.1 Simplified Representation of Degenerate Conics . . . . . . . . . 2136.4.2 Simplified Representation of Non-degenerate Conics . . . . . 214

6.5 Matrix Representation of a Conic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2246.5.1 Intersection with a Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2256.5.2 Line Tangent to a Conic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2276.5.3 Degenerate and Non-degenerate Conics: A Conic as a

Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2286.5.4 Classification of a Conic: Asymptotic Directions of a

Conic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2306.5.5 Diameters, Centres, Asymptotes, and Axes of Conics . . . . . 2366.5.6 Canonic Form of a Conic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

Page 19: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Contents xxi

Part II Elements of Linear Algebra

7 An Overview on Algebraic Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . 2537.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2537.2 Semigroups and Monoids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2547.3 Groups and Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

7.3.1 Cosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2607.3.2 Equivalence and Congruence Relation . . . . . . . . . . . . . . . . . . 2627.3.3 Lagrange’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266

7.4 Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2697.4.1 Cancellation Law for Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . 2737.4.2 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

7.5 Homomorphisms and Isomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . 276

8 Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2818.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2818.2 Vector Subspaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2828.3 Linear Dependence in n Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . 2928.4 Linear Span . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2968.5 Basis and Dimension of a Vector Space . . . . . . . . . . . . . . . . . . . . . . . 3048.6 Row and Column Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

9 An Introduction to Inner Product Spaces: Euclidean Spaces . . . . . . . 3259.1 Basic Concepts: Inner Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3259.2 Euclidean Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3269.3 Euclidean Spaces in Two Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . 3299.4 Gram-Schmidt Orthonormalization . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

10 Linear Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33910.1 Introductory Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33910.2 Linear Mappings and Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . 34410.3 Endomorphisms and Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34710.4 Rank and Nullity of Linear Mappings . . . . . . . . . . . . . . . . . . . . . . . . . 355

10.4.1 Matrix Representation of a Linear Mapping . . . . . . . . . . . . . 36210.4.2 A Linear Mapping as a Matrix: A Summarizing Scheme . . 36810.4.3 Invertible Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36910.4.4 Similar Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37110.4.5 Geometric Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377

10.5 Eigenvalues, Eigenvectors, and Eigenspaces . . . . . . . . . . . . . . . . . . . 38110.5.1 Method for Determining Eigenvalues and Eigenvectors . . . 384

10.6 Matrix Diagonalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39510.6.1 Diagonalization of a Symmetric Mapping . . . . . . . . . . . . . . . 403

10.7 Power Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

Page 20: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

xxii Contents

11 An Introduction to Computational Complexity . . . . . . . . . . . . . . . . . . . 41911.1 Complexity of Algorithms and Big-O Notation . . . . . . . . . . . . . . . . . 41911.2 P, NP, NP-Hard, NP-Complete Problems . . . . . . . . . . . . . . . . . . . . . . 42311.3 Representing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

11.3.1 Huffman Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42611.3.2 Polish and Reverse Polish Notation . . . . . . . . . . . . . . . . . . . . 430

12 Graph Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43312.1 Motivation and Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43312.2 Eulerian and Hamiltonian Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44412.3 Bipartite Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44912.4 Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450

12.4.1 Trees and Cotrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45712.4.2 Euler’s Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461

12.5 Graph Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46312.5.1 Adjacency Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46412.5.2 Incidence Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46812.5.3 Cycle Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47412.5.4 Cut-Set Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48212.5.5 Relation Among Fundamental Matrices . . . . . . . . . . . . . . . . 485

12.6 Graph Isomorphisms and Automorphisms . . . . . . . . . . . . . . . . . . . . . 48912.7 Some Applications of Graph Theory . . . . . . . . . . . . . . . . . . . . . . . . . . 492

12.7.1 The Social Network Problem . . . . . . . . . . . . . . . . . . . . . . . . . 49212.7.2 The Four Colour Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49412.7.3 Travelling Salesman Problem . . . . . . . . . . . . . . . . . . . . . . . . . 49412.7.4 The Chinese Postman Problem . . . . . . . . . . . . . . . . . . . . . . . . 49512.7.5 Applications to Sociology or to the Spread of Epidemics . . 495

13 Applied Linear Algebra: Electrical Networks . . . . . . . . . . . . . . . . . . . . . 49913.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49913.2 Bi-poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500

13.2.1 Passive Bi-poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50013.2.2 Active Bi-poles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502

13.3 Electrical Networks and Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50413.3.1 Bi-poles in Series and Parallel . . . . . . . . . . . . . . . . . . . . . . . . 50413.3.2 Kirchoff’s Laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50513.3.3 Phasorial Representation of Electrical Quantities . . . . . . . . . 50713.3.4 Impedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509

13.4 Solving Electrical Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51113.5 Remark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517

A A Non-linear Algebra: An Introduction to Boolean Algebra . . . . . . . . 519A.1 Basic Logical Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519A.2 Properties of Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521A.3 Boolean Algebra in Algebraic Structures . . . . . . . . . . . . . . . . . . . . . . 522

Page 21: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Contents xxiii

A.4 Composed Boolean Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523A.5 Crisp and Fuzzy sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524

B Proofs of Theorems That Require Further Knowledgeof Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527

Solutions to the Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567

Page 22: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

About the Author

Ferrante Neri received his master’s degree and a PhD in Electrical Engineeringfrom the Technical University of Bari, Italy, in 2002 and 2007 respectively. In 2007,he also received a PhD in Scientific Computing and Optimization from the Uni-versity of Jyväskylä, Finland. From the latter institution, he received the DSc de-gree in Computational Intelligence in 2010. He was appointed Assistant Professorin the Department of Mathematical Information Technology at the University ofJyväskylä, Finland, in 2007, and in 2009 as a Research Fellow with the Academyof Finland. Dr. Neri moved to De Montfort University, United Kingdom, in 2012,where he was appointed Reader in Computational Intelligence and, in 2013, pro-moted to Full Professor of Computational Intelligence Optimization. Since 2019Ferrante Neri moved to the School of Computer Science, University of Notting-ham, United Kingdom. Ferrante Neri’s teaching expertise lies in mathematics forcomputer science. He has a specific long lasting experience in teaching linear andabstract algebra. His research interests include algorithmics, hybrid heuristic-exactoptimization, scalability in optimization and large-scale problems.

xxv

Page 23: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Part IFoundations of Linear Algebra

Page 24: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 1Basic Mathematical Thinking

1.1 Introduction

Mathematics, from the Greek word “mathema”, is simply translated as science orexpression of the knowledge. Regardless of the fact that mathematics is somethingthat exists in our brain as well as in the surrounding nature and we discover it littleby little or an invention/abstraction of a human brain, mathematics has been with uswith our capability of thinking and is the engine of human progress.

Although it is impossible to determine the beginning of mathematics in the his-tory, at some point in the stone-age some caveman/cavewoman probably asked tohimself how many objects (stones, trees, fruits) he/she was looking at. In order tomark the amount, he/she used a gesture with the hands where each gesture corre-sponded to a certain amount. That caveman who made this for first, is the one whoinvented/discovered the concept of enumeration, that is closely related to the con-cepts of set and its cardinality. The most natural gesture I can think is to lift a fingerfor each object taken into account. This is probably a common opinion and, sincewe totally have ten fingers in our hands, is the reason why our numeral system isbase 10.

Obviously, mathematics is much more than enumeration as it is a logical thinkingsystem in which the entire universe can potentially be represented and lives aside,at an abstract level, even when there is no physically meaningful representation.

This book offers a gentle introduction to mathematics and especially to linearalgebra (from Arabic al-gabr = connection), that traditionally is the discipline thatconnects quantities (numbers) to symbol (letters) in order to extract general rules.Algebra, as well as mathematics is based on a set of initial rules that are consideredbasic system of truth that is the basis of all the further discoveries. This system isnamed Axiomatic System.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_1

3

Page 25: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4 1 Basic Mathematical Thinking

1.2 Axiomatic System

A concept is said to be primitive when it cannot be rigorously defined since itsmeaning is intrinsically clear. An axiom or postulate is a premise or a starting pointfor reasoning. Thus, an axiom is a statement which appears unequivocally true andthat does not require any proof to be verified but cannot be, in any way, falsified.

Primitive concepts and axioms compose the axiomatic system. The axiomaticsystem is the ground onto the entire mathematics is built. On the basis of thisground, a definition is a statement that introduces a new concept/object by usingpreviously known concepts (and thus primitive concepts are necessary for definingnew ones). When the knowledge can be extended on the basis of previously es-tablished statements, this knowledge extension is named theorem. The previouslyknown statements are the hypotheses while the extension is the thesis. A theoremcan be expressed in the form: “if the hypotheses are verified then the thesis occurs”.In some cases, the theorem is symmetric, i.e. besides being true that “if the hypothe-ses are verified then the thesis occurs” it is also true that “if the thesis is verified thenthe hypotheses occur”. More exactly, if A and B are two statements, a theorem ofthis kind can be expressed as “if A is verified than B occurs and if B is verified thenA occurs”. In other words the two statements are equivalent since the truth of one ofthem automatically causes the truth of the other. In this book, theorems of this kindwill be expressed in the form “A is verified if and only if B is verified”.

The set of logical steps to deduce the thesis on the basis of the hypotheses is herereferred as mathematical proof or simply proof. A large number of proof strategiesexist. In this book, we will use only the direct proof, i.e. from the hypotheses we willlogically arrive to the thesis or by contradiction (or reductio ad absurdum), i.e. thenegated thesis will be new hypothesis that will lead to a paradox. A successful proofis indicated with the symbol ��. It must be remarked that a theorem that states theequivalence of two facts requires two proofs. More specifically, a theorem of thekind ‘A is verified if and only if B is verified” is essentially two theorems in one.Hence, the statements “if A is verified than B occurs” and “if B is verified then Aoccurs” require two separate proofs.

A theorem that enhances the knowledge by achieving a minor result that is thenusable to prove a major result is called lemma while a minor result that uses a majortheorem to be proved is called corollary. A proved result that is not as important asa theorem is called proposition.

1.3 Basic Definitions in Set Theory

The first important primitive concept of this book is the set that without mathemat-ical rigour is here defined as a collection of objects that share a common feature.These objects are the elements of the set. Let us indicate with A a generic set and

Page 26: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.3 Basic Definitions in Set Theory 5

with x its element. In order to indicate that x is an element of A, we will write x ∈ A(otherwise x /∈ A).

Definition 1.1. Two sets A and B are said to be coincident if every element of A isalso an element of B and every element of B is also an element of A.

Definition 1.2. The cardinality of a set A is the number of elements contained in A.

Definition 1.3. A set A is said empty and indicated with /0 when it does not containany element.

Definition 1.4. Universal Quantifier. In order to indicate all the elements x of a setA, we will write ∀x ∈ A.

If a proposition is applied to all the elements of the set, the statement “for all theelements of A it follows that” is synthetically written as ∀x ∈ A :.

Definition 1.5. Existential Quantifier. In order to indicate that it exists at least oneelement x of a set A, we will write ∃x ∈ A. If we want to specify that only oneelement exists we will use the symbol ∃!.

If we want to state that “it exists at least one element of A such that” we willwrite ∃x ∈ A� ‘.

The statement ∀x ∈ /0 is perfectly meaningful (and it is equivalent to “for noelements”) while the statement ∃x ∈ /0 is always wrong.

Definition 1.6. Let m be the cardinality of a set B and n be the cardinality of A. Ifm≤ n and all the elements of B are also elements of A, then B is contained in A (oris a subset of A) and is indicated B⊆ A.

Definition 1.7. Let A be a set. The set composed of all the possible subsets of A(including the empty set and A itself) is said power set.

Definition 1.8. For two given sets, A and B, the intersection set C = A∩B is that setcontaining all the elements that are in both the sets A and B.

Definition 1.9. For two given sets, A and B, the union set C = A∪ B is that setcontaining all the elements that are in either or both the sets A and B.

Although proofs of set theory do not fall within the objectives of this book, inorder to have a general idea of the mathematical reasoning the proof of the followingproperty is provided.

Proposition 1.1. Associativity of the Intersection.

(A∩B)∩C = A∩ (B∩C)

Page 27: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6 1 Basic Mathematical Thinking

Proof. Let us consider a generic element x such that x∈ (A∩B)∩C. This means thatx∈ (A∩B) and x∈C which means that x∈A and x∈B and x∈C. Hence the elementx belongs to the three sets. This fact can be re-written by stating that x ∈ A andx∈ (B∩C) that is x∈A∩(B∩C). We can repeat the same operation ∀x∈ (A∩B)∩Cand thus find out that all the elements of (A∩B)∩C are also elements of A∩(B∩C).Hence, (A∩B)∩C = A∩ (B∩C). ��

Definition 1.10. For two given sets, A and B, the difference set C = A\B is that setcontaining all the elements that are in A but not in B.

Definition 1.11. For two given sets, A and B, the symmetric difference C = AΔB =(A\B)∪ (B\A) = (A∪B)\ (A∩B).

The symmetric difference set is, thus, the set of those elements that belong eitherto A or B (elements that do not belong to their intersection).

Definition 1.12. For a given set A, the complement of a set A is the set of all theelements not belonging to A. The complement of A is indicated as Ac. Complementset: Ac = {x|x /∈ A}.

Proposition 1.2. Complement of a Complement.

(Ac)c = A

Proof. Let us consider a generic element x ∈ (Ac)c. By definition, x /∈ Ac. Thismeans that x ∈ A. We can repeat the reasoning ∀x ∈ (Ac)c and find out that x ∈ A.Hence, (Ac)c = A. ��

Definition 1.13. Cartesian Product. Let A and B be two sets with n and m their re-spective cardinalities. Let us indicate each set by its elements as A = {a1,a2, . . . ,an}and B = {b1,b2, . . . ,bn}. The Cartesian product C is a new set generated by all thepossible pairs

C = A×B = {(a1,b1) ,(a1,b2) , . . . ,(a1,bm) ,

(a2,b1) ,(a2,b2) , . . . ,(a2,bm) , . . . ,

(an,b1) ,(an,b2) , . . . ,(an,bm)}

The Cartesian product A×A is indicated with A2 or in general A×A×A× . . .×A = An if A is multiplied n times.

Example 1.1. Let us consider the following two sets

A = {1,5,7}B = {2,3}.

Page 28: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.3 Basic Definitions in Set Theory 7

Let us calculate the Cartesian product A×B:

C = A×B = {(1,2) ,(1,3) ,(5,2) ,(5,3) ,(7,2) ,(7,3)}.

Example 1.2. In order to better understand the Cartesian product let us give a graph-ical example. Let us interpret the following as a set A composed of the points on thepaper needed to draw it.

A

The Cartesian product C = A×A = A2 would be graphically represented by thearea below (all the points composing the area).

A

A

Definition 1.14. Let C = A×B be a Cartesian product. A relation on C is an arbi-trary subset R ⊆C. This subset means that some elements of A relates to B accord-ing to a certain criterion R. The set A is said domain while B is said codomain. Ifx is the generic element of A and y the generic element of B. The relation can bewritten as (x,y) ∈R or xRy.

Example 1.3. With reference to the graphical example above, a relation R would beany subarea contained in the striped area C = A×A = A2. For example, a relationR is the starred ellipse below.

Page 29: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8 1 Basic Mathematical Thinking

A

A

1.3.1 Order and Equivalence

Definition 1.15. Order Relation. Let us consider a set A and a relation R on A. Thisrelation is said order relation and is indicated with if the following properties areverified.

• reflexivity: ∀x ∈ A : x x• transitivity: ∀x,y,z ∈ A : if x y and y z then x z• antisymmetry: ∀x,y ∈ A : if x y then y � x

The set A, on which the order relation is valid, is said totally ordered set.

Example 1.4. If we consider a group of people we can always sort them accordingtheirs age. Hence the relation “to not be older than” (i.e. to be younger or to have thesame age) with a set of people is a totally ordered set since every group of peoplecan be fully sorted on the basis of their age.

From the definition above, the order relation can be interpreted as a predicate tobe defined over the elements of a set. Although this is not wrong, we must recallthat, rigorously, a relation is a set and an order relation is a set with some properties.In order to emphasise this fact, let us give again the definition of order relation byusing a different notation.

Definition 1.16. Order Relation (Set Notation). Let us consider a set A and theCartesian product A×A= A2. Let R be a relation on A, that is R ⊆ A2. This relationis said order relation if the following properties are verified for the set R.

Page 30: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.3 Basic Definitions in Set Theory 9

• reflexivity: ∀x ∈ A : (x,x) ∈R• transitivity: ∀x,y,z ∈ A : if (x,y) ∈R and (y,z) ∈R then (x,z) ∈R• antisymmetry: ∀x,y ∈ A : if (x,y) ∈R then (y,x) �∈R

If the properties above are valid for all the elements of A, that is R and A2 arecoincident, then A is a totally ordered set.

Definition 1.17. Partially Ordered Set. A set A where the order relation is ver-ified to some of its elements, that is R ⊂ A2, is a partially ordered set (also namedas poset) and is indicated with (A, ).

Intuitively, a partially ordered set is a set whose elements (at least some of them)can be sorted according to a certain criterion, that is the relation .

Example 1.5. If we consider a group of people we can identify the relation “to besuccessor of”. It can be easily verified that this is an order relation as the propertiesare verified. Furthermore, in the same group of people, some individuals can also benot successors of some others. Thus, we can have groups of individuals that are inrelation with respect to the “to be successor of” order relation and some others thatare unrelated to each other. The partially ordered set can be seen as a relation thatallows the sorting of groups within a set.

Definition 1.18. Let (Y, ) be a subset of a poset (X , ). An element u in X is anupper bound of Y if y u for every element y ∈ Y . If u is an upper bound of Y suchthat u v for every other upper bound v of Y , then u is called a least upper boundor supremum of Y (sup Y ).

Example 1.6. Let us consider the set X = {1,3,5,7,9} and the set Y ⊂ X = {1,3,5}.Let us now consider the relation “to be less or equal” ≤.

We can easily verify that (Y,≤) is a poset:

• reflexivity: ∀x∈Y : x≤ x. In terms of set notation, (x,x)∈R. For example, 1≤ 1or (1,1) ∈R.

• transitivity: ∀x,y,z ∈ Y : if x ≤ y and y ≤ z then x ≤ z. For example, we can seethat 1≤ 3 and 3≤ 5. As expected, 1≤ 5.

• antisymmetry: ∀x,y ∈ Y : if x ≤ y then y � x (which means y > x). For example,we can see that 1≤ 3 and 3 > 1.

The elements 5,7,9 are all upper bounds of Y since they are all the element of Bare ≤ than them. However, only 5 is the supremum of Y since 5≤ 7 and 5≤ 9.

Definition 1.19. Let (Y, ) be a subset of a poset (X , ). An element l in X is saidto be a lower bound of Y if l y for all y ∈ Y . If l is a lower bound of Y such thatk l for every other lower bound k of Y , then l is called a greatest lower bound orinfimum of Y (inf Y ).

Page 31: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10 1 Basic Mathematical Thinking

Theorem 1.1. Let Y be a nonempty subset of a poset X (Y ⊂ X). If Y has a supre-mum, then this supremum is unique.

Proof. Let us assume by contradiction that a set Y has two suprema, u1 and u2,respectively, such that u1 �= u2. By definition of supremum ∀u ∈ X upper boundit follows that u1 u. Analogously, ∀u ∈ Y upper bound it follows that u2 u.Since both u1 and u2 are upper bounds, we would have u1 u2 and u2 u1. Thisis impossible due to the antisymmetry of the order relation. Thus, it must occur thatu1 = u2. ��

Example 1.7. With reference to Example 1.6, 5 is the only supremum.

The same proof can be done for the uniqueness of the infima.

Theorem 1.2. If Y has an infimum, this infimum is unique.

Definition 1.20. Equivalence Relation. A relation R on set A is an equivalencerelation and is indicated with ≡ if the following properties are verified.

• reflexivity: ∀x ∈ A it happens that x≡ x• symmetry: ∀x,y ∈ A if x≡ y then it also happens that y≡ x• transitivity: ∀x,y,z ∈ A if x≡ y and y≡ z then x≡ z

The equivalence relation is also given in the following alternative definition.

Definition 1.21. Equivalence Relation (Set Notation). Let us consider a set A andthe Cartesian product A×A = A2. Let R be a relation on A, that is R ⊆ A2. Thisrelation is said equivalence relation if the following properties are verified for theset R.

• reflexivity: ∀x ∈ A : (x,x) ∈R• symmetry: ∀x,y ∈ A : if (x,y) ∈R then (y,x) ∈R• transitivity: ∀x,y,z ∈ A : if (x,y) ∈R and (y,z) ∈R then (x,z) ∈R

Example 1.8. Let us consider the set A = {1,2,3} and the relation R ⊂ A2:

R = {(1,1) ,(1,2) ,(2,1) ,(2,2)}.

The relation R is not an equivalence since it is not reflexive: (3,3) �∈R.

Example 1.9. Let us give a graphical representation of the equivalence relation. Letus consider the Cartesian product A×A = A2

Page 32: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.3 Basic Definitions in Set Theory 11

A

A

an example of equivalence relation is the subset composed of the diagonal pointsand the bullet points in figure.

A

A•

••

Definition 1.22. Let R be an equivalence relation defined on A. The equivalenceclass of an element a is a set defined as

[a] = {x ∈ A|x≡ a}.

Example 1.10. The set composed of diagonal elements and bullet points of thegraphic example above (Example 1.9) is an equivalence class.

Page 33: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12 1 Basic Mathematical Thinking

Proposition 1.3. Let [a] and [b] be two equivalence classes and x ∈ [a] and y ∈ [b]two elements of the respective classes. It follows that [a] = [b] if and only if x≡ y.

This proposition means that two equivalent elements are always belonging to thesame class.

We may think of two sets such that each element of one set is equivalent to oneelement of the other set. These sets are said to be equivalent sets.

Example 1.11. Let us consider a box containing coloured balls, e.g. some red andsome blue. Let us consider the relation “to be of the same colour”. It can be eas-ily verified that this relation is an equivalence relation since reflexivity, symmetry,and transitivity are verified. An equivalence class, indicated with [r], is the set con-taining all the red balls while another equivalence class, indicated with [b], is theset containing all the blue balls. In other words, all the red balls are equivalent toeach other. Similarly, all the blue balls are equivalent to each other. The propositionabove says that if two balls are equivalent, i.e. of the same colour, they are both red(or blue), and thus belong to the same class.

1.4 Functions

Definition 1.23. Function. A relation is said to be a mapping or function when itrelates to any element of a set a unique element of another. Let A and B be two sets,a mapping f : A → B is a relation R ⊆ A×B such that ∀x ∈ A, ∀y1 and y2 ∈ B itfollows that

• (x,y1) ∈ f and (x,y2) ∈ f ⇒ y1 = y2

• ∀x ∈ A : ∃y ∈ B | (x,y) ∈ f

where the symbol : A → B indicates that the mapping puts into relationship the setA and the set B and should be read “from A to B”, while ⇒ indicates the materialimplications and should be read “it follows that”. In addition, the concept (x,y) ∈ fcan be also expressed as y = f (x).

An alternative definition of function is the following.

Definition 1.24. Let A and B be two sets, a mapping f : A → B is a relation R ⊆A×B | that satisfies the following property: ∀x ∈ A it follows that ∃!y ∈ B such that(x,y) ∈R (or, equivalently y = f (x)).

Example 1.12. The latter two definitions tell us that for example (2,3) and (2,6)cannot be both element of a function. We can express the same concept by statingthat if f (2) = 3 then it cannot happen that f (2) = 6. In other words, if we fix x = 2then we can have only one y value such that y = f (x).

Thus, although functions are often interpreted as “laws” that connect two sets,mathematically, a function is any set (subset of a Cartesian product) for which theproperty in Definition 1.24 is valid.

Page 34: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.4 Functions 13

If we consider again the caveman example, he generates a mapping betweena physical situation and the position of the fingers. More precisely, this mappingallows the relation of only one amount of object to only one position of the fingers.This means that enumeration is a special mapping f A → B that simultaneouslysatisfies the two properties described in the following two definitions.

Definition 1.25. Let f A→ B be a mapping. This mapping is said to be an injection(or the function is injective) if the function values of two different elements is alwaysdifferent: ∀x1 and x2 ∈ A if x1 �= x2 then f (x1) �= f (x2).

Example 1.13. Let us consider the set A = {0,1,2,3,4} and the Cartesian productA×A = A2. Let us consider the following function f ⊂ A2:

f = {(0,0) ,(1,1) ,(2,4) ,(3,4) ,(4,3)}.

The function f is not injective since it contains both (2,4) and (3,4). We can rewritethis statement as: although x1 �= x2 it happens that f (x1) = f (x2) where x1 = 2 andx2 = 3. Clearly, f (2) = f (3) = 4.

Definition 1.26. Let f A→ B be a mapping. This mapping is said to be a surjection(or the function is surjective) if all the elements of B are mapped by an element ofA: ∀y ∈ B it follows that ∃x ∈ A such that y = f (x).

Example 1.14. Let us consider the sets A = {0,1,2,3,4} and B = {0,1,2,7}. Let usconsider the Cartesian product A×B and the following function f ⊂ A×B:

f = {(0,0) ,(1,0) ,(2,1) ,(3,1) ,(4,2)}.

The function f is not surjective since 7 ∈ B is not mapped by the function. In otherwords, there is no element x∈A such that (x,7)∈ f (equivalently there is no elementx ∈ A such that f (x) = 7).

Definition 1.27. Let f A → B be a mapping. This mapping is said to be a bijection(or the function is bijective) when both injection and surjection are verified, i.e.when the function f is both injective and surjective.

Example 1.15. Let us consider the set A = {0,1,2,3,4} and the Cartesian productA×A = A2. Let us consider the following function f ⊂ A2 ( f : A→ A):

f = {(0,0) ,(1,1) ,(2,2) ,(3,4) ,(4,3)}.

• Since this function uses all the elements of the codomain, the function is surjec-tive.

• Since the function never takes the same value for two distinct elements of thedomain, it is injective.

Thus, the function is bijective.

Page 35: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

14 1 Basic Mathematical Thinking

Within our example, surjection says that each physical situation can be poten-tially represented (by means of a position of the fingers if up to ten objects areinvolved). Injection says that each representation is unique (and hence unambigu-ous).

It must be remarked that two sets are equivalent if a bijection between them ex-ists. In our example, the position of the fingers is thus a symbol that univocallyidentifies a quantity, i.e. the set of quantities and the set of finger positions (sym-bols) are equivalent. These symbols represent another important primitive conceptin mathematics and is called number. This concept was previously used when thecardinality of sets was introduced. The concept of a enumeration was also intu-itively introduced above as a special function which is injective and surjective (andthus bijective). The following proposition gives a formal justification of this fact.

Proposition 1.4. Let f A→ B be a mapping. Let n be the cardinality of A and m bethe cardinality of B. If f is bijective then n = m.

Proof. If f is bijective, then f is injective and surjective.Since f is injective

∀x1,x2 ∈ A with x1 �= x2 it follows that f (x1) �= f (x2) .

This means that it cannot happen that for two distinct x1 and x2 there is onlyone y = f (x1) = f (x2). On the contrary, for each pair of distinct elements of A wehave a pair of distinct elements of B. Thus, if we map the n elements of A we get nelements of B. This happens only if B contains at least n elements. This means thatthe number of elements of A cannot be greater than the number of elements of B or,in other words, n≤ m.

Since f is surjective

∀y ∈ B ∃x ∈ A such that y = f (x) .

This means that there are no elements of B which are not mapped by an elementof A. In other words, m≤ n.

Since both the properties are verified, it follows that m = n. ��

This proposition is important since it is one useful mathematical tool: in order toprove that two sets have the same cardinality, we need to find a bijection betweenthem.

1.5 Number Sets

A set can be composed of numbers, i.e. the elements of a set are numbers. In this caseit will be a number set. Before introducing number set we need one more primitiveconcept which will be the last in in this book. This concept is the infinity, indicatedas ∞. We will consider ∞ as a special number that is larger than any possible number

Page 36: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.5 Number Sets 15

we can think. Any other number but ∞ is said finite. Thanks to this introduction, wecan further characterize the sets by these definitions.

Definition 1.28. A set is said finite if its cardinality is a finite number. Conversely, aset is said infinite if its cardinality is ∞.

Definition 1.29. Let A be a number set. A is said continuous if ∀x0 ∈ A : ∃x ||x− x0|< ε , regardless how small ε is taken.

This means that a number in a continuous set is contiguously surrounded byneighbours. In other words, in a continuous set we cannot identify a minimumneighbourhood radius ε > 0 that separates two neighbour numbers. On the con-trary, when an ε > 0 can be found to separate two neighbour numbers the set issaid discrete. These definitions implicitly state that continuous sets are always infi-nite. More specifically, these sets are uncountably infinite. A discrete set composedof infinite elements is still an infinite set but in a different way as it is countablyinfinite.

Definition 1.30. Countability. A set A is said to be countably infinite if A can beput into a bijective relation with the set of natural numbers N. If the set A is infinitebut cannot be put into a bijective relation with the set of natural numbers, the set Ais uncountably infinite.

The set of natural numbers N can be defined as a discrete set {0,1,2, . . .}.Other relevant sets are:

• relative numbers Z= {. . . ,−2,−1,0,1,2 . . .}

• rational numbers Q: the set containing all the possible fractions xy where x and

y ∈ Z and y �= 0

• real numbers R: the set containing Q and all the other numbers that cannot beexpressed as fractions of relative numbers

• complex numbers C: the set of numbers that can be expressed as a+ jb wherea,b ∈ R and the imaginary unit j =

√−1, see Chap. 5.

It can be easily seen that all the number sets above except from C are totallyordered sets with respect to the relation ≤, i.e. ∀x,y we can always assess whetherx≤ y or y≤ x.

Definition 1.31. An interval is a continuous subset of R delimited by infimum andsupremum. Let a be the infimum and b the supremum, respectively. The intervalis indicated as [a,b] to denote that a and b belong to the interval. Conversely, thenotation ]a,b[ denotes that infimum and supremum do not belong to the interval.

Example 1.16. Let us consider the set X ⊂ N, {2,4,7,12} and the relation “to beless or equal” ≤. It follows that 14 is an upper bound while 12 is the supremum.The infimum is 2 while a lower bound is 1.

Page 37: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

16 1 Basic Mathematical Thinking

Example 1.17. Let us consider now the same relation and the set X ⊂ R defined as∀x ∈R such that 0≤ x≤ 1. The supremum and infimum are 1 and 0, respectively. Ifthe set is defined as ∀x ∈ R such that 0 < x < 1, still the upremum and infimum are1 and 0, respectively. Finally, if we consider the set X ⊂ R defined as ∀x ∈ R suchthat 0≤ x, this set has no supremum.

Example 1.18. Let us consider x,y∈Z\{0} and the following relation xRy: xy > 0.

• Let us check the reflexivity of this relation: xRx means xx = x2 > 0 which is true.• Let us check the symmetry: if xy > 0 then yx > 0 which is true.• Let us check the transitivity: if xy > 0 and yz > 0 then x has the same sign of

y and y has the same sign of z. It follows that x has the same sign of z. Hencexz > 0, i.e. the transitivity is verified.

This means that the relation above is an equivalence relation.

Example 1.19. Let us now consider the set N\{0}. Let us define the relation R “tobe a divisor”.

• Let us check the reflexivity of this relation: a number is always a divisor of itself.Hence the relation is reflexive.

• Let us check the symmetry: if xy = k ∈N then y

x = p = 1k which is surely not ∈N.

Hence this relation is antisymmetric.• Let us check the transitivity: if x

y = k ∈ N and yz = h ∈ N then x

z =kyhy = kh. The

product of two natural numbers is a natural number. Hence, the relation is alsotransitive.

This means that the relation above is of partial order.

Example 1.20. Let us consider x,y ∈ Z and the following relation xRy: x− y is di-vidable by 4.

• Let us check the reflexivity of this relation: x−x4 = 0 ∈ Z. Hence the relation is

reflexive.• Let us check the symmetry: if x−y

4 = k ∈ Z then y−x4 = p = −k which is ∈ Z.

Hence this relation is symmetric.• Let us check the transitivity: if x−y

4 = k ∈ Z and y−z4 = h ∈ Z then x−z

4 =x−y+y−z

4 = k+ h. The sum of these two numbers is ∈ Z. Hence, the relation isalso transitive.

This means that the relation above is an equivalence relation.

Example 1.21. Let us consider the following set

E = {(x,y) ∈ R2|(x≥ 0)AND(0≤ y≤ x)}

and the relation(a,b)R (c,d) : (a− c,b−d) ∈ E.

• Let us check the reflexivity of this relation: (a−a,b−b) = (0,0)∈ E. Hence therelation is reflexive.

Page 38: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.6 A Preliminary Introduction to Algebraic Structures 17

• Let us check the symmetry: if (a− c,b−d) ∈ E then a− c ≥ 0. If the relationis symmetric (c−a,d−b) ∈ E with c−a ≥ 0. Hence if it is symmetric a− c =c− a. This is possible only when a = c. Moreover, 0 ≤ d− b ≤ c− a = 0. Thismeans that b = d. In other words, the symmetry occurs only if the two solutionsare coincident. In all the other cases this relation is never symmetric. It is thenantisymmetric.

• Let us check the transitivity. We know that (a− c,b−d)∈E and if (c− e,d− e)∈E. For the hypothesis a−c≥ 0, c−e≥ 0, 0≤ b−d≤ a−c, and 0≤ d− f ≤ c−e.If we sum positive numbers we obtain positive numbers. Hence, (a− c+ c− e)=(a− e)≥ 0 and 0≤ b−d+d− f ≤ a−c+c−e that is 0≤ b− f ≤ a−e. Hence,the transitivity is valid.

The relation above is of partial order.

1.6 A Preliminary Introduction to Algebraic Structures

If a set is a primitive concept, on the basis of a set, algebraic structures are sets thatallow some operations on their elements and satisfy some properties. Although an indepth analysis of algebraic structures is out of the scopes of this chapter, this sectiongives basic definitions and concepts. More advanced concepts related to algebraicstructures will be given in Chap. 7.

Definition 1.32. An operation is a function f : A→ B where A⊂ X1×X2× . . .×Xk,k ∈ N. The k value is said arity of the operation.

Definition 1.33. Let us consider a set A and an operation f : A→ B. If A is X×X×. . .×X and B is X , i.e. the result of the operation is still a member of the set, the setis said to be closed with respect to the operation f .

Definition 1.34. Ring. A ring R is a set equipped with two operations called sumand product. The sum is indicated with a + sign while the product operator is simplyomitted (the product of x1 by x2 is indicated as x1x2). Both these operations processtwo elements of R and return an element of R (R is closed with respect to these twooperations). In addition, the following properties must be valid.

• commutativity (sum): x1 + x2 = x2 + x1

• associativity (sum): (x1 + x2)+ x3 = x1 +(x2 + x3)• neutral element (sum): ∃ an element 0 ∈ R such that ∀x ∈ R : x+0 = x• inverse element (sum): ∀x ∈ R : ∃(−x) |x+(−x) = 0• associativity (product): (x1x2)x3 = x1 (x2x3)• distributivity 1: x1 (x2 + x3) = x1x2 + x1x3

• distributivity 2: (x2 + x3)x1 = x2x1 + x3x1

• neutral element (product): ∃ an element 1 ∈ R such that ∀x ∈ Rx1 = 1x = x

The inverse element with respect to the sum is also named opposite element.

Page 39: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

18 1 Basic Mathematical Thinking

Definition 1.35. Let R be a ring. If in addition to the ring properties also the

• commutativity (product): x1x2 = x2x1

is valid, then the ring is said to be commutative.

Definition 1.36. Field. A field is a commutative ring which contains an inverse el-ement with respect to the product for every element of the field except 0. In otherwords, for a field, indicated here with F , besides the commutative ring properties,also the

• inverse element (product): ∀x ∈ F \{0} : ∃(x−1

)|xx−1 = 1

is valid.

For example, if we consider the set of real numbers R, and associate to it the sumand product operations, we obtain the real field.

Exercises

1.1. Prove the following statement

A∪ (A∩B) = A.

1.2. Prove the associativity of union operation

(A∪B)∪C = A∪ (B∪C) .

1.3. Calculate A×B whereA = {a,b,c}

andB = {x ∈ Z|x2−2x−8 = 0}.

1.4. Let us consider the following sets

A = {1,2,3}B = {1,2,3}

Let the relation R ⊂ A×B be a set defined as

R = {(1,1) ,(1,2) ,(1,3) ,(2,2) ,(2,3) ,(3,3)}.

Verify reflexivity, symmetry and transitivity of R and then (1) assess whether ornot R is an order relation; (2) assess whether or not R is an equivalence relation.

Page 40: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

1.6 A Preliminary Introduction to Algebraic Structures 19

1.5. Let us consider the following sets

A = {0,1,2,3}B = {1,2,3}

Let f ⊂ A×B be a set defined as

f = {(0,1) ,(1,1) ,(2,2) ,(3,3)}

Assess whether or not f is a function and whether or not f is injective. Justifyyour answers by using the relevant definitions.

Page 41: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 2Matrices

2.1 Numeric Vectors

Although this chapter intentionally refers to the set of real numbers R and its sumand multiplication operations, all the concepts contained in this chapter can be easilyextended to the set of complex numbers C and the complex field. This fact is furtherremarked in Chap. 5 after complex numbers and their operations are introduced.

Definition 2.1. Numeric Vector. Let n ∈ N and n > 0. The set generated by theCartesian product of R by itself n times (R×R×R×R . . .) is indicated with R

n andis a set of ordered n-tuples of real numbers. The generic element a = (a1,a2, . . . ,an)of this set is named numeric vector or simply vector of order n on the real field andthe generic ai ∀i from 1 to n is said the ith component of the vector a.

Example 2.1. The n-tuple

a =(

1,0,56.3,√

2)

is a vector of R4.

Definition 2.2. Scalar. A numeric vector λ ∈ R1 is said scalar.

Definition 2.3. Let a = (a1,a2, . . . ,an) and b = (b1,b2, . . . ,bn) be two numeric vec-tors ∈ R

n. The sum of these two vectors is the vector c = (a1 +b1,a2 +b2, . . . ,an

+bn) generated by the sum of the corresponding components.

Example 2.2. Let us consider the following vectors of R3

a = (1,0,3)b = (2,1,−2) .

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_2

21

Page 42: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

22 2 Matrices

The sum of these two vectors is

a+b = (3,1,1) .

Definition 2.4. Let a = (a1,a2, . . . ,an) be a numeric vector ∈ Rn and λ a number

∈ R. The product of a vector by a scalar is the vector c = (λa1,λa2, . . . ,λan) gen-erated by the product of λ by each corresponding component.

Example 2.3. Let us consider the vector a = (1,0,4) and the scalar λ = 2. The prod-uct of this scalar by this vector is

λa = (2,0,8) .

Definition 2.5. Let a = (a1,a2, . . . ,an) and b = (b1,b2, . . . ,bn) be two numeric vec-tors ∈ R

n. The scalar product of a by b is a real number

ab = c = a1b1 +a2b2, . . . ,anbn

generated by the sum of the products of each pair of corresponding components.

Example 2.4. Let us consider again

a = (1,0,3)b = (2,1,−2) .

The scalar product of these to vectors is

ab = (1 ·2)+(0 ·1)+(3 · (−2)) = 2+0−6 =−4.

Let a,b,c ∈ Rn and λ ∈ R. It can be proved that the following properties of the

scalar product are valid.

• symmetry: ab = ba• associativity: λ (ba) = (λa)b = a(λb)• distributivity: a(b+ c) = ab+ac

2.2 Basic Definitions About Matrices

Definition 2.6. Matrix. Let m,n ∈ N and both m,n > 0. A matrix (m×n) A is ageneric table of the kind:

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .am,1 am,2 . . . am,n

⎟⎟⎠

where each matrix element ai, j ∈ R. If m = n the matrix is said square while it issaid rectangular otherwise.

Page 43: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.2 Basic Definitions About Matrices 23

The numeric vector ai = (ai,1,ai,2, . . . ,ai,n) is said generic ith row vector whileaj =

(a1, j,a2, j, . . . ,am, j

)is said generic jth column vector.

The set containing all the matrices of real numbers having m rows and n columnsis indicated with Rm,n.

Definition 2.7. A matrix is said null O if all its elements are zeros.

Example 2.5. The null matrix of R2,3 is

O =

(0 0 00 0 0

)

Definition 2.8. Let A ∈ Rm,n. The transpose matrix of A is a matrix AT whose ele-ments are the same of A but ∀i, j: a j,i = aT

i, j.

Example 2.6.

A =

(2 7 3.4

√2

5 0 4 1

)

AT =

⎜⎜⎝

2 57 0

3.4 4√2 1

⎟⎟⎠

It can be easily proved that the transpose of the transpose of a matrix is the matrixitself:

(AT

)T.

Definition 2.9. A matrix A ∈ Rn,n is said n order square matrix.

Definition 2.10. Let A ∈ Rn,n. The diagonal of a matrix is the ordered n-tuple thatdisplays the same index twice: ∀i from 1 to n ai,i.

Definition 2.11. Let A∈Rn,n. The trace of a matrix tr(A) is the sum of the diagonalelements: tr(A) = ∑n

i=1 ai,i.

Example 2.7. The diagonal of the matrix⎛

⎝1 3 09 2 10 1 2

is (1,2,2) and the trace is 1+2+2 = 5.

Definition 2.12. Let A ∈ Rn,n. The matrix A is said lower triangular if all its ele-ments above the diagonal (the elements ai, j where j > i) are zeros. The matrix A issaid upper triangular if all its elements below the diagonal (the elements ai, j wherei > j) are zeros.

Page 44: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

24 2 Matrices

Example 2.8. The following matrix is lower triangular:

L =

⎝5 0 04 1 03 1 8

⎠ .

Definition 2.13. An identity matrix I is a square matrix whose diagonal elementsare all ones while all the other extra-diagonal elements are zeros.

Example 2.9. The identity matrix of R3,3 is

I =

⎝1 0 00 1 00 0 1

Definition 2.14. A matrix A ∈ Rn,n is said symmetric when ∀i, j : ai, j = a j,i.

Example 2.10. The following matrix is symmetric:

A =

⎝2 3 03 1 20 2 4

Proposition 2.1. Let A be a symmetric matrix. It follows that AT = A.

Proof. From the definition of symmetric matrix A ∈ Rn,n:

∀i, j : ai, j = a j,i.

If we transpose the matrix we have

∀i, j : aTi, j = a j,i = ai, j,

that is AT = A. ��

Example 2.11. Let us consider again the symmetric matrix A from Example 2.10and let us calculate the transpose

AT =

⎝2 3 03 1 20 2 4

⎠= A.

2.3 Matrix Operations

Definition 2.15. Let A,B∈Rm,n. The matrix sum C is defined as: ∀i, j : ci, j = ai, j +bi, j.

Page 45: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.3 Matrix Operations 25

Example 2.12. The sum of two matrices is shown below⎛

⎝1 2 32 2 01 0 1

⎠+

⎝0 5 10 3 12 0 1

⎠=

⎝1 7 42 5 13 0 2

⎠ (2.1)

The following properties can be easily proved for the sum operation amongstmatrices.

• commutativity: A+B = B+A• associativity: (A+B)+C = A+(B+C)• neutral element: A+O = A• opposite element: ∀A ∈ Rm,n : ∃!B ∈ Rm,n|A+B = O

The proof of these properties can be carried out simply considering that commu-tativity and associativity are valid for the sum between numbers. Since the sumbetween two matrices is the sum over multiple numbers the properties are still validfor matrices.

Definition 2.16. Let A ∈ Rm,n and λ ∈ R. The product of a scalar by a matrix is amatrix C defined as: ∀i, j : ci, j = λai, j.

Example 2.13. The product of a scalar λ = 2 by the matrix(

2 1 01 −1 4

)

is

λA =

(4 2 02 −2 8

).

The following properties can be easily proved for the product of a scalar by amatrix.

• associativity: ∀A ∈ Rm,n and ∀λ ,μ ∈ R : (λ μ)A = (Aμ)λ = (Aλ )μ• distributivity of the product of a scalar by the sum of two matrices:∀A,B ∈ Rm,n

and ∀λ ∈ Rλ (A+B) = λA+λB• distributivity of the product of a matrix by the sum of two scalars: ∀A∈Rm,n and∀λ ,μ ∈ R : (λ +μ)A = λA+μA

Definition 2.17. Let A ∈ Rm,r and B ∈ Rr,n. The product of matrices A and B is amatrix C = AB whose generic element ci, j is defined in the following way:

ci, j = aibj =

n

∑k=1

ai,kbk, j = ai,1b1, j +ai,2b2, j + . . .+ai,nbm, j.

The same definition with a different notation can be expressed in the followingway.

Page 46: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

26 2 Matrices

Definition 2.18. Let us consider two matrices A∈Rm,r and B∈Rr,n. Let us expressthe matrices as vectors of vectors: row vectors for the matrix A, column vectors forthe matrix B. The matrices A and B are

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,r

a2,1 a2,2 . . . a2,r

. . . . . . . . . . . .am,1 am,2 . . . am,r

⎟⎟⎠=

⎜⎜⎝

a1a2. . .am

⎟⎟⎠

and

B =

⎜⎜⎝

b1,1 b1,2 . . . b1,n

b2,1 b2,2 . . . b2,n

. . . . . . . . . . . .br,1 br,2 . . . br,n

⎟⎟⎠=

(b1 b2 . . . bn

).

The product of matrices A and B is the following matrix C where each elementis the scalar product of a row vector of A and a column vector of B:

C =

⎜⎜⎝

a1b1 a1b2 . . . a1bn

a2b1 a2b2 . . . a2bn

. . . . . . . . . . . .amb1 amb2 . . . ambn

⎟⎟⎠ .

Example 2.14. Let us multiply the matrix A by the matrix B.

A =

(2 7 3 15 0 4 1

)

B =

⎜⎜⎝

1 22 58 02 2

⎟⎟⎠

C = AB =

(a1b1 a1b2

a2b1 a2b2

)=

(42 4139 12

)

The following properties can be easily proved for the product between two ma-trices.

• left distributivity: A(B+C) = AB+AC• right distributivity: (B+C)A = BA+CA• associativity: A(BC) = (AB)C

Page 47: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.3 Matrix Operations 27

• transpose of the product: (AB)T = BTAT

• neutral element: ∀A : AI = A• absorbing element: ∀A : AO = O

Theorem 2.1. Let us consider two compatible matrices

A ∈ Rm,r

B ∈ Rr,n.

It follows that

(AB)T = BTAT.

Proof. Without a loss of generality, let us give the proof for A and B square matrices

A ∈ Rn,n

B ∈ Rn,n.

Let us consider the matrices

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠=

⎜⎜⎝

a1a2. . .an

⎟⎟⎠

and

B =

⎜⎜⎝

b1,1 b1,2 . . . b1,n

b2,1 b2,2 . . . b2,n

. . . . . . . . . . . .bn,1 bn,2 . . . bn,n

⎟⎟⎠=

(b1 b2 . . . bn

).

Let us calculate the product of matrices A and B:

AB =

⎜⎜⎝

a1b1 a1b2 . . . a1bn

a2b1 a2b2 . . . a2bn

. . . . . . . . . . . .anb1 anb2 . . . anbn

⎟⎟⎠ .

Let us now calculate the transpose (AB)T and place its elements in a matrix C:

C = (AB)T =

⎜⎜⎝

a1b1 a2b1 . . . anb1

a1b2 a2b2 . . . anb2

. . . . . . . . . . . .a1bn a2bn . . . anbn

⎟⎟⎠ .

Page 48: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

28 2 Matrices

Let us consider an arbitrary element of C, e.g.

c2,1 = a1b2 =n

∑k=1

= a1,kbk,2.

The generic element ci, j of the matrix C is

ci, j = ajbi =

n

∑k=1

a j,kbk,i.

Let us now calculate

BT =

⎜⎜⎝

b1,1 b2,1 . . . bn,1

b1,2 b2,2 . . . bn,2

. . . . . . . . . . . .b1,n b2,n . . . bn,n

⎟⎟⎠=

⎜⎜⎝

b1

b2

. . .bn

⎟⎟⎠

and

AT =

⎜⎜⎝

a1,1 a2,1 . . . an,1

a1,2 a2,2 . . . an,2

. . . . . . . . . . . .a1,n a2,n . . . an,n

⎟⎟⎠=

(a1 a2 . . . an

).

The product BTAT is given by

C = BTAT =

⎜⎜⎝

b1a1 b1a2 . . . b1an

b2a1 b2a2 . . . b2an. . . . . . . . . . . .

bna1 bna1 . . . bnan

⎟⎟⎠ .

We can already see that (AB)T = BTAT. However, let us consider an arbitraryelement of C, e.g.

c2,1 = b2a1 =n

∑k=1

bk,2a1,k.

The generic element ci, j of the matrix C is

ci, j = ajbi =

n

∑k=1

bk,ia j,k =n

∑k=1

a j,kbk,i.

It follows that (AB)T = BTAT. ��

Example 2.15. Let us consider the following two matrices:

A =

⎝1 0 12 1 03 1 0

Page 49: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.3 Matrix Operations 29

and

B =

⎝2 2 40 0 12 1 0

⎠ .

Let us calculate

(AB)T =

⎝4 4 63 4 64 9 13

and

BTAT =

⎝2 0 22 0 14 1 0

⎝1 2 30 1 11 0 0

⎠=

⎝4 4 63 4 64 9 13

⎠ .

We have verified that (AB)T = BTAT.

It must be observed that the commutativity with respect to the matrix productis generally not valid. It may happen in some cases that AB = BA. In these casesthe matrices are said commutable (one with respect to the other). Every matrix A iscommutable with O (and the result is always O) and with I (and the result is alwaysA).

Since the commutativity is not valid for the product between matrices, the setRm,n with sum and product is not a commutative ring.

Example 2.16. Let us consider again the matrices A and B from Example 2.15. Theproduct AB is

AB =

⎝4 3 44 4 96 6 13

⎠ .

The product BA is

BA =

⎝18 6 23 1 04 1 2

⎠ .

We can verify that in general AB �= BA.

If we interpret a vector as a matrix of n rows and one column (or one row and ncolumns).

Definition 2.19. If we consider the following two vectors:

x =

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠

y =

⎜⎜⎝

y1

y2

. . .yn

⎟⎟⎠ .

Page 50: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

30 2 Matrices

The scalar product xy can be redefined as

xTy =n

∑i=1

xiyi

where the transpose is calculated to ensure that the two matrices are compatible.

Example 2.17. Let us consider the following two vectors:

x =

⎝135

y =

⎝102

⎠ .

If we consider x and y as matrices, the product xy would not be viable since thenumber of columns of x, i.e. one, is not equal to the number of rows of y, i.e. three.Thus to have the matrices compatible we need to write

(1 3 5

)⎛

⎝102

⎠= xTy = 11.

Proposition 2.2. Let A,B ∈ Rn,n. The tr(AB) = tr(BA).

Example 2.18. Let us verify Proposition 2.2 If we consider again the matrices fromExample 2.16,

tr(AB) = 4+4+13 = 21

andtr(BA) = 18+1+2 = 21.

2.4 Determinant of a Matrix

Definition 2.20. Let us consider n objects. We will call permutation every groupingof these objects. For example, if we consider three objects a, b, and c, we couldgroup them as a−b−c or a−c−b, or c−b−a or b−a−c or c−a−b or b−c−a. In this case, there are totally six possible permutations. More generally, it canbe checked that for n objects there are n! (n factorial) permutations where n! =(n)(n−1)(n−2) . . .(2)(1) with n ∈ N and (0)! = 1.

We could fix a reference sequence (e.g. a−b− c) and name it fundamental per-mutation. Every time two objects in a permutation follow each other in a reverse or-der with respect to the fundamental we will call it inversion. Let us define even classpermutation a permutation undergone to an even number of inversions and odd classpermutation a permutation undergone to an odd number of inversions, see also [1].

Page 51: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 31

In other words, a sequence is an even class permutation if an even number ofswaps is necessary to obtain the fundamental permutation. Analogously, a sequenceis an odd class permutation if an odd number of swaps is necessary to obtain thefundamental permutation.

Example 2.19. Let us consider the fundamental permutation a−b−c−d associatedwith the objects a,b,c,d. The permutation d− a− c− b is of even class since twoswaps are required to reconstruct the fundamental permutation. At first we swap aand d to obtain a− d− c− b and then we swap d and b to obtain the fundamentalpermutation a−b− c−d.

On the contrary, the permutation d− c− a− b is of odd class since three swapsare necessary to reconstruct the fundamental permutation. Let us reconstruct thefundamental permutation step-by-step. At first we swap d and b and obtain b− c−a−d. Then, let us swap b and a to obtain a− c−b−d. Eventually, we swap c andb to obtain the fundamental permutation a−b− c−d.

Definition 2.21. Associate Product of a Matrix. Let us consider a matrix A ∈Rn,n

(a square matrix),

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠.

From this matrix, we can select n elements that do not belong neither to the samerow nor to the same column (the selected elements have no common indices). Theproduct of these n elements is here referred to as associated product and indicatedwith the symbol ε (c). If we order the factors of the associated product according tothe row index, the generic associated product can be expressed in the form

ε(c) = a1,c1a2,c2a3,c3 . . .an,cn.

Example 2.20. Let us consider the matrix⎛

⎝2 1 43 1 02 1 2

⎠ .

An associated product is ε(c) = a1,2a2,1a3,3 = (1)(3)(2) = 6. Two other ex-amples of associated product are ε(c) = a1,1a2,3a3,2 = (2)(0)(1) = 0 and ε(c) =a1,2a2,3a3,1 = (1)(0)(2) = 0.

Proposition 2.3. Totally, n! associated products can be extracted from a matrix A∈Rn,n.

Page 52: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

32 2 Matrices

Example 2.21. A matrix A ∈ R3,3, i.e. a square matrix with three rows and threecolumns has six associated products.

Definition 2.22. Let us consider 1−2− . . .−n as the fundamental permutation, thescalar ηk is defined as:

ηk =

{1 if c1-c2-. . . -cn is an even class permutation

−1 if c1-c2-. . . -cn is an odd class permutation.

Example 2.22. Let us consider again the matrix⎛

⎝2 1 43 1 02 1 2

and the associated product ε(c) = a1,2a2,1a3,3 = (1)(3)(2) = 6. The column indicesc1,c2,c3 and 2,1,3. If we express this fact in terms of permutations, the columnindices are the permutation 2−1−3. Since one swap is needed to obtain the naturalpermutation (we need to swap 1 and 2) then the permutation is of odd order. Thusthe corresponding coefficient ηk =−1.

In the case of the associated product ε(c) = a1,1a2,3a3,2 = (2)(0)(1) = 0 thepermutation associated with the column indices is 1−3−2. Thus, also in this caseonly one swap (3 and 2) is needed to reconstruct the fundamental permutation andconsequently ηk =−1.

In the case of the associated product ε(c) = a1,2a2,3a3,1 = (1)(0)(2) = 0, the per-mutation associated with the column indices is 2−3−1. Since we need to swaps toreconstruct the fundamental permutation, i.e. 2 and 3 and then 3 and 1, the permu-tation is of even class. Thus, the corresponding coefficient is ηk = 1.

Definition 2.23. Determinant of a Matrix. Let A ∈ Rn,n, the determinant of thematrix A, indicated as detA, is the function

det : Rn,n → R

defined as the sum of the n! associated products where each term is weighted by thecorresponding ηk:

detA =n!

∑k=1

ηkεk(c).

Example 2.23. If n = 1, detA is equal to the only element of the matrix. This can beeasily seen considering that

A = (a1,1) .

It follows that only associated product can be found that is a1,1. In this caseηk = 1 (only one element following the fundamental permutation). Thus

detA = a1,1.

Page 53: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 33

Example 2.24. If n = 2, the matrix A appears as

A =

(a1,1 a1,2

a2,1 a2,2

)

and its detA = a1,1a2,2−a1,2a2,1.

Example 2.25. If n = 3, the matrix A appears as

A =

⎝a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

and its detA = a1,1a2,2a3,3+a1,2a2,3a3,1+a1,3a2,1a3,2−a1,3a2,2a3,1−a1,2a2,1a3,3−a1,1a2,3a3,2. Looking at the column indices it can be noticed that in (1,2,3) is thefundamental permutation, it follows that (2,3,1) and (3,1,2) are even class permu-tation because two swaps are required to obtain (1,2,3). On the contrary, (3,2,1),(2,1,3), and (1,3,2) are odd class permutations because only one swap allows tobe back to (1,2,3).

Example 2.26. Let us consider again the matrix⎛

⎝2 1 43 1 02 1 2

and let us calculate its determinant:

detA == (2)(1)(2)+(1)(0)(2)+(4)(3)(1)− (4)(1)(2)− (1)(3)(2)− (2)(0)(1) == 4+0+12−8−6−0 = 2.

2.4.1 Linear Dependence of Row and Column Vectors of a Matrix

Definition 2.24. Let A be a matrix. The ith row is said linear combination of theother rows if each of its element ai, j can be expressed as weighted sum of the otherelements of the jth column by means of the same scalars λ1,λ2, . . . ,λi−1,λi+1, . . .λn:

ai = λ1a1 +λ2a2 + · · ·+λi−1ai−1 +λi+1ai+1 + . . .+λnan.

Equivalently, we may express the same concept by considering each row element:

∀ j : ∃λ1,λ2, . . . ,λi−1,λi+1, . . .λn|ai, j = λ1a1, j +λ2a2, j + . . .λi−1ai−1, j +λi+1ai+1, j + . . .λnan, j.

Page 54: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

34 2 Matrices

Example 2.27. Let us consider the following matrix:

A =

⎝0 1 13 2 16 5 3

⎠ .

The third row is a linear combination of the first two by means of scalars λ1,λ2 =1,2, the third row is equal to the weighted sum obtained by multiplying the first rowby 1 and summing to it the second row multiplied by 2:

(6,5,3) = (0,1,1)+2(3,2,1)

that isa3 = a1 +2a2.

Definition 2.25. Let A be a matrix. The jth column is said linear combination ofthe other column if each of its element ai, j can be expressed as weighted sum ofthe other elements of the ith row by means of the same scalars λ1,λ2, . . . ,λ j−1,λ j+1, . . .λn:

aj = λ1a1 +λ2a2 + · · ·+λ j−1aj−1 +λ j+1aj+1 + . . .+λnan.

Equivalently, we may express the same concept by considering each row element:

∀i : ∃λ1,λ2, . . . ,λ j−1,λ j+1, . . .λn|ai, j = λ1ai,1 +λ2ai,2 + . . .λi−1ai, j−1 +λi+1ai, j+1 + . . .λnai,n.

Example 2.28. Let us consider the following matrix:

A =

⎝1 2 12 2 41 3 0

⎠ .

The third column is a linear combination of the first two by means of scalarsλ1,λ2 = 3,−1, the third column is equal to the weighted sum obtained by multiply-ing the first column by 3 and summing to it the second row multiplied by −1:

⎝140

⎠= 3

⎝121

⎠−

⎝223

⎠ .

that isa3 = 3a1−a2.

Definition 2.26. Let A ∈ Rm,n be a matrix. The m rows (n columns) are linearlydependent if a row (column) composed of all zeros o= (0,0, . . . ,0) can be expressedas the linear combination of the m rows (n columns) by means of nun-null scalars.

Page 55: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 35

In the case of linearly dependent rows, if the matrix A is represented as a vectorof row vectors:

A =

⎜⎜⎝

a1a2. . .am

⎟⎟⎠

the rows are linearly dependent if

∃λ1,λ2, . . . ,λm �= 0,0, . . . ,0

such thato = λ1a1 +λ2a2 + . . .+λmam.

Example 2.29. The rows in the following matrix

A =

⎝1 2 12 2 44 6 6

are linearly dependent since

o =−2a1−a2 +a3

that is a null row can be expressed as the linear combination of the row vector bymeans of λ1,λ2,λ3 =−2,−1,1.

Definition 2.27. Let A ∈ R�,� be a matrix. The m rows (n columns) are linearlyindependent if the only way to express a row (column) composed of all zeros o =(0,0, . . . ,0) as the linear combination of the m rows (n columns) is by means of nullscalars.

Example 2.30. The rows in the following matrix

A =

⎝1 2 10 1 40 0 1

are linearly independent.

Proposition 2.4. Let A ∈ R�,� be a matrix. Let r be a row index such that r ≤ m. rrows are linearly dependent if and only if at least one row can be expressed as thelinear combination of the others.

Proof. Let us indicate with o a row vector composed of all zeros and let us representthe matrix A as a vector of row vectors:

A =

⎜⎜⎝

a1a2. . .am

⎟⎟⎠ .

Page 56: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

36 2 Matrices

If r rows are linearly dependent, we can write

o = λ1a1 +λ2a2 + · · ·+λrar

with λ1,λ2, . . . ,λr �= 0,0, . . .0.Since at least one coefficient is non-null, let us assume that the coefficient λi �= 0

and let us write

−λiai = λ1a1 +λ2a2 + · · ·+λi−1ai−1 +λi+1ai+1 + · · ·+λrar.

Since λi �= 0 we can write

ai =−λ1

λia1−

λ2

λia2 + · · ·−

λa−1

λiai−1−

λi+1

λiai+1−

λr

λiar.��

If one vector can be expressed as the linear combination of the others then

ai = μ1a1 +μ2a2 + · · ·+μi−1ai−1 +μi+1ai+1 +μrar.

We can now rearrange the equation as

o = μ1a1 +μ2a2 + · · ·+μi−1ai−1 +μi+1ai+1 +μrar−ai

that is a row vector composed of all zeros expressed as linear combination of the rrow vectors by means of μ1,μ2, . . . ,μi−1,μi+1, . . . ,μr,−1. This means that the rowvectors are linearly dependent. ��

Example 2.31. If we consider again

A =

⎝1 2 12 2 44 6 6

whose rows are linearly dependent since

o =−2a1−a2 +a3

we can writea3 = 2a1 +a2.

The same concept is valid for column vectors.

Proposition 2.5. Let A∈R�,� be a matrix. Let s be a column index such that s≤ n.s columns are linearly dependent if and only if at least one column can be expressedas the linear combination of the others.

Page 57: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 37

2.4.2 Properties of the Determinant

For a given matrix A ∈ Rn,n, the following properties about determinants are valid.

Proposition 2.6. The determinant of a matrix A is equal to the determinant of itstranspose matrix: detA = detAT.

Example 2.32. Let us consider the matrix

A =

⎝1,1,02,1,01,1,1

⎠ .

The determinant of this matrix is

detA = 1+0+0−0−0−2 =−1.

The transpose of the matrix A is

AT =

⎝1 2 11 1 10 0 1

and its determinant is

detAT = 1+0+0−0−0−2 =−1.

As shown detA = detAT.

Proposition 2.7. The determinant of a triangular matrix is equal to the product ofthe diagonal elements.

Example 2.33. Let us consider the matrix

A =

⎝1 2 370 1 1440 0 2

⎠ .

The determinant of A is

detA = (1)(1)(2) = 2.

Proposition 2.8. Let A be a matrix and detA its determinant. If two rows (columns)are swapped the determinant of the modified matrix As is −detA.

Example 2.34. Let us consider the following matrix:

detA =

⎝1 1 12 1 21 1 3

⎠= 3+2+2−1−2−6 =−2.

Page 58: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

38 2 Matrices

Let us swap the second row with the third one. The new matrix As is such that

detAs =

⎝1 1 11 1 32 1 2

⎠= 2+6+1−2−3−2 = 2.

Proposition 2.9. If two rows (columns) of a matrix A are identical then the detA = 0.

Proof. Let us write the matrix A as a vector of row vectors

A =

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1a2. . .ak. . .a′k. . .an

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

where the rows indicated as ak and a′k are identical. The determinant of this matrixis detA. Let us swap the rows ak and a′k and let us generate the matrix As:

As =

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1a2. . .a′k. . .ak. . .an

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

.

Since two rows have been swapped detAs = −detA. On the other hand, sincethe rows ak and a′k are identical, also the matrices As and As are identical. ThusdetAs = detA. The only number that is equal to its opposite is 0, hence detA = 0.��Proposition 2.10. Let A be a matrix and detA its determinant. If to the elementsof a row (column) the elements of another row (column) all multiplied by the samescalar λ are added, the determinant remains the same.

Example 2.35. Let us consider the following matrix:

A =

⎝1 1 11 2 10 0 1

whose determinant detA = 2−1 = 1.

Page 59: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 39

Let us now add to the third row the first row multiplied by λ = 2:

An =

⎝1 1 11 2 12 2 3

⎠ .

The determinant of this new matrix is detAn = 6+ 2+ 2− 4− 2− 3 = 1, i.e. itremained the same.

Proposition 2.11. Let A be a matrix and detA its determinant. if a row (column)is proportional to another row (column) then the determinant is zero, detA = 0: if∃i, j such that ai = kaj, with k ∈ R.

Two equal rows (columns) (k = 1) and a row(column) composed only zeros (k =0) are special cases of this property .

Example 2.36. Let us consider the matrix

A =

⎝8 8 01 1 01 1 1

⎠ .

It can be observed that a1 = 8a2 and detA = 0.

Proposition 2.12. Let A ∈ Rn,n be a matrix and detA its determinant. The deter-minant of the matrix is zero if and only if at least one row (column) is a linearcombination of the other rows (columns).

In the case of the rows, detA = 0 if and only if ∃ index i such that

ai = λ1a1 +λ2a2 + · · ·+λi−1ai−1 +λi+1ai+1 +λnan

with the scalars λ1,λ2, . . . ,λi−1,λi+1, . . . ,λn.

This proposition is essentially a generalisation of Proposition 2.11. The proposi-tions are presented as separate results for the sake of clarity but the first is a specialcase of the second.

An equivalent way to express Proposition 2.12 is the following.

Proposition 2.13. Let A ∈ Rn,n be a matrix and detA its determinant. The determi-nant of the matrix is zero if and only if the rows (columns) are linearly dependent.

Example 2.37. The following matrix

A =

⎝5 2 38 6 22 0 2

Page 60: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

40 2 Matrices

has the first column equal to the sum of the other two. In other words, the matrix Ais such that a1 = λ1a2 +λ2a3 where λ1 = 1 and λ2 = 1. It is easy to verify that

detA = det

⎝5 2 38 6 22 0 2

⎠= 60+8+0−36−0−32 = 0.

Proposition 2.14. Let A be a matrix and detA its determinant. If a row (column) ismultiplied by a scalar λ its determinant is λ detA.

Example 2.38. For the following matrix,

detA = det

(2 21 2

)= 2

while, if we multiply the second row by 2,

detA = det

(2 22 4

)= 4.

Proposition 2.15. Let A be a matrix and detA its determinant. If λ is a scalar,det(λA) = λ n detA.

Example 2.39. For the following matrix,

detA = det

(2 21 2

)= 2

while, if we multiply all the elements of the matrix by λ = 2,

detλA = det

(4 42 4

)= 16−8 = 8 = λ 2 detA.

Proposition 2.16. Let A and B be two matrices and detA, detB their respectivedeterminants. The determinant of the product between two matrices is equal to theproducts of the determinants: det(AB) = detAdetB = detBdetA = det(BA).

Example 2.40. Let us consider the following matrices,

A =

(1 −11 2

)

Page 61: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 41

and

B =

(1 20 2

)

whose determinants are detA = 3 and detB = 2, respectively.If we calculate AB we obtain the product matrix:

AB =

(1 01 6

)

whose determinant is 6 that is equal to detAdetB. If we calculate BA we obtain theproduct matrix:

BA =

(3 32 4

)

whose determinant is 6 that is equal to detAdetB.

2.4.3 Submatrices, Cofactors and Adjugate Matrices

Definition 2.28. Submatrices. Let us consider a matrix A ∈ Rm,n. Let r,s be twopositive integer numbers such that 1≤ r≤m and 1≤ s≤ n. A submatrix is a matrixobtained from A by cancelling m− r rows and n− s columns.

Example 2.41. Let us consider the following matrix:

A =

⎝3 3 1 02 4 1 25 1 1 1

⎠ .

The submatrix obtained by cancelling the second row, the second and fourthcolumns is (

3 15 1

).

Definition 2.29. Let us consider a matrix A ∈ Rm,n and one of its square submatri-ces. The determinant of this submatrix is said minor. If the submatrix is the largestsquare submatrix of the matrix A, its determinant is said major determinant or sim-ply major.

It must be observed that a matrix can have multiple majors. The following exam-ple clarifies this fact.

Example 2.42. Let us consider the following matrix A ∈ R4,3:

A =

⎜⎜⎝

1 2 02 2 30 1 01 1 0

⎟⎟⎠ .

Page 62: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

42 2 Matrices

An example of minor is

det

(1 02 3

)

obtained after cancelling the second column as well as the third and fourth rows.Several minors can be calculated. Furthermore, this matrix has also several major.For example, one major is

det

⎝1 2 02 2 31 1 0

obtained by cancelling the third row and another major is

det

⎝2 2 30 1 01 1 0

obtained by cancelling the first row.

Definition 2.30. Let us consider a matrix A ∈ Rn,n. The submatrix is obtained bycancelling only the ith row and the jth column from A is said complement subma-trix to the element ai, j and its determinant is here named complement minor andindicated with Mi, j.

Example 2.43. Let us consider a matrix A ∈ R3,3:

A =

⎝a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

⎠.

The complement submatrix to the element a1,2 is

A =

(a2,1 a2,3

a3,1 a3,3

)

while the complement minor M1,2 = a2,1a3,3−a1,3a3,1.

Definition 2.31. Let us consider a matrix A ∈Rn,n, its generic element ai, j and cor-responding complement minor Mi, j. The cofactor Ai, j of the element ai, j is definedas Ai, j = (−1)i+ jMi, j.

Example 2.44. From the matrix of the previous example, the cofactor A1,2 =(−1)M1,2.

Page 63: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 43

Definition 2.32. Adjugate Matrix. Let us consider a matrix A ∈ Rn,n:

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠ .

Let us compute the transpose matrix AT:

AT =

⎜⎜⎝

a1,1 a2,1 . . . an,1

a1,2 a2,2 . . . an,2

. . . . . . . . . . . .a1,n a2,n . . . an,n

⎟⎟⎠ .

Let us substitute each element of the transpose matrix with its correspondingcofactor Ai, j. The resulting matrix is said adjugate matrix (or adjunct or adjoint) ofthe matrix A and is indicated with adj(A):

adj(A) =

⎜⎜⎝

A1,1 A2,1 . . . An,1

A1,2 A2,2 . . . An,2

. . . . . . . . . . . .A1,n A2,n . . . An,n

⎟⎟⎠ .

Example 2.45. Let us consider the following matrix A ∈ R3,3:

A =

⎝1 3 05 3 20 1 2

and compute the corresponding Adjugate Matrix. In order to achieve this purpose,let us compute AT:

AT =

⎝1 5 03 3 10 2 2

⎠.

Let us compute the nine complements minors: M1,1 = 4, M1,2 = 6, M1,3 = 6,M2,1 = 10, M2,2 = 2, M2,3 = 2, M3,1 = 5, M3,2 = 1, and M3,3 =−12. The AdjugateMatrix adj(A) is:

adj(A) =

⎝4 −6 6−10 2 −2

5 −1 −12

⎠.

Page 64: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

44 2 Matrices

2.4.4 Laplace Theorems on Determinants

Theorem 2.2. I Laplace Theorem Let A∈Rn,n. The determinant of A can be com-puted as the sum of each row (element) multiplied by the corresponding cofactor:detA = ∑n

j=1 ai, jAi, j for any arbitrary i anddetA = ∑n

i=1 ai, jAi, j for any arbitrary j.

The I Laplace Theorem can be expressed in the equivalent form: the determinantof a matrix is equal to scalar product of a row (column) vector by the correspondingvector of cofactors.

Example 2.46. Let us consider the following A ∈ R3,3:

A =

⎝2 −1 31 2 −1−1 −2 1

The determinant of this matrix is detA= 4−1−6+6+1−4= 0. Hence, the ma-trix is singular. Let us now calculate the determinant by applying the I Laplace The-orem. If we consider the first row, it follows that detA = a1,1A1,1 +a1,2(−1)A1,2 +a1,3A1,3, detA = 2(0)+1(0)+3(0) = 0. We arrive to the same conclusion.

Example 2.47. Let us consider the following A ∈ R3,3:

A =

⎝1 2 10 1 14 2 0

The determinant of this matrix is detA = 8−4−2 = 2. Hence, the matrix is non-singular. Let us now calculate the determinant by applying the I Laplace Theorem.If we consider the second row, it follows that detA = a2,1(−1)A2,1 + a2,2A2,2 +a2,3(−1)A2,3, detA= 0(−1)(−2)+1(−4)+1(−1)(−6)= 2. The result is the same.

Let us prove the I Laplace Theorem in the special case of an order 3 matrix:

A =

⎝a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

⎠ .

Proof. By applying the definition

detA = a1,1a2,2a3,3 +a1,2a2,3a3,1 +a1,3a2,1a3,2−a1,3a2,2a3,1−a1,2a2,1a3,3−a1,1a2,3a3,2.

Page 65: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.4 Determinant of a Matrix 45

By applying the I Laplace Theorem we obtain

detA = a1,1 det

(a2,2 a2,3

a3,2 a3,3

)−a1,2 det

(a2,1 a2,3

a3,1 a3,3

)+a1,3 det

(a2,1 a2,2

a3,1 a3,2

)=

= a1,1 (a2,2a3,3−a2,3a3,2)−a1,2 (a2,1a3,3−a2,3a3,1)+a1,3 (a2,1a3,2−a2,2a3,1) =a1,1a2,2a3,3−a1,1a2,3a3,2−a1,2a2,1a3,3 +a1,2a2,3a3,1 +a1,3a2,1a3,2−a1,3a2,2a3,1

that is the determinant calculated by means of the definition. ��

Theorem 2.3. II Laplace Theorem. Let A ∈ Rn,n with n > 1. The sum of the ele-ments of a row (column) multiplied by the corresponding cofactor related to anotherrow (column) is always zero:∑n

j=1 ai, jAk, j = 0 for any arbitrary k �= i and∑n

i=1 ai, jAi,k = 0 for any arbitrary k �= j.

The II Laplace Theorem can be equivalently stated as: the scalar product of a row(column) vector by the vector of cofactors associated with another row (column) isalways null.

Example 2.48. Let us consider again the matrix

A =

⎝1 2 10 1 14 2 0

and the cofactors associated with second row: A2,1 = (−1)(−2), A2,2 = (−4), andA2,3 = (−1)(−6). Hence, A2,1 = 2, A2,2 =−4, and A2,3 = 6. Let us apply now the IILaplace Theorem by applying the scalar product of the first row vector by the vectorof the cofactors associated with the second row:

a1,1A2,1 +a1,2A2,2 +a1,3A2,3 = 1(2)+2(−4)+1(6) = 0.

It can been seen that if we multiply the third row vector by the same vector ofcofactors the result still is 0:

a3,1A2,1 +a3,2A2,2 +a3,3A2,3 = 4(2)+2(−4)+0(6) = 0.

Now, let us prove the II Laplace Theorem in the special case of an order 3 matrix:

A =

⎝a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

⎠ .

Page 66: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

46 2 Matrices

Proof. Let us calculate the elements of the scalar product of the element of thesecond row by the cofactors associated with the first row:

a2,1 det

(a2,2 a2,3a3,2 a3,3

)−a2,2 det

(a2,1 a2,3a3,1 a3,3

)+a2,3 det

(a2,1 a2,2a3,1 a3,2

)=

= a2,1(a2,2a3,3−a2,3a3,2

)−a2,2

(a2,1a3,3−a2,3a3,1

)+a2,3

(a2,1a3,2−a2,2a3,1

)=

a2,1a2,2a3,3−a2,1a2,3a3,2−a2,2a2,1a3,3 +a2,2a2,3a3,1 +a2,3a2,1a3,2−a2,3a2,2a3,1 = 0.��

2.5 Invertible Matrices

Definition 2.33. Let A ∈ Rn,n. If detA = 0 the matrix is said singular. If detA �= 0the matrix is said non-singular.

Definition 2.34. Let A ∈ Rn,n. The matrix A is said invertible if ∃ a matrix B ∈Rn,n|AB = I = BA. The matrix B is said inverse matrix of the matrix A.

Theorem 2.4. If A ∈ Rn,n is an invertible matrix and B is its inverse. It follows thatthe inverse matrix is unique: ∃!B ∈ Rn,n|AB = I = BA.

Proof. Let us assume by contradiction that the inverse matrix is not unique. Thus,besides B, there exists another inverse of A, indicated as C ∈ Rn,n.

This would mean that for the hypothesis B is inverse of A and thus

AB = BA = I.

For the contradiction hypothesis also C is inverse of A and thus

AC = CA = I.

Considering that I is the neutral element with respect to the product of matrices(∀A : AI = IA = A) and that the product of matrices is associative, it follows that

C = CI = C(AB) = (CA)B = IB = B.

In other words, if B is an inverse matrix of A and another inverse matrix C exists,then C = B. Thus, the inverse matrix is unique. ��

The only inverse matrix of the matrix A is indicated with A−1.

Theorem 2.5. Let A ∈ Rn,n and Ai, j its generic cofactor. The inverse matrix A−1 is

A−1 =1

detAadj(A) .

Page 67: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.5 Invertible Matrices 47

Proof. Let us consider the matrix A,

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

and its adjugate matrix,

adj(A) =

⎜⎜⎝

A1,1 A2,1 . . . An,1

A1,2 A2,2 . . . An,2

. . . . . . . . . . . .A1,n A2,n . . . An,n

⎟⎟⎠.

Let us compute the product matrix of A by adj(A), i.e. (A)(adj(A)),

(A)(adj(A)) =

=

⎜⎜⎝

(a1,1A1,1 +a1,2A1,2 + . . .+a1,nA1,n) (. . .) (a1,1An,1 +a1,2An,2 + . . .+a1,nAn,n)(a2,1A1,1 +a2,2A1,2 + . . .+a2,nA2,n) (. . .) (a2,1An,1 +a2,2An,2 + . . .+a2,nAn,n)

. . . . . . . . .(an,1A1,1 +an,2A1,2 + . . .+an,nA1,n) (. . .) (an,1An,1 +an,2An,2 + . . .+an,nAn,n)

⎟⎟⎠ .

The matrix can also be written as⎛

⎜⎜⎝

∑nj=1 a1, jA1, j ∑n

j=1 a1, jA2, j . . . ∑nj=1 a1, jAn, j

∑nj=1 a2, jA1, j ∑n

j=1 a2, jA2, j . . . ∑nj=1 a2, jAn, j

. . . . . . . . . . . .

∑nj=1 an, jA1, j ∑n

j=1 an, jA2, j . . . ∑nj=1 an, jAn, j

⎟⎟⎠

For the I Laplace Theorem, the diagonal elements are equal to detA:

ai,1Ai,1 +ai,2Ai,2 + . . .+ai,nAi,n =n

∑j=1

ai, jAi, j = detA.

for all the rows i.For the II Laplace Theorem, the extra-diagonal elements are equal to zero:

ai,1Ak,1 +ai,2Ak,2 + . . .+ai,nAk,n =n

∑j=1

ai, jAk, j = 0.

with i �= k.

Page 68: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

48 2 Matrices

The result of the multiplication is then

(A)(adj(A)) =

⎜⎜⎝

detA 0 . . . 00 detA . . . 0. . . . . . . . . . . .0 0 . . . detA

⎟⎟⎠.

Thus,(A)(adj(A)) = (detA)I

and

A−1 =1

detAadj(A) .��

Example 2.49. Let us calculate the inverse of the matrix

A =

(2 11 1

).

The determinant of this matrix is detA = 1. The transpose of this matrix is

AT =

(2 11 1

),

which, in this case, is equal to A.The adjugate matrix is

adj(A) =

(1 −1−1 2

).

The inverse of the matrix A is then

A−1 = 1detA adj(A) =

(1 −1−1 2

).

Example 2.50. Let us calculate the inverse of the matrix

A =

(1 1−2 1

).

The determinant of this matrix is detA = 3. The transpose of this matrix is

AT =

(1 −21 1

).

Page 69: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.5 Invertible Matrices 49

The adjugate matrix is

adj(A) =

(1 −12 1

).

The inverse of the matrix A is then

A−1 = 1detA adj(A) = 1

3

(1 −12 1

)=

( 13 −

13

23

13

).

The latter two examples suggest introduce the corollary of Theorem 2.5.

Corollary 2.1. Let A ∈ R2,2:

A =

(a1,1 a1,2

a2,1 a2,2

),

then

A−1 = 1detA

(a2,2 −a1,2

−a2,1 a1,1

).

Proof. Let us calculate the transpose of A:

AT =

(a1,1 a2,1

a1,2 a2,2

).

the adjugate matrix is

adj(A) =

(a2,2 −a1,2

−a2,1 a1,1

)

and the inverse is

A−1 = 1detA

(a2,2 −a1,2

−a2,1 a1,1

).

Example 2.51. Let us consider the matrix

A =

(1 23 4

).

The determinant is detA = 4− 6 = −2. By applying Corollary 2.1, the inversematrix of A is

A−1 =−12

(4 −2−3 1

).

Page 70: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

50 2 Matrices

Example 2.52. Let us now invert a matrix A ∈ R3,3:

A =

⎝2 1 10 1 01 3 1

⎠.

The determinant of this matrix is detA= 2−1= 1. The transpose of this matrix is

AT =

⎝2 0 11 1 31 0 1

⎠ .

The adjugate matrix is

adj(A) =

⎝1 2 −10 1 0−1 −5 2

and the corresponding inverse matrix is

A−1 = 1detA adj(A) =

⎝1 2 −10 1 0−1 −5 2

⎠ .

In all the previous examples, only one inverse matrix can be found in accor-dant with Theorem 2.4. Furthermore, all the inverted matrices are non-singular, i.e.detA �= 0. Intuitively, it can be observed that for a singular matrix the inverse cannotbe calculated since the formula A−1 = 1

detA adj(A) cannot be applied (as it wouldrequire a division by zero). The following theorem introduces the theoretical foun-dation of this intuition.

Theorem 2.6. Let A ∈ Rn,n. The matrix A is invertible if and only if A is non-singular.

Proof. If A is invertible then

∃A−1 such that AA−1 = I = A−1A

where A−1, for Theorem 2.4, is unique (A−1 is the only inverse matrix of A).Since two identical matrices have identical determinants it follows that

det(

AA−1)= detI = 1.

Since for the properties of the determinant, the determinant of the product of two(square) matrices is equal to the product of the determinants of these two matrices,

Page 71: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.5 Invertible Matrices 51

it follows that

det(

AA−1)= (detA)

(detA−1

)= 1.

Hence, detA �= 0, i.e. A is non-singular. ��

If A is non-singular, then detA �= 0. Thus, we can consider a matrix B ∈ Rn,n

taken as

B =1

detAadj(A) .

We could not have taken B in this way if detA = 0. We know from Theorem 2.5that B = A−1 and thus A is invertible. ��

Example 2.53. Let us consider the following matrix

A =

⎝1 3 40 2 24 −2 2

⎠ .

It can be easily seen that detA = 0. The matrix is singular and not invertible. Wecould not calculate the inverse

A−1 =1

detAadj(A)

since its calculation would lead to a division by zero.

Corollary 2.2. Let A ∈ Rn,n be an invertible matrix. It follows that detA−1 = 1detA .

Proof. From the proof of Theorem 2.6 we know that

det(

AA−1)= detI = 1.

It follows that

detA−1 =1

detA.��

Example 2.54. Let us consider the following matrix

A =

⎝2 4 10 1 04 0 4

⎠ ,

whose determinant is detA = 4.The inverse matrix of A is

A =

⎝1 −4 −0.250 1 0−1 4 0.5

⎠ ,

whose determinant is detA−1 = 0.25 = 1detA .

Page 72: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

52 2 Matrices

Corollary 2.3. Let A ∈ R1,1, i.e. A = (a1,1), be a matrix composed of only one ele-ment. The inverse matrix of A is

A−1 =1

detA=

1a1,1

.

Proof. For the I Laplace Theorem

a1,1A1,1 = det(A)

with A1,1 cofactor of a1,1.Since, as shown in Example 2.23, the detA = a1,1 it follows that A1,1 = 1. Since

the only cofactor is also the only element of the adjugate matrix:

adj(A) = A1,1 = 1

it follows that

A−1 =1

detAadj(A) =

1detA

=1

a1,1.��

The last corollary simply shows how numbers can be considered as special casesof matrices and how the matrix algebra encompasses the number algebra.

Example 2.55. If A = (5), its inverse matrix would be A−1 =(

15

). If A = (0) the

matrix would be singular and thus not invertible, in accordance with the definitionof field, see Definition 1.36.

The following illustration represents and summarizes the matrix theory studies inthe past sections. The empty circles represent singular matrices which are not linkedto other matrices since they have no inverse. Conversely, filled circles represent non-singular matrices. Each of them has one inverse matrix to which is linked in theillustration. Non-singular matrices are all paired and connected by a link. There areno isolated filled circles (every non-singular matrix has an inverse) and every filledcircle has only one link (the inverse matrix is unique).

A

A−1

Proposition 2.17. Let A and B be two square and invertible matrices. it follows that

(AB)−1 = B−1A−1.

Page 73: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.5 Invertible Matrices 53

Proof. Let us calculate

(AB)(B−1A−1)= AIA−1 = AA−1 = I.

Thus, the inverse of (AB) is(B−1A−1

), i.e.

(AB)−1 = B−1A−1.��

Example 2.56. Let us consider the following matrices

A =

⎝2 0 11 1 03 2 1

and

B =

⎝1 0 11 1 02 2 2

⎠ .

We can easily verify that

AB =

⎝4 2 42 1 17 4 5

and

AB−1 =

⎝0.5 3 −1−1.5 −4 20.5 −1 0

⎠ .

Also, let us calculate the inverse matrices

A−1 =

⎝1 2 −1−1 −1 1−1 −4 2

and

B−1 =

⎝1 1 −0.5−1 0 0.50 −1 0.5

⎠ .

Let us now calculate their product

B−1A−1 =

⎝0.5 3 −1−1.5 −4 20.5 −1 0

⎠ .

Page 74: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

54 2 Matrices

2.6 Orthogonal Matrices

Definition 2.35. A matrix A ∈ Rn,n is said orthogonal if the product between it andits transpose is the identity matrix:

AAT = I = ATA.

Theorem 2.7. An orthogonal matrix is always non-singular and its determinant iseither 1 or −1.

Proof. Let A ∈ Rn,n be an orthogonal matrix. Then,

AAT = I.

Thus, the determinants are still equal:

det(AAT)= detI.

For the properties of the determinant

det(AAT

)= detAdetAT

detA = detAT

detI = 1

Thus,(detA)2 = 1.

This can happen only when detA =±1. ��

Theorem 2.8. Property of Orthogonal Matrices. A matrix A ∈Rn,n is orthogonalif and only if the sum of the squares of the element of a row (column) is equal to 1and the scalar product of any two arbitrary rows (columns) is equal to 0:

∑nj=1 a2

i, j = 1∀i, j aiaj = 0.

Proof. The proof will be given for row vectors. The proof for column vectors isanalogous. Let us consider a matrix A ∈ Rn,n

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠=

⎜⎜⎝

a1a2. . .an

⎟⎟⎠

Page 75: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.6 Orthogonal Matrices 55

and its transpose

AT =

⎜⎜⎝

a1,1 a2,1 . . . an,1

a1,2 a2,2 . . . an,2

. . . . . . . . . . . .a1,n a2,n . . . an,n

⎟⎟⎠=

(a1 a2 . . . an

).

Since A is orthogonal it follows that

AAT = I.

Thus,

AAT =

⎜⎜⎝

a1a1 a1a2 . . . a1anna2a1 a2a2 . . . a2an. . . . . . . . . . . .

ana1 ana2 . . . anan

⎟⎟⎠=

⎜⎜⎝

1 0 . . . 00 1 . . . 0. . . . . . . . . . . .0 0 . . . 1

⎟⎟⎠ .

This means that ∀i, j

aiai =n

∑j=1

a2i, j = 1

andaiaj = 0.��

The scalar product of every two row vectors is 0. This condition as shown inChap. 4 means that the vectors are orthogonal, which is the reason why these matri-ces are called orthogonal matrices.

Example 2.57. The following matrices are orthogonal:

(sin(α) cos(α)cos(α) −sin(α)

)

and

⎝sin(α) 0 cos(α)

0 1 0−cos(α) 0 sin(α)

⎠.

Example 2.58. The following matrix is orthogonal

A =1√2

(1 11 −1

).

Page 76: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

56 2 Matrices

Let us verify that the matrix is orthogonal by calculating AAT:

AAT =1√2

(1 11 −1

)1√2

(1 11 −1

)=

12

(2 00 2

)=

(1 00 1

)= I.

Let us verify the properties of orthogonal matrices. The sum of the squares of therows (columns) is equal to one, e.g.

a21,1 +a2

1,2 =

(1√2

)2

+

(1√2

)2

=12+

12= 1.

The scalar product of each pair of rows (columns) is zero, e.g.

a1a2 = a1,1a2,1 +a1,2a2,2 =

(1√2,

1√2

)(1√2,− 1√

2

)=

12− 1

2= 0.

Example 2.59. The following matrix is orthogonal

A =13

⎝2 −2 11 2 22 1 −2

⎠ .

Let us verify that the matrix is orthogonal by calculating AAT:

AAT =13

⎝2 −2 11 2 22 1 −2

⎠ 13

⎝2 1 2−2 2 11 2 −2

⎠=19

⎝9 0 00 9 00 0 9

⎠=

⎝1 0 00 1 00 0 1

⎠= I.

Let us verify the properties of orthogonal matrices. The sum of the squares of therows (columns) is equal to one, e.g.

a21,1 +a2

1,2 +a21,3 =

(23

)2

+

(−2

3

)2

+

(13

)2

=49+

49+

19= 1.

The scalar product of each pair of rows (columns) is zero, e.g.

a1a2 = a1,1a2,1 +a1,2a2,2 +a1,3a2,3 =

(23,−2

3,

13

)(13,

23,

23

)=

29− 4

9+

29= 0.

2.7 Rank of a Matrix

Definition 2.36. Let A ∈ Rm,n with A assumed to be different from the null matrix.The rank of the matrix A, indicated as ρA, is the highest order of the non-singularsubmatrix Aρ ⊂ A. If A is the null matrix then its rank is taken equal to 0.

Page 77: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 57

Example 2.60. The rank of the matrix

(1 −1 −2−1 1 0

)

is 2 as the submatrix

(−1 −21 0

)

is non-singular.

Example 2.61. Let us consider the following matrix:

A =

⎝−1 2 −12 −3 21 −1 1

⎠.

It can be easily seen that detA = 0 while there is at least one non-singular squaresubmatrix having order 2. Thus ρA = 2.

If a matrix A ∈ Rm,n and we indicate with the min a function that detects thelowest element of a (finite) set, the procedure for finding its rank ρA is shown in thepseudocode represented in Algorithm 1.

Algorithm 1 Rank Detectionfor the matrix A ∈ Rm,n find s = min{m,n}while s≥ 0 AND detAs == 0 do

extract all the order s submatrices Asfor all the submatrices As do

calculate det(As)end fors = s−1

end whileThe rank ρA = s

Theorem 2.9. Let A∈Rn,n and ρ its rank. The matrix A has ρ linearly independentrows (columns).

Proof. Let us prove this theorem for the rows. For linearly independent columnsthe proof would be analogous. Let us apply the procedure in Algorithm 1 to deter-mine the rank of the matrix A. Starting from s = n the determinant is checked, ifthe determinant is null then the determinants of submatrices of a smaller size arechecked. For Proposition 2.13 if detAs = 0 then the rows are linearly dependent.When detAs �= 0 the rows of As are linearly independent and the size s of As is therank ρ of the matrix A. Thus, in A there are ρ linearly independent rows. ��

Page 78: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

58 2 Matrices

Example 2.62. Let us consider the following matrix

A =

⎝1 2 02 1 23 3 2

⎠ .

We can easily verify that detA = 0 and that the rank of the matrix is ρ = 2. Wecan observe that the third row is sum of the other two rows:

a3 = a1 +a2

that is the rows are linearly dependent. On the other hand, any two rows are linearlyindependent.

Example 2.63. Let us consider the following matrix

A =

⎝1 2 12 4 20 0 1

⎠ .

Also in this case we can verify that detA = 0 and that the rank of the matrix isρ = 2. Furthermore, the rows are linearly dependent since

a2 = 2a1 +0a3.

This means that also in this case two rows are linearly independent. However, thiscase is different from the previous one since the linearly independent rows cannotbe chosen arbitrarily. More specifically, a1 and a3 are linearly independent as wellas a2 and a3. On the other hand, a1 and a2 are linearly dependent (a2 = 2a1).

In other words, the rank ρ says how many rows (columns) are linearly indepen-dent but does not say that any ρ rows (columns) are linearly independent. Determin-ing which rows (columns) are linearly independent is a separate task which can benot trivial.

Definition 2.37. Let A ∈ Rm,n and let us indicate with Mr a r order square subma-trix of A. A r+ 1 square submatrix of A that contains also Mr is here said edgedsubmatrix.

Example 2.64. Let us consider a matrix A ∈ R4,3.

A =

⎝a1,1 a1,2 a1,3 a1,4

a2,1 a2,2 a2,3 a2,4

a3,1 a3,2 a3,3 a3,4

Page 79: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 59

From A let us extract the following submatrix Mr,

Mr =

(a1,1 a1,3

a3,1 a3,3

).

Edged submatrices are

⎝a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

and

⎝a1,1 a1,3 a1,4

a2,1 a2,3 a2,4

a3,1 a3,3 a3,4

⎠.

Theorem 2.10. Kronecker’s Theorem. Let A∈Rm,n and Mr a r order square sub-matrix of A with 1 ≤ r < min{m,n}. If Mr is non-singular and all the edged sub-matrices of Mr are singular, then the rank of A is r.

Example 2.65. Let us consider the following matrix

A =

⎝1 2 1 31 0 1 11 2 1 3

⎠ .

The submatrix

(1 21 0

)

is non-singular while its edged submatrices

⎝1 2 11 0 11 2 1

Page 80: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

60 2 Matrices

and

⎝1 2 31 0 11 2 3

are both singular. Kronecker’s Theorem states that this is enough to conclude thatthe rank of the matrix A is 2. We can verify this fact by considering the other order3 submatrices, that is

⎝2 1 30 1 12 1 3

and

⎝1 1 31 1 11 1 3

⎠ .

It can be immediately observed that also these two submatrices are singular,hence the rank of A is indeed 2.

Lemma 2.1. Let A ∈ Rn,n and B ∈ Rn,q. Let A be non-singular and ρB be the rankof the matrix B. It follows that the rank of the product matrix AB is ρB.

Example 2.66. Let us consider the following matrix

A =

(2 11 2

)

and the matrix

B =

(0 1 11 1 1

).

Page 81: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 61

The matrix A is non-singular and hence has rank ρA = 2. The matrix B has alsorank ρB = 2 since the submatrix

(0 11 1

)

is clearly non-singular.The product matrix

AB =

(1 3 32 3 3

)

has rank ρAB = ρB = 2, as expected from Lemma 2.1.If we consider a matrix B having rank equal to 1

B =

(0 1 10 1 1

)

and multiply A by B we obtain

AB =

(0 3 30 3 3

)

that has rank ρAB = ρB = 1, in accordance with Lemma 2.1.

Theorem 2.11. Sylvester’s Law of Nullity. Let A ∈Rm,n and B ∈Rn,q. Let ρA andρB be the ranks of the matrices A and B, respectively, and ρAB be the rank of theproduct matrix AB. It follows that

ρAB ≥ ρA +ρB−n.

Example 2.67. In order to check the Sylvester’s law of nullity, let us consider thefollowing two matrices:

A =

(0 11 1

)

and

B =

(4 10 0

).

Page 82: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

62 2 Matrices

Matrix A is non-singular, hence has rank ρA = 2 while B is singular and had hasrank ρB = 1.

Let us calculate the product AB:

AB =

(0 04 1

)

whose rank is ρAB = 1.We can easily verify that ρA +ρB−n = 2+1−2 = 1 that is equal to ρAB.

Example 2.68. Let us consider again the matrix A which we know has rank ρA = 2and the following matrix ρB having ρB = 2:

B =

(4 10 1

).

In accordance with the Sylvester’s law of nullity we expect that the product ABhas a rank > 1 since ρA +ρB− n = 2+ 2− 2 = 2. In other words, the Sylvester’slaw of nullity tells us before calculating it, that AB is non-singular.

Let us verify this fact:

AB =

(0 14 2

).

The product matrix is non-singular, i.e. its rank is ρAB = 2, which verifies this the-orem.

These examples suggest the following corollary, i.e. the Sylvester’s law of nullityfor square matrices.

Corollary 2.4. Let A ∈Rn,n and B ∈Rn,n. Let ρA and ρB be the ranks of the matri-ces A and B, respectively, and ρAB be the rank of the product matrix AB. It followsthat

ρAB ≥ ρA +ρB−n.

Example 2.69. Let us consider the following two matrices

A =

⎝1 3 11 3 11 3 1

and

B =

⎝2 1 24 2 41 1 1

⎠ .

Page 83: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 63

The ranks of these two matrices are ρA = 1 and ρB = 2 respectively.The product matrix

AB =

⎝15 8 1515 8 1515 8 15

has rank ρAB = 1. Considering that n = 3, ρAB = 1≥ ρA +ρB−n = 1+2−3 = 0

Example 2.70. Before entering into the next theorem and its proof, let us introducethe concept of partitioning of a matrix. Let us consider the following two matrices:

A =

⎝2 1 01 3 11 1 0

and

B =

⎝1 1 12 1 00 1 3

⎠.

We can calculate the matrix product

AB =

⎝4 3 27 5 43 2 1

⎠.

Let us now re-write the matrices A as

A =

(A1,1 A1,2A2,1 A2,2

)

where

A1,1 =

(2 11 3

),

A1,2 =

(01

),

A2,1 =(

1 1),

and

A2,2 =(

0).

Page 84: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

64 2 Matrices

Analogously, the matrix B can be written as

B =

(B1,1B2,1

)

where

B1,1 =

(1 1 12 1 0

)

and

B2,1 =(

0 1 3).

This variable replacement is said partitioning of a matrix. We can now treat thesubmatrices as matrix element. This means that in order to calculate AB we canwrite

AB =

(A1,1 A1,2A2,1 A2,2

)(B1,1B2,1

)=

(A1,1B1,1 +A1,2B2,1A2,1B1,1 +A2,2B2,1

).

We can easily verify this fact by calculating the two matrix expressions:

A1,1B1,1 +A1,2B2,1 =

(2 11 3

)(1 1 12 1 0

)+

(01

)(

0 1 3)=

=

(4 3 27 4 1

)+

(0 0 00 1 3

)=

(4 3 27 5 4

)

and

A2,1B1,1 +A2,2B2,1 =(

1 1)(

1 1 12 1 0

)+(

0)(

0 1 3)=

=(

3 2 1)+(

0 0 0)=(

3 2 1).

Hence, we obtain the same AB matrix as before by operation with the partitionsinstead of working with the elements:

AB =

(A1,1B1,1 +A1,2B2,1A2,1B1,1 +A2,2B2,1

)=

⎝4 3 27 5 43 2 1

⎠ .

Lemma 2.2. Let A ∈ Rm,n and ρA be its rank. If r ≤ m rows (s ≤ n columns) areswapped, the rank ρA does not change.

Page 85: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 65

Proof. Every row (column) swaps yields to a change in the determinant sign, seeProposition 2.8. Thus, a row swap cannot make a (square) singular sub-matrix non-singular or vice versa. The rank does not change. ��

Example 2.71. The following matrix

A =

⎝1 1 30 0 05 3 0

is singular and has ρA = 2 since e.g.

det

(1 15 3

)=−2 �= 0.

If we swap second and third row we obtain

As =

⎝1 1 35 3 00 0 0

the rank ρA is still 2.Thus, without changing the rank of the matrix we can swap the rows (columns)

of a matrix to have the non-singular sub-matrix in a specific position of the matrix.We can then partition the matrix to have the non-singular sub-matrix in the first ρArows:

As =

(A1,1 A1,2A2,1 A2,2

)

where

A1,1 =

(1 15 3

)

A1,2 =

(30

)

A2,1 =(

0 0)

A2,2 = (0) .

Lemma 2.3. Let A ∈ Rm,r and B ∈ Rr,n be two compatible matrices and C ∈ Rm,n

the product matrixAB = C.

If two arbitrary rows ith and jth of the matrix A are swapped, the product of theresulting matrix As by the matrix B is

AsB = Cs

where Cs is the matrix C after the ith and the jth row have been swapped.

Page 86: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

66 2 Matrices

Proof. Let us write the matrices A and B as a vector of row vectors and a vector ofcolumn vectors respectively:

A =

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1a2. . .ai. . .aj. . .am

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

andB =

(b1 b2 . . . bn

).

We know that the product matrix C is

C =

⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1b1 a1b2 . . . a1bn

a2b1 a2b2 . . . a2bn

. . . . . . . . . . . .aib1 aib2 . . . aibn

. . . . . . . . . . . .ajb1 ajb2 . . . ajbn

amb1 amb2 . . . ambn

⎟⎟⎟⎟⎟⎟⎟⎟⎠

.

If we swap the ith and jth rows of A we obtain

As =

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1a2. . .aj. . .ai. . .am

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

.

Let us now calculate the product AsB:

AsB =

⎜⎜⎜⎜⎜⎜⎜⎜⎝

a1b1 a1b2 . . . a1bn

a2b1 a2b2 . . . a2bn

. . . . . . . . . . . .ajb1 ajb2 . . . ajbn

. . . . . . . . . . . .aib1 aib2 . . . aibn

amb1 amb2 . . . ambn

⎟⎟⎟⎟⎟⎟⎟⎟⎠

= Cs.��

Page 87: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 67

Example 2.72. Let us consider the following two matrices

A =

⎝1 5 04 2 10 2 3

and

B =

⎝0 2 51 1 05 0 2

⎠ .

The product of these two matrices is

AB = C =

⎝5 7 57 10 22

17 2 6

Let us now swap the second and the third rows of the matrix A. The resultingmatrix is

As =

⎝1 5 00 2 34 2 1

⎠ .

Let us now calculate AsB:

AsB = Cs =

⎝5 7 5

17 2 67 10 22

⎠ .

Lemma 2.4. Let A ∈ Rm,r and B ∈ Rr,n be two compatible matrices such that

AB = O.

If two arbitrary rows ith and jth of the matrix A are swapped, the product of theresulting matrix As by the matrix B is

AsB = O.

Proof. For Lemma 2.3 the result of AsB is the null matrix with two swapped rows.Since all the rows of the null matrix are identical and composed of only zeros,AsB = O. ��Example 2.73. The product of the following matrices

A =

(5 10 0

)

and

B =

(0 −10 5

)

is the null matrix.

Page 88: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

68 2 Matrices

Let us now swap first and second rows of the matrix A and obtain As:

As =

(0 05 1

).

We can easily verify that AsB is also the null matrix.

Lemma 2.5. Let A ∈ Rn,n and B ∈ Rn,n be two compatible matrices and C ∈ Rn,n

the product matrixAB = C.

Let us consider that matrix As obtained by swapping two arbitrary columns, theith and jth, and the matrix Bs obtained by swapping the ith and jth rows.

It follows that the product of the matrix As by the matrix Bs is still the matrix C:

AsBs = C.

Proof. Let us consider the matrices

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

and

B =

⎜⎜⎝

b1,1 b1,2 . . . b1,n

b2,1 b2,2 . . . b2,n

. . . . . . . . . . . .bn,1 bn,2 . . . bn,n

⎟⎟⎠ .

Without a loss of generality let us assume i = 1 and j = 2, i.e. let us swap firstand second columns of the matrix A and first and second rows of the matrix B. Theresulting matrices are

As =

⎜⎜⎝

a1,2 a1,1 . . . a1,n

a2,2 a2,1 . . . a2,n

. . . . . . . . . . . .an,2 an,1 . . . an,n

⎟⎟⎠

and

Bs =

⎜⎜⎝

b2,1 b2,2 . . . b2,n

b1,1 b1,2 . . . b1,n

. . . . . . . . . . . .bn,1 bn,2 . . . bn,n

⎟⎟⎠ .

Let us calculate the product AsBS. The first scalar product of the first row of Asand the first column of Bs is

as1b1s = a1,2b2,1 +a1,1b1,1 +

n

∑k=3

a1,kbk,1 =n

∑k=1

a1,kbk,1 = a1b1.

Page 89: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 69

Analogously, we can verify that as1b2s = a1b2 and, more generally that

∀i, j : asibjs = aib

j.

Thus, AsBs = AB =C. ��

Example 2.74. Let us consider again the matrices

A =

⎝1 5 04 2 10 2 3

and

B =

⎝0 2 51 1 05 0 2

⎠ .

We know that their product is

AB = C =

⎝5 7 57 10 22

17 2 6

⎠ .

Let us swap first and second columns of the matrix A as well as first and secondrows of the matrix B. The resulting matrices are

As =

⎝5 1 02 4 12 0 3

and

B =

⎝1 1 00 2 55 0 2

⎠ .

The product matrix is again

AsBs = C =

⎝5 7 57 10 22

17 2 6

⎠ .

Lemma 2.6. Let A ∈ Rn,n and B ∈ Rn,n be two compatible matrices such that

AB = O.

If the ith and jth columns of the matrix A and the ith and jth rows of the matrix Bare swapped, the product of the resulting matrix As by the matrix Bs is still null

AsBs = O.

Page 90: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

70 2 Matrices

Proof. For Lemma 2.5 the product does not change. Thus it remains the nullmatrix. ��

The Sylvester’s Law of Nullity can be also expressed in a weaker form that isoften used in applied sciences and engineering.

Theorem 2.12. Weak Sylvester’s Law of Nullity. Let A ∈ Rn,n and B ∈ Rn,n suchthat AB = O. Let ρA and ρB be the ranks of the matrices A and B. It follows that

ρA +ρB ≤ n.

Proof. Let us swap the rows and the columns of the matrix A in order to have in theupper left part of the matrix a ρA×ρA non-singular sub-matrix. For Lemma 2.2, therow and column swap did not alter the rank of the matrix A. Let us indicate with Asthe matrix resulting from A after the row and column swaps.

Every time a column swap occurs on A, the ith column is swapped with the jth

column, a row swap occurs on B, the ith row is swapped with the jth row. Let usindicate with Bs the matrix B after these row swaps.

For Lemmas 2.4 and 2.6 it follows that

AsBs = O.

After this rearrangement of rows and columns (after this matrix transformation),let us partition the matrix As in the following way:

As =

(A1,1 A1,2A2,1 A2,2

)

where A1,1 has rank ρA and size ρA×ρA.Analogously, let us perform the partitioning of the matrix B in order to have B1,1

of size ρA×n.

Bs =

(B1,1B2,1

).

For Lemma 2.2 the rank of Bs is the same as the rank of B:

ρB = ρBs .

Since AsBs = O, it follows that

A1,1B1,1 +A1,2B2,1 = O

A2,1B1,1 +A2,2B2,1 = O.

Page 91: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 71

From the first equation

B1,1 =−A−11,1A1,2B2,1.

Let us consider the following non-singular matrix

P =

(I A−1

1,1A1,2

O I

).

If we calculate PB we obtain

PBs =

(O

B2,1

).

Since the matrix P is non-singular, for the Lemma 2.1, the matrix PBs has rank

ρPB = ρB.

It follows that the rank of B2,1 is ρB:

ρB2,1 = ρB.

The size of B2,1 is (n−ρA)× n. Hence, ρB can be at most (n−ρA). In otherwords,

ρB ≤ (n−ρA)⇒ ρA +ρB ≤ n. ��

Example 2.75. Let us consider the following two matrices verifying the hypothesesof the theorem:

A =

⎝1 0 05 1 00 0 0

and

B =

⎝0 0 00 0 00 0 1

⎠.

The product of the two matrices is AB = O. Furthermore, ρA = 2 and ρB = 1.Clearly n = 3 which is 2+1.

Example 2.76. Let us consider now the following matrices:

A =

⎝5 2 10 1 −24 2 0

Page 92: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

72 2 Matrices

and

B =

⎝−121

⎠.

We can easily verify that A is singular and its rank is ρA = 2. Clearly, ρA = 1.Moreover, we can verify that AB = O. Considering that n = 3, the weak Sylvester’slaw of nullity is verified since n = ρA +ρB.

It can be observed that if A is a non-singular matrix of order n and B is a vectorhaving n rows, the only way to have AB = O is if B is the null vector.

Exercises

2.1. Calculate the product of λ = 3 by the vector x = (2,−3,0,5)

2.2. Calculate the scalar product of x = (2,−3,1,1) by y = (3,3,4,−1)

2.3. Multiply the following two matrices:

A =

(2 1 −1−2 3 4

)

B =

⎝1 1 2 22 −3 1 3−1 −1 5 2

⎠.

2.4. Multiply the following two matrices:

A =

⎝7 −1 22 3 00 4 1

B =

⎝0 −3 24 1 −1

15 0 1

⎠.

Page 93: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

2.7 Rank of a Matrix 73

2.5. Calculate the determinant the following two matrices:

A =

⎝2 4 10 −1 01 8 0

B =

⎝0 8 11 −1 01 7 1

⎠.

2.6. For each of the following matrices, determine the values of k that make thematrix singular.

A =

⎝2 −1 22 5 0k 4 k+1

B =

⎝k −2 2− k

k+4 1 03 2 0

⎠.

C =

⎝k −2 2− k

k+4 1 02k+4 −1 2− k

⎠.

2.7. Compute the adj(A) where A is the following matrix.

A =

⎝5 0 46 2 −1

12 2 0

2.8. Invert the following matrices.

A =

(3 −38 2

)

B =

⎝2 0 21 −2 −50 1 1

Page 94: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

74 2 Matrices

2.9. Let us consider the following matrix A:

A =

⎝3 −1 20 1 20 −2 3

⎠.

1. Verify that A is invertible.2. Invert the matrix.3. Verify that AA−1 = I.

2.10. Find the rank of the following matrix

A =

⎝2 1 30 1 11 3 4

⎠ .

2.11. Determine the rank of the matrix A and invert it, if possible:

A =

⎝1 2 12 4 23 6 3

Page 95: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 3Systems of Linear Equations

3.1 Solution of a System of Linear Equations

Definition 3.1. A linear equation in R in the variables x1,x2, . . . ,xn is an equationof the kind:

a1x1 +a2x2 + . . .+anxn = b

where ∀ index i, ai is said coefficient of the equation, aixi is said ith term of theequation, and b is said known term. Coefficients and known term are constant andknown numbers in R while the variables are an unknown set of numbers in R thatsatisfy the equality.

Definition 3.2. Let us consider m (with m > 1) linear equations in the variablesx1,x2, . . . ,xn. These equations compose a system of linear equations indicated as:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1x1 +a1,2x2 + . . .+a1,nxn = b1

a2,1x1 +a2,2x2 + . . .+a2,nxn = b2

. . .

an,1x1 +an,2x2 + . . .+an,nxn = bn

.

Every ordered n-tuple of real numbers y1,y2, . . .yn such that

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1y1 +a1,2y2 + . . .+a1,nyn = b1

a2,1y1 +a2,2y2 + . . .+a2,nyn = b2

. . .

an,1y1 +an,2y2 + . . .+an,nyn = bn

is said solution of the system of linear equations.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_3

75

Page 96: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

76 3 Systems of Linear Equations

A system can be written as a matrix equation Ax = b where

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .am,1 am,2 . . . am,n

⎟⎟⎠

x =

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠

b =

⎜⎜⎝

b1

b2

. . .bm

⎟⎟⎠

The coefficient matrix A is said incomplete matrix. The matrix Ac ∈ Rm,n+1

whose first n columns are those of the matrix A and the (n+1)th column is thevector b is said complete matrix:

Ac = (A|b) =

⎜⎜⎝

a1,1 a1,2 . . . a1,n b1

a2,1 a2,2 . . . a2,n b2

. . . . . . . . . . . . . . .am,1 am,2 . . . am,n bm

⎟⎟⎠.

Two systems of linear equations are said to be equivalent if they have the samesolution. It can be observed that if two equations of a system (two rows of the matrixAc) are swapped, the solution does not change.

Theorem 3.1. Cramer’s Theorem. Let us consider a system of n linear equationsin n variables, Ax= b. If A is non-singular, there is only one solution simultaneouslysatisfying all the equations: if detA �= 0, then ∃!x such that Ax = b.

Proof. Let us consider the system Ax = b. If A is non-singular for the Theorem 2.6the matrix A is invertible, i.e. a matrix A−1 exists.

Page 97: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.1 Solution of a System of Linear Equations 77

Let us multiply A−1 by the equation representing the system:

A−1 (Ax) = A−1b⇒⇒

(A−1A

)x = A−1b⇒

⇒ Ix = A−1b⇒ x = A−1b

For Theorem 2.4 the inverse matrix A−1 is unique and thus also the vector x isunique, i.e. the only one solution solving the system exists. ��

We could verify that A−1b is the solution of the system by substituting it withinthe system Ax = b. Obviously it follows that

A(

A−1b)=(AA−1)b = Ib = b,

i.e. the system is solved.Thus, on the basis of the Cramer’s Theorem, in order to solve a system of lin-

ear equations, the inverse matrix of the coefficient matrix should be computed andmultiplied by the vector of known terms. In other words, the solution of a system oflinear equations Ax = b is x = A−1b.

Definition 3.3. A system of linear equations that satisfies the hypotheses of theCramer’s Theorem is said a Cramer system.

Example 3.1. Solve the following system by inverting the coefficient matrix:

⎧⎪⎨

⎪⎩

2x− y+ z = 3

x+2z = 3

x− y = 1

.

The system can be re-written as a matrix equation Ac = b where

A =

⎝2 −1 11 0 21 −1 0

and

b =

⎝331

Page 98: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

78 3 Systems of Linear Equations

In order to verify the non-singularity, let us compute detA. It can be easily seenthat detA = 1. Thus, the matrix is non-singular and is invertible. The inverse matrixA−1 = 1

detA adj(a).The transpose is:

AT =

⎝2 1 1−1 0 −11 2 0

The inverse matrix is:

1detA adj(A) = 1

1

⎝2 −1 −22 −1 −3−1 1 1

⎠.

Thus x = A−1b = (6−3−2,6−3−3,−3+3+1) = (1,0,1).

Definition 3.4. Let us consider a system of linear equations

Ax = b

where

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

and

b =

⎝b1

b2

. . .bn

⎠ .

The hybrid matrix with respect to the ith column is the matrix Ai obtained fromA by substituting the ith column with b:

Ai =

⎜⎜⎝

a1,1 a1,2 . . . b1 . . . a1,n

a2,1 a2,2 . . . b2 . . . a2,n

. . . . . . . . . . . . . . . . . .an,1 an,2 . . . bn . . . an,n

⎟⎟⎠ .

Equivalently if we write A as a vector of column vectors:

A =(

a1 a1 . . . ai−1 ai ai+1 . . . an)

the hybrid matrix Ai would be

Ai =(

a1 a1 . . . ai−1 b ai+1 . . . an).

Page 99: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.1 Solution of a System of Linear Equations 79

Theorem 3.2. Cramer’s Method. For a given system of linear equations Ax = bwith A non-singular, a generic solution xi element of x can be computed as, see [2]:

xi =detAi

detA

where Ai is the hybrid matrix with respect to the ith column.

Proof. Let us consider a system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1x1 +a1,2x2 + . . .+a1,nxn = b1

a2,1x1 +a2,2x2 + . . .+a2,nxn = b2

. . .

an,1x1 +an,2x2 + . . .+an,nxn = bn

.

We can compute x = A−1b:

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠= 1

detA

⎜⎜⎝

A1,1 A2,1 . . . An,1

A1,2 A2,2 . . . An,2

. . . . . . . . . . . .A1,n A2,n . . . An,n

⎟⎟⎠

⎜⎜⎝

b1

b2

. . .bn

⎟⎟⎠

that is

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠= 1

detA

⎜⎜⎝

A1,1b1 +A2,1b2 + . . .+An,1bn

A1,2b1 +A2,2b2 + . . .+An,2bn

. . .A1,nb1 +A2,nb2 + · · ·+An,nbn

⎟⎟⎠.

For the I Laplace Theorem the vector of solutions can be written as:

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠= 1

detA

⎜⎜⎝

detA1detA2. . .

detAn

⎟⎟⎠.

��

Page 100: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

80 3 Systems of Linear Equations

Example 3.2. Considering the system of the previous example, where detA = 1,

x1 = det

⎝3 −1 13 0 21 −1 0

⎠= 1

x2 = det

⎝2 3 11 3 21 1 0

⎠= 0

and,

x3 = det

⎝2 −1 31 0 31 −1 1

⎠= 1.

Definition 3.5. A system of m linear equations in n variables is said compatible if ithas at least one solution, determined if it has only one solution, undetermined if ithas infinite solutions, and incompatible if it has no solutions.

Theorem 3.3. Rouchè-Capelli Theorem (Kronecker-Capelli Theorem). A sys-tem of m linear equations in n variables Ax = b is compatible if and only if both theincomplete and complete matrices (A and Ac respectively) are characterised by thesame rank ρA = ρAc = ρ named rank of the system, see [3].

A proof of the Rouchè-Capelli theorem is given in Appendix B.The non-singular submatrix having order ρ is said fundamental submatrix. The

first practical implication of the Rouchè-Capelli Theorem is that when a system ofm linear equations in n variables is considered, its compatibility can be verified bycomputing ρA and ρAc .

• If ρA < ρAc the system is incompatible and thus it has no solutions.• If ρA = ρAc the system is compatible. Under these conditions, three cases can be

identified.

– Case 1: If ρA = ρAc = ρ = n = m, the system is a Cramer’s system and canbe solved by the Cramer’s method.

– Case 2: If ρA = ρAc = ρ = n < m, ρ equations of the system compose aCramer’s system (and as such has only one solution). The remaining m− ρequations are a linear combination of the other, these equations are redundantand the system has only one solution.

Page 101: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.1 Solution of a System of Linear Equations 81

Algorithm 2 Detection of the General Solutionselect the ρ rows linearly independent rows of the complete matrix Ac

choose (arbitrarily) n−ρ variables and replace them with parameterssolve the system of linear equations with respect to the remaining variablesexpress the parametric vector solving the system of linear equations as a sum of vectors whereeach parameter appears in only one vector

– Case 3: If ρA = ρAc = ρ

{< n

≤ m, the system is undetermined and has ∞n−ρ

solutions.

In the case of undetermined systems of linear equations the general parametricsolution can be found by performing the procedure illustrated in Algorithm 2.

Example 3.3. Let us consider the following system of linear equations:

⎧⎪⎨

⎪⎩

3x1 +2x2 + x3 = 1

x1− x2 = 2

2x1 + x3 = 4

.

The incomplete and complete matrices associated with this system are:

A =

⎝3 2 11 −1 02 0 1

and

Ac =

⎝3 2 1 11 −1 0 22 0 1 4

The det(A) = −3. Hence, the rank ρA = 3. It follows that ρAc = 3 since a non-singular 3× 3 submatrix can be extracted (A) and a 4× 4 submatrix cannot be ex-tracted since the size of Ac is 3× 4. Hence, ρA = ρAc = m = n = 3 (case 1). Thesystem can be solved by Cramer’s Method.

Page 102: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

82 3 Systems of Linear Equations

Only one solution exists and is:

x1 =

det

⎝1 2 12 −1 04 0 1

−3=

13

x2 =

det

⎝3 1 11 2 02 4 1

−3=−5

3

x3 =

det

⎝3 2 11 −1 22 0 4

−3=

103.

Example 3.4. Let us now consider the following system of linear equations:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

3x1 +2x2 + x3 = 1

x1− x2 = 2

2x1 + x3 = 4

6x1 + x2 +2x3 = 7

.

In this case we have m = 4 equations and n = 3 variables. From the previousexample we already know that ρA = 3. The complete matrix has also rank ρAc = 3because the fourth row is a linear combination of the first three (the fourth row is thesum of the first three rows). Hence ρA = ρAc = n = 3≤m = 4. This is a case 2. Thesystem has only one solution, that is that calculated above and the fourth equationis redundant (the same solution satisfies this equation as well).

Example 3.5. Let us now consider the following system of linear equations:

⎧⎪⎨

⎪⎩

3x1 +2x2 +5x3 = 5

x1− x2 = 0

2x1 +2x3 = 2

.

In this case we have m = 3 equations and n = 3 variables. The matrix associatedwith the system is

A =

⎝3 2 51 −1 02 0 2

⎠.

Page 103: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.1 Solution of a System of Linear Equations 83

It can be observed that the third column is linear combination of the other two.Hence, this matrix is singular. As such, it cannot be solved by Cramer’s Method(nor by Cramer’s Theorem). The rank of this matrix is 2 as well as the rank of thecomplete matrix. Hence, we have ρA = ρAc = 2 < n = 3. For the Rouchè-CapelliTheorem the system has ∞n−ρ = ∞1 solutions. This is a case 3.

It can be observed that any solution proportionate to (1,1,1) solves the systemabove, e.g. (100,100,100) would be a solution of the system. We can syntheticallywrite that (α,α,α) = α (1,1,1), ∀α ∈ R.

Example 3.6. Finally let us consider the system of linear equations:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

3x1 +2x2 + x3 = 1

x1− x2 = 2

2x1 + x3 = 4

6x1 + x2 + x3 = 6

.

We already know from the examples above that ρA = 3. In this case the ρAc = 4because det(Ac) =−6 �= 0. Hence, ρA �= ρAc . The system is incompatible., i.e. thereis no solution satisfying the system.

Example 3.7. Let us consider the following system of linear equations:⎧⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎩

x1 + x2− x3 = 2

2x1 + x3 = 1

x2 +3x3 =−3

2x1 + x2 +4x3 =−2

x1 +2x2 +2x3 =−1

.

The incomplete and complete matrices associated with this system are:

A =

⎜⎜⎜⎜⎝

1 1 −12 0 10 1 32 1 41 2 2

⎟⎟⎟⎟⎠

and

Ac =

⎜⎜⎜⎜⎝

1 1 −1 22 0 1 10 1 3 −32 1 4 −21 2 2 −1

⎟⎟⎟⎟⎠

.

Page 104: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

84 3 Systems of Linear Equations

It can be verified that the ρA = ρAc = 3. Thus, the system for the Rouchè-Capellitheorem is compatible. Since ρ = n < m we are in case 2. The fourth row of Ac

is a linear combination of the second and third rows (it is the sum of those tworows). The fifth row of Ac is a linear combination of first and third rows (it is thesum of those two rows). Thus the last two equations are redundant and the solution(1,0,−1) solves the system of five equations in three variables.

Example 3.8. Let us consider the following system of linear equations:⎧⎪⎨

⎪⎩

5x+ y+6z = 6

2x− y+ z = 1

3x−2y+ z = 1.

The incomplete and complete matrices associated with this system are:

A =

⎝5 1 62 −1 13 −2 1

and

Ac =

⎝5 1 6 62 −1 1 13 −2 1 1

⎠.

The third column of the matrix A is some of the first two columns, hence it issingular. It can be seen that ρA = 2 = ρAc . The system is therefore compatible.Moreover ρA = ρAc = 2 < n = 3. Hence, the system is undetermined has ∞1 solu-tions.

In order to find the general solution, let us cancel the first equation and let uspose x = α with α real parameter. It follows that our problem becomes

{2α− y+ z = 1

3α−2y+ z = 1⇒

{2α− y = 1− z

3α−2y = 1− z⇒ 2α− y = 3α−2y⇒ y = α.

By substitution we obtain z = 1−α . Thus, the general solution is

(α,α,1−α) = (α,α,−α)+(0,0,1) = α (1,1,−1)+(0,0,1) .

Example 3.9. Let us consider the following system of linear equations:⎧⎪⎨

⎪⎩

5x+ y+6z = 6

2x− y+ z = 1

3x−2y+ z = 0.

Page 105: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.2 Homogeneous Systems of Linear Equations 85

We know that ρA = 2. It can be easily seen that ρAc = 3. Hence ρA = 2< ρAc = 3,i.e. the system is impossible.

3.2 Homogeneous Systems of Linear Equations

Definition 3.6. A system of linear equations Ax = b is said homogeneous if thevector of known terms b is composed of only zeros and is indicated with O:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1x1 +a1,2x2 + . . .+a1,nxn = 0

a2,1x1 +a2,2x2 + . . .+a2,nxn = 0

. . .

am,1x1 +am,2x2 + . . .+am,nxn = 0

.

Theorem 3.4. A homogeneous system of linear equations is always compatible asit always has at least the solution composed of only zeros.

Proof. From the properties of the matrix product AO = O, ∀ matrix A ∈ Rm,n andvector O ∈ Rn,1. ��

Thus, for the Rouchè-Capelli Theorem, if the rank ρ of the system is equal ton, then the system is determined and has only one solution, that is O. If ρ < n thesystem has ∞n−ρ solutions in addition to O.

Example 3.10. The following homogeneous system of linear equations⎧⎪⎨

⎪⎩

x+ y = 0

2x−3y+4z = 0

2y+5z = 0

is associated with its incomplete matrix

A =

⎝1 1 02 −3 40 2 5

⎠ .

The determinant of the incomplete matrix is (−15−8−10) = −33. Thus, thematrix is non-singular and consequently ρA = 3. The system is thus determined. Ifwe apply Cramer’s method we can easily find that the only solution of this systemis 0,0,0.

Theorem 3.5. If the n-tuple α1,α2, . . . ,αn is a solution of the homogeneous systemAx = O, then ∀λ ∈ R : λα1,λα2, . . . ,λαn is also a solution of the system.

Page 106: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

86 3 Systems of Linear Equations

Proof. Let us consider the generic ith row of the matrix A : ai,1,ai,2, . . . ,ai,n. Let usmultiply this row by λα1,λα2, . . . ,λαn. The result of the multiplication is ai,1λα1+ai,2λα2+ . . .+ai,nλαn = λ (α1ai,1 +α2ai,2 + . . .+αnai,n) = λ0= 0. This operationcan be repeated ∀ith row. Thus λα1,λα2, . . . ,λαn is a solution of the system ∀λ ∈R.��

Example 3.11. The following homogeneous system of linear equations⎧⎪⎨

⎪⎩

3x+2y+ z = 0

4x+ y+3z = 0

3x+2y+ z = 0

has the following incomplete matrix

A =

⎝3 2 14 1 33 2 1

which is singular. Hence it follows that ρA = ρAc = 2 and that the system has ∞solutions. For example 1,−1,−1 is a solution of the system. Also, (2,−2,−2) is asolution of the system as well as (5,−5,−5) or (1000,−1000,−1000). In general(λ ,−λ ,−λ ) is a solution of this system ∀λ ∈ R.

Theorem 3.6. Let us consider a homogeneous system Ax = O. If (α1,α2, . . . ,αn)and (β1,β2, . . . ,βn) are both solutions of the system, then every linear combinationof these two n-tuple is solution of the system: ∀λ ,μ ∈R, (λα1+μβ1,λα2 +μβ2, . . . ,λαn +μβn) is also a solution.

Proof. Let us consider the generic ith row of the matrix A : ai,1,ai,2, . . . ,ai,n. Letus multiply this row by λα1 + μβ1,λα2 + μβ2, . . . ,λαn + μβn. The result ofthe multiplication is ai,1 (λα1 +μβ1)+ai,2 (λα2 +μβ2)+ . . .+ai,n (λαn +μβn) =λ (ai,1α1 +ai,2α2 + . . .+ai,nαn)+μ (ai,1β1 +ai,2β2 + . . .+ai,nβn) = 0+0= 0. ��

Example 3.12. Let us consider again the homogeneous system of linear equations⎧⎪⎨

⎪⎩

3x+2y+ z = 0

4x+ y+3z = 0

3x+2y+ z = 0.

We know that this system has ∞ solutions and that (1,−1,−1) and (2,−2,−2)are two solutions. Let us choose two arbitrary real numbers λ = 4 and μ = 5. Letus calculate the linear combination of these two solutions by means of the scalars λand μ :

λ (1,−1,−1)+μ (2,−2,−2) = 4(1,−1,−1)+5(2,−2,−2) = (14,−14,−14)

that is also a solution of the system.

Page 107: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.2 Homogeneous Systems of Linear Equations 87

Theorem 3.7. Let Ax = O be a homogeneous system of n equations in n+ 1 vari-ables. Let the rank ρ associated with the system be n. This system has ∞1 solutionsproportionate to the n-tuple

(D1,−D2, . . . ,(−1)i+1Di . . .(−1)n+2Dn+1

)where ∀ in-

dex i, Di is the determinant of the matrix A after the ith column has been cancelled.

Proof. Let us consider the matrix A:

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n+1

a2,1 a2,2 . . . a2,n+1

. . . . . . . . . . . .an,1 an,2 . . . an,n+1

⎟⎟⎠.

Let us indicate with A a matrix ∈ Rn+1,n+1 constructed from the matrix A andadding one row

A =

⎜⎜⎜⎜⎜⎜⎝

ar,1 ar,2 . . . ar,n+1

a1,1 a1,2 . . . a1,n+1

a2,1 a2,2 . . . a2,n+1

. . . . . . . . . . . .an,1 an,2 . . . an,n+1

an+1,1 an+1,2 . . . an+1,n+1

⎟⎟⎟⎟⎟⎟⎠

.

The elements of the n-tuple D1,−D2, . . . ,(−1)nDn+1 can be seen as the cofactorsAn+1,1, An+1,2, . . . , An+1,n+1 related to (n+1)th row of the matrix A. Thus, if wemultiply the ith row of the matrix A by D1,−D2, . . . ,(−1)nDn+1 we obtain:

ai,1D1−ai,2D2 + . . .+(−1)n ai,n+1Dn+1 =

= ai,1An+1,1 +ai,2An+1,2 + . . .+ai,n+1An+1,n+1.

This expression is equal to 0 due to the II Laplace Theorem. Thus D1,−D2, . . . ,(−1)nDn+1 is a solution of the system. ��

Example 3.13. Let us consider the following homogeneous system of linear equa-tions:

{2x+ y+ z = 0

x+0y+ z = 0.

The associated matrix is

A =

(2 1 11 0 1

).

Cancelling first, second, and third column and computing the respective deter-minants we obtain that the ∞ solutions solving this system are all proportionate to(1,−1,−1).

Page 108: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

88 3 Systems of Linear Equations

3.3 Direct Methods

Let us consider a Cramer’s system Ax = b where A ∈ Rn,n. The solution of thissystem can be laborious indeed as, by applying the Cramer’s Theorem (matrix in-version in Theorem 3.1), it would require the calculation of one determinant of an order matrix and n2 determinants of n− 1 order matrices. The application of theCramer’s Method (see Theorem 3.2), would require the calculation of one deter-minant of a n order matrix and n determinants of n order matrices. As shown inChap. 2, a determinant is the sum of n! terms where each term is the result of amultiplication, see also [4].

Let us identify each term with a mathematical operation and we can concludethat, if we neglect computational simple operations such as the transposition, thesolution of a system of linear equations requires at least n! + n2 ((n−1)!) andn!+ n(n!) mathematical operations by matrix inversion and Cramer’s Method, re-spectively. It can be easily verified that the computational cost of the matrix inver-sion is the same as that of the Cramer’s Method. If n = 6, the solution of the systemrequires 5040 mathematical operations by matrix inversion or Cramer’s Method.Hence, it can be very laborious to be solved by hand. On the other hand, a moderncomputer having 2.8 GHz clock frequency can perform 2.8 billions of mathemati-cal operations per second and can quickly solve a system of six linear equations insix variables in a fraction of second. If the system is composed of 50 equations in50 variables (this would not even be a large problem in many engineering applica-tions) the modern computer will need to perform more than 1.55×1066 operationsby Cramer’s Method, thus requiring over 1.75× 1046 millennia to be solved. If weconsider that the estimated age of the universe approximately 13× 106 millennia,this waiting time is obviously unacceptable, see [5].

On the basis of this consideration during the last centuries mathematicians in-vestigated methods to solve systems of linear equations by drastically reduction theamount of required calculations. One class of these methods, namely direct methodsperform a set of matrix transformations to re-write the system of linear equation ina new form that is easy to be solved.

Definition 3.7. Let A ∈ Rm,n. The matrix A is said staircase matrix (a.k.a. row ech-elon form) if the following properties are verified:

• rows entirely consisting of zeros are placed at the bottom of the matrix• in each non-null row, the first non-null element cannot be in a column to the right

of any non-null element below it: ∀ index i, if ai, j = 0 then ai+1,1 = 0,ai+1,2 =0, . . . ,ai+1, j−1 = 0

Definition 3.8. Let A ∈ Rm,n be a staircase matrix. The first non-null element ineach row is said pivot element of the row.

Page 109: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 89

Example 3.14. The following matrices are staircase matrices:

⎜⎜⎝

2 6 1 70 0 1 30 0 2 30 0 0 0

⎟⎟⎠

⎜⎜⎝

3 2 1 70 2 1 30 0 2 30 0 0 4

⎟⎟⎠.

Definition 3.9. Let A ∈ Rm,n. The following operations on the matrix A are saidelementary row operations:

• E1: swap of two rows ai and aj

ai ← ajaj ← ai

• E2: multiplication of a row ai by a scalar λ ∈ R

ai ← λai

• E3: substitution of a row ai by the sum of the row ai to another row aj

ai ← ai +aj

By combining E2 and E3, we obtain a transformation consisting of the substitu-tion of the row ai by the sum of the row ai to another row aj multiplied by a scalarλ :

ai ← ai +λaj.

It can be easily observed that the elementary row operations do not affect thesingularity of the matrix of square matrices or, more generally, the rank of matrices.

Definition 3.10. Equivalent Matrices. Let us consider a matrix A ∈ Rm,n. If weapply the elementary row operations on A we obtain a new matrix C ∈ Rm,n. Thismatrix is said equivalent to A.

Theorem 3.8. For every matrix A a staircase matrix equivalent to it exists: ∀A ∈Rm,n : exists a staircase matrix C ∈ Rm,n equivalent to it.

Page 110: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

90 3 Systems of Linear Equations

Example 3.15. Let us consider the matrix

⎜⎜⎝

0 2 −1 2 50 2 0 1 01 1 0 1 21 1 1 −1 0

⎟⎟⎠.

Let us swap first and third row,

⎜⎜⎝

1 1 0 1 20 2 0 1 00 2 −1 2 51 1 1 −1 0

⎟⎟⎠,

then, let us add to the fourth row the first row multiplied by −1

⎜⎜⎝

1 1 0 1 20 2 0 1 00 2 −1 2 50 0 1 −2 −2

⎟⎟⎠,

then, let us add to third row the second row multiplied by −1

⎜⎜⎝

1 1 0 1 20 2 0 1 00 0 −1 1 50 0 1 −2 −2

⎟⎟⎠,

finally, let us add to the fourth row the third row,

⎜⎜⎝

1 1 0 1 20 2 0 1 00 0 −1 1 50 0 0 −1 3

⎟⎟⎠.

The obtained matrix is a staircase matrix.

Definition 3.11. Let us consider a system of linear equations Ax = b. If the com-plete matrix Ac is a staircase matrix then the system is said staircase system.

Page 111: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 91

Definition 3.12. Equivalent Systems. Let us consider two systems of linear equa-tions in the same variables: Ax = b and Cx = d. These two systems are equivalentif they have the same solutions.

Theorem 3.9. Let us consider a system of m linear equations in n variables Ax = b.Let Ac ∈ Rm,n+1 be the complete matrix associated with this system. If another sys-tem of linear equations is associated with a complete matrix Ac ∈Rm,n+1 equivalentto Ac, then the two systems are also equivalent.

Proof. By following the definition of equivalent matrices, if Ac is equivalent toAc, then Ac can be generated from Ac by applying the elementary row operations.Each operation of the complete matrix obviously has a meaning in the system oflinear equations. Let us analyse the effect of the elementary row operations on thecomplete matrix.

• When E1 is applied, i.e. the swap of two rows, the equations of the system areswapped. This operation has no effect on the solution of the system. Thus afterE1 operation the modified system is equivalent to the original one.

• When E2 is applied, i.e. a row is multiplied by a non-null scalar λ , a scalaris multiplied to all the terms of the equation. In this case the equation ai,1x1 +ai,2x2 + . . .+ai,nxn = bi is substituted by

λai,1x1 +λai,2x2 + . . .+λai,nxn = λbi.

The two equations have the same solutions and thus after E2 operation the mod-ified systems is equivalent to the original one.

• When E3 is applied, i.e. a row is added to another row, the equation ai,1x1 +ai,2x2 + . . .+ai,nxn = bi is substituted by the equation

(ai,1 +a j,1

)x1 +

(ai,2 +a j,2

)x2 + . . .+(ai,n +a j,n)xn = bi +b j.

If the n-tuple y1,y2, . . . ,yn is solution of the original system is obviously solutionof ai,1x1 +ai,2x2 + . . .+ai,nxn = bi and a j,1x1 +a j,2x2 + . . .+a j,nxn = b j. Thus,y1,y2, . . . ,yn also verifies

(ai,1 +a j,1

)x1+

(ai,2 +a j,2

)x2+ . . .+(ai,n +a j,n)xn =

bi+b j. Thus, after E3 operation the modified system is equivalent to the originalone.��

By combining the results of Theorems 3.8 and 3.9, the following Corollary canbe easily proved.

Corollary 3.1. Every system of linear equations is equivalent to a staircase systemof linear equations.

This is the theoretical foundation for the so called direct methods, see [6]. Letus consider a system of n linear equations in n variables Ax = b with A ∈ Rn,n.The complete matrix Ac can be then manipulated by means of the elementary rowoperations to generate an equivalent staircase system. The aim of this manipulation

Page 112: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

92 3 Systems of Linear Equations

is to have a triangular incomplete matrix. The transformed system can then be solvedwith a modest computational effort. If the matrix A is triangular the variables areuncoupled: in the case of upper triangular A, the last equation is in only one variableand thus can be independently solved; the last but one equation is in two variablesbut one of them is known from the last equation thus being in one variable and soon. An upper triangular system is of the kind

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1x1 +a1,2x2 + . . .+a1,nxn = b1

a2,2x2 + . . .+a2,nxn = b2

. . .

an,nxn = bn.

The system can be solved row by row by sequentially applying⎧⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎩

xn =bn

an,n

xn−1 =bn−1−an−1,nxn

an−1,n−1

. . .

xi =bi−∑n

j=i+1 ai, jx j

ai,i.

In an analogous way, if A is lower triangular, the first equation is in only one vari-able and thus can be independently solved; the second equation is in two variablesbut one of them is known from the first equation thus being in one variable and so on.

3.3.1 Gaussian Elimination

The Gaussian elimination, see [6], is a procedure that transforms any system of lin-ear equations into an equivalent triangular system. This procedure, although namedafter Carl Friedrich Gauss, was previously presented by Chinese mathematicians inthe second century AC. The Gaussian elimination, starting from a system Ax = bconsists of the following steps.

• Construct the complete matrix Ac

• Apply the elementary row operations to obtain a staircase complete matrix andtriangular incomplete matrix

• Write down the new system of linear equations• Solve the nth equation of the system and use the result to solve the (n−1)th

• Continue recursively until the first equation

Example 3.16. Let us solve by Gaussian elimination the following (determined) sys-tem of linear equations:

⎧⎪⎨

⎪⎩

x1− x2 + x3 = 1

x1 + x2 = 4

2x1 +2x2 +2x3 = 9

.

Page 113: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 93

The associated complete matrix is

Ac = (A|b) =

⎝1 −1 1 11 1 0 42 2 2 9

⎠.

By applying the elementary row operations we obtain the staircase matrix

Ac = (A|b) =

⎝1 −1 1 10 2 −1 30 0 2 1

⎠.

The matrix corresponds to the system

⎧⎪⎨

⎪⎩

x1− x2 + x3 = 1

2x2− x3 = 3

2x3 = 1

.

From the last equation, x3 can be immediately derived: x3 =12 . Then x3 is sub-

stituted in the second equation and x2 is detected: x2 =74 . Finally, after substituting,

x1 =94 .

Let us determine the general transformation formulas of the Gaussian elimina-tion. A system of linear equation Ax = b can be re-written as

n

∑j=1

ai, jx j = bi

for i = 1,2, . . . ,n. Let us pose a(1)i, j = ai, j and b(1)i = bi. Hence, the matrix A at thefirst step is

A(1) =

⎜⎜⎜⎝

a(1)1,1 a(1)1,2 . . . a(1)1,n

a(1)2,1 a(1)2,2 . . . a(1)2,n. . . . . . . . . . . .

a(1)n,1 a(1)n,2 . . . a(1)n,n

⎟⎟⎟⎠

and the system can be written as

{a(1)1,1x1 +∑n

j=2 a(1)1, j x j = b(1)1

a(1)i,1 x1 +∑nj=2 a(1)i, j x j = b(1)i i = 2,3, . . . ,n.

Page 114: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

94 3 Systems of Linear Equations

Let us consider the first equation of the system. Let us divide this equation by

a(1)1,1:

x1 +n

∑j=2

a(1)1, j

a(1)1,1

x j = b(1)1 .

Let us now generate n− 1 equations by multiplying the latter equation by−a1

2,1,−a13,1, . . . ,−a1

n,1, respectively:

−a(1)i,1 x1 +∑nj=2

−a(1)i,1 a(1)1, j

a(1)1,1

x j =−a(1)i,1

a(1)1,1

b(1)1 i = 2,3, . . . ,n.

These n−1 equations are equal to the first row of the system after a multiplicationby a scalar. Thus, if we add the first of these equations to the second of the originalsystem, the second of these equations to the third of the original system, . . ., the lastof these equations to the nth of the original system, we obtain a new system of linearequations that is equivalent to the original one and is

⎧⎪⎨

⎪⎩

a(1)1,1x1 +∑nj=2 a(1)1, j x j = b(1)1

a(1)i,1 x1 +∑nj=2 a(1)i, j x j −a(1)i,1 x1 +∑n

j=2−a(1)i,1 a(1)1, j

a(1)1,1

x j = b(1)i − a(1)i,1

a(1)1,1

b(1)1 i = 2,3, . . . ,n⇒

⎧⎪⎨

⎪⎩

a(1)1,1x1 +∑nj=2 a(1)1, j x j = b(1)1

∑nj=2

(a(1)i, j −

a(1)i,1 a(1)1, j

a(1)1,1

)x j = b(1)i − a(1)i,1

a(1)1,1

b(1)1 i = 2,3, . . . ,n⇒

{a(1)1,1x1 +∑n

j=2 a(1)1, j x j = b(1)1

∑nj=2 a(2)i, j x j = b(2)i i = 2,3, . . . ,n

where ⎧⎪⎪⎨

⎪⎪⎩

a(2)i, j = a(1)i, j −a(1)i,1 a(1)1, j

a(1)1,1

b(2)i = b(1)i − a(1)i,1

a(1)1,1

b(1)1 .

Thus, the matrix A at the second step is

A(2) =

⎜⎜⎜⎝

a(1)1,1 a(1)1,2 . . . a(1)1,n

0 a(2)2,2 . . . a(2)2,n. . . . . . . . . . . .

0 a(2)n,2 . . . a(2)n,n

⎟⎟⎟⎠

We can now repeat the same steps for the system of n− 1 equations in n− 1unknowns

n

∑j=2

a(2)i, j x j = b(2)i

Page 115: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 95

for i = 2,3, . . . ,n. We can re-write this system as

{a(2)2,2x2 +∑n

j=3 a(2)1, j x j = b(2)2

a(2)i,2 x2 +∑nj=3 a(2)i, j x j = b(2)i i = 3,4, . . . ,n.

Let us multiply the second equation by − a(2)i,2

a(2)2,2

for i = 2,3, . . . ,n thus generating

n−2 new equations

−a(2)i,2 x2 +∑nj=3

−a(2)i,2 a(2)2, j

a(2)2,2

x j =−a(2)i,2

a(2)2,2

b(2)2 i = 3,4, . . . ,n.

and sum them, one by one, to the last n− 2 equations of the system at the secondstep

⎧⎪⎨

⎪⎩

a(2)2,2x2 +∑nj=3 a(2)2, j x j = b(2)2

∑nj=3

(a(2)i, j −

a(2)i,2 a(2)2, j

a(2)2,2

)x j = b(2)i − a(2)i,2

a(2)2,2

b(2)2 i = 3,4, . . . ,n⇒

{a(2)2,2x2 +∑n

j=3 a(2)2, j x j = b(2)2

∑nj=2 a(3)i, j x j = b(3)i i = 3,4 . . . ,n

where ⎧⎪⎪⎨

⎪⎪⎩

a(3)i, j = a(2)i, j −a(2)i,2 a(2)2, j

a(2)2,2

b(3)i = b(2)i − a(2)i,2

a(2)2,2

b(2)2 .

The matrix associated with the system at the third step becomes

A(3) =

⎜⎜⎜⎜⎜⎜⎝

a(1)1,1 a(1)1,2 a(1)1,3 . . . a(1)1,n

0 a(2)2,2 a(2)2,3 . . . a(2)2,n

0 0 a(3)3,3 . . . a(3)3,n. . . . . . . . . . . . . . .

0 0 a(3)n,3 . . . a(3)n,n

⎟⎟⎟⎟⎟⎟⎠

.

By repeating these steps for all the rows we finally reach a triangular system inthe form ⎛

⎜⎜⎜⎜⎜⎜⎝

a(1)1,1 a(1)1,2 a(1)1,3 . . . a(1)1,n

0 a(2)2,2 a(2)2,3 . . . a(2)2,n

0 0 a(3)3,3 . . . a(3)3,n. . . . . . . . . . . . . . .

0 0 0 . . . a(n)n,n

⎟⎟⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

x1

x2

x3

. . .xn

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎜⎝

b(1)1

b(2)2

b(3)3. . .

b(n)n

⎟⎟⎟⎟⎟⎠.

As shown above, this system is triangular and can be easily solved.

Page 116: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

96 3 Systems of Linear Equations

The generic Gaussian transformation formulas at the step k can be thus writtenas:

a(k+1)i, j = a(k)i, j −

a(k)i,k

a(k)k,k

a(k)k, j i, j = k+1, . . . ,n

b(k+1)i = b(k)i − a(k)i,k

a(k)k,k

b(k)k i = k+1, . . . ,n.

3.3.1.1 Row Vector Notation for Gaussian Elimination

Let us know write an equivalent formulation of the Gaussian transformation by us-ing the row vector notation. Let us consider a system of linear equations in a matrixformulation:

Ax = b

and let us write the complete matrix Ac in terms of its row vectors

Ac =

⎜⎜⎝

r1r2. . .rn

⎟⎟⎠

and, to emphasize that we are working at the step one we can write the completematrix as

Ac(1) =

⎜⎜⎜⎝

r(1)1

r(1)2. . .

r(1)n

⎟⎟⎟⎠.

The Gaussian transformation to obtain the matrix at the step (2) are:

r(2)1 = r(1)1

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

(−a(1)2,1

a(1)1,1

)r(1)1

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

(−a(1)3,1

a(1)1,1

)r(1)1

. . .

r(2)n = r(1)n +

(−a(1)n,1

a(1)1,1

)r(1)1 .

Page 117: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 97

After the application of these steps the complete matrix can be written as

Ac(2) =

⎜⎜⎜⎝

a(2)1,1 a(2)1,2 . . . a(2)1,n b(2)1

0 a(2)2,2 . . . a(2)2,n b(2)2. . . . . . . . . . . . . . .

0 a(2)n,2 . . . a(2)n,n b(2)n

⎟⎟⎟⎠.

The Gaussian transformation to obtain the matrix at the step (3) are:

r(3)1 = r(2)1

r(3)2 = r(2)2

r(3)3 = r(2)3 +

(−a(1)3,2

a(2)2,2

)r(2)2

. . .

r(3)n = r(2)n +

(−a(2)n,2

a(2)2,2

)r(2)2

which leads to the following complete matrix

Ac(3) =

⎜⎜⎜⎜⎜⎜⎝

a(3)1,1 a(3)1,2 . . . a(3)1,n b(3)1

0 a(3)2,2 . . . a(3)2,n b(3)2

0 0 . . . a(3)3,n b(3)3. . . . . . . . . . . . . . .

0 0 . . . a(3)n,n b(3)n

⎟⎟⎟⎟⎟⎟⎠

.

At the generic step (k+1) the Gaussian transformation formulas are

r(k+1)1 = r(k)1

r(k+1)2 = r(k)2

. . .

r(k+1)k = r(k)k

r(k+1)k+1 = r(k)k+1 +

(−a(k)k+1,k

a(k)k,k

)r(k)k

r(k+1)k+2 = r(k)k+2 +

(−a(k)k+2,k

a(k)k,k

)r(k)k

. . .

r(k+1)n = r(k)n +

(−a(k)n,k

a(k)k,k

)r(k)k

which completes the description of the method.

Page 118: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

98 3 Systems of Linear Equations

Equivalently we can present the Gaussian elimination as an algorithm that in-spects the columns and the rows of the matrix. With reference to a system of n lin-ear equations in n variables and indicating with rk the generic row of the completematrix Ac, the pseudocode of the Gaussian elimination is presented in Algorithm 3.

Algorithm 3 Gaussian Elimination as a Pseudocodefor k = 1 : n−1 do

for j = k+1 : n do

r(k+1)j = r(k)j +

(− a jk

akk

)r(k)k

end forend for

Example 3.17. Let us apply the Gaussian elimination to solve the following systemof linear equations:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

x1− x2− x3 + x4 = 0

2x1 +2x3 = 8

−x2−2x3 =−8

3x1−3x2−2x3 +4x4 = 7

.

The associated complete matrix is

Ac(1) = (A|b) =

⎜⎜⎝

1 −1 −1 1 02 0 2 0 80 −1 −2 0 −83 −3 −2 4 7

⎟⎟⎠.

Let us apply the Gaussian transformations to move to the step (2)

r(2)1 = r(1)1

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

(−a(1)2,1

a(1)1,1

)r(1)1 = r(1)2 −2r(1)1

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

(−a(1)3,1

a(1)1,1

)r(1)1 = r(1)3 +0r(1)1

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

(−a(1)4,1

a(1)1,1

)r(1)1 = r(1)4 −3r(1)1

Page 119: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 99

thus obtaining the following complete matrix

Ac(2) = (A|b) =

⎜⎜⎝

1 −1 −1 1 00 2 4 −2 80 −1 −2 0 −80 0 1 1 7

⎟⎟⎠.

Let us apply the Gaussian transformations to move to the step (2)

r(3)1 = r(2)1

r(3)2 = r(2)2

r(3)3 = r(2)3 +

(−a(2)3,2

a(2)2,2

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

2 r(2)2

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

(−a(2)4,1

a(2)2,2

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

thus obtaining the following complete matrix

Ac(2) = (A|b) =

⎜⎜⎝

1 −1 −1 1 00 2 4 −2 80 0 0 −1 −40 0 1 1 7

⎟⎟⎠.

We would need one more step to obtain a triangular matrix. However, in thiscase, after two steps the matrix is already triangular. It is enough to swap the thirdand fourth rows to obtain

Ac(2) = (A|b) =

⎜⎜⎝

1 −1 −1 1 00 2 4 −2 80 0 1 1 70 0 0 −1 −4

⎟⎟⎠.

From the system of linear equations associated with this matrix we can easilyfind that x4 = 4, x3 = 3, x2 = 2, and x1 = 1.

3.3.2 Pivoting Strategies and Computational Cost

From the Gaussian transformation formulas in Sect. 3.3.1, it follows that the Gaus-sian elimination can be applied only when a(k)k,k �= 0 for k = 1,2, . . . ,n. These ele-ments are said pivotal elements of the triangular matrix. The condition that all the

Page 120: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

100 3 Systems of Linear Equations

pivotal elements must be non-null is not an actually limiting condition. For the The-orem 3.8, the matrix A can be transformed into an equivalent staircase matrix, thatis a triangular matrix in the square case. If the matrix is non-singular, i.e. the sys-tem is determined, the product of the diagonal elements, i.e. the determinant, mustbe non-null. For this reasons, a non-singular matrix can always be re-arranged as atriangular matrix displaying non-null diagonal elements.

This means that a system of linear equations might need a preprocessing strategyprior to the application of the Gaussian elimination. Two simple strategies are hereillustrated. The first one, namely partial pivoting consists of swapping the kth row ofthe matrix at the step k with that row such that the element in the kth column below

a(k)k,k is the maximum in absolute value. In other words, at first the element a(k)r,k

∣∣∣a(k)r,k

∣∣∣= max

k≤i≤n

∣∣∣a(k)i,k

∣∣∣

is found. Then, the rth and kth rows are swapped.

Example 3.18. Let us consider the following system of linear equation

⎧⎪⎨

⎪⎩

x2− x3 = 4

2x1 +6x3 = 10

50x1− x2−2x3 =−8

.

The associated complete matrix at the step 1 is

Ac(1) = (A|b) =

⎝0 1 −1 02 0 6 10

50 −1 −2 −8

⎠.

We cannot apply the Gaussian transformation because a(1)1,1 = 0 and we cannotperform a division by zero. Nonetheless, we can swap the rows in order to be ableto apply the Gaussian transformation. The partial pivoting at the step 1 consists ofswapping the first and the third rows, that is that row having in the first column thecoefficient having maximum absolute value. The resulting matrix is

Ac(1) = (A|b) =

⎝50 −1 −2 −82 0 6 100 1 −1 0

⎠.

Page 121: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 101

Now we can apply the first step of Gaussian elimination:

r(2)1 = r(1)1

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

(−a(1)2,1

a(1)1,1

)r(1)1

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

(−a(1)3,1

a(1)1,1

)r(1)1 .

Another option is the total pivoting. This strategy at first seeks for the indices rand s such that ∣

∣∣a(k)r,s

∣∣∣= max

k≤i, j≤n

∣∣∣a(k)i, j

∣∣∣

and then swaps rth and kth rows as well as sth and kth columns. Total pivoting guar-antees that pivotal elements are not small numbers and thus that the multipliers arenot big numbers. On the other hand, total pivoting performs a swap of the columns,i.e. a perturbation of the sequence of variables. It follows that if the total pivoting isapplied, the elements of the solution vector must be rearranged to obtain the originalsequence.

As a conclusion of this overview on Gaussian elimination, the question that couldbe posed is: “What is the advantage of Gaussian elimination with respect to theCramer’s Method?”. It can be proved that Gaussian elimination requires about n3

arithmetic operations to detect the solution, see [5] and [7]. More specifically, ifwe neglect the pivotal strategy, in order to pass from the matrix A(k) to the matrixA(k+1), 3(n− k)2 arithmetic operations are required while to pass from the vectorb(k) to the vector b(k+1), 2(n− k) arithmetic operations are required. Hence, in orderto determine the matrix A(n) starting from A and to determine the vector b(n) startingfrom b,

3n−1

∑k=1

(n− k)2 +2n−1

∑k=1

(n− k)

arithmetic operations are totally required. Considering that a triangular system re-quires n2 operations, it can be easily proved that the total amount of arithmeticoperations necessary to solve a system of linear equations by means of the Gaussianmethod is

2

(n(n−1)(2n−1)

6

)+3

n(n−1)2

+n2 =23

n3 +32

n2− 76

n.

Thus, in the example of a system of 50 linear equations in 50 variables the solu-tion is found after about 8.4×104 arithmetic operations. This means that a moderncomputer can solve this problem in about one thousandth of second.

Page 122: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

102 3 Systems of Linear Equations

3.3.3 LU Factorization

Equivalently to the Gaussian elimination, the LU factorization is a direct methodthat transforms a matrix A into a matrix product LU where L is a lower triangularmatrix having the diagonal elements all equal to 1 and U is an upper triangularmatrix. Thus, if we aim at solving a system of linear equations Ax = b, we obtain

Ax = b⇒⇒ LUx = b.

If we pose Ux = y, we solve at first the triangular system Ly = b and then extractx from the triangular system Ux = y.

The main advantage of factorizing the matrix A into LU with respect to Gaussianelimination is that the method does not alter the vector of known terms b. In appli-cations, such as modelling, where the vector of known terms can vary (e.g. if comesfrom measurements), a new system of linear equation must be solved. WhereasGaussian elimination would impose the solution of the entire computational task,LU factorization would require only the last steps to be performed again since thefactorization itself would not change.

The theoretical foundation of the LU factorization is given in the following the-orem.

Theorem 3.10. Let A ∈ Rn,n be a non-singular matrix. Let us indicate with Akthe submatrix having order k composed of the first k rows and k columns of A.If detAk �= 0 for k = 1,2, . . . ,n then ∃! lower triangular matrix L having all thediagonal elements equal to 1 and ∃! upper triangular matrix U such that A = LU.

Under the hypotheses of this theorem, every matrix can be decomposed into thetwo triangular matrices. Before entering into implementation details let consider theLU factorization at the intuitive level throughout the next example.

Example 3.19. If we consider the following system of linear equations

⎧⎪⎨

⎪⎩

x+3y+6z = 17

2x+8y+16z = 42

5x+21y+45z = 91

and the corresponding incomplete matrix A

A =

⎝1 3 62 8 165 21 45

⎠ ,

Page 123: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 103

we can impose the factorization A = LU. This means

A =

⎝1 3 62 8 165 21 45

⎠=

⎝l1,1 0 0l2,1 l2,2 0l3,1 l3,2 l3,3

⎝u1,1 u1,2 u1,3

0 u2,2 u2,3

0 0 u3,3

⎠ .

If we perform the multiplication of the two matrices we obtain the followingsystem of 9 equations in 12 variables.

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

l1,1u1,1 = 1

l1,1u1,2 = 3

l1,1u1,3 = 6

l2,1u1,1 = 2

l2,1u1,2 + l2,2u2,2 = 8

l2,1u1,3 + l2,2u2,3 = 16

l3,1u1,1 = 5

l3,1u1,2 + l3,2u2,2 = 21

l3,1u1,3 + l3,2u2,3 + l3,3u3,3 = 45.

Since this system has infinite solutions we can impose some extra equations. Letus impose that l1,1 = l2,2 = l3,3 = 1. By substitution we find that

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

u1,1 = 1

u1,2 = 3

u1,3 = 6

l2,1 = 2

u2,2 = 2

u2,3 = 4

l3,1 = 5

l3,2 = 3

u3,3 = 3.

The A = LU factorization is then

⎝1 3 62 8 165 21 45

⎠=

⎝1 0 02 1 05 3 1

⎝1 3 60 2 40 0 3

⎠ .

Page 124: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

104 3 Systems of Linear Equations

In order to solve the original system of linear equations Ax = b we can write

Ax = b⇒ LUx = b⇒ Lw = b.

where Ux = w.Let us solve first Lw = b, that is

⎝1 0 02 1 05 3 1

⎝w1

w2

w3

⎠=

⎝174291

⎠.

Since this system is triangular, it can be easily solved by substitution and itssolution is w1 = 17, w2 = 8, w3 =−18. With these results, the system Ux = w mustbe solved:

⎝1 3 60 2 40 0 3

⎝xyz

⎠=

⎝178−18

which, by substitution, leads to z =−6, y = 16, and x = 5, that is the solution to theinitial system of linear equations by LU factorization.

Let us now derive the general transformation formulas. Let A be

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

while L and U are respectively

L =

⎜⎜⎝

1 0 . . . 0l2,1 1 . . . 0. . . . . . . . . . . .ln,1 ln,2 . . . 1

⎟⎟⎠

U =

⎜⎜⎝

u1,1 u1,2 . . . u1,n

0 u2,2 . . . u2,n

. . . . . . . . . . . .0 0 . . . un,n

⎟⎟⎠.

Page 125: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 105

If we impose A = LU we obtain

ai, j =n

∑k=1

li,kuk, j =min(i, j)

∑k=1

li,kuk, j

for i, j = 1,2, . . . ,n.In the case i≤ j, i.e. in the case of the triangular upper part of the matrix we have

ai, j =i

∑k=1

li,kuk, j =i−1

∑k=1

li,kuk, j + li,iui, j =i−1

∑k=1

li,kuk, j +ui, j

This equation is equivalent to

ui, j = ai, j−i−1

∑k=1

li,kuk, j

that is the formula to determine the elements of U.Let us consider the case j < i, i.e. the lower triangular part of the matrix

ai, j =j

∑k=1

li,kuk, j =j−1

∑k=1

li,kuk, j + li, ju j, j.

This equation is equivalent to

li, j =1

u j, j

(

ai, j−j−1

∑k=1

li,kuk, j

)

that is the formula to determine the elements of L.In order to construct the matrices L and U, the formulas to determine their ele-

ments should be properly combined. Two procedures (algorithms) are here consid-ered. The first procedure, namely Crout’s Algorithm, consists of the steps illustratedin Algorithm 4.

Algorithm 4 Crout’s Algorithmcompute the first row of Ucompute the second row of Lcompute the second row of Ucompute the third row of Lcompute the third row of Ucompute the fourth row of Lcompute the fourth row of U. . .

In other words, the Crout’s Algorithm computes alternately the rows of the twotriangular matrices until the matrices have been filled. Another popular way to full

Page 126: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

106 3 Systems of Linear Equations

the matrices L and U is by means the so called Doolittle’s Algorithm. This procedureis illustrated in Algorithm 5 and consists of filling the rows of U alternately with thecolumns of L.

Algorithm 5 Doolittle’s Algorithmcompute the first row of Ucompute the first column of Lcompute the second row of Ucompute the second column of Lcompute the third row of Ucompute the third column of Lcompute the fourth row of U. . .

Example 3.20. Let us apply the Doolittle’s Algorithm to perform LU factorizationof the following matrix

A =

⎜⎜⎝

1 −1 3 −42 −3 9 −93 1 −1 −101 2 −4 −1

⎟⎟⎠ .

At the first step, the first row of the matrix U is filled by the formula

u1, j = a1, j−0

∑k=1

l1,kuk, j

for j = 1,2,3,4.This means

u1,1 = a1,1 = 1u1,2 = a1,2 =−1u1,3 = a1,3 = 3

u1,4 = a1,4 =−4.

Then, the first column of L is filled by the formula

li,1 =1

u1,1

(

ai,1−0

∑k=1

li,kuk,1

)

for i = 2,3,4.This means

l2,1 =a2,1u1,1

= 2

l3,1 =a3,1u1,1

= 3

l4,1 =a4,1u1,1

= 1.

Page 127: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 107

Thus, the matrices L and U at the moment appear as

L =

⎜⎜⎝

1 0 0 02 1 0 03 l3,2 1 01 l4,2 l4,3 1

⎟⎟⎠ .

and

U =

⎜⎜⎝

1 −1 3 −40 u2,2 u2,3 u2,4

0 0 u3,3 u3,4

0 0 0 u4,4

⎟⎟⎠

Then, the second row of the matrix U is found by applying

u2, j = a2, j−1

∑k=1

l2,kuk, j = a2, j− l2,1u1, j

for j = 2,3,4.This means

u2,2 = a2,2− l2,1u1,2 =−1u2,3 = a2,3− l2,1u1,3 = 3

u2,4 = a2,4− l2,1u1,4 =−1.

The second column of L is given by

li,2 =1

u2,2

(

ai,2−1

∑k=1

li,kuk,2

)

=1

u2,2(ai,2− li,1u1,2)

for i = 3,4.This means

l3,2 =a3,2−l3,1u1,2

u2,2=−4

l4,2 =a4,2−l4,1u1,2

u2,2=−3.

The third row of the matrix U is given by

u3, j = a3, j−2

∑k=1

l3,kuk, j = a3, j− l3,1u1, j− l3,2u2, j

for j = 3,4.This means

u3,3 = 2u3,4 =−2.

Page 128: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

108 3 Systems of Linear Equations

In order to complete the matrix L, we compute

li,3 =1

u3,3

(

ai,1−2

∑k=1

li,kuk,3

)

for i = 4, i.e. l4,3 = 1.Finally, the matrix U is computed by

u4, j = a4, j−3

∑k=1

l4,kuk, j

for j = 4, i.e. u4,4 = 2.Thus, the L and U matrices are

L =

⎜⎜⎝

1 0 0 02 1 0 03 −4 1 01 −3 1 1

⎟⎟⎠ .

and

U =

⎜⎜⎝

1 −1 3 −40 −1 3 −10 0 2 −20 0 0 2

⎟⎟⎠ .

3.3.4 Equivalence of Gaussian Elimination and LU Factorization

It can be easily shown that Gaussian elimination and LU factorization are essentiallytwo different implementations of the same method. In order to remark this fact itcan be shown how a LU factorization can be performed by applying the Gaussianelimination.

Let Ax = b be a system of linear equations with

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠ .

Let us apply the Gaussian elimination to this system of linear equation. Let usindicate with Gt the triangular incomplete matrix resulting from the application of

Page 129: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.3 Direct Methods 109

the Gaussian elimination:

Gt =

⎜⎜⎝

g1,1 g1,2 . . . g1,n

0 g2,2 . . . g2,n

. . . . . . . . . . . .0 0 . . . gn,n

⎟⎟⎠ .

In order to obtain the matrix Gt from the matrix A, as shown in Sect. 3.3.1.1,linear combinations of row vectors must be calculated by means of weights

⎝a(1)2,1

a(1)1,1

⎠ ,

⎝a(1)3,1

a(1)1,1

⎠ , . . .

⎝a(2)3,2

a(2)2,2

⎠ . . . .

Let us arrange these weights in a matrix in the following way

Lt =

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

1 0 . . . . . . 0(a(1)2,1

a(1)1,1

)1 . . . . . . 0

(a(1)3,1

a(1)1,1

) (a(2)3,2

a(2)2,2

)1 . . . 0

. . . . . . . . . . . . . . .(a(1)n,1

a(1)1,1

) (a(2)n,2

a(2)2,2

). . . . . . 1

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

.

It can be easily shown thatA = LtGt

and thus Gaussian elimination implicitly performs LU factorization where U is thetriangular Gaussian matrix and L is the matrix Lt of the Gaussian multipliers.

Let us clarify this fact by means of the following example.

Example 3.21. Let us consider again the system of linear equations

⎧⎪⎨

⎪⎩

x+3y+6z = 17

2x+8y+16z = 42

5x+21y+45z = 91

and its corresponding incomplete matrix A

A =

⎝1 3 62 8 165 21 45

⎠ ,

Page 130: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

110 3 Systems of Linear Equations

Let us apply Gaussian elimination to obtain a triangular matrix. At the first step

r(1)1 = r(0)1 = (1,3,6)

r(1)2 = r(0)2 −2r(1)1 = (0,2,4)

r(1)3 = r(0)3 −5r(1)1 = (0,6,15)

which leads to⎛

⎝1 3 60 2 40 6 15

and to a preliminary Lt matrix⎛

⎝1 0 02 1 05 # 1

⎠ .

where # simply indicates that there is a nun-null element which has not been calcu-lated yet.

Let us apply the second step:

r(2)1 = r(1)1 = (1,3,6)

r(2)2 = r(1)2 = (0,2,4)

r(2)3 = r(2)3 −3r(2)2 = (0,0,3)

which leads to the following matrices

Gt =

⎝1 3 60 2 40 0 3

and

Lt =

⎝1 0 02 1 05 3 1

⎠ .

It can be easily verified that

LtGt =

⎝1 0 02 1 05 3 1

⎝1 3 60 2 40 0 3

⎠=

⎝1 3 62 8 165 21 45

⎠= A.

Page 131: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 111

3.4 Iterative Methods

These methods, starting from an initial guess x(0), iteratively apply some formu-las to detect the solution of the system. For this reason, these methods are oftenindicated as iterative methods. Unlike direct methods that converge to the theoreti-cal solution in a finite time, iterative methods are approximate since they converge,under some conditions, to the exact solution of the system of linear equations ininfinite steps. Furthermore, it must be remarked that both direct and iterative meth-ods perform subsequent steps to detect the solution of systems of linear equations.However, while direct methods progressively manipulate the matrices (complete orincomplete), iterative methods progressively manipulate a candidate solution.

Definition 3.13. Convergence of an Iterative Method. If we consider a system oflinear equations Ax = b, the starting solution x(0), and the approximated solution atthe kth step x(k), the solution of the system c, then an approximated method is saidto converge to the solution of the system when

limk→∞

|x(k)− c|= O

On the contrary, if the limk→∞ |x(k)− c| grows indefinitely then the method is saidto diverge.

All Iterative methods are characterized by the same structure. If Ax = b is asystem of linear equations, it can be expressed as b−Ax = O. Let us consider anon-singular matrix M and write the following equation:

b−Ax = O⇒Mx+(b−Ax) = Mx⇒⇒M−1 (Mx+(b−Ax)) = M−1Mx⇒

⇒ x = M−1Mx+M−1 (b−Ax) = M−1Mx+M−1b−M−1Ax⇒⇒ x =

(I−M−1A

)x+M−1b.

If we replace the variables as H = I−M−1A and t = M−1b, an iterative methodis characterized by the update formula

x = Hx+ t

and if we emphasize that this is an update formula

x(k+1) = Hx(k) + t.

In this formulation the convergence condition can be written easily. An iterativemethod converges to the solution of a system of linear equations for every initialguess x(0), if and only if the absolute value of the maximum eigenvalue of matrix His < 1. The meaning and calculation procedure for eigenvalues are given in Chap. 10.While a thorough study of iterative methods in not a scope of this book, this sectiongives some examples of simple iterative methods.

Page 132: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

112 3 Systems of Linear Equations

3.4.1 Jacobi’s Method

The Jacobi’s method is the first and simplest iterative method illustrated in this chap-ter. The method is named after Carl Gustav Jacob Jacobi (1804–1851). Let us con-sider a system of linear equations Ax = b with A non-singular, b �= O, and A doesnot display zeros on its main diagonal. Let us indicate with

x(0) =

⎜⎜⎜⎝

x(0)1

x(0)2. . .

x(0)n

⎟⎟⎟⎠

the initial guess. At the first step, the system can be written as:

⎧⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎩

a1,1x(1)1 +a1,2x(0)2 + . . .+a1,nx(0)n = b1

a2,1x(0)1 +a2,2x(1)2 + . . .+a2,nx(0)n = b2

. . .

an,1x(0)1 +an,2x(0)2 + . . .+an,nx(1)n = bn

.

At the generic step k, the system can be written as:

⎧⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎩

a1,1x(k+1)1 +a1,2x(k)2 + . . .+a1,nx(k)n = b1

a2,1x(k)1 +a2,2x(k+1)2 + . . .+a2,nx(k)n = b2

. . .

an,1x(k)1 +an,2x(k)2 + . . .+an,nx(k+1)n = bn

.

The system of linear equation can be rearranged as:

⎧⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎩

x(k+1)1 =

(b1−∑n

j=1, j �=1 a1, jx(k)j

)1

a1,1

x(k+1)2 =

(b2−∑n

j=1, j �=2 a2, jx(k)j

)1

a2,2

. . .

x(k+1)n =

(bn−∑n

j=1, j �=n an, jx(k)j

)1

an,n.

Page 133: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 113

Jacobi’s method simply makes use of this manipulation to iteratively detect thesolution. The generic update formula for the ith variable is

x(k+1)i =

(

bi−n

∑j=1, j �=i

ai, jx(k)j

)1

ai,i.

Jacobi’s method is conceptually very simple and also easy to implement. Thenext example clarifies the implementation of the method in practice.

Example 3.22. The following system of linear equations⎧⎪⎨

⎪⎩

10x+2y+ z = 1

10y− z = 0

x+ y−10z = 4

is determined as the matrix associated with it is non-singular and has determinantequal to −1002. The solution by the application of Cramer’s method is

x = 49334

y =− 13334

z =− 65167 .

Let us solve now the same system by means of the application of Jacobi’s method.Let us write the update formulas at first:

x(k+1) = 110

(1−2y(k)− z(k)

)

y(k+1) = 110

(z(k)

)

z(k+1) =− 110

(4− x(k)−10y(k)

)

and take our initial guess

x(0) = 0y(0) = 0z(0) = 0.

Let us now apply the method

x(1) = 110

(1−2y(0)− z(0)

)= 0.1

y(1) = 110

(z(0)

)= 0

z(1) =− 110

(4− x(0)−10y(0)

)=−0.4.

Page 134: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

114 3 Systems of Linear Equations

These three values are use to calculate x(2),y(2),z(2):

x(2) = 110

(1−2y(1)− z(1)

)= 0.14

y(2) = 110

(z(1)

)=−0.04

z(2) =− 110

(4− x(1)−10y(1)

)=−0.39.

We can apply Jacobi’s method iteratively and obtain

x(3) = 0.147y(3) =−0.039z(3) =−0.39,

x(3) = 0.1468y(3) =−0.039z(3) =−0.3892,

x(4) = 0.14672y(4) =−0.03892z(4) =−0.389220.

The solution at the step (4) approximately solves the system. We can check it bysubstituting these numbers into the system:

10x(4) +2y(4) + z(4) = 1.000110y(4)− z(4) = 0.00002x(4) + y(4)−10z(4) = 4.

This solution already gives an approximation of the exact solution. At the step(10) we have

x(10) = 0.146707y(10) =−0.038922z(10) =−0.389222

which is about 10−9 distant from the exact solution.

Jacobi’s method can be expressed also in a matrix form. If we indicate with

E =

⎜⎜⎝

0 0 . . . 0a2,1 0 . . . 0. . . . . . . . . . . .an,1 an,2 . . . 0

⎟⎟⎠ ,

Page 135: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 115

F =

⎜⎜⎝

0 a1,2 . . . a1,n

0 0 . . . a2,n

. . . . . . . . . . . .0 0 . . . 0

⎟⎟⎠ ,

and

D =

⎜⎜⎝

a1,1 0 . . . 00 a2,2 . . . 0. . . . . . . . . . . .0 0 . . . an,n

⎟⎟⎠

the system of linear equation can be written as

Ex(k) +Fx(k) +Dx(k+1) = b,

that isx(k+1) =−D−1 (E+F)x(k) +D−1b.

Considering that E+F = A−D, the equation can be written as

x(k+1) =(I−D−1A

)x(k) +D−1b.

Hence, in the case of Jacobi’s method H = I−D−1A and t = D−1b.

Example 3.23. The system of linear equations related to the previous example canbe written in a matrix form Ax = b. Considering that

E =

⎝0 0 00 0 01 1 0

⎠ ,

F =

⎝0 2 10 0 −10 0 0

and

D =

⎝10 0 00 10 00 0 −10

⎠ ,

we can calculate the inverse D−1:

D−1 =

⎝1

10 0 00 1

10 00 0 − 1

10

⎠ .

Page 136: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

116 3 Systems of Linear Equations

The matrix representation of the Jacobi’s method means that the vector of thesolution is updated according to the formula

⎝x(k+1)

y(k+1)

z(k+1)

⎠= H

⎝x(k)

y(k)

z(k)

⎠+ t

where

H =(I−D−1A

)=

=

⎝1 0 00 1 00 0 1

⎠−

⎝1

10 0 00 1

10 00 0 − 1

10

⎝10 2 10 10 −11 1 −10

⎠=

=

⎝0 − 1

5 −110

0 0 110

110

110 0

and

t = D−1b =

=

⎝110 0 00 1

10 00 0 − 1

10

⎝104

⎠=

⎝1100− 4

10

⎠ .

It can be verified that the iterative application of matrix multiplication and sumleads to an approximated solution. Considering our initial guess

x(0) = 0y(0) = 0z(0) = 0,

we have

⎝x(1)

y(1)

z(1)

⎠=

⎝0 − 1

5 −110

0 0 110

110

110 0

⎝000

⎠+

⎝1

100− 4

10

⎠=

⎝1

100− 4

10

⎠ .

Then,

⎝x(2)

y(2)

z(2)

⎠=

⎝0 − 1

5 −110

0 0 110

110

110 0

⎝1100− 4

10

⎠+

⎝1

100− 4

10

⎠=

⎝0.14−0.04−0.39

⎠ .

If we keep on iterating the procedure we obtain the same result at step (10):

x(10) = 0.146707y(10) =−0.038922z(10) =−0.389222.

Page 137: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 117

Obviously the two ways of writing Jacobi’s method lead to the same results (asthey are the same thing).

For the sake of clarity, the pseudocode of the Jacobi’s method is shown in Algo-rithm 6.

Algorithm 6 Jacobi’s Methodinput A and bn is the size of Awhile precision conditions do

for i = 1 : n dos = 0for j = 1 : n do

if j �= i thens = s+ai, jx j

end ifend foryi =

1ai,i

(bi− s)

end forx = y

end while

3.4.2 Gauss-Seidel’s Method

The Gauss-Siedel’s method, named after Carl Friedrich Gauss (1777–1855) andPhilipp L. Seidel (1821–1896) is a greedy variant of the Jacobi’s method. This vari-ant, albeit simplistic, often (but not always) allows a faster convergence to the solu-tion of the system. With the Jacobi’s method the update of x(k+1) occurs only when

all the values x(k+1)i are available. With Gauss-Siedel’s method, the xi values replace

the old ones as soon as they have been calculated. Thus, from a system of linearequations the formulas for the Gauss-Siedel’s method are:

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

x(k+1)1 =

(b1−∑n

j=2 a1, jx(k)j

)1

a1,1

x(k+1)2 =

(b2−∑n

j=3 a2, jx(k)j −a2,1x(k+1)

1

)1

a2,2

. . .

x(k+1)i =

(bi−∑n

j=i+1 ai, jx(k)j −∑i−1

j=1 ai, jx(k+1)j

)1

ai,i

. . .

x(k+1)n =

(bn−∑n−1

j=1 ai, jx(k+1)i

)1

an,n.

Page 138: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

118 3 Systems of Linear Equations

Example 3.24. Let us now solve the same system of linear equations consideredabove by means of Gauss-Seidel’s method. The system is

⎧⎪⎨

⎪⎩

10x+2y+ z = 1

10y− z = 0

x+ y−10z = 4.

Let us write the update formulas of Gauss-Seidel’s method at first:

x(k+1) = 110

(1−2y(k)− z(k)

)

y(k+1) = 110

(z(k)

)

z(k+1) =− 110

(4− x(k+1)−10y(k+1)

).

Starting from the initial guess

x(0) = 0y(0) = 0z(0) = 0,

we havex(1) = 1

10

(1−2y(0)− z(0)

)= 0.1

y(1) = 110

(z(0)

)= 0

z(1) =− 110

(4− x(1)−10y(1)

)=−0.39.

Iterating the procedure we have

x(2) = 110

(1−2y(1)− z(1)

)= 0.139

y(2) = 110

(z(1)

)=−0.039

z(2) =− 110

(4− x(2)−10y(2)

)=−0.39,

x(3) = 110

(1−2y(2)− z(2)

)= 0.1468

y(3) = 110

(z(2)

)=−0.039

z(3) =− 110

(4− x(3)−10y(3)

)=−0.38922,

x(4) = 110

(1−2y(3)− z(3)

)= 0.146722

y(4) = 110

(z(3)

)=−0.038922

z(4) =− 110

(4− x(4)−10y(4)

)=−0.389220.

Page 139: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 119

At the step (10) the solution is

x(10) = 0.146707y(10) =−0.038922z(10) =−0.389222.

which is at most 10−12 distant from the exact solution.

Let us re-write the Gauss-Siedel’s method in terms of matrix equations. If wepose

G =

⎜⎜⎝

a1,1 0 . . . 0a2,1 a2,2 . . . 0. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

and

S =

⎜⎜⎝

0 a1,2 . . . a1,n

0 0 . . . a2,n

. . . . . . . . . . . .0 0 . . . 0

⎟⎟⎠

we can write

Ax = b⇒Gx(k+1) +Sx(k) = b⇒⇒ x(k+1) =−G−1Sx(k) +G−1b.

Hence, for the Gauss-Seidel’s method the general scheme of the iterative methodscan be applied by posing H =−G−1S and t = G−1b.

Example 3.25. Let us reach the same result of the system above by means of matrixformulation. The matrices characterizing the method are

G =

⎝10 0 00 10 01 1 −10

⎠ ,

S =

⎝0 2 10 0 −10 0 0

⎠ .

Page 140: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

120 3 Systems of Linear Equations

We can calculate the inverse matrix

G−1 =

⎝1

10 0 00 1

10 01

10110 −

110

and write the update formula as

⎝x(k+1

y(k+1

z(k+1

⎠=−

⎝1

10 0 00 1

10 01

101

10 −110

⎝0 2 10 0 −10 0 0

⎝x(k

y(k

z(k

⎠+

⎝1

10 0 00 1

10 01

101

10 −110

⎝104

that is

⎝x(k+1)

y(k+1)

z(k+1)

⎠=−

⎝0 0.2 0.10 0 −0.10 0.02 0

⎝x(k)

y(k)

z(k)

⎠+

⎝0.10

−0.39

If we apply iteratively this formula we have the same results above, e.g. at the step(10) we have

x(10) = 0.146707y(10) =−0.038922z(10) =−0.389222.

For the sake of clarity, the pseudocode of the Gauss-Seidel’s method is shown inAlgorithm 7.

Algorithm 7 Gauss-Seidel’s Methodinput A and bn is the size of Awhile precision conditions do

for i = 1 : n dos = 0for j = 1 : n do

if j �= i thens = s+ai, jx j

end ifend forxi =

1ai,i

(bi− s)

end forend while

Page 141: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 121

3.4.3 The Method of Successive Over Relaxation

The Method of Successive Over Relaxation, briefly indicated as SOR, is a variant ofthe Gauss-Siedel’s method which has been designed to obtain a faster convergenceof the original method, see [8]. The SOR method corrects the Gauss-Siedel methodby including in the update formula a dependence on the tentative solution at the stepk. More specifically, if x(k) is the solution at the step k and xGS

(k+1) is the updateto the step k+1 according to the Gauss-Siedel’s method, the update formula of theSOR method is:

xSOR(k+1) = ωxGS

(k+1) + (1−ω)x(k)

where ω is a parameter to be set. Obviously if ω = 1 the SOR method degeneratesinto the Gauss-Siedel’s method. The explicit update formula of the SOR method canbe simply obtained from that of Gauss-Seidel’s method by adding the contributiondue to x(k):

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

x(k+1)1 =

(b1−∑n

j=2 a1, jx(k)j

a1,1+(1−ω)x(k)1

x(k+1)2 =

(b2−∑n

j=3 a2, jx(k)j −a2,1x(k+1)

1

a2,2+(1−ω)x(k)2

. . .

x(k+1)i =

(bi−∑n

j=i+1 ai, jx(k)j −∑i−1

j=1 ai, jx(k+1)j

)ωai,i

+(1−ω)x(k)i

. . .

x(k+1)n =

(bn−∑n−1

j=1 ai, jx(k+1)j

an,n+(1−ω)x(k)n .

Example 3.26. Let us solve again the system of linear equation⎧⎪⎨

⎪⎩

10x+2y+ z = 1

10y− z = 0

x+ y−10z = 4.

This time let us apply SOR method. Let us pose ω = 0.9 and write the updateequations

x(k+1) = 0.910

(1−2y(k)− z(k)

)+0.1x(k)

y(k+1) = 0.910

(z(k)

)+0.1y(k)

z(k+1) =− 0.910

(4− x(k+1)−10y(k+1)

)+0.1z(k).

Let us start again from the initial guess

x(0) = 0y(0) = 0z(0) = 0,

Page 142: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

122 3 Systems of Linear Equations

and let us calculate for a few iterations the solution by the SOR method:

x(1) = 110

(1−2y(0)− z(0)

)+0.1x(0) = 0.09

y(1) = 110

(z(0)

)+0.1y(0) = 0

z(1) =− 110

(4− x(1)−10y(1)

)++0.1z(0) =−0.3519

Iterating the procedure we have

x(2) = 0.910

(1−2y(1)− z(1)

)+0.1x(1) = 0.130671

y(2) = 0.910

(z(1)

)+0.1y(1) =−0.031671

z(2) =− 0.910

(4− x(2)−10y(2)

)+0.1z(1) =−0.386280,

x(3) = 110

(1−2y(2)− z(2)

)+0.1x(2) = 0.143533

y(3) = 110

(z(2)

)+0.1y(2) =−0.037932

z(3) =− 110

(4− x(3)−10y(3)

)+0.1z(2) =−0.389124,

x(4) = 0.910

(1−2y(3)− z(3)

)+0.1x(3) = 0.146202

y(4) = 0.910

(z(3)

)+0.1y(3) =−0.038814

z(4) =− 0.910

(4− x(4)−10y(4)

)+0.1z(3) =−0.389247.

At the step (10) we have

x(10) = 0.146707y(10) =−0.038922z(10) =−0.389222,

whose error is at the most in the order of 10−8.It can be observed that the best results (or better the fastest convergence) were

obtained by Gauss-Seidel. The reason behind the use of the SOR method is theparameter ω which allows an easy control of the performance of the method. Thistopic, as well as the selection of the parameter value is discussed in the followingsections.

If, as in the case of Jacobi’s method, we indicate with

E =

⎜⎜⎝

0 0 . . . 0a2,1 0 . . . 0. . . . . . . . . . . .an,1 an,2 . . . 0

⎟⎟⎠ ,

Page 143: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 123

F =

⎜⎜⎝

0 a1,2 . . . a1,n

0 0 . . . a2,n

. . . . . . . . . . . .0 0 . . . 0

⎟⎟⎠ ,

and

D =

⎜⎜⎝

a1,1 0 . . . 00 a2,2 . . . 0. . . . . . . . . . . .0 0 . . . an,n

⎟⎟⎠

we can indicate the system Ax = b as Ex+Fx+Dx = b. If we consider the updateindex according to Gauss-Seidel’s method, we can write

Ex(k+1) +Fx(k) +Dx(k+1) = b⇒⇒ x(k+1) = D−1

(−Ex(k+1)−Fx(k) +b

).

The SOR method corrects the formula above as

x(k+1) = ωD−1(−Ex(k+1)−Fx(k) +b

)+(1−ω)x(k).

Extracting x(k+1), we obtain

Dx(k+1) = ω(−Ex(k+1)−Fx(k) +b

)+(1−ω)Dx(k) ⇒

⇒ (D+ωE)x(k+1) = ω(−Fx(k) +b

)+(1−ω)Dx(k) = ((1−ω)D−ωF)x(k) +ωb⇒

⇒ x(k+1) = (D+ωE)−1(((1−ω)D−ωF)x(k) +ωb

).

We can then pose that

H = (D+ωE)−1 ((1−ω)D−ωF)

andt = (D+ωE)−1 ωb.

Hence, the SOR is expressed in the general form of an iterative method.

Example 3.27. Let us write the matrix update formula of the SOR method for thesystem of linear equation above. Considering that

E =

⎝0 0 00 0 01 1 0

⎠ ,

Page 144: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

124 3 Systems of Linear Equations

F =

⎝0 2 10 0 −10 0 0

and

D =

⎝10 0 00 10 00 0 −10

⎠ ,

obviously, if ω = 0.9 we have

ωE =

⎝0 0 00 0 0

0.9 0.9 0

and

D+ωE =

⎝10 0 00 10 0

0.9 0.9 −10

⎠ .

The inverse of this triangular matrix is

(D+ωE)−1 =

⎝0.1 0 00 0.1 0

0.009 0.009 −0.1

⎠ .

Let us calculate now

((1−ω)D−ωF) =

=

⎝0.1

⎝10 0 00 10 00 0 −10

⎠−0.9

⎝0 2 10 0 −10 0 0

⎠=

=

⎝1 −1.8 −0.90 1 0.90 0 −1

⎠ .

Finally, let us calculate H by multiplying the two matrices:

H = (D+ωE)−1 ((1−ω)D−ωF) =

=

⎝0.1 −0.18 −0.090 0.1 0.09

0.009 −0.0072 0.1

Page 145: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 125

Then to calculate the vector t we have

t = (D+ωE)−1 ωb =

=

⎝0.1 0 00 0.1 0

0.009 0.009 −0.1

⎝0.90

3.6

⎠=

=

⎝0.09

0−0.3519

⎠ .

For the sake of clarity the pseudocode explaining the logical steps of the SORmethod is given in Algorithm 8.

Algorithm 8 Method of SORinput A and binput ωn is the size of Awhile precision conditions do

for i = 1 : n dos = 0for j = 1 : n do

if j �= i thens = s+ai, jx j

end ifend forxi =

ωai,i

(bi− s)+(1−ω)xi

end forend while

3.4.4 Numerical Comparison Among the Methods andConvergence Conditions

In order to understand differences and relative advantages amongst the three iterativemethods described in the previous sections, the following example is given.

Example 3.28. Let us consider the following system of linear equations⎧⎪⎨

⎪⎩

5x−2y+3z =−1

3x+9y+ z = 2

2x+ y+7z = 3.

Page 146: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

126 3 Systems of Linear Equations

In order to solve it, let us apply at first the Jacobi’s method. The system can bere-written as ⎧

⎪⎨

⎪⎩

x =− 15 +

25 y− 3

5 z

y = 29 −

39 x− 1

9 z

z = 37 −

27 x− 1

7 y

while Jacobi’s update formulas from step (k) to step (k+1) are

x(k+1) =−15+

25

y(k)− 35

z(k)

y(k+1) =29− 3

9x(k)− 1

9z(k)

z(k+1) =37− 2

7x(k)− 1

7y(k).

If we choose x(0) = (0,0,0) as an initial guess, we obtain x(1) =(− 1

5 ,29 ,

37

). If

we substitute iteratively the guess solutions we obtain

k x y z0 0 0 01 −0.20000 0.2222222 0.42857142 −0.3682540 0.2412698 0.45396833 −0.3758730 0.2945326 0.49931974 −0.3817788 0.2920333 0.49388765 −0.3795193 0.2946054 0.49593206 −0.3797171 0.2936251 0.49491907 −0.3795014 0.2938036 0.49511568 −0.3795479 0.2937098 0.4950285

After eight iterations the Jacobi’s method returns a solution x(8) such that

|Ax(8)−b|=

⎝0.00007390.00022670.0001868

⎠ .

Let us now apply the Gauss-Seidel’s method to the same system of linear equa-tions. The Gauss-Seidel’s update formulas from step (k) to step (k+1) are

x(k+1) =−15+

25

y(k)− 35

z(k)

y(k+1) =29− 3

9x(k+1)− 1

9z(k)

z(k+1) =37− 2

7x(k+1)− 1

7y(k+1).

Page 147: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 127

If the initial guess is x(0) = (0,0,0), at first x(1) = −0.200, and then y1 = 29 −

39 x(1)− 1

9 z(0) = 0.288 and z(1) = 37 −

27 x(1)− 1

7 y(1) = 0.444. The application of theGauss-Seidel’s method leads to the following results:

k x y z0 0 0 01 −0.20000 0.2888889 0.44444442 −0.3511111 0.2898765 0.48747803 −0.3765362 0.2935701 0.49421464 −0.3791007 0.2936764 0.49493225 −0.3794887 0.293726 0.49503596 −0.3795312 0.2937286 0.49504777 −0.3795372 0.2937293 0.49504938 −0.3795378 0.2937294 0.4950495

It can be observed that Jacobi’s and Gauss-Seidel’s methods converge to verysimilar solutions. However, for the same amount of iterations, Gauss-Siedel is moreaccurate since

|Ax(8)−b|=

⎝0.00000050.0000002

0

⎠ .

Finally, let us solve the system above by applying the SOR method. The SORupdate formulas from step (k) to step (k+1) are

x(k+1) = ω(−1

5+

25

y(k)− 35

z(k))+(1−ω)x(k)

y(k+1) = ω(

29− 3

9x(k+1)− 1

9z(k)

)+(1−ω)y(k)

z(k+1) = ω(

37− 2

7x(k+1)− 1

7y(k+1)

)+(1−ω)z(k).

Let us set ω = 0.9. If the initial guess is x(0) = (0,0,0), at first x(1) = 0.9(−0.200)+

0.1(0) =−0.18, and then y1 = 0.9(

29 −

39 x(1)− 1

9 z(0))+0.1y(0) = 0.254 and z(1) =

0.9(

37 −

27 x(1)− 1

7 y(1))+0.5z(0) = 0.399.

Page 148: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

128 3 Systems of Linear Equations

k x y z0 0 0 01 −0.18000 0.254000 0.39934292 −0.3222051 0.2821273 0.47222783 −0.3656577 0.2906873 0.48958934 −0.3762966 0.2929988 0.49376395 −0.3787826 0.2935583 0.49474876 −0.3793616 0.2936894 0.49497927 −0.3794967 0.2937200 0.49503318 −0.3795283 0.2937272 0.4950457

Again, the SOR method detected a very similar solution with respect to that foundby Jacobi’s and Gauss-Seidel’s methods. After eight steps the solution x(8) is suchthat

|Ax(8)−b|=

⎝0.00004100.00000540.0000098

that is slightly worse than that detected by Gauss-Siedel. On the other hand, theSOR method has the advantage that the convergence of the method can be ex-plicitly controlled by tuning ω . This tuning can be a difficult task but may lead,in some cases, to a higher performance of the method. A wrong choice can makethe method diverge away from the solution of the system. For example, given theprevious system of linear equations, if ω is chosen equal to 8, after eight stepsx(8) = (1.7332907e10,−5.9691761e10,3.7905479e10). The error related to this so-lution would be in the order of 1011 and would grow over the subsequent iterations.The relation between ω and convergence of SOR is given by the following theorem.

As a further remark, although Jacobi’s method appears to be the least powerfulmethod out of the three under examination, it hides a precious advantage in the com-putational era. At each iteration, the calculation of each row occurs independentlyon the other rows. Hence, an iteration of Jacobi’s method can be easily parallelizedby distributing the calculations related to each row to a different CPU. A paralleliza-tion would not be so easy for Gauss-Seidel’s method since each row requires a valuecalculated in the previous row. Obviously, the natural way Jacobi’s method can bedistributed make the method appealing when large linear systems (when the order nof the system is a large number) must be solved and a cluster is available.

Theorem 3.11. Let us consider a system of n linear equations in n variables Ax= b.If the SOR method converges to the solution of the system for the given matrix andknown terms, the parameter ω is such that

|ω−1|< 1.

The selection of ω is not the only issue relevant to the convergence of the method.The following example better clarifies this point.

Page 149: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 129

Example 3.29. Let us consider the following system of linear equations:

⎧⎪⎨

⎪⎩

5x−2y = 4

9x+3y+ z = 2

8x+ y+ z = 2.

The application Jacobi’s and Gauss-Seidel’s methods do not converge to the so-lution of the system. More specifically, after 100 iterations, we obtain

|Ax(100)−b|=

⎝93044.372116511.8895058.989

for Jacobi’s method and

|Ax(100)−b|= 1014

⎝22.9881057.2843257

0

for Gauss-Seidel’s method, respectively. In other words, the system above cannotbe tackled by means of Jacobi’s nor Gauss-Seidel’s methods. On the other hand, atuning of ω can lead to the detection of a good approximation of the solution. Forexample, if ω is set equal to 0.5, we obtain

|Ax(100)−b|=

⎝00

8.882e−16

⎠ .

This example suggests that not all the systems of linear equations can be tackledby an iterative method. The following definition and theorem clarify the reason.

Definition 3.14. Let A∈Rn,n be a square matrix. The matrix A is said to be strictlydiagonally dominant if the absolute value of each entry on the main diagonal isgreater than the sum of the absolute values of the other entries in the same row, thatis,

|a1,1|> |a1,2|+ |a1,3|+ . . .+ |a1,n||a2,2|> |a2,1|+ |a1,3|+ . . .+ |a2,n|

. . .

|ai,i|> |ai,1|+ |ai,2|+ . . .+ |ai,n|. . .

|an,n|> |an,1|+ |an,2|+ . . .+ |an,n−1|

Page 150: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

130 3 Systems of Linear Equations

Theorem 3.12. Let Ax = b be a system of n linear equations in n variables. If Ais strictly diagonally dominant, then this system of linear equations has a uniquesolution to which the Jacobi’s and Gauss-Seidel’s methods will converge for anyinitial approximation x(0).

It must be noted that this theorem states that the strict diagonal dominance guar-antees the convergence of the Jacobi’s and Gauss-Seidel’s methods. The reverseimplication is not true, i.e. some systems of linear equations can be solved by Ja-cobi’s and Gauss-Seidel methods even though the associated matrix A is not strictlydiagonal dominant.

Moreover, since a row swap (elementary row operation E1) leads to an equivalentsystem of linear equations, if the rows of the complete matrix Ac can be rearrangedso that A can be transformed into a strictly diagonally dominant matrix C, thenAx = b can still be solved by Jacobi’s and Gauss-Seidel’s methods.

Example 3.30. The system of linear equations

⎧⎪⎨

⎪⎩

x−10y+2z =−4

7x+ y+2z = 3

x+ y+8z =−6.

is associated with the matrix

A =

⎝1 −10 27 1 21 1 8

⎠ ,

that is not strictly diagonally dominant. Nonetheless, if we swap the first and secondequations, we obtain an equivalent system whose associated incomplete matrix is

C =

⎝7 1 21 −10 21 1 8

⎠ .

Obviously this matrix is strictly diagonally dominant. Hence, Jacobi’s and Gauss-Seidel’s methods will converge to the solution.

A synoptic scheme of the methods for solving systems of linear equation is dis-played in Table 3.1 where the symbol O represents the computational complexityof the method, see Chap. 11.

Page 151: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

3.4 Iterative Methods 131

Table 3.1 Synopsis of the methods for solving linear systems

Cramer (Rouchè-Capelli) Direct IterativeOperational feature Determinant Manipulate matrix Manipulate guess solution

Outcome Exact solution Exact solution Approximate solutionComputational cost Unacceptably high (O (n!), High O

(n3), see Chap. 11 ∞ to the exact solution

see Chap. 11) but it can be stopped after k stepswith k ·O

(n2), see Chap. 11

Practical usability Very small matrices Medium matrices Large matrices(up to approx. 10×10) (up to approx 1000×1000)

Hypothesis No hypothesis a(k)kk �= 0 (solvable Conditions on the eigenvaluesby pivoting) of the matrix

Exercises

3.1. Solve, if possible, the following homogeneous system of linear equations byapplying matrix theory of Cramer and Rouchè-Capelli:

⎧⎪⎨

⎪⎩

x−2y+ z = 2

x+5y = 1

−3y+ z = 1

.

3.2. Determine for what values of the parameter k, the system is determined, unde-termined, and incompatible.

⎧⎪⎨

⎪⎩

(k+2)x+(k−1)y− z = k−2

kx− ky = 2

4x− y = 1

.

3.3. Solve, if possible, the following homogeneous system of linear equations byapplying matrix theory of Cramer and Rouchè-Capelli

⎧⎪⎨

⎪⎩

x+ y− z = 0

y− z = 0

x+2y−2z = 0

.

Find, if possible, the unique solution or the general solution of the system.

Page 152: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

132 3 Systems of Linear Equations

3.4. Solve, if possible, the following system of linear equations by applying matrixtheory of Cramer and Rouchè-Capelli

⎧⎪⎨

⎪⎩

x+2y+3z = 1

4x+4y+8z = 2

3x− y+2z = 1

.

Find, if possible, the unique solution or the general solution of the system.

3.5. Solve, if possible, the following system of linear equations by applying matrixtheory of Cramer and Rouchè-Capelli

⎧⎪⎨

⎪⎩

x+2y+3z = 1

2x+4y+6z = 2

3x+6y+9z = 3

.

Find, if possible, the unique solution or the general solution of the system.

3.6. Apply the Gaussian elimination to the following system of linear equations tofind the equivalent triangular matrix/system (the solution of the equivalent systemis not required).

⎧⎪⎨

⎪⎩

x− y+ z = 1

x+ y = 4

2x+2y+2z = 9

.

3.7. Perform the LU factorization of the following matrix A:

A =

⎝5 0 5

10 1 1315 2 23

3.8. For the following system of linear equation⎧⎪⎨

⎪⎩

x+2y = 0

2x− y+6z = 2

4y+ z = 8

starting from x(0) = 0,y(0) = 0,z(0) = 0,

1. apply the first step of Jacobi’s Method to obtain x(1),y(1),z(1);2. apply the first step of Gauss-Siedel’s Method to obtain x(1),y(1),z(1).

Page 153: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 4Geometric Vectors

4.1 Basic Concepts

It can be proved that R is a continuous set. As such, it can be graphically representedas an infinite continuous line, see [1].

0 1 2−1−2

The set R2 = R×R is also continuous and infinite. As such, it can be graphi-cally represented by a plane [1]. Each element of R2 can be thus seen as a pointP = (x1,x2) belonging to this plane. Without a generality loss, let us fix a Cartesianreference system within this plane, see [9]. Within a Cartesian reference system, thehorizontal reference axis is referred to as abscissa’s axis while the vertical referenceaxis is referred to as ordinate’s axis.

Px2

x1O

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_4

133

Page 154: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

134 4 Geometric Vectors

In summary, since there is a bijection between lines and R and between R2 and

planes, we can identify the concept of line (and plane) with the concepts of contin-uous set in one and two dimensions, respectively.

Definition 4.1. Two lines belonging to the same plane are said parallel if they haveno common points.

Definition 4.2. A direction of a line is another line parallel to it and passing throughthe origin of the Cartesian system.

Let us consider an arbitrary pair of points P = (x1,x2) and Q = (y1,y2) belongingto the same plane. By means of simple considerations of Euclidean geometry, onlyone line passes through P and Q. This line identifies univocally a direction. Thisdirection is oriented in two ways on the basis of the starting and final point. Thefirst is following the line from P to Q and the second from Q to P. Along this line,the points between P and Q are a segment, characterised by the Euclidean distance

d (PQ) =

√(y1− x1)

2 +(y2− x2)2, see [9].

Example 4.1. Let us consider the following two points of the plane P = (2,1) andQ = (2,2). The Euclidean distance

d (PQ) =

√(2−2)2 +(2−1)2 = 1.

Definition 4.3. Let P and Q be two points in the plane. A geometric vector in theplane #»v with starting point P and final point Q is a mathematical entity character-ized by:

1. its oriented direction, identified by P and Q2. its module || #»v ||, that is the distance between P and Q

Px2

x1

Qy2

y1O

It must be remarked that while the distance is well defined above, the concept ofdirection is not formally defined at this stage. A more clear explanation of directionwill be clear at the end of this chapter and will be formalized in Chap. 6.

Page 155: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.1 Basic Concepts 135

The concept of geometric vector is the same as the number vector defined inChap. 2 from a slightly different perspective. It can be observed that if the startingpoint is the origin O, the geometric vector is the restriction to R

2 of the number vec-tor. Considering that the origin of the reference system is arbitrary, the two conceptscoincide. More formally, between the set of vectors in the plane and the set of pointsin the plane (i.e. R2) there is a bijective relation.

Example 4.2. A vector of the plane can be (1,2), (6,5), or (7,3).

The definition above can be extended to vectors in the space. In the latter case,two points belonging to R

3 are represented as P = (x1,x2,x3) and Q = (y1,y2,y3).The segment from P to Q is identified by the distance of the two points and thedirection of the line passing though P and Q.

Definition 4.4. Let P and Q be two points in the space. A geometric vector in thespace #»v with starting point P and final point Q is a mathematical entity character-ized by:

1. its oriented direction, identified by P and Q2. its module || #»v ||, that is the distance between P and Q

A point in the plane belongs to infinite lines. Analogously, a vector in the (3D)space belongs to infinite planes. If two vectors in the space do not have the samedirection, they determine a unique plane which they both belong to.

Definition 4.5. When three vectors in the space all belong to the same plane are saidcoplanar.

Definition 4.6. Sum of Two Vectors. Let #»u and #»v be two vectors. Let #»u =# »

AB =(B−A) and #»v =

# »

BC = (C−B). The sum #»w = #»u + #»v = (B−A) + (C−B) =C−A =

# »

AC, where #»w ∈ V3#»w belongs to the same plane where #»u and #»v lie.

A

B

O

C

Page 156: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

136 4 Geometric Vectors

Definition 4.7. A special vector in the space is the vector with starting and finalpoint in the origin O of the reference system. This vector, namely null vector isindicated with #»o .

The null vector #»o of the space coincides with O = (0,0,0)It can be observed that there is a bijective relation also between the set of vectors

in the space and points in the space.In this chapter we will focus on those vectors of the type

# »

PO, i.e. those vectorswhose starting point is the origin O.

Definition 4.8. Let us indicate with V3 the set containing all the possible geometricvectors of the space whose starting point is the origin O.

Example 4.3. A vector #»v ∈ V3 is, for example, (2,5,8) where one of the pointsidentifying the direction is the origin O.

Let us define within this V3 the sum of vectors as a special case of the sum ofvectors in Definition 4.6.

Definition 4.9. Sum of Two Vectors with Starting Point in O. Let B and C be thefollowing two points of the space

B = (b1,b2,b3)C = (c1,c2,c3) .

Let #»u and #»v be the following two vectors:

#»u =# »

OB = (B−O)#»v =

# »

OC = (C−O)

The sum of vectors of V3 is

#»w = #»u + #»v = (B−O)+(C−O) = B+C = (b1 + c1,b2 + c2,b3 + c3)

where #»w ∈ V3#»w belongs to the same plane where #»u and #»v lie.

The following properties are valid for the sum between vectors.

• commutativity: ∀ #»u , #»v ∈ V3 : #»u + #»v = #»v + #»u• associativity: ∀ #»u , #»v , #»w ∈ V3: ( #»u + #»v )+ #»w = #»u +( #»v + #»w)• neutral element: ∀ #»v : ∃! #»o | #»v + #»o = #»o + #»v = #»v• opposite element: ∀ #»v : ∃! # »−v| # »−v+ #»v = #»v +

( # »−v)= #»o

From the properties of the sum we can derive the difference between twovectors #»u =

# »

AB and #»w =# »

AC: #»u − #»w = (B−A)− (C−A) = B−C =# »

CB

Page 157: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.1 Basic Concepts 137

Example 4.4. Let us consider two points P, Q ∈ R3, where P = (1,3,4) and Q =

(2,5,6). The vectors# »

OP and# »

OQ are, respectively,

# »

OP = (1,3,4)# »

OQ = (2,5,6) .

The sum of these two vectors is

# »

OP+# »

OQ = (3,8,10) .

Example 4.5. Let us consider the following points ∈ R2:

A = (1,1)B = (2,3)C = (4,4)

and the following vectors

# »

AB = B−A = (1,2)# »

BC = C−B = (2,1) .

The sum of these two vectors is

# »

AC =# »

AB+# »

BC = B−A+C−B = C−A = (3,3) . (4.1)

It can be observed that the vector# »

AC would be the coordinates of the point C ifthe origin of the reference system is A.

Definition 4.10. Product of a Scalar by a Vector. Let #»v be a vector ∈ V3 and λ ascalar ∈R. The product of a scalar λ by a vector #»v is a new vector ∈V3, λ #»v havingthe same direction of #»v , module || # »

λv||= |λ | || #»v ||, and orientation is the same of #»vif λ is positive and the opposite if λ is negative.

The following properties are valid for the product of a scalar by a vector.

• commutativity: ∀ λ ∈ R and ∀ #»v ∈ V3 : λ #»v = #»v λ• associativity: ∀ λ , μ ∈ R and ∀ #»v ∈ V3: λ (μ #»v ) = (λ #»v )μ• distributivity 1: ∀ λ ∈ R and ∀ #»u , #»v ∈ V3 : λ ( #»u + #»v ) = λ #»u +λ #»v• distributivity 2: ∀ λ , μ ∈ R and ∀ #»v ∈ V3:(λ +μ) #»v = λ #»v +μ #»v• neutral element: ∀ #»v : 1 #»v = #»v

Example 4.6. If λ = 2 and #»v = (1,1,1), the vector λ #»v = (2,2,2).

Proposition 4.1. Let λ ∈R and #»v ∈V3. If either λ = 0 or #»v = #»o , then λ #»v is equalto the null vector #»o

Page 158: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

138 4 Geometric Vectors

Proof. Let us prove that if λ = 0 then λ #»v = #»o . From the properties of the sum ofvectors we know that

#»o = λ #»v +(−λ #»v ) .

Since λ = 0 then, from basic arithmetic, λ = 0+0. By substituting we obtain

#»o = 0 #»v +0 #»v +(−0 #»v ) = 0 #»v + #»o = 0 #»v .��

Let us prove that if #»v = #»o then λ #»v = #»o . Considering that #»o = #»o + #»o , then

λ #»o = λ ( #»o + #»o ) = λ #»o +λ #»o .

If we sum to both the terms −λ #»o , it follows that

λ #»o +(−λ #»o ) = (λ #»o +λ #»o )+(−λ #»o ) .

From the properties of the sum of vectors, it follows that #»o = λ #»o . ��

4.2 Linear Dependence and Linear Independence

Definition 4.11. Let λ1,λ2, . . . ,λn be n scalars ∈ R and #»v1,#»v2, . . . ,

#»vn be n vectors∈ V3. The linear combination of the n vectors by means of the n scalars is thevector

#»w = λ1#»v1 +λ2

#»v2 + . . . ,λn#»vn.

Definition 4.12. Let #»v1,#»v2, . . . ,

#»vn be n vectors ∈ V3. These vectors are said linearlydependent if the null vector can be expressed as their linear combination by meansof and n-tuple of non-null coefficients:

∃λ1,λ2, . . . ,λn ∈ R� ‘#»o = λ1

#»v1 +λ2#»v2 + . . .+λn

#»vn

with λ1,λ2, . . . ,λn �= 0,0, . . . ,0.

Definition 4.13. Let #»v1,#»v2, . . . ,

#»vn be n vectors ∈ V3. These vectors are said linearlyindependent if the null vector can be expressed as their linear combination only bymeans of null coefficients:

� ∃λ1,λ2, . . . ,λn ∈ R� ‘#»o = λ1

#»v1 +λ2#»v2 + . . .+λn

#»vn

with λ1,λ2, . . . ,λn �= 0,0, . . . ,0.

Example 4.7. Let us consider three vectors #»v1, #»v2, and #»v3 ∈ V3. If at least one tupleλ1,λ2,λ3 ∈ R and �= 0,0,0 such that #»o = λ1

#»v1 + λ2#»v2 + λ3

#»v3 can be found, thevectors are linearly dependent. For example if the tuple −4,5,0 is such that #»o =−4 #»v1 +5 #»v2 +0 #»v3 then the tree vectors are linearly dependent.

Page 159: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 139

Obviously, if λ1,λ2,λ3 = 0,0,0 the equation #»o = λ1#»v1 +λ2

#»v2 +λ3#»v3 is always

verified for the Proposition 4.1 for both, linearly dependent and linearly indepen-dent vectors. If the only way to obtain a null linear combination is by means ofcoefficients all null, then the vectors are linearly independent.

Example 4.8. Let us consider the following vectors ∈ V3:

#»v1 = (1,2,1)#»v2 = (1,1,1)#»v3 = (2,4,2) .

Let us check whether or not these vectors are linearly dependent. From its defini-tion, these vectors are linearly independent if there exists a triple λ1,λ2,λ3 �= 0,0,0such that

#»o = λ1#»v1 +λ2

#»v2 +λ3#»v3.

The latter equation, in our case, is

(0,0,0) = λ1 (1,2,1)+λ2 (1,1,1)+λ3 (2,4,2) ,

which can be written as ⎧⎪⎨

⎪⎩

λ1 +λ2 +2λ3 = 0

2λ1 +λ2 +4λ3 = 0

λ1 +λ2 +2λ3 = 0.

This is a homogeneous system of linear equations. It can be observed that thematrix associated with the system is singular and has rank ρ = 2. Thus the systemhas ∞1 solutions. Hence, not only λ1,λ2,λ3 = 0,0,0 solves the system. For exam-ple, λ1,λ2,λ3 = 2,0,−1 is a solution of the system. Thus, the vectors #»v1,

#»v2,#»v3 are

linearly dependent.

Example 4.9. Let us check the linear dependence for the following vectors

#»v1 = (1,0,0)#»v2 = (0,1,0)#»v3 = (0,0,2) .

This means that we have to find those scalars λ1,λ2,λ3

(0,0,0) = λ1 (1,0,0)+λ2 (0,1,0)+λ3 (0,0,2) ,

which leads to ⎧⎪⎨

⎪⎩

λ1 = 0

λ2 = 0

2λ3 = 0

whose only solution is λ1,λ2,λ3 = 0,0,0. Thus the vectors #»v1,#»v2,

#»v3 are linearlyindependent.

Page 160: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

140 4 Geometric Vectors

Example 4.10. Let us check the linear dependence for the following vectors

#»v1 = (1,2,0)#»v2 = (3,1,0)#»v3 = (4,0,1) .

This means that we have to find those scalars λ1,λ2,λ3

(0,0,0) = λ1 (1,2,0)+λ2 (3,1,0)+λ3 (4,0,1) ,

which leads to ⎧⎪⎨

⎪⎩

λ1 +3λ2 +4λ3 = 0

2λ1 +λ2 = 0

λ3 = 0.

This system is determined and its only solution is λ1,λ2,λ3 = 0,0,0. The vectorsare linearly independent.

Theorem 4.1. Let #»v1,#»v2, . . . ,

#»vn be n vectors ∈V3. These vectors are linearly depen-dent if and only if at least one of them can be expressed as a linear combination ofthe others.

Proof. If the vectors are linearly dependent, the

∃λ1,λ2, . . . ,λn �= 0,0, . . . ,0� ‘#»o = λ1

#»v1 +λ2#»v2 + . . .+λn

#»vn.

Without a loss of generality, let us suppose that λ1 �= 0. Thus,

#»o = λ1#»v1 +λ2

#»v2 + . . .+λn#»vn ⇒

⇒−λ1#»v1 = λ2

#»v2 + . . .+λn#»vn ⇒

⇒ #»v1 =λ2

−λ1

#»v2 + . . .+λn

−λ1

#»vn

One vector has been expressed as linear combination of the others. ��If one vector can be expressed as a linear combination of the others then we can

write#»vn = λ1

#»v1 +λ2#»v2 + . . .+λn−1

# »vn−1.

Thus,

#»vn = λ1#»v1 +λ2

#»v2 + . . .+λn−1# »vn−1 ⇒

⇒ #»o = λ1#»v1 +λ2

#»v2 + . . .+λn−1# »vn−1− #»vn.

The null vector #»o has been expressed as a linear combination of the n vectors bymeans of the coefficients λ1,λ2, . . . ,λn−1,−1 �= 0,0, . . . ,0. The vectors are linearlydependent. ��

Page 161: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 141

Example 4.11. We know that the vectors

#»v1 = (1,2,1)#»v2 = (1,1,1)#»v3 = (2,4,2)

are linearly dependent. We can express one of them as linear combination of theother two:

#»v3 = μ1#»v1 +μ2

#»v2

with μ1,μ2 = 2,0.Let us try to express #»v2 as a linear combination of #»v1 and #»v3:

#»v2 = ν2#»v1 +ν3

#»v3.

In order to find ν2 and ν3 let us write

(1,1,1) = ν2 (1,2,1)+ν3 (2,4,2)

which leads to ⎧⎪⎨

⎪⎩

ν2 +2ν3 = 1

2ν2 +4ν3 = 1

ν2 +2ν3 = 1

which is an impossible system of linear equations. Thus #»v2 cannot be expressed asa linear combination of #»v1 and #»v3.

The latter example has been reported to remark that Theorem 4.1 states that ina list of linearly dependent vectors at least one can be expressed as a linear combi-nation of the other. Thus, not necessarily all of them can be expressed as a linearcombination of the others.

Proposition 4.2. Let #»v1,#»v2, . . . ,

#»vn be n vectors ∈ V3. Let h ∈ N with 0 < h < n. If hvectors are linearly dependent, then all the n vectors are linearly dependent.

Proof. If h vectors a linearly dependent, then

#»o = λ1#»v1 +λ2

#»v2 + . . .+λh#»vh

with λ1,λ2, . . . ,λh �= 0,0, . . . ,0.Even if we assume that all the other λ values λh+1, . . . ,λn = 0, . . . ,0, then we can

write#»o = λ1

#»v1 +λ2#»v2 + . . .+λh

#»vh +λh+1# »vh+1 + . . .+λn

#»vn

where λ1,λ2, . . . ,λh,λh+1, . . . ,λn �= 0,0, . . . ,0. Thus, the n vectors are linearly de-pendent. ��

Page 162: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

142 4 Geometric Vectors

Example 4.12. Let us consider the following vectors

#»v1 = (2,2,1)#»v2 = (1,1,1)#»v3 = (3,3,2)#»v4 = (5,1,2) .

We can easily notice that #»v3 = #»v1 +#»v2, hence #»v1,

#»v2,#»v3 are linearly dependent.

Let us check that all four are linearly dependent. We have to find those scalarsλ1,λ2,λ3,λ4 such that

(0,0,0,0) = λ1 (2,2,1)+λ2 (1,1,1)+λ3 (3,3,2)+λ4 (5,1,2) ,

which leads to ⎧⎪⎨

⎪⎩

2λ1 +λ2 +3λ3 +5λ4 = 0

2λ1 +λ2 +3λ3 +λ4 = 0

λ1 +λ2 +2λ3 +2λ4 = 0.

This system has ∞1 solutions. For example, λ1,λ2,λ3,λ4 = 1,1,−1,0 is a solu-tion of the system. Thus, #»v1,

#»v2,#»v3,

#»v4 are linearly dependent.

Proposition 4.3. Let #»v1,#»v2, . . . ,

#»vn be n vectors ∈ V3. If one of these vectors is null#»o , then the n vectors are linearly dependent.

Proof. We know from hypothesis that one vector is null. Without a loss of generalitylet us assume that #»v1 = #»o . Thus, if we consider the linear combination of thesevectors:

λ1#»o +λ2

#»v2 + . . .+λn#»vn

If λ1 is chosen equal to a real scalar k �= 0, then the linear combination will beequal to the null vector #»o for

λ1,λ2, . . . ,λn = k,0, . . . ,0 �= 0,0, . . . ,0.

Thus, the vectors are linearly dependent. ��

Example 4.13. Let us consider the following vectors

#»v1 = (0,0,0)#»v2 = (1,5,1)#»v3 = (8,3,2) .

Let us check the linear dependence

(0,0,0) = λ1 (0,0,0)+λ2 (1,5,1)+λ3 (8,3,2) .

For example λ1,λ2,λ3 = 50,0,0 satisfies the equation. Thus, the vectors are lin-early dependent.

Page 163: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 143

Definition 4.14. Let #»u and #»v ∈ V3. The two vectors are parallel if they have thesame direction.

It can be observed that for the parallelism relation the following properties arevalid:

• reflexivity: a vector (line) is parallel to itself• symmetry: if #»u is parallel to #»v then #»v is parallel to #»u• transitivity: if #»u is parallel to #»v and #»v is parallel to #»w , then #»u is parallel to #»w

Since these three properties are simultaneously verified the parallelism is anequivalence relation. Two vectors having same module, direction, and orientationare said equipollent. It can be proved that equipollence is an equivalence relation.This means that a vector having a first point A is equivalent to one with same mod-ule, direction, and orientation having a different starting point, e.g. B.

In addition, it can be observed that every vector is parallel to the null vector #»o .

Lemma 4.1. Let #»u and #»v ∈ V3. If the two vectors are parallel, then they could beexpressed as

#»u = λ #»v

with λ ∈ R.

Theorem 4.2. Let #»u and #»v ∈ V3. The two vectors are linearly dependent if andonly if they are parallel.

Proof. If the two vectors are linearly dependent then the null vector can be ex-pressed as linear combination by means of non-null coefficients:

∃λ ,μ ∈ R

with λ ,μ �= 0,0 such that#»o = λ #»u +μ #»v .

Let us suppose that λ �= 0. Thus,

#»o = λ #»u +μ #»v ⇒⇒ λ #»u =−μ #»v ⇒

⇒ #»u =−μλ

#»v .

The two vectors are parallel. ��If the two vectors are parallel then

∃λ ∈ R� ‘#»u = λ #»v .

Thus,#»u = λ #»v ⇒ #»o = #»u −λ #»v .

Page 164: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

144 4 Geometric Vectors

The null vector has been expressed as the linear combination of the two vectorby means of the coefficients 1,−λ �= 0,0. Hence, the vectors are linearly dependent.��Example 4.14. The vectors

#»v1 = (1,1,1)#»v2 = (2,2,2) .

These two vectors are parallel since #»v2 = 2 #»v1. We can easily check that thesevectors are linearly dependent since

#»o = λ1#»v2 +λ2

#»v1

with λ1,λ2 = 1,−2.

Let us indicate with V1 the set of vectors belonging to one line, i.e. the unidi-mensional vectors.

Theorem 4.3. Let #»u and #»v be two parallel vectors ∈ V3 with #»u �= #»o and #»v �= #»o .The vector #»u can be expressed in only one way as the product of a scalar λ and thevectors #»v :

∃!λ � ‘ #»u = λ #»v .

Proof. By contradiction let us assume that ∃λ ,μ � ‘

#»u = λ #»v

and#»u = μ #»v

with λ �= μ .Thus,

#»o = (λ −μ) #»v ⇒

since for the hypothesis #»v �= #»o ,

⇒ λ −μ = 0⇒ λ = μ

Since λ �= μ , by contradiction hypothesis, then we reached a contradiction ��Example 4.15. Let us consider the following vector #»v ∈ V3:

#»v = (6,6,6)

The previous theorem simply says that for a vector #»u ∈ V3 parallel to #»v , thereexists only one scalar λ such that

#»v = λ #»u .

If #»u = (2,2,2), the only λ value such that #»v = λ #»u is λ = 3.

Page 165: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 145

Theorem 4.4. Let #»u , #»v , and #»w ∈ V3 and �= #»o . The three vectors are coplanar ifand only if #»u , #»v , and #»w are linearly dependent.

Proof. If #»u , #»v , and #»w are coplanar, they all belong to the same plane. Let us con-sider three coplanar vectors having all an arbitrary starting point O and final points,A, b, and c, respectively, where #»u =

# »OA. Let us indicated with B, and C the projec-

tion of the point A over the directions determined by the segments# »

Ob and# »Oc (or

by the vectors #»v and #»w) respectively. A parallelogram is determined by the verticesABCD.

O A

b

c

B

C

On the basis of the geometrical construction,

# »

OA =# »

OB+# »

OC

where# »

OA = #»u ,# »

OB = λ #»v , and# »

OC = μ #»w . Thus, #»u = λ #»v + μ #»w . For the Theo-rem 4.1, the vectors are linearly dependent. ��

If the vectors are linearly dependent they can be expressed as #»u = λ #»v +μ #»w .

• If #»v and #»w are parallel then #»u is parallel to both of them. Thus, the three vectorsdetermine a unique direction. Since infinite planes include a line (direction), thereis at least one plane that contains the three vectors. The three vectors would becoplanar.

• If #»v and #»w are not parallel, they determine one unique plane containing both ofthem. Within this plane the sum #»u = λ #»v +μ #»w is verified. The vector #»u belongsto a plane where λ #»v and μ #»w belong to. This is true because the sum of twovectors in a plane is a vector belonging to the same plane (the sum is a closedoperator, see e.g. [10]). Obviously λ #»v is parallel to #»v and μ #»w is parallel to #»w .Thus #»u , #»v , and #»w belong to the same plane. ��

Example 4.16. Let us consider the following three vectors ∈ V3:

#»u = (1,2,1)#»v = (2,2,4)#»w = (4,6,6) .

Page 166: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

146 4 Geometric Vectors

We can easily observe that

(4,6,6) = 2(1,2,1)+(2,2,4)

that is#»w = λ #»u +μ #»v .

This means that the vectors #»u , #»v , #»w are linearly dependent. The fact that onevector is linear combination of the other two has a second meaning. The vectors #»uand #»v identify a plane. The vector #»w is the weighted sum of the other two and thusbelongs to the same plane where #»u and #»v lie. Thus #»u , #»v , #»w are also coplanar.

Example 4.17. The three vectors inV3

#»u = (1,2,1)#»v = (2,4,2)#»w = (4,6,6) .

In this case #»u and #»v are parallel and thus identify one direction. The vector #»widentifies another direction. The two directions identify a plane containing the threevectors. Thus, the vectors are coplanar. Let us check the linear dependence. Theequation

#»o = λ #»u +μ #»v +ν #»w

is verified for infinite values of λ ,μ ,ν , e.g. 1,− 12 ,0.

Theorem 4.5. Let #»u , #»v , and #»w ∈ V3 and �= #»o . If these three vectors are coplanarand two of them ( #»v and #»w) are linearly independent ( #»v and #»w are not parallel toeach other), the third ( #»u ) can be expressed as the linear combination of the othertwo in only one way (i.e. by means of only one tuple of scalars λ ,μ):

∃!λ ,μ �= 0,0� ‘#»u = λ #»v +μ #»w.

Proof. Let us assume by contradiction that ∃λ ,μ ∈ R such that #»u = λv+μ #»w , andalso ∃λ ′,μ ′ ∈ R such that #»u = λ ′ #»v +μ ′ #»w with λ ,μ �= λ ′,μ ′. Thus,

#»o =(λ −λ ′

)#»v +

(μ−μ ′

)#»w.

Since the vectors are linearly independent λ −λ ′ = 0 and μ−μ ′ = 0. Thus λ = λ ′and μ = μ ′. ��

Example 4.18. If we consider again

#»u = (1,2,1)#»v = (2,2,4)#»w = (4,6,6)

Page 167: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 147

we know that#»w = λ #»u +μ #»v .

with λ ,μ = 2,1.The theorem above says that the couple λ ,μ = 2,1 is unique. Let us verify it:

(4,6,6) = λ (1,2,1)+μ (2,2,4) ,

which leads to ⎧⎪⎨

⎪⎩

λ +2μ = 4

2λ +2μ = 6

λ +4μ = 6.

The system is determined and the only solution is λ ,μ = 2,1.

Theorem 4.6. Let #»u , #»v , #»w, and #»t ∈ V3. These vectors are always linearly depen-dent: ∀ #»u , #»v , #»w, and #»t ∈ V3 :

∃λ ,μ ,ν �= 0,0,0� ‘#»t = λ #»u +μ #»v +ν #»w .

Proof. If one vector is the null vector #»o or two vectors are parallel or three vec-tors are coplanar, the vectors are linearly dependent for Proposition 4.3 and Theo-rems 4.2 and 4.4.

Let us consider the case of four vectors such that each triple is not coplanar.Without a loss of generality let us consider all the vectors have the same arbitrarystarting point O.

v

w

u

t

O

A B

C

It can be observed that

# »

OC =# »

OA+# »

AB+# »

BC.

This equation can be written as

#»t = λ #»u +μ #»v +ν #»w ⇒⇒ #»o = λ #»u +μ #»v +ν #»w− #»t .

Page 168: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

148 4 Geometric Vectors

The null vector has been expressed as linear combination of the four vectors bymeans of non-null coefficients as λ ,μ ,ν ,−1 �= 0,0,0,0. The vectors are linearlydependent. ��

Example 4.19. The theorem above tells us that three arbitrary vectors ∈ V3

#»u = (0,1,1)#»v = (0,1,0)#»w = (1,0,0)#»t = (4,6,5)

are necessarily linearly dependent. If we write

#»t = λ #»u +μ #»v +ν #»w

that is(4,6,5) = λ (0,1,1)+μ (0,1,0)+ν (1,0,0)

which leads to the following system of linear equations:⎧⎪⎨

⎪⎩

ν = 4

λ +μ = 6

λ = 5.

The system is determined and λ ,μ ,ν = 5,1,4 is its solution.

In summary, two parallel vectors, three vectors in a plane, or four vectors in thespace are linearly dependent. Looking at its geometric implications, the concept oflinear dependence can be interpreted as the presence of redundant pieces of infor-mation within a mathematical description. Intuitively, we can easily see that in aunidimensional space one number fully describes an object. There is no need of twonumbers to represent a unidimensional object. In a similar way, two parallel vectorsin the space identify only one direction and are de facto describing a unidimensionalproblem. The three dimensional problem degenerates in a unidimensional problem.When this situation occurs the vectors are linearly dependent.

If two vectors are not parallel they identify a plane and describe a point within it.This object requires two numbers to be described and a third coordinate would beunnecessary. In a similar way, three (or more) coplanar vectors in the space are defacto a two-dimensional problems. Also in this case redundant pieces informationare present in tha mathematical description and the vectors are linearly dependent.

Finally, three vectors are needed to describe an object in the space. Any fourthvector would give redundant pieces of information. This fact is mathematicallytranslated into the statement that four (or more) vectors in the space are surely lin-early dependent.

Page 169: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.2 Linear Dependence and Linear Independence 149

Each point of the space can then be detected by three linearly independent vec-tors. Equivalently, each vector of V3 can be univocally expressed as the linear com-bination of three linearly independent vectors. Thus, when three linearly indepen-dent vectors #»u , #»v , and #»w are fixed, every vector #»t in V3 is univocally identified bythose three coefficients λ ,μ ,ν such that

#»t = λ #»u +μ #»v +ν #»w .

Let us formally prove this statement

Theorem 4.7. Let #»u , #»v , and #»w be three linearly independent vectors ∈ V3 andλ ,μ ,ν �= 0,0,0 be a triple of scalars. Let a vector #»t be another vector ∈ V3. Itfollows that the vector #»t can be expressed as the linear combination of the otherthree in only one way (i.e. by means of only one tuple of scalars λ ,μ ,ν):

∃!λ ,μ ,ν �= 0,0,0� ‘#»t = λ #»u +μ #»v +ν #»w

Proof. If, by contradiction, there exists another triple λ ′,μ ′,ν ′ �= 0,0,0 such that#»t = λ ′ #»u +μ ′ #»v +ν ′ #»w , it follows that

#»t = λ #»u +μ #»v +ν #»w = λ ′ #»u +μ ′ #»v +ν ′ #»w ⇒⇒ (λ −λ ′) #»u +(μ−μ ′) #»v +(ν−ν ′) #»w = #»o .

Since, for hypothesis, #»u , #»v , and #»w are linearly independent, it follows that

(λ −λ ′) = 0⇒ λ = λ ′(μ−μ ′) = 0⇒ μ = μ ′(ν−ν ′) = 0⇒ ν = ν ′.��

Example 4.20. Let us consider again

#»u = (0,1,1)#»v = (0,1,0)#»w = (1,0,0)#»t = (4,6,5) .

We know that#»t = λ #»u +μ #»v +ν #»w

with λ ,μ ,nu = 5,1,4.We can easily verify that if λ ,μ ,nu and #»u , #»v , #»w are fixed, then #»t is implicitly

identified.Also, if #»t , #»u , #»v , #»w are fixed, the scalars λ ,μ ,ν are univocally determined (the

resulting system is determined).

Page 170: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

150 4 Geometric Vectors

4.3 Matrices of Vectors

Proposition 4.4. Let #»u , #»v ∈ V3 where

#»u = (u1,u2,u3)#»v = (v1,v2,v3)

and A be a 2×3 matrix whose elements are the components of #»u and #»v

A =

(u1 u2 u3

v1 v2 v3

).

These two vectors are parallel (and thus linearly dependent) if and only if therank of the matrix A associated with the corresponding components is < 2: ρA < 2.

Proof. If #»u and #»v are parallel they could be expressed as #»u = λ #»v with λ ∈ R.Thus,

#»u = λ #»v ⇒⇒ u1

#»e1 +u2#»e2 +u3

#»e3 = λ (v1#»e1 + v2

#»e2 + v3#»e3) .

Since two vectors are the equal if and only if they have the same components,

u1 = λv1

u2 = λv2

u3 = λv3.

Since the two rows are proportional, there is no non-singular order 2 submatrix.Thus ρA < 2. ��

If ρA < 2, every two submatrix has null determinant. This can happen in thefollowing cases.

• A row is composed of zeros. This means that one vector is the null vector #»o , e.g.

A =

(0 0 0v1 v2 v3

).

Since every vector is parallel to #»o , the vectors are parallel.• Two columns are composed of zeros. The vectors are of the kind

#»u = (u1,0,0)#»v = (v1,0,0) .

These vectors can always be expressed as

#»u = λ #»v .

Thus, the vectors are parallel.

Page 171: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.3 Matrices of Vectors 151

• Two rows are proportional.

#»u = (u1,u2,u3)#»v = (λu1,λu2,λu3) .

The vectors are parallel.• Each pair of columns is proportional. The vectors are of the kind

#»u = (u1,λu1,μu1)#»v = (v1,λv1,μv1) .

If we posev1

u1= k

then#»v = (ku1,λku1,μku1)⇒ #»v = (ku1,ku2,ku3) = k #»u .

The vectors are parallel.��

Example 4.21. The following vectors

#»u = (1,3,6)#»v = (2,6,12)

are parallel since #»v = 2 #»u . Obviously the matrix(

1 3 62 6 12

)

has rank equal to 1, that is < 2.

Example 4.22. The following vectors

#»u = (2,4,6)#»v = (3,6,9)

are associated with a matrix(

2 4 63 6 9

)=

(2 2λ 2μ3 3λ 3μ

)

with λ ,μ = 2,3. Ever pair of columns is proportional. Thus, this matrix has rankρ < 2.

If we pose k = v1u1

= 1.5 we can write the two vectors as

#»u = (2,4,6)#»v = k (2,4,6) .

Thus, these two vectors are parallel.

Page 172: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

152 4 Geometric Vectors

Example 4.23. Let us determine the values of h that make #»u parallel to #»v .

#»u = (h−1) #»e1 +2h #»e2 +#»e3

#»v = #»e1 +4 #»e2 +#»e3

These two vectors are parallel if and only if the matrix A has a rank ρA < 2:

A =

(h−1 2h 1

1 4 1

).

Let us compute det

(h−1 2h

1 4

)= 4h−4−2h = 2h−4. The vectors are parallel

if 2h−4 = 0⇒ h = 2. In addition, we have to impose that det

(2h 14 1

)= 0⇒ h = 2

and det

(h−1 1

1 1

)= h−1−1 = 0. Thus, the vectors are parallel if h = 2.

Proposition 4.5. Let #»u , #»v , and #»w ∈ V3 be

#»u = (u1,u2,u3)#»v = (v1,v2,v3)#»w = (w1,w2,w3)

and A be the matrix whose elements are the components of #»u , #»v , and #»w:

A =

⎝u1 u2 u3

v1 v2 v3

w1 w2 w3

⎠ .

The three vectors are coplanar (and thus linearly dependent) if and only if thedeterminant of the matrix A is equal to 0:

det(A) = 0.

Proof. If the vectors are coplanar then they are linearly dependent for Theorem 4.4.For Theorem 4.1 one of them can be expressed as linear combination of the others:

#»u = λ #»v +μ #»w ⇒(u1,u2,u3) = λ (v1,v2,v3)+μ (w1,w2,w3)⇒

(u1,u2,u3) = (λv1 +μw1,λv2 +μw2,λv3 +μw3) .

The first row of the matrix A has been expressed as linear combination of theother two rows:

A =

⎝λv1 +μw1 λv2 +μw2 λv3 +μw3

v1 v2 v3

w1 w2 w3

⎠ .

Page 173: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.3 Matrices of Vectors 153

Thusdet(A) = 0.��

If det(A) = 0 the following conditions may occur.

• A row is null, e.g.:

A =

⎝0 0 0v1 v2 v3

w1 w2 w3

⎠ .

This means that one vector is null and two vectors determine a plane. Thus, thethree vectors are coplanar.

• A column is null, e.g.

A =

⎝u1 u2 0v1 v2 0w1 w2 0

⎠ .

One component is null for all the vectors and thus the vectors are in V2, i.e. thethree vectors are in the (same) plane.

• One column is linear combination of the other two columns. This means that thethree vectors can be expressed as

#»u = (u1,u2,λu1 +μu2)#»v = (v1,v2,λv1 +μv2)#»w = (w1,w2,λw1 +μw2)

that is

A =

⎝u1 u2 λu1 +μu2

v1 v2 λv1 +μv2

w1 w2 λw1 +μw2

with the scalars λ ,μ ∈ R.Since one component is not independent, the vectors are in V2, i.e. the threevectors are in the (same) plane. In other words, since the vectors are linearlydependent are coplanar.

• One row is linear combination of the other two rows, e.g.

A =

⎝λv1 +μw1 λv2 +μw2 λv3 +μw3

v1 v2 v3

w1 w2 w3

⎠ .

The vectors are linearly dependent and thus coplanar.��

Propositions 4.4 and 4.5 clarify the meaning of determinant and rank of a ma-trix by offering an immediate geometric interpretation. The determinant of a 3× 3matrix can be interpreted as a volume generated by three vectors. If the vectors arecoplanar the volume is zero as well as the associated determinant. This situation oc-curs when a redundancy appears in the mathematical description. In a similar way,

Page 174: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

154 4 Geometric Vectors

if we consider only two vectors in the space we can geometrically interpret the con-cept of rank of a matrix. If the vectors are not parallel, they identify a plane andthe rank of the associated matrix is 2. If the two vectors are parallel, the problemis practically unidimensional and the rank is 1. In other words, the rank of a ma-trix can be geometrically interpreted as the actual dimensionality of a mathematicaldescription.

Example 4.24. Let us verify whether or not the following three vectors are coplanar:

#»u = (5,3,12)#»v = (2,8,4)

#»w = (1,−13,4)

The det

⎝5 3 122 8 41 −13 4

⎠ = 160+ 12− 312− 96− 24+ 260 = 0. The vectors are

coplanar. It can be observed that #»w = #»u −2 #»v .

4.4 Bases of Vectors

Definition 4.15. A vector basis in V3 is a triple of linearly independent vectors andis indicated with

B = { #»e1,#»e2,

#»e3}.

For Theorem 4.7 every vector belonging to V3 can be univocally expressed asthe linear combination of the vectors composing the basis: ∀ #»v ∈ V3:

#»v = v1#»e1 + v2

#»e2 + v3#»e3

where v1,v2,v3 ∈ R and can be indicated as

#»v = (v1,v2,v3) .

Each vi, ∀i is named component of the vector #»v . In this case the vector #»v isrepresented in the basis B= { #»e1,

#»e2,#»e3}. In general, for a fixed basis B= { #»e1,

#»e2,#»e3},

each vector belonging to V3 is identified by its component and, thus, two vectors areequal if they have the same components in the same basis.

Every time in the previous sections of this chapter a vector has been indicatede.g. #»v = (x,y,z), we implicitly meant that

#»v = x #»e1 + y #»e2 + z #»e3.

Page 175: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.4 Bases of Vectors 155

where #»e1,#»e2,

#»e3 is a basis of vector having module equal to 1 and direction of theaxes of the reference system, i.e.

#»e1 = (1,0,0)#»e2 = (0,1,0)#»e3 = (0,0,1) .

Example 4.25. We can easily verify that the vectors

#»e1 = (0,1,2)#»e2 = (0,1,0)#»e3 = (4,0,0)

are linearly independent. As such, these vectors are a basis B = { #»e1,#»e2,

#»e3}. ForTheorem 4.7 any vector ∈ V3 can be univocally expressed as a linear combinationof the vectors of this basis.

Let us express an arbitrary vector #»t = (4,8,6):

#»t = λ #»e1 +μ #»e2 +ν #»e3

with λ ,μ ,ν = 3,5,1.Thus, when we write #»t = (3,5,1) in the basis B = { #»e1,

#»e2,#»e3}.

A basis of V3 can be seen as a set of vectors able to generate, by linear combi-nation, any arbitrary vector ∈ V3. The following corollary gives a formalization ofthis statement.

Corollary 4.1. Every vector #»t ∈ V3 can be represented as a linear combination ofthe vectors #»e1,

#»e2,#»e3 composing a basis of V3.

Proof. Let us consider a generic vector #»t ∈ V3. For Theorem 4.6 #»t , #»e1,#»e2,

#»e3 arelinearly dependent. For Theorem 4.7 it follows that

#»t = λ #»e1 +μ #»e2 +ν #»e3

by means of a unique triple λ ,μ ,ν . Thus, in the basis the vector #»t is univocallydetermined by the triple (λ ,μ ,ν).

If we considered another vector#»

t ′ ∈V3 with #»t �=#»

t ′ it would follow that anothertriple λ ′,μ ′,ν ′ �= λ ,μ ,ν would be univocally associated with

t ′ . We can indefi-nitely reiterate this operation and discover that any arbitrary vector ∈ V3 can berepresented as linear combination of #»e1,

#»e2,#»e3 by means of a unique triple of scalars.

��

The following corollary revisits the previous result and formally states a con-cept previously introduced in an intuitive way: there is an equivalence between thevectors of the space and the points of the space.

Corollary 4.2. If an arbitrary basis B = { #»e1,#»e2,

#»e3} is fixed, there exists a bijectionbetween the set of vectors in the space V3 and the set of points R3.

Page 176: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

156 4 Geometric Vectors

Proof. For a fixed basis B = { #»e1,#»e2,

#»e3} let us consider the mapping φ : V3 → R3

defined as#»t = (λ ,μ ,ν) ,

where#»t = λ #»e1 +μ #»e2 +ν #»e3

This mapping is injective since for #»t �=#»

t ′ with

#»t = (λ ,μ ,ν)#»

t ′ = (λ ′,μ ′,ν ′)

for Theorem 4.6, it follows that the triple λ ′,μ ′,ν ′ �= λ ,μ ,ν .This mapping is surjective since, for Theorem 4.7, a vector is always repre-

sentable as a linear combination of #»e1,#»e2,

#»e3 and thus, always associated with a tripleλ ,μ ,ν .

Thus, the mapping is bijective. ��

Definition 4.16. Two vectors (or two lines) in V3 are said to be perpendicular whentheir direction compose four angles of 90◦.

Definition 4.17. Three vectors in V3 are said to be orthogonal if each of them isperpendicular to the other two.

It must be remarked that the notion of perpendicularity does not coincide withthe notion of orthogonality. However, the two concepts are closely related. Whileperpendicularity refers to lines (or vectors) in the plane and means that these twoobjects generate a 90◦ angle, orthogonality is a more general term and refers tomultidimensional objects (such as planes in the space). This concept is better ex-plained in Chap. 8. Intuitively we may think that two multi-dimensional objects areorthogonal when all the angles generated by the intersection of these two objects are90◦. For example, three vectors in V3 can be interpreted as an object in the space.The definition above states that this solid is orthogonal when all the angles involvedare 90◦. We may conclude that perpendicularity is orthogonality among lines of theplane.

Definition 4.18. If a basis of vectors in V3 is composed of three orthogonal vectors{ #»

i ,#»j ,

k } the basis is said orthonormal.

Definition 4.19. When the vectors composing an orthonormal basis have modulusequal to 1, the vectors composing this basis are said versors.

In V3, an orthonormal basis composed of vectors is

#»i = (1,0,0)#»j = (0,1,0)

k = (0,0,1) .

Page 177: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.4 Bases of Vectors 157

Vectors are in general represented in an orthonormal basis of versors but can berewritten in another basis by simply imposing the equivalence of each component.The following example clarifies this fact.

Example 4.26. Let us consider the following vectors in an orthonormal basis of ver-sors { #»

i ,#»j ,

k }.

#»u = (2,0,−1)#»v = (1,2,1)#»w = (1,0,3)

#»t = (2,−1,−1)

Let us verify that #»u , #»v , and #»w are linearly independent:

det

⎝2 0 −11 2 11 0 3

⎠= 12+2 = 14 �= 0.

The vectors #»u , #»v , and #»w are linearly independent. Now, let us determine thecomponents of #»t in the new basis { #»u , #»v , #»w}.

#»t = λ #»u +μ #»v +ν #»w ⇒⇒ (2,−1,−1) = λ (2,0,−1)+μ (1,2,1)+ν (1,0,3)⇒

⇒ (2,−1,−1) = (2λ +μ +ν ,2μ ,−λ +μ +3ν) .

In order to detect the values of λ ,μ ,ν the following linear system must be solved:

⎧⎪⎨

⎪⎩

2λ +μ +ν = 2

2μ =−1

−λ +μ +3ν =−1

.

It can be easily observed that the matrix associated with this linear system isthe transpose of the matrix A associated with the three vectors. The system is de-termined. The solution of the linear system is λ = 8

7 , μ = − 12 , and ν = 3

14 . Thus,#»t = 8

7#»u − 1

2#»v + 3

14#»w .

Page 178: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

158 4 Geometric Vectors

Example 4.27. Let us consider the following vectors in an orthonormal basis of ver-sors { #»

i ,#»j ,

k }.

#»u = (2,0,−1)#»v = (1,2,1)#»w = (3,2,0)

#»t = (2,−1,−1)

It can be easily verified that #»u , #»v , and #»w are linearly dependent since the matrix

det

⎝2 0 −11 2 13 2 0

⎠= 0.

If we try to express anyway #»t as a linear combination of #»u , #»v , and #»w we obtain

#»t = λ #»u +μ #»v +ν #»w ⇒⇒ (2,−1,−1) = λ (2,0,−1)+μ (1,2,1)+ν (3,2,0)⇒

⇒ (2,−1,−1) = (2λ +μ +3ν ,2μ +2ν ,−λ +μ) .

In order to detect the values of λ ,μ ,ν the following linear system must be solved:

⎧⎪⎨

⎪⎩

2λ +μ +3ν = 2

2μ +2ν =−1

−λ +μ =−1

.

This system is impossible because the rank of the incomplete matrix is 2 whilstthe rank of the complete matrix is 3. The system has no solutions. This fact canbe geometrically seen with the following sentence: it is impossible to generate avector in the space starting from three coplanar vectors. The three coplanar vectorsare effectively in two dimensions and their combination cannot generate a three-dimensional object.

Example 4.28. Let us consider the following vectors in an orthonormal basis of ver-sors { #»

i ,#»j ,

k }.

#»u = (2,0,−1)#»v = (1,2,1)#»w = (3,2,0)#»t = (2,4,2)

Page 179: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.4 Bases of Vectors 159

We already know that #»u , #»v , and #»w are coplanar. If we try to express #»t as linearcombination of them, we obtain the following system of linear equations:

⎧⎪⎨

⎪⎩

2λ +μ +3ν = 2

2μ +2ν = 4

−λ +μ = 2

.

The rank of the incomplete matrix is 2 as well as the rank of the complete matrix.The system in undetermined and, hence, has ∞ solutions. It can be observed that#»t and #»v are parallel. Hence #»t , #»u , #»v , and #»w are coplanar. In the same plane onevector can be expressed as the linear combination of three other vectors in an infinitenumber of ways.

Example 4.29. Let us consider the following vectors in an orthonormal basis of ver-sors { #»

i ,#»j ,

k }.

#»u = (2,0,−1)#»v = (1,2,1)#»w = (1,0,3)#»t = (0,0,0)

We know that #»u , #»v , and #»w are linearly independent and thus are a basis.Let us express #»t in the basis of #»u , #»v , and #»w :

#»t = λ #»u +μ #»v +ν #»w ⇒⇒ (0,0,0) = λ (2,0,−1)+μ (1,2,1)+ν (1,0,3)⇒

⇒ (0,0,0) = (2λ +μ +ν ,2μ ,−λ +μ +3ν) .

In order to detect the values of λ ,μ ,ν the following linear system must be solved:

⎧⎪⎨

⎪⎩

2λ +μ +ν = 0

2μ = 0

−λ +μ +3ν = 0

.

This is a homogeneous system of linear equations. The system is determined asthe associated incomplete matrix is non-singular. The only solution of the system isλ ,μ ,ν = 0,0,0. It can be observed that #»t is the null vector. Hence, we found outthat the only linear combination of #»u , #»v , and #»w that return the null vector #»o is bymeans of the tuple λ ,μ ,ν = 0,0,0. We have verified the linear independence of thevectors #»u , #»v , and #»w .

Page 180: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

160 4 Geometric Vectors

Example 4.30. If we consider three linearly dependent vectors , such as

#»u = (2,0,−1)#»v = (1,2,1)#»w = (3,2,0)

and we try to express the vector #»t = (0,0,0) as a linear combination of #»u , #»v , and#»w by means of three scalars λ ,μ ,ν we have the following homogeneous system oflinear equations:

⎧⎪⎨

⎪⎩

2λ +μ +3ν = 0

2μ +2ν = 0

−λ +μ = 0

.

The rank of the incomplete matrix is 2 as well as the rank of the complete matrix.The system in undetermined and, hence, has ∞ solutions besides 0,0,0. This meansthat at least one solution �= 0,0,0 such that #»o = λ #»u + μ #»v + ν #»w exists. This isanother way to express the linear dependence of the vectors.

These examples are extremely important as they link systems of linear equationsand vectors highlighting how they correspond to different formulations of the sameconcepts.

4.5 Products of Vectors

Definition 4.20. Let #»u , #»v ∈ V3 having both an arbitrary starting point O. The con-vex angle determined by the vectors is said angle of the vectors. This angle can bebetween 0 and π .

O

f

v

u

Page 181: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.5 Products of Vectors 161

Definition 4.21. Scalar Product (Dot Product). Let #»u , #»v ∈ V3 having both an ar-bitrary starting point O and let us indicate with φ their angle. The scalar product isan operator that associates a scalar to two vectors (V3×V3 → R) according to thefollowing formula:

#»u #»v = || #»u |||| #»v ||cosφ .

Proposition 4.6. Let #»u , #»v ∈V3. The scalar product of these two vectors is equal to0 ( #»u #»v = 0) if and only if they are perpendicular.

Proof. If #»u #»v = 0 ⇒ || #»u |||| #»v ||cosφ = 0. This equality is verified either if at leastone of the modules in 0 or if cosφ = 0. If a module is 0, the one vector is thenull vector #»o . Since a null vector has an undetermined direction, every vector isperpendicular to the null vector, the vectors are perpendicular. If cosφ = 0⇒ φ = π

2(+kπ with k ∈ N). Thus the vectors are perpendicular. ��

If the vectors are perpendicular, their angle φ = π2 . Thus, cosφ = 0 and the scalar

product is 0. ��

The following properties are valid for the scalar product with #»u , #»v , and #»w ∈ V3

and λ ∈ R.

• commutativity: #»u #»v = #»v #»u• homogeneity: λ ( #»u #»v ) = (λ #»u ) #»v = #»u (λ #»v )• associativity: #»w ( #»u #»v ) = ( #»w #»u ) #»v• distributivity with respect to the sum of vectors: #»w ( #»u + #»v ) = #»w #»u + #»w #»v

This is the second time in this book that the term “scalar product is used”. Anatural question would be “How does the latter definition relate to that given inChap. 2?”. The following proposition addresses this question.

Proposition 4.7. Let #»u , #»v ∈V3, with #»u = u1#»i +u2

#»j +u3

k and #»v = v1#»i +v2

#»j +

v3#»

k . The scalar product is equal to:

#»u #»v = || #»u |||| #»v ||cosφ = u1v1 +u2v2 +u3v3.

Proof. The scalar product can be expressed in the following way.

#»u #»v =(

u1#»i +u2

#»j +u3

k)(

v1#»i + v2

#»j + v3

k)=

= (u1v1)#»i

#»i +(u1v2)

#»i

#»j +(u1v3)

#»i

k +

+(u2v1)#»j

#»i +(u2v2)

#»j

#»j +(u2v3)

#»j

k +

(u3v1)#»

k#»i +(u3v2)

k#»j +(u3v3)

k#»

k

Considering that { #»i ,

#»j ,

k } is taken orthonormal, the scalar product of a basisvector by itself, e.g.

#»i

#»i , is equal to 1 because the vectors are parallel (φ = 0 ⇒

cosφ = 1) and the module is unitary, while the scalar product of a basis vector byanother basis vector, e.g.

#»i

#»j , is equal to 0 because the vectors are perpendicular.

Page 182: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

162 4 Geometric Vectors

Thus,#»u #»v = u1v1 +u2v2 +u3v3.

��

In other words, the two scalar products defined in this book are homonyms be-cause they are the same concept from different perspectives.

Example 4.31. The two vectors

#»u = (1,5,−3)#»v = (0,6,1)

have scalar product#»u #»v = 1(0)+5(6)−3(1) = 27.

These two vectors are not perpendicular.

Example 4.32. The two vectors

#»u = (2,5,−3)#»v = (1,2,4)

have scalar product#»u #»v = 2(1)+5(2)−3(4) = 0.

These two vectors are perpendicular.

Definition 4.22. Vector Product (Cross Product). Let #»u , #»v ∈ V3 having both anarbitrary starting point O and let us indicate with φ their angle. The vector product isan operator that associates a vector to two vectors (V3×V3 → V3) and is indicatedwith #»u ⊗ #»v . The resulting vector has module according to the following formula:

|| #»u ⊗ #»v ||= || #»u |||| #»v ||sinφ .

The direction of #»u ⊗ #»v is perpendicular to that of #»u and #»v . The orientation of#»u ⊗ #»v is given by the so-called right-hand-rule, graphically represented below.

v

u ⊗ v

u �

Proposition 4.8. Let #»u , #»v ∈V3 and φ their angle. The vector product of the vectors#»u , #»v is equal to #»o if and only if the two vectors are parallel.

Page 183: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.5 Products of Vectors 163

Proof. The vector product is equal to the null vector #»o either if one of the twovectors is the null vector or if the sinφ = 0. If one of the vector is the null vector #»othen the vectors are parallel. If sinφ = 0⇒ φ = 0 and the vectors are parallel. ��

If the vectors are parallel φ = 0⇒ sinφ = 0. Thus the vector product is equal to#»o . ��

The following properties for the vector product are valid.

• anticommutativity: #»u ⊗ #»v =− #»v ⊗ #»u• homogeneity: (λ #»u )⊗ #»v = #»u ⊗ (λ #»v )• distributivity with respect to the sum of vectors: #»w⊗ ( #»u + #»v ) = #»w⊗ #»u + #»w⊗ #»v

It can be observed that the associativity is not valid for the vector product, i.e.

( #»u ⊗ #»v )⊗ #»w �= #»u ⊗ ( #»v ⊗ #»w) .

Proposition 4.9. Let #»u , #»v ∈ V3 and φ their angle. The vector product : #»u ⊗ #»v isequal to the (symbolic) determinant of the matrix A where,

A =

#»i

#»j

ku1 u2 u3

v1 v2 v3

⎠.

Proof. The vector product of #»u by #»v is calculated in the following way.

#»u ⊗ #»v =(

u1#»i +u2

#»j +u3

k)⊗(

v1#»i + v2

#»j + v3

k)=

= (u1v1)#»i ⊗ #»

i +(u1v2)#»i ⊗ #»

j +(u1v3)#»i ⊗ #»

k +

+(u2v1)#»j ⊗ #»

i +(u2v2)#»j ⊗ #»

j +(u2v3)#»j ⊗ #»

k +

(u3v1)#»

k ⊗ #»i +(u3v2)

k ⊗ #»j +(u3v3)

k ⊗ #»

k

The vector product of a basis vector by itself, e.g.#»i ⊗ #»

i , is equal to #»o sincethe vectors are parallel. Since { #»

i ,#»j ,

k } is orthonormal, the vector product of twovectors composing the basis is the third vector. Hence, we obtain:

#»i ⊗ #»

j =#»

k#»j ⊗ #»

k =#»i

k ⊗ #»i =

#»j

and, for anticommutativity

#»j ⊗ #»

i =− #»

k#»

k ⊗ #»j =− #»

i#»i ⊗ #»

k =− #»j .

Page 184: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

164 4 Geometric Vectors

Thus, the equation becomes:

#»u ⊗ #»v = (u1v2)#»

k − (u1v3)#»j − (u2v1)

k +

+(u2v3)#»i +(u3v1)

#»j − (u3v2)

#»i =

= (u2v3)#»i +(u3v1)

#»j +(u1v2)

k +

−(u3v2)#»i − (u1v3)

#»j − (u2v1)

k =

= det(A) .

��

The det(A) is said symbolic because it is based on a matrix composed of hetero-geneous elements (instead of being composed of only numbers).

Example 4.33. Let us consider the following two vectors

#»u = (2,5,1)#»v = (4,10,2) .

These vectors are parallel since #»v = 2 #»u . Let us check their parallelism by crossproduct

#»v ⊗ #»u = det

#»i

#»j

k2 5 14 10 2

⎠= 10#»i +4

#»j +20

k −20#»

k −4#»j −10

#»i = #»o .

Example 4.34. Let us consider the following two vectors:

#»u = (4,1,−2)#»v = (1,0,2) .

The scalar product of these two vectors is

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

The vectors are perpendicular. If we calculate the vector product we obtain

det

#»i

#»j

k4 1 −22 0 2

⎠= 2#»i −12

#»j −2

k .

Definition 4.23. Mixed Product (Triple Product). Let #»u , #»v , #»w ∈V3 having all anarbitrary starting point O. The mixed product is an operator that associates a scalarto three vectors (V3×V3×V3 → R) and is defined as the scalar product of one ofthe three vectors by the vector product of the other two vectors:

( #»u ⊗ #»v ) #»w

Page 185: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.5 Products of Vectors 165

Proposition 4.10. Let #»u , #»v , #»w ∈ V3 having all an arbitrary starting point O. Thethree vectors are coplanar if and only if their mixed product ( #»u ⊗ #»v ) #»w is equalto 0.

Proof. If the tree vectors are coplanar, #»u and #»v are also coplanar. Thus, the vectorproduct #»u ⊗ #»v is a vector perpendicular to both and to the plane that contains them.Since #»w belongs to the same plane, #»w and #»u ⊗ #»v are perpendicular. Thus the scalarproduct between them is equal to 0, i.e. the mixed product is equal to 0. ��

If the mixed product ( #»u ⊗ #»v ) #»w is equal to 0, #»w and #»u ⊗ #»v are perpendicular.By definition of vector product, #»u ⊗ #»v is perpendicular to both #»u and #»v and tothe plane determined by them. Since #»u ⊗ #»v is perpendicular to the three vectors#»u , #»v , #»w , there is only one plane that contains all of them. Thus, #»u , #»v , #»w are copla-nar. ��

Proposition 4.11. Let B = { #»i ,

#»j ,

k } be an orthonormal basis. Let #»u , #»v , #»w ∈ V3

having components #»u = (u1,u2,u3),#»v = (v1,v2,v3), and #»w = (w1,w2,w3), respec-

tively, in the basis B. The mixed product ( #»u ⊗ #»v ) #»w = det(A) where the matrix Ais:

A =

⎝u1 u2 u3

v1 v2 v3

w1 w2 w3

⎠.

Proof. The vector product is equal to

#»u ⊗ #»v = det

#»i

#»j

ku1 u2 u3

v1 v2 v3

⎠=

=

(det

(u2 u3

v2 v3

)#»i −det

(u1 u3

v1 v3

)#»j +det

(u1 u2

v1 v2

)#»

k

)

because of the I Laplace Theorem.The mixed product is then obtained by calculating the scalar product between #»w

and #»u ⊗ #»v :

( #»u ⊗ #»v ) #»w =

(det

(u2 u3

v2 v3

)w1−det

(u1 u3

v1 v3

)w2 +det

(u1 u2

v1 v2

)w3

)= det(A)

for the I Laplace Theorem. ��

Example 4.35. The following three vectors are coplanar since #»w = 2 #»u +3 #»v :

(1,2,1)(0,4,2)(4,16,8) .

Page 186: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

166 4 Geometric Vectors

Let us check that the vectors are coplanar by verifying that the matrix associatedwith these vectors is singular

det

⎝1 2 10 4 24 16 8

⎠= 0.

This result could have seen immediately by considering that the third row is alinear combination of the first two.

Example 4.36. The following three vectors are coplanar since two of these vectorsare parallel (hence only two directions are under consideration):

(2,2,1)(6,6,3)(5,1,2) .

Let us check that the vectors are coplanar by verifying that the matrix associatedwith these vectors is singular

det

⎝2 2 16 6 35 1 2

⎠= 0.

This result could have seen immediately by considering that the second row isthe first two multiplied by 3.

Exercises

4.1. Let us consider the two following vectors∈ V3:

#»u = 2 #»e1 +1 #»e2−2 #»e3#»v =−8 #»e1−4 #»e2 +8 #»e3

expressed in the orthonormal basis.Determine whether or not the two vectors are parallel.

4.2. Let us consider the three following vectors in an orthonormal basis of versors

#»v = (1,0,1− k)#»w = (2,0,1)

1. Determine the value of k that makes the two vectors perpendicular;2. Determine the value of k that makes the two vectors parallel.

Page 187: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

4.5 Products of Vectors 167

4.3. Let us consider the following vectors

#»u = (2,−3,2)#»v = (3,0,−1)

#»w = (1,0,2) .

Determine whether or not the vectors are linearly independent.

4.4. Let us consider the three following vectors in an orthonormal basis of versors

#»u = (6,2,3)#»v = (1,0,1)#»w = (0,0,1)

1. Check whether or not the vectors are linearly independent;2. State whether or not #»u , #»v , #»w are a basis (and justify the answer) and express, if

possible, the vector #»t = (1,1,1) in the basis #»u , #»v , #»w .

4.5. Let us consider the following vectors ∈ V3 expressed in the orthonormal basis:

#»u = (1,0,1)#»v = (2,1,1)#»w = (3,1,2)#»t = (1,1,1) .

1. Verify whether or not the vectors #»u , #»v , #»w are a basis of V3;2. Express, if possible, the vector #»t in the basis identified by #»u , #»v , #»w .

4.6. Check whether or not the vectors u = (4,2,12), v = (1,1,4), and w = (2,2,8)are linearly dependent and coplanar.

4.7. Determine, if they exist, the values of h that make #»u parallel to #»v .

#»u = (3h−5) #»e1 +(2h−1) #»e2 +3 #»e3#»v = #»e1− #»e2 +3 #»e3

4.8. Determine, if they exists, the values of h that make #»u , #»v , and #»w coplanar.

#»u = 2 #»e1− #»e2 +3 #»e3#»v = #»e1 +

#»e2−2 #»e3#»w = h #»e1− #»e2 +(h−1) #»e3

Page 188: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 5Complex Numbers and Polynomials

5.1 Complex Numbers

As mentioned in Chap. 1, for a given set and an operator applied to its elements,if the result of the operation is still an element of the set regardless of the input ofthe operator, then the set is said closed with respect to that operator. For exampleit is easy to verify that R is closed with respect to the sum as the sum of two realnumbers is certainly a real number. On the other hand, R is not closed with respectto the square root operation. More specifically, if a square root of a negative numberhas to be calculated the result is not determined and is not a real number. In orderto represent these numbers Gerolamo Cardano in the sixteenth century introducedthe concept of Imaginary numbers, see [11], by defining the imaginary unit j as thesquare root of −1: j =

√−1. This means that the square roots of negative numbers

can be represented.

Example 5.1.√−9 = j3.

Imaginary numbers compose a set of numbers represented by the symbol I. Thebasic arithmetic operations can be applied to imaginary numbers.

• sum: ja+ jb = j (a+b)• difference: ja− jb = j (a−b)• product: ja jb =−ab• division: ja

jb = ab

Example 5.2. Let us consider the imaginary numbers j2 and j5. It follows that

j2+ j5 = j7j2− j5 =− j3j2 j5 =−10j2j5 = 2

5 .

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_5

169

Page 189: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

170 5 Complex Numbers and Polynomials

It can be observed that while the set ℑ is closed with respect to sum and differenceoperations, it is not closed with respect to product and division. For example, theproduct of two imaginary numbers is a real number.

In addition, the zero has an interesting role. Since 0 j = j0 = 0, the zero is both areal and imaginary number, i.e. it can be seen as the intersection of the two sets.

Definition 5.1. A complex number is a number that can be expressed as z = a+ jbwhere a and b are real numbers and j is the imaginary unit. Furthermore, a is thereal part of the complex number while jb is its imaginary part. The set of complexnumbers is indicated with C.

Example 5.3. The number a+ jb = 3+ j2 is a complex number.

Complex numbers can be graphically represented as points in the so called Gaus-sian plane where real and imaginary parts are, respectively, the projections of thepoint on the real and imaginary axes.

za

bO

R

I

The representation of a complex number in a Gaussian plan must not be confusedwith the representation of a point in R

2. Although in both cases there is a bijectionbetween the set and the points of the plane, while the set R2 is the Cartesian productR×R, the set of complex numbers C contains numbers that are the sum of real andimaginary parts.

If z1 = a+ jb and z2 = c+ jd, the basic arithmetic operations can be applied tocomplex numbers.

• sum: z1 + z2 = a+ c+ j (c+d)• product: z1z2 = (a+ jb)(c+ jd) = ac+ jad + jbc−bd = ac−bd + j (ad +bc)

• division: z1z2= a+ jb

c+ jd = (a+ jb)(c− jd)(c+ jd)(c− jd) =

ac+bd+ j(bc−ad)c2+d2

Page 190: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.1 Complex Numbers 171

Example 5.4. Let us consider the complex numbers z1 = 4+ j3 and z2 = 2− j5. Letus compute their sum, product, and division.

z1 + z2 = 6− j2z1z2 = 8− j20+ j6+15 = 23− j14z1z2= 4+ j3

2− j5 = (4+ j3)(2+ j5)(2− j5)(2+ j5) =

−7+ j2629 .

From the division of complex numbers, the inverse of a complex number z =a+ jb can be easily verified as

1z=

1a+ jb

=a− jb

(a+ jb)(a− jb)=

a− jba2 +b2 .

Example 5.5.

12+ j2

=2− j2

8=

18− j

18.

Definition 5.2. Let z = a+ jb be a complex number. The complex number a− jb issaid conjugate of z and is indicated with z.

The following basic arithmetic operations can be defined for a complex numberand its conjugate.

• sum: z+ z = a+ jb+a− jb = 2a• difference: z− z = a+ jb−a+ jb = j2b• product: zz = (a+ jb)(a− jb) = a2− jab+ jab− j2b2 = a2 +b2

Example 5.6. Let us consider the following conjugate complex numbers z = 3+ j2and z = 3− j2. It follows that

z+ z = 6z− z = j4zz = 9+4 = 13.

From the first basic arithmetic operations we can extract that if z = a+ jb,

• a = z+z2

• b = z−z2 .

Proposition 5.1. Let z1 and z2 be two complex numbers (z1,z2 ∈ C) and z1 and z2

be the corresponding conjugate numbers. It follows that

˙z1z2 = z1z2.

Proof. Let z1,z2 be two complex numbers

z1 = a+ jbz2 = c+ jd

Page 191: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

172 5 Complex Numbers and Polynomials

and the corresponding complex numbers

z1 = a− jbz2 = c− jd.

Let us calculate

z1z2 = ac−bd + j(ad +bc)

and

˙z1z2 = ac−bd− j(ad +bc).

Let us calculate now

z1z2 = (a− jb)(c− jd) = ac− jad− jbc−bd = ac−bd− j (ad +bc) .��

Example 5.7. Let us consider the following two complex numbers

z1 = 1+ j2z2 = 4+ j3.

Let us calculate

z1z2 = 4−6+ j(3+8) =−2+ j11

and then

˙z1z2 =−2− j11.

Let us calculate now

z1z2 = (1− j2)(4− j3) =−2− j11.

An important characterization of complex numbers can be done on the basis ofthe definitions of ordered set and field given in Chap. 1. We know that the field ofreal number is the set R with its sum and product operations. In addition, we havedefined the operations of sum and product over the set of complex numbers C. Itcan easily be verified that the field properties are valid for sum and product overcomplex numbers. In a similar way we can define a field of imaginary numbers.

The real field R is totally ordered, i.e. the following properties are valid.

• ∀x1,x2 ∈ R with x1 �= x2: either x1 ≤ x2 or x2 ≤ x1

• ∀x1,x2 ∈ R : if x1 ≤ x2 and x2 ≤ x1 then x1 = x2

• ∀x1,x2,x3 ∈ R : if x1 ≤ x2 and x2 ≤ x3 then x1 ≤ x3

• ∀x1,x2,c ∈ R with c > 0 : if x1 ≤ x2 then x1 + c≤ x2 + c• ∀x1,x2 ∈ R with x1 > 0 and x2 > 0 : x1x2 > 0

Proposition 5.2. The imaginary field I is not totally ordered.

Page 192: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.1 Complex Numbers 173

Proof. Let us prove that the property:

∀x1,x2 ∈ I with x1 > 0 and x2 > 0 : x1x2 > 0

is not valid in the imaginary field.Let us consider x1,x2 ∈ I. Let x1 = jb and x2 = jd. Let b > 0. and d > 0. Then,

x1x2 = j2bd with bd > 0. Thus, x1x2 = −bd < 0. Since one of the total order re-quirement is not respected the imaginary field is not totally ordered. ��

It follows that the complex field is not totally ordered. As an intuitive explanationof this fact, two complex numbers cannot be in general sorted in the same way asthere is no explicit criterion to sort two points in a plane.

The representation of a complex number as z = a+ jb is said in rectangularcoordinates. A complex number can have an equivalent representation using a sys-tem of polar coordinates. More specifically, from a complex number z = a+ jb, wecan represent the same number in terms of radius (or module) ρ and phase θ , andindicate as (ρ;∠θ), where

ρ =√

a2 +b2

θ =

{arctan

(ba

)if a > 0

arctan(

ba

)+π if a < 0.

za

bO

R

I

θ

Example 5.8. Let us consider the two following complex numbers: z1 = 2+ j3 andz2 =−4+ j8. Let us represent these two numbers in polar coordinates. As for z1, theradius ρ1 =

√22 +32 =

√13 and the phase θ1 = arctan

(32

)= 56,3◦. As for z2, the

radius ρ2 =√−42 +82 =

√80 and the phase θ1 = arctan

(8−4 +180◦

)= 116,6◦.

Let us now compute sum and product of these two complex numbers. The sumis z1 + z2 = −2+ j11. The product can be computed from the polar representationof the numbers: z1z2 =

((√13√

80)

;∠172,9◦).

Page 193: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

174 5 Complex Numbers and Polynomials

From simple trigonometric considerations on the geometric representation of acomplex number we can derive that

a = ρ cosθb = ρ sinθ .

Thus, we can represent a complex number as

z = a+ jb = ρ (cosθ + j sinθ) .

Let us consider two complex numbers z1 = ρ1 (cosθ1 + j sinθ1),z2 = ρ2 (cosθ2 + j sinθ2) and compute their product.

z1z2 = ρ1 (cosθ1 + j sinθ1)ρ2 (cosθ2 + j sinθ2) =

= ρ1ρ2 (cosθ1 + j sinθ1)(cosθ2 + j sinθ2) =

= ρ1ρ2 (cosθ1 cosθ2 + j cosθ1 sinθ2 + j sinθ1 cosθ2− sinθ1 sinθ2) =

= ρ1ρ2 (cos(θ1 +θ2)+ j sin(θ1 +θ2)) .

This means that if two complex numbers are represented in polar coordinates, inorder to computer their product, it is enough to calculate the product of their mod-ules and to sum their phases. It is here reminded that cos(α−β ) = cosα cosβ +sinαsinβ and sin(α +β ) = sinαcosβ + cosα sinβ .

Example 5.9. Let us consider the following complex numbers z1 = (5;∠30◦) andz2 = (2;∠45◦). It follows that

z1z2 = (10;∠75◦) = 10(cos(75◦)+ j sin(75◦)) .

From the product of two complex numbers in polar coordinates , it immediatelyfollows that the nth power of a complex number is given by

zn = ρn (cos(nθ)+ j sin(nθ)) .Example 5.10. Let us consider the complex number z= 2+ j2. The complex numberz in polar coordinates is

z =(√

8;∠45◦).

Let us calculate

z4 = 64(cos(180◦)+ j sin(180◦)) =−64.

From this formula, the nth root can be derived. More specifically, let us supposethat (z1)

n = z2. If z1 = ρ1 (cosθ1 + j sinθ1) and z2 = ρ2 (cosθ2 + j sinθ2) then

z2 = (ρ1 (cosθ1 + j sinθ1))n ⇒

⇒ ρ2 (cosθ2 + j sinθ2) = ρn1 (cos(nθ1)+ j sin(nθ1)) .

Page 194: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.1 Complex Numbers 175

From these formulas we can write⎧⎪⎨

⎪⎩

ρ2 = ρn1

cosθ2 = cos(nθ1)

sinθ2 = sin(nθ1)

⎧⎪⎨

⎪⎩

ρ1 = n√ρ2

θ1 =θ2+2kπ

n

θ1 =θ2+2kπ

n .

where k ∈ N. Thus, the formula for the nth root is

n√

z = n√

ρ2

(cos

(θ2 +2kπ

n

)+ j sin

(θ2 +2kπ

n

)).

In a more compact way and neglecting 2kπ , if z = ρ (cosθ + j sinθ), then

n√

z = n√

ρ(

cos

(θn

)+ j sin

(θn

)).

Example 5.11. Let us consider the complex number z = (8;∠45◦) and calculate

3√

z = (2;∠15◦) = 2(cos(15◦)+ j sin(15◦)) .

An alternative (and equivalent) formulation of the nth power of a complex numberis the so-called De Moivre formula.

Theorem 5.1. De Moivre’s Formula. For every real number θ ∈ R and integern ∈ N,

(cosθ + j sinθ)n = cos(nθ)+ j sin(nθ) .

Finally, the following Theorem broadens the interpretation of the concept of com-plex numbers.

Theorem 5.2. Euler’s Formula. For every real number θ ∈ R,

e jθ = cosθ + j sinθ ,

where e is the Euler’s number 2.71828, base of natural logarithm.

The Euler formula is an important result that allows to connect exponential func-tions to sinusoidal functions to complex numbers by means of their polar represen-tation, see [12]. A proof of the Euler’s Formula is reported in Appendix B.

Example 5.12. For θ = 45◦ = π4 ,

e j π4 = cos45◦+ j sin45◦ =

√2

2+ j

√2

2.

Page 195: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

176 5 Complex Numbers and Polynomials

As a remark, the De Moivre’s formula is anterior with respect to the Euler’sformula, and thus this is not the original proof. Nonetheless, it can be seen as anextension of the Euler’s formula and, thus, may appear as its logical consequence,see [13].

Proposition 5.3. Let z = ρe jθ = ρ (cosθ + j sinθ) be a complex number. It followsthat

jz = ρ (cos(θ +90◦)+ j sin(θ +90◦)) = ρe j(θ+90◦).

Proof. If we multiply z by j we obtain:

jz = jρe jθ = jρ (cosθ + j sinθ) == ρ ( j cosθ − sinθ) = ρ (−sinθ + j cosθ) =

= ρ (sin(−θ)+ j cos(θ)) = ρ (cos(θ +90◦)+ j sin(θ +90◦)) == ρe j(θ+90◦).��

This means that the multiplication of a complex number by the imaginary unitj can be interpreted as a 90◦ rotation of the complex number within the Gaussianplane.

Example 5.13. Let us consider the complex number z = 2+ j2 and multiply is by j:

jz = j2−2 =−2+ j2.

In the Gaussian plane this means

zjz

O

R

I

θ

θ +90◦

Example 5.14. Let us consider the complex number z = ρ∠15◦, which can be writ-ten as 5(cos15◦+ j sin15◦). Let us multiply this number by j:

jz = j5(cos15◦+ j sin15◦) = 5(−sin15◦+ j cos15◦) == 5(sin−15◦+ j cos15◦) = 5(cos105◦+ j sin105◦) =

5(cos(90◦+15◦)+ j sin(90◦+15◦)) = 5e j(15◦+90◦)

Page 196: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.2 Complex Vectors, Matrices and Systems of Linear Equation 177

Finally, if we calculate Euler’s formula for θ = π we obtain:

e jπ +1 = 0,

that is the so called Euler’s identity. This equation is historically considered as anexample of mathematical beauty as it contains the basic numbers of mathematics,i.e. 0,1,e,π, j, as well as the basic operations, i.e. sum, multiplication, and expo-nentiation, all these elements appearing only once in the equation.

5.2 Complex Vectors, Matrices and Systems of Linear Equation

All the theory and examples in the previous chapters refer to real numbers. However,it is worth mentioning that the algebra analysed up to this point can be straightfor-wardly extended to the complex case. This section elaborates on this statement byshowing several examples.

Definition 5.3. Let C be the complex set and Cn = C×C× . . .×C the Cartesian

product obtained by the composition of the complex set calculated n times.A generic element u ∈ C

n is named complex vector and is an n-tuple of the type

u = (a1 + jb1,a2 + jb2, . . . ,an + jbn)

where each component ak + jbk is a complex number.

Example 5.15. The following is a complex vector of C3:

u = (3− j2,4,1+ j7) .

By using the operation of sum and product of complex numbers we can definethe scalar product of complex vectors.

Definition 5.4. Let u = (u1,u2, . . . ,un) and v = (v1,v2, . . . ,vn) be two vectors of Cn.The scalar product uv is

uv =n

∑j=1

u jv j. (5.1)

Example 5.16. Let us consider the following complex vectors of C3:

u = (1,1+ j2,0)v = (3− j, j5,6− j2) .

The scalar product is

uv = 3− j+−10+ j5+0 =−7+ j4.

Similarly, we may think about a matrix whose elements are complex numbers.

Page 197: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

178 5 Complex Numbers and Polynomials

Definition 5.5. A complex matrix C composed of m rows and n columns is a tableof the type

C =

⎜⎜⎝

c1,1 c1,2 . . . c1,n

c2,1 c2,2 . . . c2,n

. . . . . . . . . . . .cm,1 cm,2 . . . cm,n

⎟⎟⎠

where ci, j is a complex number:

ci, j = ai, j + jbi, j.

The set of all the possible m×n complex matrices is indicated with Cm,n.

Example 5.17. The follow matrix is a complex matrix

C =

⎝3 −1+ j3 j5

1+ j8 −9 00 2 j12

⎠ .

For complex matrices can be summed like matrices composed of real numbersby adding the complex elements one by one.

Example 5.18. Let us consider the following matrices:

C =

⎝3 −1+ j3 j5

1+ j8 −9 00 2 j12

⎠ .

and

D =

⎝1+ j2 0 − j14− j8 4 0

0 −2 − j3

⎠ .

The sum of these matrices is

C+D =

⎝4+ j2 −1+ j3 j4

5 −5 00 0 − j9

⎠ .

From the definition of scalar product we can easily extend also the matrix productto complex matrices.

Definition 5.6. Let us consider the complex matrices C ∈Cm,r and D ∈Cr,n. Let usrepresent C as a vector of row vectors and D as a vector of column vectors:

C =

⎜⎜⎝

c1c2. . .cm

⎟⎟⎠

Page 198: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.2 Complex Vectors, Matrices and Systems of Linear Equation 179

andD =

(d1 d2 . . . dn

)

The product matrix CD is

CD =

⎜⎜⎝

c1d1 c1d2 . . .c1dn

c2d1 c2d2 . . .c2dn

. . . . . . . . . . . .cmd1 cmd2 . . .cmdn

⎟⎟⎠

where cidj is the scalar product of two complex vectors, i.e. ci and dj.

Example 5.19. Let us consider the following two complex matrices:

C =

⎝2+ j 0 5− j3

1 1 0j5 3+ j2 0

and

D =

⎝1 0 10 1 0j5 3+ j2 0

The product matrix is

CD =

⎝17+ j26 21+ j 2+ j

1 1 1j5 3+ j2 j5

⎠ .

All the properties valid for sum and product of matrices of real numbers can bestraightforwardly extended to complex numbers. Similarly we can extend to com-plex numbers the definition of determinant according to the description in Sect. 2.4and inverse matrix according to the theory outlined in Sect. 2.5.

Example 5.20. Let us consider again the complex matrix

C =

⎝2+ j 0 5− j3

1 1 0j5 3+ j2 0

⎠ .

The determinant of the matrix is det(C) = 6− j24 �= 0. Thus the matrix C isinvertible. By applying the formula to invert the matrix

C−1 =1

det(C)adj(C)

Page 199: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

180 5 Complex Numbers and Polynomials

we can calculate the inverse of a complex matrix:

C−1 =1

6− j24

⎝0 21+ j −5+ j30 −15− j25 5− j3

3− j3 −4− j7 2+ j.

Example 5.21. The complex matrix

C =

⎝2+ j 0 2+ j

1 1 2j5 3+ j2 3+ j7

is singular. The third column is sum of the other two. The matrix is not invertible.

We can extend to complex numbers also the theory of systems of linear equations.

Definition 5.7. Let us consider m (with m > 1) linear equations in the variablesx1,x2, . . . ,xn. These equations compose a system of complex linear equations indi-cated as:

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

c1,1x1 + c1,2x2 + . . .+ c1,nxn = d1

c2,1x1 + c2,2x2 + . . .+ c2,nxn = d2

. . .

cn,1x1 + cn,2x2 + . . .+ cn,nxn = dn

where ∀i, j ci, j ∈ C and di ∈ C.

For systems of complex linear equations, the same theorems valid for real lin-ear equations are still valid. For examples, Cramer’s and Rouchè-Capelli theory isvalid as well as Gaussian elimination, LU factorisation and iterative methods. Thefollowing examples clarify this fact.

Example 5.22. Let us solve by applying Cramer’s method the following system oflinear equations.

{2x−4 jy = 0

(1+ j)x+ y = 2.

The determinant of the associated incomplete matrix is −2+ j4. Let us applyCramer’s method. The solution is

x =det

(0 − j42 1

)

−2+ j4= 1.6− j0.8

Page 200: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.2 Complex Vectors, Matrices and Systems of Linear Equation 181

and

y =det

(2 0

(1+ j) 2

)

−2+ j4=−0.4− j0.8

respectively.

Example 5.23. Let us consider the following system of linear equations⎧⎪⎨

⎪⎩

4x+3 jy+ z = 0

(2+ j)x−2y+ z = 0

(6+ j)x+(−2+ j3)y+2z = 0.

We can easily see that the third equation is the sum of the first two. Since thesystem is homogeneous, by applying the Rouchè-Capelli Theorem, the rank ρA =ρAc = 2 < n = 3. Thus the system has ∞1 solutions.

Let us find the general solution to the system by placing x = α . It follows that

z =−4α− j3y

and(2+ j)α−2y−4α− j3y = 0

which yields to

y =(−2+ j)(2+ j3)

α =

(− 1

13+ j

813

and

z =−4α− j3(−2+ j)(2+ j3)

α =

(−28

13+ j

313

)α.

Example 5.24. Let us solve by Gaussian elimination the following system of linearequations

⎧⎪⎨

⎪⎩

x− jy+2z = 1

4x−10y− z = 2

2x+2y+10z = 4

Starting from the complete matrix

Ac =

⎝1 − j 2 14 −10 −1 22 2 10 4

Let us apply the row transformations

r2 = r2−4r1r3 = r3−2r1

Page 201: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

182 5 Complex Numbers and Polynomials

and obtain

Ac =

⎝1 − j 2 10 (−10+ j4) −9 −20 (2+ j2) 6 2

⎠ .

We now need to apply the following row transformation

r3 = r3−2+ j2−10+ j4

r2 = r3−(− 3

29− j

729

)r2 = r3 +

(329

+ j729

)r2

which leads to

Ac =

⎝1 − j 2 10 (−10+ j4) −9 −20 0 (5.068− j2.172) (1.793− j0.483)

⎠ .

The solution of this triangular system of linear equation is

x = 0.336− j0.006y =−0.101+ j0.002z = 0.333+ j0.048

From the final Ac we can extract the matrix U while the matrix L is

L =

⎝1 0 04 1 02(− 3

29 − j 729

)1

Example 5.25. Let us consider the following matrix

A =

⎝1 3 j (4+ j)j2 (−6+ j5) (−1+ j8)

(1+ j) (−3+ j3) (4+ j5)

⎠ .

The matrix A can be factorized as LU where

L =

⎝1 0 0j2 1 0

(1+ j) 0 1

and

U =

⎝1 j3 (4+ j)0 j5 10 0 1

⎠ .

Page 202: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 183

5.3 Complex Polynomials

5.3.1 Operations of Polynomials

Definition 5.8. Let n ∈ N and a0,a1, . . . ,an ∈ C. The function p(z) in the complexvariable z ∈ C defined as

p(z) = a0 +a1z+a2z2 + . . .+ . . .anzn =n

∑k=0

akzk

is said complex polynomial in the coefficients ak and complex variable z. The order nof the polynomial is the maximum value of k corresponding to a non-null coefficientak.

Example 5.26. The following function

p(z) = 4z4−5z3 + z2−6

is a polynomial.

Definition 5.9. Let p(z) = ∑nk=0 akzk be a polynomial. If ∀k ∈N with k≤ n : ak = 0,

the polynomial is said null polynomial.

Definition 5.10. Let p(z) = ∑nk=0 akzk be a polynomial. If ∀k ∈ N with 0 < k ≤ n :

ak = 0 and a0 �= 0, the polynomial is said constant polynomial.

Definition 5.11. Identity Principle. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑n

k=0 bkzk

be two complex polynomials. The two polynomials are said identical p1 (z) = p2 (z)if and only if the following two conditions are both satisfied:

• the order n of the two polynomials is the same• ∀k ∈ N with k ≤ n : ak = bk.

Example 5.27. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk be two complex poly-nomials with m < n. The two polynomials are identical if and only if

• ∀k ∈ N with k ≤ m : ak = bk

• ∀k ∈ N with m < k ≤ n : ak = 0

Definition 5.12. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk be two polynomialsof orders n and m, respectively. The sum polynomial is the polynomial p3 (z) =∑n

k=0 akzk +∑mk=0 bkzk.

Example 5.28. Let us consider the polynomials

p1 (z) = z3−2zp2 (z) = 2z3 +4z2 +2z+2.

The sum polynomial is

p3 (z) = 3z3 +4z2 +2.

Page 203: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

184 5 Complex Numbers and Polynomials

Proposition 5.4. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk be two polynomialsof orders n and m, respectively.

• If m �= n, the order of the sum polynomial p3 (z) = p1 (z)+ p2 (z) is the greatestamong n and m.

• If m = n, the order of the sum polynomial p3 (z) = p1 (z)+ p2 (z) is ≤ n.

Example 5.29. To clarify the meaning of this proposition let us consider the follow-ing polynomials: p1 (z) = 5z3 + 3z− 2 and p2 (z) = 4z2 + z+ 8. It is obvious thatthe sum polynomial is of the same order of the greatest among the orders of the twopolynomials, i.e. 3 and 2. Hence the sum polynomial is of order 3.

On the other hand, if we consider two polynomials of the same order such asp1 (z) = 5z3 +3z−2 and p2 (z) =−5z3 + z+8, their sum results into a polynomialof the first order. The sum polynomial could have a lower order with respect to thestarting ones.

Definition 5.13. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk be two polynomi-als of orders n and m, respectively. The product polynomial is a polynomial p3 =(∑n

k=0 akzk)(

∑mk=0 bkzk

).

Proposition 5.5. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk be two polynomi-als of orders n and m, respectively. The order of the product polynomial p3 (z) =p1 (z) p2 (z) is n+m.

Example 5.30. The following two polynomials

p1 (z) = z2−2zp2 (z) = 2z+2.

are of order 2 and 1 respectively.The product polynomial

p3 (z) = 2z3−4z2 +2z2−4z = 2z3−2z2−4z

is of order 2+1 = 3.

Theorem 5.3. Euclidean Division. Let p1 (z) = ∑nk=0 akzk and p2 (z) = ∑m

k=0 bkzk

be two polynomials of orders n and m, respectively and p2 (z) �= 0. The division ofpolynomials p1 (z) (dividend) by p2 (z) (divisor) results into a polynomial

p3 (z) =p1 (z)p2 (z)

= q(z)+d (z)

which can be rewritten as

p1 (z) = p2 (z)q(z)+ r (z)

Page 204: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 185

where q(z) is said polynomial quotient and r (z) is said polynomial remainder. Theorder r or the polynomial remainder is strictly less than the order m of the divisorp2 (z):

r < m.

Example 5.31. Let us consider the following polynomials

p1 (z) = z2− z+5p2 (z) = z−4.

It follows thatp1 (z) = p2 (z)q(z)+ r (z)

whereq(z) = z+3r (z) = 17.

We have that the order n of p1 (z) is 2, the order m of p2 (z) is 1 and the order rof the remainder is < m, i.e. it is zero.

The following theorem shows that polynomial quotient and remainder are uniquefor a given pair of polynomials p1 (z) and p2 (z).

Theorem 5.4. Uniqueness of Polynomial Quotient and Remainder. Let p1 (z) =∑n

k=0 akzk and p2 (z) = ∑mk=0 bkzk be two complex polynomials with m < n. ∃! com-

plex polynomial q(z) and ∃! complex polynomial r (z) having order r < m|p1 (z) =p2 (z)q(z)+ r (z).

Proof. By contradiction, let us assume that two pairs of complex polynomials q(z),r (z) and q0 (z), r0 (z) exist such that

p1 (z) = p2 (z)q(z)+ r (z)

p1 (z) = p2 (z)q0 (z)+ r0 (z)

where the order of r (z), r, and the order of r0 (z), r0, are both < m.Thus, the following equality is verified:

0 = p2 (z)(q(z)−q0 (z))+(r (z)− r0 (z))⇒⇒ r0 (z)− r (z) = p2 (z)(q(z)−q0 (z)) .

From the hypothesis we know that the order of p2 (z) is m. Let us name l theorder of (q(z)−q0 (z)). The order of p2 (z)(q(z)−q0 (z)) is m+ l ≥ m. Since theorder of r0 (z)− r (z) can be at most m−1, the equation above violates the identityprinciple of two polynomials. Thus, we reached a contradiction as the polynomialquotient and remainder must be unique. ��

Example 5.32. Let us consider a special case of the Theorem 5.4 where the order ofp1 (z) is n while the order of p2 (z) is 1. More specifically, p2 (z) = (z−α).

Page 205: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

186 5 Complex Numbers and Polynomials

From Theorem 5.4 we know that ∃!q(z) and ∃!r (z) such that p1 (z) =(z−α)q(z)+ r (z).

The order r of the polynomial r (z)< than the order of p2 (z), that is 1. Thus theorder of the polynomial r (z) is 0, i.e. the polynomial r (z) is either the constant orthe null polynomial.

Definition 5.14. Let p1 (z)=∑nk=0 akzk and p2 (z)=∑m

k=0 bkzk be two complex poly-nomials. The polynomial p1 (z) is said to be divisible by p2 (z) if ∃! polynomial q(z)such that p1 (z) = p2 (z)q(z) (with r (z) = 0 ∀z).

In the case p2 (z) = (z−α), a polynomial p1 (z) is divisible by p2 (z) if ∃! poly-nomial q(z) such that p1 (z) = (z−α)q(z) (with r (z) = 0 ∀z).

It must be observed that the null polynomial is divisible by all polynomials whileall polynomials are divisible by a constant polynomial.

Theorem 5.5. Polynomial Remainder Theorem or Little Bézout’s Theorem. Letp(z) = ∑n

k=0 akzk be a complex polynomial having order n ≥ 1. The polynomialremainder of the division of p(z) by (z−α) is r (z) = p(α).

Proof. From the Euclidean division in Theorem 5.3 we know that

p(z) = (z−α)q(z)+ r (z)

with the order of r (z) less than the order of (z−α). Hence, the polynomial remain-der r (z) has order 0, i.e. the polynomial remainder r (z) is a constant. To highlightthat the polynomial remainder is a constant, let us indicate it with r. Hence, theEuclidean division is

p(z) = (z−α)q(z)+ r.

Let us calculate the polynomial p(z) in α

p(α) = (α−α)q(α)+ r = r.

Hence, r = p(α). ��

5.3.2 Roots of Polynomials

Definition 5.15. Let p(z) be a polynomial. The values of z such that p(z) = 0 aresaid roots or solutions of the polynomial.

Corollary 5.1. Ruffini’s Theorem. Let p(z) = ∑nk=0 akzk be a complex polynomial

having order n≥ 1. The polynomial p(z) is divisible by (z−α) if and only if p(α)=0 (α is a root of the polynomial).

Proof. If p(z) is divisible by (z−α) then we may write

p(z) = (z−α)q(z) .

Page 206: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 187

Thus, for z = α we have

p(α) = (α−α)q(α) = 0.��

If α is a root of the polynomial, then p(α) = 0. Considering that

p(z) = (z−α)q(z)+ r (z)

and for the little Bézout’s Theorem p(α) = r, it follows that r = 0 and that

p(z) = (z−α)q(z)

that is p(z) is divisible by (z−α). ��

Example 5.33. Let us consider the division of polynomials(−z4 +3z2−5

)

(z+2).

It can be easily verified that the polynomial reminder of this division is

r = p(−2) =−9.

On the contrary, in the case of the division of(−z4 +3z2 +4

)

(z+2)

we obtainr = p(−2) = 0.

In the latter case the two polynomials are divisible.

A practical implication of Polynomial Reminder and Ruffini’s Theorems is the socalled Ruffini’s rule that is an algorithm for dividing a polynomial p(z) =∑n

k=0 akzk

by a first order polynomial (z−α). Obviously, for the Euclidean division and Poly-nomial Remainder Theorem it results that

p(z) = (z−α)q(z)+ r

where r is a constant and q(z) = ∑n−1k=0 bkzk.

The algorithm consists of the following steps. At the beginning the coefficientsare arranged as

an an−1 . . . a1 a0

α

Page 207: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

188 5 Complex Numbers and Polynomials

and the coefficient corresponding to the maximum power in the polynomial an isinitialized in the second row. Let us rename it as bn−1 as it is the coefficient of themaximum power of q(z):

an an−1 . . . a1 a0

αbn−1 = an

From this point, each coefficient bk of q(z) can be recursively calculated as bk =ak+1 +bk+1α for k = n−1,n−1, . . . ,0:

an an−1 . . . a1 a0

αbn−1 = an bn−2 = an−1 +bn−1α . . . b0 = a1 +b1α

Finally, the remainder r is r = a0 +b0α .

Example 5.34. Let us consider the division of the polynomial(−z4 +3z2−5

)by

(z+2). By applying Ruffini’s rule we obtain

−1 0 3 0 −5−2

−1 2 −1 2

Hence the polynomial quotient is(−z3 +2z2− z+2

)and the polynomial re-

minder as expected from the Polynomial Remainder Theorem is r = a0+b0α =−9.

Theorem 5.6. Fundamental Theorem of Algebra. If p(z) = ∑nk=0 akzk is a com-

plex polynomial having order n≥ 1, then this polynomial has at least one root.

Obviously, for the Ruffini’s Theorem if α ∈C is the root of the polynomial, thenp(z) is divisible by (z−α). A proof of this theorem is given in Appendix B.

As a first observation of the Fundamental Theorem of Algebra, since real num-bers are special case of complex numbers, i.e. complex numbers with null imaginarypart, the theorem is valid for real polynomials too. This means that a real polynomialalways has at least one root. This root is not necessarily a real number but it couldbe a complex number as in the case of x2 +1.

Furthermore, let us give a second interpretation of the Fundamental Theorem ofAlgebra. In order to do this, let us consider the set of natural numbers N. Let usconsider the following natural polynomial (a polynomial where all the coefficientsare natural numbers):

8− x = 9.

Although all the coefficients of this polynomial are natural numbers, the root of thispolynomial is not a natural number. For this reason we have the need of “expanding”the set of natural numbers to the set of relative numbers Z. This statement can bewritten as: “the set of natural numbers is not closed with respect to the subtractionoperation”.

Page 208: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 189

Now, let us consider the following relative polynomial (a polynomial where allthe coefficients are relative numbers):

−5x = 3.

In a similar way, although all the coefficients of the polynomial are relative numbersthe root of this polynomial is not a relative number. To find the root, we need a setexpansion. Thus, we introduce the set of relative numbers Q and we conclude that “the set of relative number is not closed with respect to the division operation”.

Now, let us consider the following rational polynomial (a polynomial where allthe coefficients are relative numbers):

x2 = 2.

The roots of this polynomial are not relative numbers. Thus we need a further setexpansion and we need to introduce the set of real numbers R. We can conclude that“the set of rational numbers is not closed with respect to the nth root operation”.

Finally, let us consider the real polynomial

x2 =−1.

The roots of this polynomial are not real numbers. In order to solve this equationwe had to introduce the set of complex numbers. Hence, we can conclude that also“the set of real numbers is not closed with respect to the nth root operation”. Morespecifically, it is not closed when the square root of a negative number is taken.

Now, the Fundamental Theorem of Algebra guarantees that if we consider a com-plex polynomial, it will sure have at least one complex root. This means that we canconclude that “the set of complex numbers is closed with respect to the operationsof sum (subtraction), multiplication (division), exponentiation (nth root).”

Remembering that a field is essentially a set with its operations, the latter state-ment can be re-written according to the equivalent and alternative formulation of theFundamental Theorem of Algebra.

Theorem 5.7. Fundamental Theorem of Algebra (Alternative Formulation).The field of complex numbers is algebraically closed.

An algebraically closed field is a field that contains the roots for every non-constant polynomial.

Definition 5.16. Let p(z) be a complex polynomial and α its root. The root is saidsingle or simple is p(z) is divisible by (z−α) but not (z−α)2.

Definition 5.17. If a polynomial can be expressed as

p(z) = h(z−α1)(z−α2) . . .(z−αn)

with h constant and α1 �= α2 �= . . . �= αn, the polynomial is said to have n distinctroots α1,α2, . . . ,αn.

Page 209: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

190 5 Complex Numbers and Polynomials

Theorem 5.8. Theorem on the Distinct Roots of a Polynomial. If p(z)=∑nk=0 akzk

is a complex polynomial having order n≥ 1, then this polynomial has at most n dis-tinct solutions.

Proof. Let us assume, by contradiction, that the polynomial has n+1 distinct rootsα1,α2, . . . ,αn+1. Hence, p(z) is divisible by (z−α1) ,(z−α2) , . . . , and (z−αn+1).Since p(z) is divisible by (z−α1), then we can write

p(z) = (z−α1)q(z) .

Let us considerp(α2) = (α2−α1)q(α2)

with α1 �= α2. Since α2 is a root of the polynomial p(α2) = 0. It follows that alsoq(α2) = 0. If α2 is a root of q(α2), then q(z) is divisible by (z−α2), i.e. we canwrite

q(z) = (z−α2)q1 (z) .

Hence,p(z) = (z−α1)(z−α2)q1 (z) .

Let us consider the root α3 �=α2 �=α1. Then, p(α3) = 0. It follows that q1 (α3) =0 and that we can write

q1 (z) = (z−α3)q2 (z) .

Hence,p(z) = (z−α1)(z−α2)(z−α3)q2 (z) .

If we iterate this procedure we obtain

p(z) = (z−α1)(z−α2) . . .(z−αn+1)qn

with qn constant.We have written an equality between a n order polynomial (p(z) has order n for

hypothesis) and a n+ 1 order polynomial, against the identity principle. We havereached a contradiction. ��

Corollary 5.2. If two complex polynomials p1 (z) and p2 (z) of order n≥ 1 take thesame value in n+1 points, then the two polynomials are identical.

Example 5.35. Let us consider the following order 2 polynomial:

z2 +5z+4.

For the theorem on the distinct roots of a polynomial, this polynomial cannothave more than two distinct roots. In particular, the roots of this polynomial are −1and −4 and can be written as

(z2 +5z+4

)= (z+1)(z+4) .

Page 210: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 191

Example 5.36. The polynomial

z3 +2z2−11z−12

cannot have more than three distinct roots. The roots are −1, −4, and 3 and thepolynomial can be written as

(z3 +2z2−11z−12

)= (z+1)(z+4)(z−3) .

Example 5.37. The polynomialz2 +2z+5

cannot have more than two distinct roots. In this case the roots are not simple realroots but two distinct complex roots, i.e. −1+ j2 and −1− j2. The polynomial canbe written as (

z2 +2z+5)= (z+1− j2)(z+1+2 j) .

Obviously, a polynomial can have both real and complex roots as in the case of(z3 + z2 +3z−5

)= (z+1− j2)(z+1+2 j)(z−1).

Example 5.38. Finally, the polynomial

z4− z3−17z2 +21z+36

is of order 4 and cannot have more than four distinct roots. It can be verified thatthis polynomial has three roots, that is −1, −4, and 3 as the polynomial above butthe root −3 is repeated twice. The polynomial can be written as

(z4− z3−17z2 +21z+36

)= (z+1)(z+4)(z−3)(z−3) .

This situation is explained in the following definition.

Definition 5.18. Let p(z) be a complex polynomial in the variable z. A solution issaid multiple with algebraic multiplicity k ∈ N and k > 1 if p(z) is divisible by(z−α)k but not divisible by (z−α)k+1.

Example 5.39. In the example above, 3 is a solution (or a root) of multiplicity 2because the polynomial

(z4− z3−17z2 +21z+36

)is divisible by (z−3)2 and not

by (z−3)3.

Theorem 5.9. Let p(z) = ∑nk=0 akzk be a complex polynomial of order n > 1 in the

variable z. If α1,α2, . . . ,αs are its roots having algebraic multiplicity h1,h2, . . . ,hs

thenh1 +h2 + · · ·+hs = n

andp(z) = an (z−α1)

h1 (z−α2)h2 . . .(z−αs)

hs .

Page 211: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

192 5 Complex Numbers and Polynomials

Proof. Since the polynomial p(z) has roots α1,α2, . . . ,αn with the respective mul-tiplicity values h1,h2, . . . ,hs then we can write that ∃!q(z) such that

p(z) = q(z)(z−α1)h1 (z−α2)

h2 . . .(z−αs)hs .

At first, we need to prove that q(z) is a constant. Let us assume, by contradiction,that q(z) is of order≥ 1. For the Fundamental Theorem of Algebra, this polynomialhas at least one root α ∈ C. Thus, ∃q1 (z) |q(z) = (z−α)q1 (z). If we substitute inthe p(z) expression we obtain

p(z) = (z−α)q1 (z)(z−α1)h1 (z−α2)

h2 . . .(z−αs)hs .

This means that α is also a root of p(z). Since for hypothesis the roots of p(z)are α1,α2, . . . ,αs, α must be equal to one of them. Let us consider a generic indexi such that α = αi. In this case p(z) must be divisible by (z−αi)

hi+1. Since this isagainst the definition of multiplicity of a root, we reached a contradiction. It followsthat q(z) is a constant q and the polynomial is

p(z) = q(z−α1)h1 (z−α2)

h2 . . .(z−αs)hs .

Let us re-write the polynomial p(z) as

p(z) = anzn +an−1zn−1 + . . .a2z2 +a1z+a0.

It follows that the addend of order n is

anzn = qzh1+h2+...+hs .

For the identity principle

h1 +h2 + · · ·+hs = n

an = q.

Thus, the polynomial can be written as

p(z) = an (z−α1)h1 (z−α2)

h2 . . .(z−αs)hs .��

Example 5.40. The polynomial(z4− z3−17z2 +21z+36

)in the previous exam-

ple has three roots, two of them having multiplicity 1 and one having multiplicity2: h1 = 1,h2,= 1,h3 = 2. It follows that h1 + h2 + h3 = 4 that is the order of thepolynomial. As shown above, the polynomial can be written as

(z+1)(z+4)(z−3)2 .

With reference to Theorem 5.9, an = 1.

Page 212: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 193

Example 5.41. Let us consider the polynomial

2z7−20z6 +70z5−80z4−90z3 +252z2−30z+200

which can be written as

2(z+1)2(z−4)(z2−4z+5)2.

The roots are−1 with multiplicity 1, 4 with multiplicity 2, 2− j with multiplicity2 and 2+ j with multiplicity 2. Hence we have that the sum of the multiplicity valuesis 1+2+2+2 = 7 that is the order of the polynomial and an = 2.

Definition 5.19. Let p(z) = ∑nk=0 akzk be a complex polynomial of order n ≥ 1. A

conjugate complex polynomial p(z) is a polynomial whose coefficients are conju-gate of the coefficients of p(z): p(z) = ∑n

k=0 akzk.

Proposition 5.6. Let p(z) be a complex polynomial of order n≥ 1. If α1,α2, . . . ,αs

are its roots having algebraic multiplicity h1,h2, . . . ,hs then α1, α2, . . . , αs with al-gebraic multiplicity h1,h2, . . . ,hs are roots of p(z).

Proposition 5.7. Let p(z) = ∑nk=0 akzk be a complex polynomial of order n ≥ 1. If

α1,α2, . . . ,αn are its roots it follows that

• α1 +α2 + . . .+αs =− an−1an

• α1α2 +α2α3 . . .+αs−1αs =an−2

an

• α1α2 . . .αs = (−1)n a0an

.

5.3.2.1 How to Determine the Roots of a Polynomial

The previous sections explain what a root is, what type of roots exist, and how manyroots are in a polynomial. It has not been explained yet how to determine these roots.In order to pursue this aim let us consider polynomials of increasing orders.

The detection of the root of a polynomial of order 1, az−b is a trivial problem:

az−b⇒ α =ba.

The roots of a polynomial of order 2, az2 + bz+ c, can be found analytically bythe popular formula developed by antique Indian, Babylonian and Chinese mathe-maticians:

α1 =−b2a +

√b2−4ac

2a

α2 =−b2a −

√b2−4ac

2a

Let us prove this formula.

Page 213: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

194 5 Complex Numbers and Polynomials

Proof. The roots are the solution of the equation

az2 +bz+ c = 0⇒ az2 +bz =−c.

Let us multiply both members of the equation by 4a:

4a2z2 +4abz =−4ac⇒ (2az)2 +2(2az)b =−4ac.

Let us add b2 to both members

(2az)2 +2(2az)b+b2 =−4ac+b2 ⇒ ((2az)+b)2 = b2−4ac⇒ ((2az)+b) =±√

b2−4ac.

From this equation we obtain

α1 =−b2a +

√b2−4ac

2a

α2 =−b2a −

√b2−4ac

2a

��

The method for the calculation of the roots of a polynomial of order 3, az3 +bz2 + cz+ d has been introduced in the sixteenth century thanks to the studies ofGirolamo Cardano and Niccoló Tartaglia. The solution of az3+bz2+cz+d = 0 canbe calculated by posing x = y− b

3a and thus obtaining a new equation:

y3 + py+q = 0.

wherep = c

a −b2

3a2

q = da −

bc3a2 +

2b3

27a3 .

The solutions of this equation are given by y = u+ v where

u =3

− q2 +

√q2

4 + p3

27

v =3

− q2 −

√q2

4 + p3

27

and two solutions whose values depend of Δ = q2

4 + p3

27 . If Δ > 0 the roots are

α1 = u+ v

α2 = u(− 1

2 + j√

32

)+ v

(− 1

2 − j√

32

)

α3 = u(− 1

2 − j√

32

)+ v

(− 1

2 + j√

32

).

Page 214: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.3 Complex Polynomials 195

If Δ < 0, in order to find the roots, the complex number − q2 + j

√−Δ must be

expressed in polar coordinates as (ρ∠θ) . The roots are:

α1 = 2√− p

3 + cos( θ

3

)

α2 = 2√− p

3 + cos( θ+2π

3

)

α3 = 2√− p

3 + cos( θ+4π

3

).

If Δ = 0 the roots areα1 =−2 3

√− q

2

α2 = α3 = 3√− q

2 .

The proof of the solving formulas are not reported as they are outside the scopesof this book.

If the polynomial is of order 4, i.e. in the form ax4+bx3+cx2+dx+e, the detec-tion of the roots have been investigated by Lodovico Ferrari and Girolamo Cardanoin the sixteenth century. A representation of the solving method is the following.

α1 =− b4a −S+ 1

2

√−4S2−2p+ q

s

α2 =− b4a −S− 1

2

√−4S2−2p+ q

s

α3 =− b4a +S+ 1

2

√−4S2−2p+ q

s

α4 =− b4a +S− 1

2

√−4S2−2p+ q

s

wherep = 8ac−3b2

8a2

q = b3−4abc+8a2d8a3 .

The value of S is given by

S =12

−23

p+1

3a

(Q+

Δ0

Q

)

where

Q =3

√Δ1+

√Δ2

1−Δ30

2Δ0 = c2−3bd +12ae

Δ1 = 2c3−9bcd +27b2e+27ad2−72ace.

The proof of the solving method is also not reported in this book. However, itis clear that the detection of the roots of a polynomial is in general a difficult task.More drastically, the detection of the roots of a polynomial having order 5 or higheris an impossible task. This fact is proved in the so called Abel-Ruffini’s Theorem.

Page 215: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

196 5 Complex Numbers and Polynomials

Theorem 5.10. Abel-Ruffini’s Theorem. There is no general algebraic solution topolynomial equations of degree five or higher with arbitrary coefficients.

This means that if the calculation of the roots of a polynomial of order ≥ 5 mustbe calculated a numerical method must be implemented to find an approximatedsolution as the problem has no analytic solution. A description of the numericalmethods does not fall within the scopes of this book. However, some examples ofnumerical methods for finding the roots of a high order polynomial are the bisectionand secant methods, see e.g. [14].

5.4 Partial Fractions

Definition 5.20. Let p1 (z)=∑mk=0 akzk and p2 (z)=∑n

k=0 bkzk be two complex poly-nomials. The function Q(z) obtained by dividing p1 (z) by p2 (z),

Q(z) =p1 (z)p2 (z)

is said rational fraction in the variable z.

Let Q(z) = p1(z)p2(z)

be a rational fraction in the variable z. The partial fractiondecomposition (or partial fraction expansion) is a mathematical procedure that con-sists of expressing the fraction as a sum of rational fractions where the denominatorsare of lower order that that of p2 (z):

Q(z) =p1 (z)p2 (z)

=n

∑k=1

fi (z)gi (z)

This decomposition can be of great help to break a complex problem into manysimple problems. For example, the integration term by term can be much easier ifthe fraction has been decomposed, see Chap. 13.

Let us consider the case of a proper fraction, i.e. the order of p1 (z) ≤ than theorder of p2 (z) (m≤ n). Let us indicate with the term zeros the values α1,α2, . . . ,αm

such that p1 (αk) = 0 ∀k ∈ N with 1 ≤ k ≤ n, and the term poles the valuesβ1,β2, . . . ,βn such that p2 (βk) = 0 ∀k ∈ N with 1≤ k ≤ n.

Let us distinguish three cases:

• rational fractions with distinct/single real or complex poles• rational fractions with multiple real or complex poles• rational fractions with conjugate complex poles

Rational fractions with only distinct poles are characterized by a denominator ofthe kind

p2 (z) = (z−β1)(z−β2) . . .(z−βn)

Page 216: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.4 Partial Fractions 197

i.e. the poles have null imaginary parts (the poles are real numbers).In this first case the rational fraction can be written as

Q(z) =p1 (z)

(z−β1)(z−β2) . . .(z−βn)=

A1

(z−β1)+

A2

(z−β1)+ . . .+

An

(z−βn)

where A1,A2, . . . ,An are constant coefficients.If the rational fraction contains multiple poles, each multiple pole in the denom-

inator appears asp2 (z) = (z−βk)

h

i.e. some poles are real numbers with multiplicity > 1.In this second case the rational fraction can be written as

Q(z) =p1 (z)

(z−βk)h =

A1k

(z−βk)+

A2k

(z−βk)2 + . . .+

Ahk

(z−βk)h

where A1k ,A

2k , . . . ,A

hk are constant coefficients.

rational fractions with quadratic terms are characterized by a denominator of thekind

p2 (z) =(z2 +ξ z+ζ

)

i.e. some poles are conjugate imaginary or conjugate complex numbers.In this third case the rational fraction can be written as

Q(z) =p1 (z)

(z−β2) . . .(z−βn)=

Bz+C(z2 +ξ z+ζ )

where B,C are constant coefficients.Obviously, the polynomial can contain single and multiple poles as well as real

and complex poles. In the case of multiple complex poles, the corresponding con-stant coefficients are indicated with B j

k and C jk .

In order to find these coefficients, from the equation

p1 (z) =n

∑k=1

fk (z) p2 (z)gk (z)

the coefficients ak of the polynomial p1 (z) are imposed to be equal to the corre-sponding ones on the left hand side of the equation. This operation leads to a systemof linear equations in the variables Ak, A j

k, Bk, and B jk whose solution completes the

partial fraction decomposition.

Example 5.42. Let us consider the following rational fraction

8z−42z2 +3z−18

.

Page 217: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

198 5 Complex Numbers and Polynomials

This rational fraction has two single poles and can be written as

8z−42(z+6)(z−3)

=A1

z+6+

A2

z−3.

Thus, we can write the numerator as

8z−42=A1 (z−3)+A2 (z+6)=A1z−A13+A2z+A26=(A1 +A2)z−3A1+6A2.

We can now set the following system of linear equations in the variables A1 andA2

{A1 +A2 = 8

−3A1 +6A2 =−42

whose solution is A1 = 10 and A2 = −2. Hence the partial fraction decompositionis

8z−42z2 +3z−18

=10

z+6− 2

z−3.

Example 5.43. Let us consider the following rational fraction

4z2

z3−5z2 +8z−4.

This rational fraction has one single pole and one double pole. The fraction canbe written as

4z2

(z−1)(z−2)2 =A1

z−1+

A12

z−2+

A22

(z−2)2 .

The numerator can be written as

4z2 = A1 (z−2)2 +A12 (z−2)(z−1)+A2

2 (z−1) =

= z2A1 +4A1−4zA1 + z2A12−3zA1

2 +2A12 + zA2

2−A22 =

= z2 (A1 +A12

)+ z

(A2

2−3A12−4A1

)+4A1 +2A1

2−A22

and the following system of linear equations can be set⎧⎪⎨

⎪⎩

A1 +A12 = 4

−4A1−3A12 +A2

2 = 0

4A1 +2A12−A2

2 = 0,

Page 218: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.4 Partial Fractions 199

whose solution is A1 = 4, A12 = 0, and A2

2 = 16. The partial fraction decompositionis

4z2

z3−5z2 +8z−4=

4z−1

+16

(z−2)2 .

Example 5.44. Let us consider the following rational fraction

8z2−12z3 +2z2−6z

.

This rational fraction has one pole in the origin and two conjugate complex poles.The fraction can be written as

8z2−12z(z2 +2z−6)

=A1

z+

B1z+C1

z2 +2z−6.

The numerator can be written as

8z2−12 = A1(z2 +2z−6

)+(B1z+C1)z =

= z2A1 +2zA1−6A1 + z2B1 + zC1 = z2 (A1 +B1)+ z(2A1 +C1)−6A1

and the following system of linear equations can be set⎧⎪⎨

⎪⎩

A1 +B1 = 8

2A1 +C1 = 0

−6A1 =−12,

whose solution is A1 = 2, B1 = 6, and C1 =−4. The partial fraction decompositionis

8z2−12z3 +2z2−6z

=2z+

6z−4z2 +2z−6

.

Let us now consider a rational fraction

Q(z) =p1 (z)p2 (z)

where the order m of p1 (z) is > than the order n of p2 (z). This rational fraction iscalled improper fraction.

A partial fraction expansion can be performed also in this case but some consider-ations must be done. By applying the Theorem 5.4, we know that every polynomialp1 (z) can be expressed as

p1 (z) = p2 (z)q(z)+ r (z)

Page 219: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

200 5 Complex Numbers and Polynomials

by means of unique q(z) and r (z) polynomials. We know also that the order ofp1 (z) is equal to the sum of the orders of p2 (z) and q(z). Thus, we can express theimproper fraction as

p1 (z)p2 (z)

= q(z)+r (z)p2 (z)

.

The polynomial q(z) is of order m−n and can be expressed as :

q(z) = E0 +E1z+E2z2 + . . .+Em−nzm−n

and the improper fraction can be expanded as

p1 (z)p2 (z)

= E0 +E1z+E2z2 + . . .+Em−nzm−n +r (z)p2 (z)

and apply the partial fraction expansion for r(z)p2(z)

that is certainly proper as the order

of r (z) is always < than the order of p2 (z) for the Theorem 5.4. The coefficientsE0,E1, . . . ,Em−n can be determined at the same time of the coefficients resultingfrom the expansion of r(z)

p2(z)by posing the identity of the coefficients and solving the

resulting system of linear equations.

Example 5.45. Let us consider the following improper fraction

4z3 +10z+42z2 + z

.

The rational fraction can be written as

4z3 +10z+42z2 + z

=4z3 +10z+4

z(2z+1)= zE1 +E0 +

A1

z+

A2

2z+1.

The numerator can be expressed as

4z3 +10z+4 = z2 (2z+1)E1 + z(2z+1)E0 +(2z+1)A1 + zA2 =

= 2z3E1 + z2E1 +2z2E0 + zE0 +2zA1 + zA2 +A1 = z32E1 + z2 (E1 +2E0)+ z(2A1 +A2 +E0)+A1.

We can then pose the system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

2E1 = 4

E1 +2E0 = 0

2A1 +A2 +E0 = 10

A1 = 4

whose solution is A1 = 4, A2 = 3, E0 =−1, and E1 = 2.

Page 220: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

5.4 Partial Fractions 201

Thus, the partial fraction expansion

4z3 +10z+42z2 + z

= 2z−1+4z+

32z+1

.

Exercises

5.1. Verify that if z = a+ jb, then

1z=

a− jba2 +b2 .

5.2. Express the complex number z = 1− j in polar coordinates.

5.3. Express the complex number z = 4;∠90◦ in rectangular coordinates.

5.4. Calculate 3√

5+ j5

5.5. Apply Ruffini’s theorem to check whether or not z3−3z2−13z+15 is divisibleby (z−1).

5.6. Invert, if possible, the matrix A

A =

⎝1 6 12 j2 23 6+2 j 3

5.7. Calculate the remainder of the division

z3 +2z2 +4z−8z−2 j

where z is a complex variable.

5.8. Expand in partial fractions the following rational fraction

−9z+92z2 +7z−4

.

5.9. Expand in partial fractions the following rational fraction

3z+1

(z−1)2 (z+2).

5.10. Expand in partial fractions the following rational fraction

5z(z3−3z2−3z−2)

.

Page 221: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 6An Introduction to Geometric Algebraand Conics

6.1 Basic Concepts: Lines in the Plane

This chapter introduces the conics and characterizes them from an algebraic per-spective. While in depth geometrical aspects of the conics lie outside the scopes ofthis chapter, this chapter is an opportunity to revisit concepts studied in other chap-ters such as matrix and determinant and assign a new geometric characterization tothem.

In order to achieve this aim, let us start with considering the three-dimensionalspace. Intuitively, we may think that, within this space, points, lines, and planesexist.

We have previously introduced, in Chap. 4, the concept of line as representationof the set R. If R2 can be represented as the plane, a line is an infinite subset ofR

2. We have also introduced in Chap. 4 the concepts of point, distance between twopoints, segment, and direction of a line. From the algebra of the vectors we alsoknow that the direction of a line is identified by the components of a vector havingthe same direction, i.e. a line can be characterized by two numbers which we willindicate here as (l,m).

Definition 6.1. Let P and Q be two points of the plane and dPQ be the distance

between two points. The point M of the segment PQ such that dPM = dMQ is saidmiddle point.

6.1.1 Equations of the Line

Let #»v �= #»o be a vector of the plane having components (l,m) and P0 (x0,y0) bea point of the plane. Let us think about the line passing through P0 and havingdirection (l,m).

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_6

203

Page 222: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

204 6 An Introduction to Geometric Algebra and Conics

(l,m)P0

Now let us consider a point P(x,y) of the plane. The segment P0P can be inter-preted as a vector having components (x− x0,y− y0). For Proposition 4.4 vectors#»v = (l,m) and P0P = (x− x0,y− y0) are parallel if and only if

det

((x− x0) (y− y0)

l m

)= 0.

This situation occurs when

(x− x0)m− (y− y0) l = 0⇒⇒ mx− ly−mx0 + ly0 = 0⇒

ax+by+ c = 0

wherea = mb =−lc =−mx0 + ly0.

Example 6.1. Let is consider the point P0 = (1,1) and the vector #»v = (3,4). Let usdetermine the equation of the line passing through P0 and having the direction of #»v .Let us impose the parallelism between #»v and P0P:

det

((x−1) (y−1)

3 4

)= 4(x−1)−3(y−1) = 4x−4−3y+3 = 4x−3y−1 = 0.

Definition 6.2. A line in a plane is a set of points P(x,y)∈R2 such that ax+by+c=

0 where a, b, and c are three coefficients ∈ R.

The equation ax+by+c= 0 is said analytic representation of the line or analyticequation of the line in its explicit form. The coefficients a and b are non-null because(l,m) �= (0,0).

By applying some simple arithmetic operations

ax+by+ c = 0⇒ by =−ax− c⇒⇒ y =− a

b x− cb ⇒ y = kx+q

which is known as analytic equation of the line in its explicit form.It must be observed that a line having direction (l,m) has equation ax+by+c= 0

where a = m and b = −l. Analogously a line having equation ax+ by+ c = 0 hasdirection (−b,a) = (b,−a).

Page 223: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.1 Basic Concepts: Lines in the Plane 205

Example 6.2. The line having equation

5x+4y−2 = 0

has direction (−4,5) = (4,−5).

Definition 6.3. The components of a vectors parallel to a line are said directionnumbers of the line.

Let us now calculate the scalar product ((x− x0) ,(y− y0))(a,b) and let us im-pose that it is null:

(x− x0) ,(y− y0)(a,b) = a(x− x0)+b(y− y0) == ax+by−ax0−by0 = ax+by+ c = 0.

This equation means that a line having equation ax+by+ c = 0 is perpendicularto the direction (a,b). In other words, the direction identified by the coefficients(a,b) of the line equation in its explicit form is perpendicular to the line.

Let us write an alternative representation of the line. The equation above (x− x0)m− (y− y0) l = 0 can be re-written as

(x− x0)

l=

(y− y0)

m.

This equation yields to the following system of linear equations{

x− x0 = lt

y− y0 = mt⇒

{x(t) = lt + x0

y(t) = mt + y0

where t is a parameter. While t varies the line is identified. The equations of thesystem are said parametric equations of the line.

Example 6.3. Let 5x− 4y− 1 = 0 be the equation of a line in the plane. We knowthat the direction numbers (l,m) = (4,5). Hence, we can write the parametric equa-tions as {

x(t) = 4t + x0

y(t) = 5t + y0.

In order to find x0 and y0, let us choose an arbitrary value for x0 and let us use theequation of the line to find the corresponding y0 value. For example if we choosex0 = 1 we have y0 = 1. The parametric equations are then

{x(t) = 4t +1

y(t) = 5t +1.

Let us now write the equation of the line in a slightly different way. Let P1 (x1,y1)and P2 (x2,y2) be two points of the plane. We would like to write the equation ofthe line between the two points. In order to do it, let us impose that for a generic

Page 224: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

206 6 An Introduction to Geometric Algebra and Conics

point P(x,y), the segment P1P2 = (x1− x2,y1− y2) is parallel to the segment PP2 =(x− x2,y− y2). If the two segments have the same direction are thus aligned andbelong to the same line.

P1

P2

P

The parallelism is given by

det

((x− x2) (y− y2)(x1− x2) (y1− y2)

)= 0⇒ (x− x2)

(y− y2)=

(x1− x2)

(y1− y2)

that is the equation of a line between two points.

Example 6.4. A line passing through the points P1 (1,5) and P2 (−2,8) has equation

x+2y−8

=1+25−8

which can equivalently be written as

(5−8)(x+2)− (1+2)(x+2) .

6.1.2 Intersecting Lines

Let l1 and l2 be two lines of the plane having equation, respectively,

l1 : a1x+b1y+ c1 = 0l2 : a2x+b2y+ c2 = 0.

We aim at studying the position of these two line in the plane. If these two lineintersect in a point P0 it follows that the point P0 belongs to both the line. Equiv-alently we may state that the coordinates (x0,y0) of this point P0 simultaneouslysatisfy the equations of the lines l1 and l2.

In other words, (x0,y0) is the solution of the following system of linear equations:{

a1x+b1y+ c1 = 0

a2x+b2y+ c2 = 0.

Page 225: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.1 Basic Concepts: Lines in the Plane 207

At first, we may observe that a new characterization of the concept of system oflinear equations is given. A system of linear equation can be seen as a set of linesand its solution, when it exists, is the intersection of these lines. In this chapter westudy lines in the plane. Thus, the system has two linear equations in two variables.A system having size 3× 3 can be seen as the equation of three lines in the space.By extension an n×n system of linear equation represents lines in a n-dimensionalspace. In general, even when not all the equations are equations of the line, thesolutions of a system of equations can be interpreted as the intersection of objects.

Let us focus on the case of two lines in the plane. The system above is associatedwith the following incomplete and complete matrices, respectively,

A =

(a1 b1

a2 b2

)

and

Ac =

(a1 b1 −c1

a2 b2 −c2

).

Indicating with ρA and ρAc the ranks of the matrices A and Ac, respectively, andby applying the Rouchè-Capelli Theorem the following cases are distinguished.

• Case 1: If ρA = 2 (which yields that also ρAc = 2), the system is determinedand has only one solution. Geometrically, this means that the lines intersect in asingle point.

• Case 2: If ρA = 1 and ρAc = 2, the system is incompatible and has no solutions.Geometrically, this means that the two lines are parallel, thus the system is of thekind {

ax+by+ c1 = 0

λax+λby+ c2 = 0

with λ ∈ R.• Case 3: If ρA = 1 and ρAc = 1, the system is undetermined and has ∞ solutions.

Geometrically this means that the two lines are overlapped and the system is ofthe kind {

ax+by+ c = 0

λax+λby+λc = 0

with λ ∈ R.

It can be observed that if det(A) �= 0 it follows that ρA = 2 and that also ρAc = 2.If det(A) = 0 it follows that ρA = 1 (ρA = 0 would mean that there are no lines onthe plane).

Example 6.5. Let us find, if possible, the intersection point of the lines having equa-tion 2x+ y− 1 = 0 and 4x− y+ 2 = 0. This means that the following system of

Page 226: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

208 6 An Introduction to Geometric Algebra and Conics

linear equations must be set{

2x+ y−1 = 0

4x− y+2 = 0.

The incomplete matrix is non-singular as it has determinant −6. Thus, the lines areintersecting. The solution of the system is

x =det

(1 1−2 −1

)

−6=−1

6

and

y =det

(2 14 −2

)

−6=

43.

The intersection point is(− 1

6 ,43

).

Example 6.6. Let us find, if possible, the intersection point of the lines having equa-tion 2x+ y−1 = 0 and 4x+2y+2 = 0. The associated incomplete matrix

(2 14 2

)

is singular and thus ρA = 1 while the rank of the complete matrix(

2 1 14 2 −2

)

is 2. The system is incompatible and thus the two lines are parallel.

Example 6.7. Let us find, if possible, the intersection point of the lines having equa-tion 2x+y−1= 0 and 4x+2y−2= 0. It can be easily seen that the second equationsis the first one multiplied by 2. Thus, the two equations represent the same line. Thetwo lines are overlapped and have infinite points in common.

6.1.3 Families of Straight Lines

Definition 6.4. A family of intersecting straight lines is the set of infinite lines ofthe plane that contain a common point. The intersection point of all the infinite linesis said center of the family.

Definition 6.5. A family of parallel straight lines is the set of infinite lines of theplane having the same direction. The lines can be parallel or overlapped.

Page 227: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.1 Basic Concepts: Lines in the Plane 209

Theorem 6.1. Let l1, l2, and l3 be three lines of the plane having equations

l1 : a1x+b1y+ c1 = 0l2 : a2x+b2y+ c2 = 0l3 : a3x+b3y+ c3 = 0.

The lines l1, l2, and l3 belong to the same family if and only if

det(A) =

⎝a1 b1 c1

a2 b2 c2

a3 b3 c3

⎠= 0.

Proof. If l1, l2, and l3 belong to the same family of intersecting lines, they are si-multaneously verified for the center of the family. The associated system of linearequations ⎧

⎪⎨

⎪⎩

a1x+b1y+ c1 = 0

a2x+b2y+ c2 = 0

a3x+b3y+ c3 = 0

composed of three equations in two variables, has only one solution. Thus, forRouchè-Capelli Theorem, the rank of the matrix A is 2. This means that det(A) = 0.

If l1, l2, and l3 belong to the same family of parallel lines, the rank of the matrixA is 1. This means that if an arbitrary 2×2 submatrix is extracted it is singular. Forthe I Laplace Theorem det(A) = 0.

In summary, if the lines belong to the same family of either intersecting or paral-lel lines then det(A) = 0. ��

If det(A) = 0 the rank of the matrix A is < 3.If the rank is 2 the system is compatible and determined. The solution is then the

intersection point of the family. Thus, the three lines belong to the same family ofintersecting lines.

If the rank is 1 each pair of lines is of the kind

ax+by+ c = 0λax+λb+λc = 0.

This means that all the lines are parallel (have the same direction). Thus, the threelines belong to the same family of parallel lines. Hence if det(A) = 0 the three linesbelong to the same family of either intersecting or parallel lines. ��

If det(A) = 0 then at least a row of A is linear combination of the other two. Thismeans that ∃ a pair of real scalar (λ ,μ) �= (0,0) such that

a3 = λa1 +μa2

b3 = λb1 +μb2

c3 = λc1 +μc2.

Page 228: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

210 6 An Introduction to Geometric Algebra and Conics

If we substitute these values in the third equation of the system of linear equationsabove we obtain

(λa1 +μa2)x+(λb1 +μb2)y+(λc1 +μc2) = 0

which can be re-written as

λ (a1x+b1y+ c1)+μ (a2x+b2y+ c2) = 0

which is said equation of the family of lines. When the parameters (λ ,μ) vary a lineof the family is identified.

We know that (λ ,μ) �= (0,0). Without a loss of generality let assume that λ �= 0.It follows that

λ (a1x+b1y+ c1)+μ (a2x+b2y+ c2) = 0⇒⇒ (a1x+b1y+ c1)+ k (a2x+b2y+ c2) = 0

with k = μλ .

Each value of k identifies a line. If k = 0 the line l1 is obtained, if k = ∞ the linel2 is identified.

If the lines l1 and l2 are parallel then can be written as

ax+by+ c1 = 0νax+νb+ c2 = 0

and the family of lines becomes

(ax+by+ c1)+ k (νax+νb+ c2) = 0⇒⇒ a(1+νk)x+b(1+νk)y+ c1 + c2k = 0⇒

⇒ ax+by+h = 0

with

h =c1 + c2k1+νk

.

Thus, if the lines are parallel, all the lines have the same direction.

Example 6.8. A family of straight lines is for example

(5x+3y−1)λ +(4x−2y+6)μ = 0.

Example 6.9. The center of the family

(2x+2y+4) l +(2x−4y+8)m = 0.

Page 229: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.2 An Intuitive Introduction to the Conics 211

is the solution of the system of linear equations{

2x+2y+4 = 0

2x−4y+8 = 0

that is x =− 83 and y = 2

3 .

6.2 An Intuitive Introduction to the Conics

Definition 6.6. The orthogonal projection of a point P of the space on a plane isa point of this plane obtained by connecting P with the plane by means of a lineorthogonal to the plane (orthogonal to all the lines contained in the plane).

Following the definition of orthogonal projection of a point on a plane, we canperform the orthogonal projection for all the infinite points contained in a line. Inthis way, we can perform the orthogonal projection of a line on a plane.

Definition 6.7. An angle between a line and a plane is the angle≤ 90◦ between thatline and its orthogonal projection on the plane.

Now, let us consider two lines that are chosen to be not parallel. Let us indicateone of the two lines with z and let us refer to it as “axis” while the other one issimply indicated as “line”. the angle between the line and the axis is indicated as θ .In Fig. 6.1 the axis is denoted with an arrow. Let us imagine that the line performs afull rotation (360◦) around the axis. This rotation generates a solid object which wewill refer to as “cone”.

Fig. 6.1 Cone as rotational solid

If we take into consideration a plane in the space, it can intersect the cone in threeways according to the angle φ between this plane and the axis z. More specificallythe following cases can occur:

• if 0≤ φ < θ the intersection is an open figure, namely hyperbola• if φ = θ the intersection is an open figure, namely parabola

Page 230: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

212 6 An Introduction to Geometric Algebra and Conics

Fig. 6.2 Conics as conical sections

• if θ < φ ≤ π2 the intersection is a closed figure, namely ellipse

The special ellipse corresponding to φ = π2 is named circumference. These fig-

ures, coming from the intersection of a cone with a plane are said conics. A graphicalrepresentation of the conics is given in Fig. 6.2.

Besides the cases listed above, three more cases can be distinguished:

• a plane intersecting the cone with 0 ≤ φ < θ and passing for the intersectionbetween the axis of the cone and the line that generates it, that is two intersectinglines

• a plane tangent to the cone with φ = θ , that is a line• a plane intersecting the cone with 0≤ φ < θ in the intersection between the axis

of the cone and the line that generates it, that is a point

These three cases are a special hyperbola, parabola, and ellipse, respectively,corresponding to a point and a line. These special conics are said degenerate conics.

6.3 Analytical Representation of a Conic

Now that the conics have been introduced let us define them again in a differentway.

Definition 6.8. A set of points whose location satisfies or is determined by one ormore specified conditions is said locus of points.

The easiest example of locus of points is a line where the condition is given byits equation ax+by+ c = 0.

Page 231: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 213

If we consider a point Q(xQ,yQ) not belonging to this line, from basic geometrywe know that the distance between Q and the line is given by, see e.g. [15]:

axQ +byQ + c√a2 +b2

.

Definition 6.9. Conic as a Locus of Points. Let F be a point of a plane, namelyfocus and d be a line in the same plane, namely directrix. Let us consider the genericpoint P of the plane. Let us indicate with dPF the distance from P to F and with dPd

the distance from P to d. A conic C is the locus of points P ∈ R2 of a plane such

that the ratio dPFdPd

is constant.

C =

{P

∣∣∣∣dPF

dPd= e

}

where e is a constant namely eccentricity of the conic.

If the coordinates of the focus F are (α,β ), and the equation of the directrixis indicated with ax+ by+ c = 0 where x and y are variable while a, b, and c arecoefficients, we can re-write dPF

dPd= e in the following way:

dPFdPd

= e⇒ dPF = edPd ⇒ d2PF = e2d2

Pd ⇒⇒ (x−α)2 +(y−β )2 = e2 (ax+by+c)2

a2+b2 .(6.1)

which is called analytical representation of a conic. This is a second order(quadratic) algebraic equation in two variables, x and y respectively.

6.4 Simplified Representation of Conics

This section works out the analytical representation of a conic given in Eq. (6.1) inthe case of a reference system that allows a simplification of the calculations. Thissimplified representation allows a better understanding of the conic equations and astraightforward graphic representation by means of conic diagrams.

6.4.1 Simplified Representation of Degenerate Conics

Let us consider, at first, the special case where the focus belongs to the directrix,i.e. F ∈ d. Without a loss of generality, let us choose a reference system having itsorigin in F, that is α = β = 0, and the directrix coinciding with the ordinate axis,that is the equation ax+by+c = 0 becomes x = 0 (equivalently a = 1, b = 0, c = 0).

Page 232: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

214 6 An Introduction to Geometric Algebra and Conics

In this specific case the analytical representation of the conic can be re-written as:

d2PF = e2d2

Pd ⇒ (x−α)2 +(y−β )2 = e2 (ax+by+c)2

a2+b2 ⇒⇒ (x)2 +(y)2 = e2 (x)2

1 ⇒ x2 + y2 = e2x2 ⇒(1− e2

)x2 + y2 = 0.

From this equation and considering that the eccentricity for its definition can takeonly non-negative values, we can distinguish three cases.

• The conic is two intersecting lines. 1− e2 < 0 ⇒ e > 1: the equation of theconic becomes −kx2 +y2 = 0, with k =−

(1− e2

)> 0. If we solve this equation

we obtain, y =±√

kx, that is the equations of two intersecting lines.• The conic is two overlapped lines. 1−e2 = 0⇒ e = 1: the equation of the conic

becomes 0x2+y2 = 0⇒ y2 = 0. This is the equation of the abscissa’s axis (y= 0)counted twice. The geometrical meaning of this equation is two overlapped lines.

• The conic is one point. 1− e2 > 0 ⇒ 0 ≤ e < 1: the equation of the conic be-comes kx2 + y2 = 0, with k =

(1− e2

)> 0. This equation has only one solution

in R2, that is (0,0). This means that the conic is only one point, that is the focus

and the origin of the axes.

These three situations correspond to the degenerate conics, hyperbola, parabola,and ellipse, respectively.

6.4.2 Simplified Representation of Non-degenerate Conics

Let us now consider the general case F /∈ d. Without a loss of generality, let uschoose a reference system such that a directrix has equation x− h = 0 with h con-stant ∈R and F has coordinates (F,0). Under these conditions, the analytical repre-sentation of the conic can be re-written as:

d2PF = e2d2

Pd ⇒ (x−α)2 +(y−β )2 = e2 (ax+by+c)2

a2+b2 ⇒⇒ (x−F)2 + y2 = e2 (x−h)2 ⇒

⇒ x2 +F2−2Fx+ y2 = e2(x2 +h2−2hx

)

⇒ x2 +F2−2Fx+ y2− e2x2− e2h2− e22hx = 0⇒⇒

(1− e2

)x2 + y2−2

(F−he2

)x+F2− e2h2 = 0

(6.2)

Let us now consider the intersection of the conic with the abscissa’s axis, y = 0.

(1− e2)x2−2

(F−he2)x+F2− e2h2 = 0

This is a second order polynomial in the real variable x. This polynomial has atmost two real (distinct) solutions for the Theorem 5.8.

Page 233: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 215

If we fix the reference axis so that its origin is between the intersections of theconic with the line y = 0, the two intersection points can be written as (a,0) and(−a,0), respectively. For the Proposition 5.7 if p(z) = ∑n

k=0 akzk is a complex (realis a special case of complex) polynomial of order n ≥ 1 and α1,α2, . . . ,αn are itsroots it follows that α1 +α2 + . . .+αs = − an−1

an. Thus, in this case the sum of the

roots a−a is equal to2(F−he2

)

(1− e2)= a−a = 0.

From this equation we obtain

(F−he2)= 0⇒ h =

Fe2 (6.3)

given that we suppose 1− e2 �= 0⇒ e �= 1.Furthermore, for the Proposition 5.7 it also occurs that α1α2 . . .αs = (−1)n a0

anwhich, in this case, means

F2− e2h2

(1− e2)=−a2.

From this equation we obtain

F2− e2h2 = a2 (e2−1). (6.4)

Substituting equation (6.3) into (6.4) we have

F2− e2(

Fe2

)2= a2

(e2−1

)⇒ c2− F2

e2 = a2(e2−1

)⇒

⇒ F2(e2−1

)= e2a2

(e2−1

)⇒ F2 = e2a2 ⇒ e2 = F2

a2 .(6.5)

Substituting equation (6.5) into (6.3) we obtain

h =a2

F(6.6)

and substituting equations (6.5) and (6.6) into the general equation of a conic inEq. (6.2) we have

(1− F2

a2

)x2 + y2−2

(c− a2

FF2

a2

)x+ c2− F2

a2

(a2

F

)2= 0⇒

⇒(

1− F2

a2

)x2 + y2−2(F−F)x+F2−a2 = 0⇒

⇒(a2−F2

)x2 +a2y2 +a2

(F2−a2

)= 0.

(6.7)

This formulation of a conic has been done under the hypothesis that e �= 1. ForEq. (6.5) it occurs that a2 �= F2. This means that Eq. (6.7) can be considered in onlytwo cases: a2 < F2 (e > 1) and a2 > F2 (e < 1), respectively.

Page 234: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

216 6 An Introduction to Geometric Algebra and Conics

Equation of the Hyperbola

If a2 < F2, it follows that e > 1. Let us pose b2 =(F2−a2

)> 0 and let us substitute

into the equation of the conic in Eq. (6.7).

−b2x2 +a2y2 +a2b2 = 0⇒− x2

a2 +y2

b2 +1 = 0⇒ x2

a2 −y2

b2 −1 = 0.

This is the analytical equation of the hyperbola. From this simplified equationwe can easily see that the fraction x2

a2 is always non-negative. From this statement itfollows that

y2

b2 +1 > 0

regardless of the value of y. This means that a hyperbola has y values that can be inthe ]−∞,+∞[ interval.

In a similar way, since y2

b2 is always non-negative, it follows that

x2

a2 −1≥ 0.

This happens when x≥ a and x≤−a. In other words, a graphic of an hyperbola(in its simplified equation form) can be only in the area marked in figure.

−4 −2 2 4

−4

−2

2

4

x

y

The position of the foci can be easily identified by considering that in an hy-perbola F2 > a2. It follows that F > a or F < −a, i.e. the foci are in the markedarea of the figure. In order to calculate the position of the directrix le us consider

Page 235: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 217

only the right hand side of the graphic. The foci have coordinates(√

a2 +b2,0)

and(−√

a2 +b2,0)

, respectively.

We know that F > a. Thus, Fa > a2 ⇒ a > a2

F . Taking into consideration that, as

shown in Eq. (6.6), the equation of the directrix is x = a2

F , it follows that the directrixof the right hand side part of the graphic falls outside and at the left of the markedarea. It can be easily verified that there is a symmetric directrix associated with theleft hand side of the graphic.

If we now consider from the equations of the line and from basic analytical geom-etry, see e.g. [16], that the equation of a line passing for the origin the Cartesian sys-tem of coordinates can be written in its implicit form as y = mx with x variable andm coefficient, namely angular coefficient, we may think about the infinite lines ofthe plane passing through the origin. Each line is univocally identified by its angularcoefficient m. Obviously, this equation is equivalent to the equation ax+by+c = 0.

In order to narrow down the areas where the graphic of the hyperbola (of thesimplified equation) can be plotted, let us calculate those values of m that result intoan intersection of the line with the hyperbola. This means that we want to identifythe values of m that satisfy the following system of equations:

{x2

a2 − y2

b2 −1 = 0

y = mx.

Substituting the second equation into the first one we obtain

x2

a2 −m2x2

b2 = 1⇒(

1a2 −

m2

b2

)x2 = 1.

Since x2 must be non-negative (and it is actually positive because the multiplica-tion must be 1) it follows that the values of m satisfying the inequality

(1a2 −

m2

b2

)> 0

are those values that identify the region of the plane where the hyperbola can beplotted. By solving the inequality in the variable m we have

1a2 >

m2

b2 ⇒ m2 <b2

a2 ⇒−ba< m <

ba.

This means that the graphic of the (simplified) hyperbola delimited by the lineshaving angular coefficient − b

a and ba respectively. The corresponding two lines hav-

ing equation y =− ba x and y = b

a x, respectively, are named asymptotes of the hyper-bola.

Page 236: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

218 6 An Introduction to Geometric Algebra and Conics

The figure below highlights the areas where the hyperbola can be plotted.

−4 −2 2 4

−4

−2

2

4

x

y

By using the simplified analytical equation of the hyperbola we can now plot theconic, as shown in the following figure.

−4 −2 2 4

−4

−2

2

4

x

y

Example 6.10. Let us consider the equation

9x2−16y2−144 = 0

which can be re-written as

x2

a2 −y2

b2 =x2

42 −y2

32 = 1.

Page 237: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 219

This is the equation of an hyperbola in the simplified conditions mentionedabove. The coordinates of the foci are (F,0) and (−F,0) where

F =√

a2 +b2 = 5.

The directrices have equations x = a2

F and x =− a2

F , respectively, where

a2

F=

42

5=

165.

The asymptotes have equations y = ba x and y =− b

a x, respectively, where

ba=

34.

Let us work the equation of the hyperbola out to obtain an alternative definition.

Theorem 6.2. Let F and F′ be two foci of an hyperbola. An hyperbola is the locusof points P such that dPF′ −dPF is constant and equal to 2a.

Proof. The distance of a generic point of the conic from the focus is given by theequations

dPF =

√(x−F)2 + y2

dPF′ =

√(x−F)2 + y2.

For the simplified equation of the hyperbola it happens that

y2 = b2(

x2

a2 −1

),

and that

b2 =(F2−a2)⇒ F =

√a2 +b2.

We can write now the distance of a point from the focus as

dPF =

√(x−

√a2 +b2

)2+b2

(x2

a2 −1)=

=

√(x2 +a2 +b2−2

√a2 +b2x

)−b2 +b2 x2

a2 =

=√

x2 +a2−2√

a2 +b2x+b2 x2

a2 =

a2−2√

a2 +b2x+(a2+b2)x2

a2 =

=

√(a−

√a2+b2

a

)2

= |a− Fxa |

Page 238: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

220 6 An Introduction to Geometric Algebra and Conics

and analogously

dPF′ =

√(x+

√a2 +b2

)2+b2

(x2

a2 −1)= |a+ Fx

a |.

The absolute values are to highlight that the expressions above have a geometricmeaning, i.e. they are distances. In order to be always positive dPF = a− Fx

a whena− Fx

a is positive and dPF = −a+ Fxa when a− Fx

a is negative. Similarly, dPF′ =

a+ Fxa when a+ Fx

a is positive and dPF′ = −a− Fxa when a+ Fx

a is negative. If we

solve the inequality a− Fxa ≥ 0, we find that the inequality is verified when x < a2

F .

Considering that x = a2

F is the equation of the directrix which, as shown above, ison the left of the right hand side of the hyperbola, the inequality is verified onlyfor the left hand side of the hyperbola. A symmetric consideration can be done fora+ Fx

a > 0⇒ x >− a2

F (right hand side of the hyperbola).In summary we have two possible scenarios:

• Right hand side: dPF =−a+ Fxa and dPF′ = a+ Fx

a

• Left hand side: dPF = a− Fxa and dPF′ =−a− Fx

a .

In both cases we obtain

dPF−dPF′ = |2a|.�� (6.8)

Equation (6.8) gives an alternative characterization of an hyperbola.

Equation of the Parabola

If e = 1 the Eq. (6.7) cannot be used. However, if we substitute e = 1 into Eq. (6.2)we obtain

y2−2(F−h)x+F2−h2 = 0.

Without a loss of generality let us fix the reference system so that the conic passesthrough its origin. Under these conditions, the term F2 − h2 = 0. This means thatF2 = h2 ⇒ h =±F . However, h = F is impossible because we have supposed F /∈ dwith F : (F,0) and d : x−h = 0. Thus the statement h = 0 would be equivalent to sayF ∈ d. Thus, the only possible value of h is −F . If we substitute it into the equationabove we have

y2−4Fx = 0

that is the analytical equation of the parabola.

Page 239: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 221

Let us try to replicate the same procedure done for the hyperbola in order tonarrow down the area where a parabola can be plotted. At first let us observe that thisequation, written as y2 = 4Fx imposes that the focus coordinate F and the variable xare either both positive or both negative. This means that the graphic of a (simplified)parabola is plotted either all in the positive semi-plane x≥ 0 or in the negative semi-plane x≤ 0. Let us consider the case when both F ≥ 0 and x≥ 0.

Furthermore, the fact that ∀x there are two values of y (one positive and onenegative respectively) make the graphic of this parabola symmetric with respect tothe abscissa’s axis. Finally, if we look for the value of m such that the lines y = mxintersect the parabola, we can easily verify that there are no impossible m values.This means that the parabola has no asymptotes.

A graphic of the parabola is shown in the figure below.

−4 −2 2 4

−4

−2

2

4

x

y

Example 6.11. Let us consider the equation

2y2−16x = 0.

This is the equation of a parabola and can be re-written as

y2−4Fx = y2−8x = 0.

The coordinates of the focus are simply (2,0) and the directrix has equationx =−2.

Theorem 6.3. Let F be the focus and d be the directrix of a parabola, respectively.A parabola is the locus of points P such that dPF = dPd.

Proof. Considering that dPF = edPd with e = 1, it occurs that dPF = dPd , that is analternative definition of the parabola.

Page 240: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

222 6 An Introduction to Geometric Algebra and Conics

Equation of the Ellipse

If a2 > F2, it follows that e < 1. Let us pose b2 =(a2−F2

)> 0 and let us substitute

this piece of information into the equation of the conic in Eq. (6.7)

b2x2 +a2y2−a2b2 = 0⇒ x2

a2 +y2

b2 −1 = 0.

This is the analytical equation of the ellipse. Analogous to what done for the

hyperbola, this equation is defined when x2

a2 ≥ 0 and when y2

b2 ≥ 0. This occurs whenthe following two inequality are verified:

1− y2

b2 ≥ 0⇒ y2 ≤ b2 ⇒−b≤ y≤ b

and

1− x2

a2 ≥ 0⇒ x2 ≤ a2 ⇒−a≤ x≤ a.

This means that the graphic of the ellipse can be plot only within a a× brectangle.

−4 −2 2 4

−4

−2

2

4

x

y

Since a is the horizontal (semi-)length of this rectangle and for an ellipsea2 −F2 > 0 ⇒ −a < F < a, i.e. the focus is within the rectangle. The foci havecoordinates (F,0) and (−F,0), respectively where F =

√a2−b2.

Since a > F , it follows that a2 > aF ⇒ a2

F > a. Since, as shown in Eq. (6.6), the

directrix has equation x = a2

F it follows that the directrix is outside the rectangle.It can be easily checked that the ellipse, like the hyperbola, is symmetric with

respect to both abscissa’s and ordinate’s axes (y = 0 and x = 0). Hence the ellipsehas two foci having coordinates (F,0) and (−F,0), respectively, and two directrices

having equation x = a2

F and x = − a2

F . Each pair focus-directrix is associated withhalf graphic below (right and left hand side respectively).

Page 241: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.4 Simplified Representation of Conics 223

The graphic of the ellipse is plotted in the figure below.

−4 −2 2 4

−4

−2

2

4

x

y

Example 6.12. Let us consider the following equation

4x2 +9y2−36 = 0.

This equation can be re-written as

x2

a2 +y2

b2 =x2

32 +y2

22 = 1

that is the simplified equation of an ellipse where a = 3 and b = 2. The foci have co-ordinates (F,0) and (−F,0), respectively, where F =

√a2−b2 =

√5. The directrix

has equation x = a2

F = 9√5

Let us now work the equations out to give the alternative definition also for theellipse.

Theorem 6.4. Let F and F′ be the two foci of an ellipse. An ellipse is the locus ofpoints P such that dPF′ +dPF is constant and equal to 2a.

Proof. Considering that

dPF =

√(x−F)2 + y2

dPF′ =

√(x−F)2 + y2,

that for the simplified equation of the ellipse it happens that

y2 = b2(

1− x2

a2

),

Page 242: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

224 6 An Introduction to Geometric Algebra and Conics

and that

b2 =(a2−F2)⇒ F =

√a2−b2,

we can write the distance of a point from the focus as

dPF =

√(x−

√a2−b2

)2+b2

(1− x2

a2

)=

=

√(x2 +a2−b2−2x

√a2−b2

)+b2−

(b2x2

a2

)=

=

a2−2x√

a2−b2 +(a2−b2)x2

a2 =

√(a−

√a2−b2

a x

)2

=

=

(a−

√a2−b2

a x

)= a− Fx

a

and analogously

dPF′ =

√(x+

√a2−b2

)2+b2

(1− x2

a2

)= a+ Fx

a .

If we now sum these two distances we obtain

dPF +dPF′ = 2a. (6.9)

In other words, the sum of these two distances does not depend on any variable,i.e. it is a constant equal to 2a. ��

Equation (6.9) represents an alternative definition of the ellipse.

6.5 Matrix Representation of a Conic

In general, a conic is shifted and rotated with respect to the reference axes. In thefollowing sections a characterization of a conic in its generic conditions is given.

Let us consider again the analytical representation of a conic. If we work out theexpression in Eq. (6.1) we have:

(x2 +α2−2αx+ y2 +β 2−2βy

)(a2 +b2

)= a2x2 +b2y2 + c2 +2abxy+2acx+2bcy⇒

⇒ b2x2 +a2y2−2abxy−2(αa2 +αb2 +ac

)x−2

(βa2 +βb2 +bc

)y+

+(a2α2 +a2β 2 +b2α2 +b2β 2− c2

).

Page 243: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 225

If we now perform the following replacements:

a1,1 = b2

a1,2 =−aba1,3 =−

(αa2 +αb2 +ac

)

a2,2 = a2

a2,3 =−(βa2 +βb2 +bc

)

a3,3 =(a2α2 +a2β 2 +b2α2 +b2β 2− c2

)

we can write the analytical representation of a conic as

a1,1x2 +2a1,2xy+2a1,3x+a2,2y2 +2a2,3y+a3,3 = 0 (6.10)

which will be referred to as matrix representation of a conic.

Example 6.13. The equation

5x2 +26xy+14x+8y2 +5y+9 = 0

represents a conic. However, from the knowledge we have at this point, we can-not assess which kind of conic this equation represents and we cannot identify itsother features, such as the position of foci and directrices. In the following pages, acomplete and general characterization of the conics is presented.

6.5.1 Intersection with a Line

Let us consider two points of the plane, T and R, respectively, whose coordinates ina Cartesian reference system are (xt ,yt) and (xr,yr). From Sect. 6.1.1 we know thatthe equation of a line passing from T and R is

x− xt

xr− xt=

y− yt

yr− yt

where x and y are variables.Since xr − xt and yr − yt are constants, let us pose l = xr − xt and m = yr − yt .

Hence, the equation of the line becomes

x− xt

l=

y− yt

m(6.11)

where l and m are supposed �= 0.Let us pose now

y− yt

m= t

Page 244: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

226 6 An Introduction to Geometric Algebra and Conics

where t is a parameter. It follows that{

y−ytm = t

x−xtl = t

⇒{

y = mt + yt

x = lt + xt.

Let us now consider again the matrix representation of a conic in Eq. (6.10). Wewould like to find the intersections between the line and the conic. The search ofan intersection point is the search for a point that simultaneously belongs to twoobjects. This means that an intersection point can be interpreted as the solution thatsimultaneously satisfies multiple equations. In our case the intersection point of theline with the conic is given by

⎧⎪⎨

⎪⎩

y = mt + yt

x = lt + xt

a1,1x2 +2a1,2xy+2a1,3x+a2,2y2 +2a2,3y+a3,3 = 0

which leads to the equation

a1,1 (lt + xt)2+2a1,2 (lt + xt)(mt + yt)+2a1,3 (lt + xt)+a2,2 (mt + yt)

2 +2a2,3 (mt + yt)+a3,3=0⇒⇒

(a1,1l2 +2a1,2lm+a2,2m2

)t2+

+2((a1,1xt +a1,2yt +a1,3) l +(a1,2xt +a2,2yt +a2,3)m)+

+(a1,1x2

t +a2,2y2t +2a1,2xt yt +2a1,2xt yt +2a1,3xt +2a2,3yt +a3,3

)= 0

that can be re-written asαt2 +2β t + γ = 0 (6.12)

where

α =(a1,1l2 +2a1,2lm+a2,2m2

)

β = ((a1,1xt +a1,2yt +a1,3) l +(a1,2xt +a2,2yt +a2,3)m)γ =

(a1,1x2

t +a2,2y2t +2a1,2xtyt +2a1,2xtyt +2a1,3xt +2a2,3yt +a3,3

).

It must be observed that γ is the Eq. (6.10) calculated in the point T. Let us nowconsider Eq. (6.12). It is a second order polynomial in the variable t. As such we candistinguish the following three cases:

• if the equation has two real solutions then the line crosses the conic, i.e. the lineintersects the conic in two distinct points of the plane (the line is said secant tothe conic)

• if the equation has two coinciding solution then the line is tangent to the conic• if the equation has two complex solutions then the line does not intersect the

conic (the line is said external to the conic)

Page 245: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 227

6.5.2 Line Tangent to a Conic

Let us focus on the case when Eq. (6.12) has two coinciding solutions, i.e. when theline is tangent to the conic, and let us write down the equation of a line tangent to aconic.

The solution of Eq. (6.12) corresponds to a point T of the plane belonging to boththe line and the conic. Since this point belongs to the conic, its coordinates satisfyEq. (6.10) that, as observed above, can be written as γ = 0. Since γ = 0 Eq. (6.12)can be written as

αt2 +β t = 0.

Obviously this equation can be re-written as

t (αt +β ) = 0

which has t = 0 as a solution. Since the solutions are coinciding with t = 0 it followsthat

β = 0⇒ ((a1,1xt +a1,2yt +a1,3) l +(a1,2xt +a2,2yt +a2,3)m) = 0.

This is an equation in two variables, l and m respectively. Obviously, this equa-tion has ∞ solutions. The solution (0,0), albeit satisfying the equation, is unaccept-able because it has no geometrical meaning, see Eq. (6.11). Since ∞ solutions satisfythe equation if we find one solution, all the others are proportionate to it. A solutionthat satisfies the equation is the following:

l = (a1,2xt +a2,2yt +a2,3)m =−(a1,1xt +a1,2yt +a1,3) .

If we substitute the values of l and m into Eq. (6.11) we obtain

(a1,1xt +a1,2yt +a1,3)(x− xt)+(a1,2xt +a2,2yt +a2,3)(y− yt) = 0⇒⇒ a1,1xtx+a1,2ytx+a1,3x−a1,1x2

t −a1,2ytxt −a1,3xt++a1,2xty+a2,2yty+a2,3y−a1,2xtyt −a2,2y2

t −a2,3yt = 0⇒⇒ a1,1xtx+a1,2ytx+a1,3x+a1,2xty+a2,2yty+a2,3y+−a1,1x2

t −2a1,2xtyt −a1,3xt −a2,2y2t −a2,3yt = 0.

(6.13)

Let us consider again Eq. (6.10) and let us consider that T is a point of the conic.Hence, the coordinates of T verify the equation of the conic:

a1,1x2t +2a1,2xtyt +2a1,3xt +a2,2y2

t +2a2,3yt +a3,3 = 0⇒⇒ a1,3xt +a2,3yt +a3,3 =−a1,1x2

t −a2,2y2t −2a1,2xtyt −a2,3yt −a1,3xt .

Page 246: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

228 6 An Introduction to Geometric Algebra and Conics

Substituting this result into Eq. (6.13) we obtain

a1,1xtx+a1,2ytx+a1,3x+a1,2xty+a2,2yty+a2,3y+a1,3xt +a2,3yt +a3,3 = 0⇒⇒ (a1,1xt +a1,2yt +a1,3)x+(a1,2xt +a2,2yt +a2,3)y+(a1,3xt +a2,3yt +a3,3) = 0

(6.14)

that is the equation of a line tangent to a conic in the point T with coordinates(xt ,yt).

6.5.3 Degenerate and Non-degenerate Conics: A Conic as a Matrix

The equation of a line tangent to a conic is extremely important to study and under-stand conics. In order to do so, let us consider the very special case when Eq. (6.14)is verified regardless of the values of x and y or, more formally ∀x,y the line is tan-gent to the conic. This situation occurs when the coefficients of x and y are null aswell as the constant coefficient. In other words, this situation occurs when

⎧⎪⎨

⎪⎩

a1,1xt +a1,2yt +a1,3 = 0

a1,2xt +a2,2yt +a2,3 = 0

a1,3xt +a2,3yt +a3,3 = 0.

Algebraically, this is a system of three linear equations in two variables. FromRouchè-Capelli Theorem we know that, since the rank of the incomplete matrixis at most 2, if the determinant of the complete matrix is null then the system iscertainly incompatible. In our case, if

detAc = det

⎝a1,1 a1,2 a1,3

a1,2 a2,2 a2,3

a1,3 a2,3 a3,3

⎠ �= 0

then the system is surely incompatible, i.e. it is impossible to have a line tangent tothe conic regardless of x and y. On the contrary, if detAc = 0 the system has at leastone solution, i.e. the special situation when ∀x,y the line is tangent to the conic isverified.

Geometrically, a line can be tangent to a conic regardless of its x and y valuesonly when the conic is a line itself or a point of the line. These situations correspondto a degenerate conic. From the considerations above, given a generic conic havingequation

a1,1x2 +2a1,2xy+2a1,3x+a2,2y2 +2a2,3y+a3,3 = 0,

Page 247: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 229

we can associate to it the following matrix

Ac =

⎝a1,1 a1,2 a1,3

a1,2 a2,2 a2,3

a1,3 a2,3 a3,3

⎠ .

The determinant of this matrix tells us whether or not this conic is degenerate.More specifically the following cases can occur:

• detAc �= 0: the conic is non-degenerate• detAc = 0: the conic is degenerate.

This finding allows us to see how a conic can also be considered as a matrix. Fur-thermore, the understanding of the determinant can also be revisited: a line tangentto a conic means that two figures in the plane have one point in common or that theintersection of two sets is a single point. If this intersection point is the only pointof the conic or if the intersection is the entire line we can conclude that the set ofthe points of the conic is contained within the set of the line. This can be seen asan initial problem involving two sets is collapsed into a problem involving only oneset. Yet again, a null determinant can be seen as the presence of redundant pieces ofinformation.

The figure below depicts the two situations. On the left a line tangent to a non-degenerate conic is shown. The tangent point T is also indicated. On the right, theline is tangent to the conic in all its points, i.e. the conic is part of the line or coin-cides with it. In figure, the overlap of the conic with the line is graphically repre-sented with a thick line.

T

detAc �= 0 detAc = 0

Example 6.14. The conic having equation

5x2 +2xy+14x+8y2 +5y+9 = 0

is associated with the matrix ⎛

⎝5 1 71 8 37 3 9

whose determinant is −44. The conic is non-degenerate.

Page 248: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

230 6 An Introduction to Geometric Algebra and Conics

6.5.4 Classification of a Conic: Asymptotic Directions of a Conic

Let us consider again Eq. (6.12) and let us analyse again its meaning. It representsthe intersection of a line with a generic conic. It is a second order polynomial be-cause the conic has a second order equation. If α = 0 the polynomial becomes ofthe first order.

Algebraically, the condition α = 0 can be written as

α =(a1,1l2 +2a1,2lm+a2,2m2)= 0.

This equation would be verified for (l,m) = (0,0). However, this solution can-not be considered for what written in Eq. (6.11). Hence, we need to find a solution(l,m) �= (0,0). A pair of these numbers, when existent, are said asymptotic directionof the conic.

Let us divide the equation α = 0 by l2. If we pose μ = ml the equation becomes

(a2,2μ2 +2a1,2μ +a1,1

)= 0

namely, equation of the asymptotic directions.Let us solve the equation above as a second order polynomial in the variable μ .

In order to do it we need to discuss the sign of

Δ = a21,2−a1,1a2,2.

More specifically the following cases can be distinguished:

• Δ > 0: the equation has two real and distinct solutions, i.e. two asymptotic direc-tions of the conic exist

• Δ = 0: the equation has two real and coinciding solutions, i.e. one asymptoticdirection of the conic exist

• Δ < 0: the equation has two complex solutions, i.e. no asymptotic directions exist

Obviously, the relation between the solution μ and the asymptotic directions(l,m) is given by

(1,μ) =(

1,ml

).

The amount of asymptotic directions is a very important feature of conics. Thefollowing theorem describes this fact.

Theorem 6.5. An hyperbola has two asymptotic directions, a parabola has oneasymptotic direction, an ellipse has no asymptotic directions.

Furthermore, since

Δ = a21,2−a1,1a2,2 =−

(a2

1,2−a1,1a2,2)=−det

(a1,1 a1,2

a1,2 a2,2

)

we can study a conic from directly its matrix representation in Eq. (6.10).

Page 249: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 231

Theorem 6.6. Classification Theorem. Given the a conic having equation

a1,1x2 +2a1,2xy+a2,2y2 +a1,3x+a2,3y+a3,3 = 0

and associated matrix⎛

⎝a1,1 a1,2 a1,3

a1,2 a2,2 a2,3

a1,3 a2,3 a3,3

⎠ ,

this conic is classified by the determinant of its submatrix

I3,3 =

(a1,1 a1,2

a1,2 a2,2

).

It occurs that

• if detI33 < 0 the conic is an hyperbola• if detI33 = 0 the conic is a parabola• if detI33 > 0 the conic is an ellipse

Example 6.15. Let us consider again the conic having equation

5x2 +2xy+14x+8y2 +5y+9 = 0.

We already know that this conic is non-degenerate. Let us classify this conic bycalculating the determinant of I33:

detI3,3 = det

(5 11 8

)= 38 > 0.

The conic is an ellipse.

Example 6.16. We know that the conic having equation

x2

25+

y2

16= 1

is an ellipse in its simplified form. Let us verify it by applying the ClassificationTheorem. Let us verify at first that this conic is non-degenerate. In order to do it, letus write the equation in its matrix representation:

16x2 +25y2−400 = 0.

Let us write its associated matrix:

Ac =

⎝16 0 00 25 00 0 −400

⎠ .

Page 250: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

232 6 An Introduction to Geometric Algebra and Conics

It can be immediately observed that this matrix is diagonal. A such the matrix isnon-singular, hence the conic is non-degenerate. Furthermore, since it happens that

detI3,3 = det

(16 00 25

)= 400 > 0,

the conic is an ellipse.It can be shown that all the simplified equations of ellipses and hyperbolas cor-

respond to diagonal matrices. More rigorously, the simplified equations are writtenby choosing a reference system that leads to a diagonal matrix. Let us verify thisstatement by considering the simplified equation of an hyperbola

x2

25− y2

16= 1.

The matrix representation of this conic is

16x2−25y2−400 = 0

with associated matrix

Ac =

⎝16 0 00 −25 00 0 −400

⎠ .

Since this matrix is non-singular it is non-degenerate. By applying the Classifi-cation Theorem we observe that since

detI3,3 = det

(16 00 −25

)=−400 < 0,

the conic is an hyperbola.

Example 6.17. Let us consider the following simplified equation of a parabola:

2y2−2x = 0.

The associated matrix is

Ac =

⎝0 0 10 2 01 0 0

⎠ ,

that is non-singular. Hence, the conic is non-degenerate. If we apply the Classifica-tion Theorem we obtain

detI3,3 = det

(0 00 2

)= 0,

i.e. the conic is a parabola.It can be observed that the simplified equation of a parabola corresponds to a

matrix where only its elements on the secondary diagonal are non-null.

Page 251: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 233

Example 6.18. Let us now write the equation of a generic conic and let us classify it:

6y2−2x+12xy+12y+1 = 0.

At first, the associated matrix is

Ac =

⎝0 6 −16 6 6−1 6 0

⎠ ,

whose determinant is −36−36−6 =−78 �= 0. The conic is non-degenerate. Let usclassify it

detI3,3 = det

(0 66 6

)=−36 < 0.

The conic is an hyperbola.

Proposition 6.1. The asymptotic directions of an hyperbola are perpendicular ifand only if the trace of the associated submatrix I33 is equal to 0.

Proof. For an hyperbola the equation of the asymptotic directions(a2,2μ2 +2a1,2μ +a1,1

)= 0

has two distinct real roots μ1 and μ2. The associated asymptotic directions are(1,μ1) and (1,μ2), respectively. These two directions can be seen as two vectorsin the plane.

If these two directions are perpendicular for Proposition 4.6, their scalar productis null:

1+μ1μ2 = 0.

For Proposition 5.7 μ1μ2 =a1,1a2,2

. Hence,

1+a1,1

a2,2= 0⇒ a11 =−a2,2.

The trace of I33 is a1,1 +a2,2 = 0 ��If tr(I33) = 0, then a11 = −a2,2, that is

a1,1a2,2

= −1. For Proposition 5.7 μ1μ2 =

−1⇒ (1,μ1)(1,μ2) = 0, i.e. the two directions are perpendicular. ��

Example 6.19. The hyperbola having equation

−2x2 +2y2− x+3xy+5y+1 = 0

has perpendicular asymptotic directions since a11 +a2,2 = 2−2 = 0.

Page 252: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

234 6 An Introduction to Geometric Algebra and Conics

Let us find the asymptotic directions. In order to do it let us solve the equation ofthe asymptotic directions:

(a2,2μ2 +2a1,2μ +a1,1

)= 2μ2 +3μ−2 = 0,

whose solutions are μ1 =−2 and μ2 =12 . The corresponding asymptotic directions

are (1,−2) and(1, 1

2

).

Definition 6.10. An hyperbola whose asymptotic directions are perpendicular issaid to be equilateral.

Let us see a few degenerate examples.

Example 6.20. Let us consider the following conic

2x2 +4y2 +6xy = 0

and its associated matrix

Ac =

⎝2 3 03 4 00 0 0

⎠ .

The determinant of the matrix is null. Hence, the conic is degenerate. By applyingthe classification theorem we find out that since

detI3,3 = det

(2 33 4

)=−1 < 0

the conic is an hyperbola. More specifically the conic is a degenerate hyperbola, i.e.a pair of intersecting lines. By working out the original equation we obtain

2x2 +4y2 +6xy = 0⇒ 2(x2 +2y2 +3xy

)= 0⇒ 2(x+ y)(x+2y) = 0.

Hence the conic is the following pair of lines:

y =−xy =− x

2 .

Example 6.21. If we consider the conic having equation

2x2 +4y2 +2xy = 0,

its associated matrix is

Ac =

⎝2 1 01 4 00 0 0

is singular and its classification leads to

detI3,3 = det

(2 11 4

)= 7 > 0,

Page 253: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 235

i.e. the conic is an ellipse. More specifically, the only real point that satisfies theequation of this conic (and thus the only point with geometrical meaning) is (0,0).The conic is a point.

Example 6.22. Let us consider the conic having equation

y2 + x2−2xy−9 = 0.

The matrix associated with this conic is

Ac =

⎝1 −1 0−1 1 00 0 −9

whose determinant is null. The conic is degenerate and, more specifically, a degen-erate parabola since

detI3,3 = det

(1 −1−1 1

)= 0.

This equation of the conic can be written as (x− y+3)(x− y−3) = 0 that is theequation of two parallel lines:

y = x+3y = x−3.

Example 6.23. Let us consider the conic having equation

x2 +4y2 +4xy = 0.

Since the matrix associated with this conic is

Ac =

⎝1 2 02 4 00 0 0

⎠ ,

the conic is degenerate. Considering that

detI3,3 = det

(1 22 4

)= 0,

it follows that the conic is a parabola. The conic can written as (x+2y)2 = 0 that isthe equation of two coinciding lines.

The last two examples show that a degenerate parabola can be of two kinds.In Example 6.21 the parabola breaks into two parallel lines. On the contrary, inExample 6.23 the two parallel lines are also overlapping. In the first case the rankof the matrix Ac is 2 while in the second one the rank of Ac is 1. Degenerate conicsbelonging to the latter group are said twice degenerate.

Page 254: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

236 6 An Introduction to Geometric Algebra and Conics

6.5.5 Diameters, Centres, Asymptotes, and Axes of Conics

Definition 6.11. A chord of a conic is a segment connecting two arbitrary points ofa conic.

Obviously, since infinite points belong to a conic, a conic has infinite chords.

Definition 6.12. Let (l,m) be an arbitrary direction. A diameter of a conic conjugateto the direction (l,m) (indicated with diam) is the locus of the middle points of allthe possible chords of a conic that have direction (l,m). The direction (l,m) is saidto be direction conjugate to the diameter of the conic.

−15 −10 −5 0 5 10 15−5

0

5

10

(l,m)

diam

It must be noted that in this context, the term conjugated is referred with respectto the conic. In other words the directions of line and diameter are conjugated toeach other with respect to the conic.

Page 255: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 237

Definition 6.13. Two diameters are said to be conjugate if the direction of one di-ameter is the conjugate direction of the other and vice-versa.

The conjugate diameters diam and diam′ are depicted in figure below.

−15 −10 −5 0 5 10 15−5

0

5

10

(l,m)diam’

diam

Proposition 6.2. Let diam be the diameter of a conic conjugated to a direction(l,m). If this diameter intersects the conic in a point P the line containing P andparallel to the direction (l,m) is tangent to the conic in the point P.

−15 −10 −5 0 5 10 15−5

0

5

10

(l,m)

diam

P

Proof. Since P belongs to both the conic and the line, it follows that the line cannotbe external to the conic. It must be either tangent or secant.

Page 256: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

238 6 An Introduction to Geometric Algebra and Conics

Let us assume by contradiction, that the line is secant to the conic and thus inter-sects it in two points. We know that one point is P. Let us name the second intersec-tion point Q. It follows that the chord PQ is parallel to (l,m). The middle point ofthis chord, for definition of diameter, is a point of the diameter diam. It follows thatP is middle point of the chord PQ (starting and middle point at the same time). Wehave reached a contradiction which can be sorted only if the segment is one point,i.e. only if the line is tangent to the conic. ��Proposition 6.3. Let us consider an ellipse and a non-asymptotic direction (l,m).Let us consider now the two lines having direction (l,m) and tangent to the conic.Let us name the tangent points A and B respectively.

A

B

The line passing through A and B is the diameter of a conic conjugate to thedirection (l,m).

Theorem 6.7. For each (l,m) non-asymptotic direction, the diameter of a conicconjugated to this direction has equation

(a1,1x+a1,2y+a1,3) l +(a1,2x+a2,2y+a2,3)m = 0. (6.15)

It can be observed from Eq. (6.15) that for each direction (l,m) a new conjugatediameter is associated. Hence, while these parameters vary a family of intersectingstraight lines is identified. For every direction (l,m) a conjugate diameter is identi-fied. Since infinite directions in the plane exist, a conic has infinite diameters.

Definition 6.14. The center of a conic is the intersection point of the diameters.

In order to find the coordinates of the center, we intersect two diameters that isEq. (6.15) for (l,m) = (1,0) and (l,m) = (0,1), respectively. The coordinates of thecenter are the values of x and y that satisfy the following system of linear equations:

{a1,1x+a1,2y+a1,3 = 0

a1,2x+a2,2y+a2,3 = 0.(6.16)

Page 257: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 239

The system is determined when

det

(a1,1 a1,2

a1,2 a2,2

)�= 0.

In this case the conic is an either an hyperbola or an ellipse. These conics havea center and infinite diameters passing through it (family of intersecting straightlines). On the contrary, if

det

(a1,1 a1,2

a1,2 a2,2

)= 0

the conic is a parabola and two cases can be distinguished:

• a1,1a1,2

=a1,2a2,2

�= a1,3a2,3

: the system is incompatible, the conic has no center within theplane;

• a1,1a1,2

=a1,2a2,2

=a1,3a2,3

: the system is undetermined and has infinite centres.

In the first case, the two equations of system (6.16) are represented by two par-allel lines (hence with no intersections). Since there are no x and y values satisfyingthe system also Eq. (6.15) is never satisfied. Hence, the conic has infinite paralleldiameters (a family of parallel straight lines).

In the second case, the parabola is degenerate. The rows of the equations of thesystem are proportionate, i.e. a1,2 = λa1,1, a2,2 = λa1,2, and a2,3 = λa1,3 with λ ∈R.The two equations of system (6.16) are represented by two coinciding lines.

It follows that

(a1,1x+a1,2y+a1,3) l +(a1,2x+a2,2y+a2,3)m = 0⇒⇒ (a1,1x+a1,2y+a1,3)(l +λm) = 0⇒ (a1,1x+a1,2y+a1,3) = 0.

In this degenerate case, the parabola has thus only one diameter (all the diameters areoverlapped on the same line) having equation (a1,1x+a1,2y+a1,3) = 0 and whereeach of its points is center.

Example 6.24. If we consider again the hyperbola having equation

6y2−2x+12xy+12y+1 = 0,

we can write the equation of the diameters

(6y−1) l +(6x+6y+6)m = 0.

In order to find two diameters let us write the equations in the specific case(l,m) = (0,1) and (l,m) = (1,0). The two corresponding diameters are

6y−1 = 06x+6y+6 = 0.

Let us now simultaneously solve the equations to obtain the coordinates of the cen-ter. The coordinates are

(− 7

6 ,16

).

Page 258: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

240 6 An Introduction to Geometric Algebra and Conics

Example 6.25. Let us consider the conic having equation

4y2 +2x+2y−4 = 0.

The associated matrix

Ac =

⎝0 0 10 4 11 1 −4

has determinant −4. The conic is non-degenerate and, more specifically, a parabolasince

detI3,3 = det

(0 00 4

)= 0.

This parabola has no center. If we tried to look for one we would need to solvethe following system of linear equations

{1 = 0

4y+1 = 0

which is incompatible. The parabola has infinite diameters parallel to the line havingequation 4y+1 = 0⇒ y =− 1

4 .

Example 6.26. Let us consider again the conic having equation

x2 +4y2 +4xy = 0.

We know that this conic is a degenerate parabola consisting of two coincidinglines. Let us write the system of linear equations for finding the coordinates of thecenter {

x+2y = 0

2x+4y = 0.

This system is undetermined and has ∞ solutions. The conic has ∞ centres be-longing to the diameter. The latter is the line having equation x+2y = 0.

Proposition 6.4. Let the conic C be an ellipse or an hyperbola. The diameters ofthis conic are a family of intersecting straight lines whose intersection point is thecenter of symmetry of the conic C .

Proof. Let (l,m) be a non-asymptotic direction and diam the diameter conjugated to(l,m). Let us indicate with (l′,m′) the direction of the diameter diam. The diameterdiam intersects the conic in two points A and B, respectively. Thus, the segment ABis a chord. We may think of the infinite chords parallel to AB and thus to a diameterdiam′ conjugated to the direction (l,m). The diameter diam′ intersects the conic inthe points C and D, respectively, and the segment AB in its middle point M (fordefinition of diameter). The point M is also middle point for the segment CD.

Page 259: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 241

−15 −10 −5 0 5 10 15−5

0

5

10

(l,m)

(l’,m’) B

A

D

C

M

We can make the same consideration for any arbitrary direction (l,m), i.e. everychord is intersected in its middle point by a chord having direction conjugate to(l,m). Hence, the diameters are a family of straight lines intersecting in M and M isthe center of symmetry. ��

Definition 6.15. An axis of a conic is a diameter when it is perpendicular to its con-jugate direction (equivalently: an axis is a diameter whose direction is conjugated toits perpendicular direction).

In order to calculate the equation of an axis, let us prove the following theorem.

Theorem 6.8. An ellipse or an hyperbola has two axes, perpendicular to each other.

Proof. Let us consider a direction (l,m) and Eq. (6.15):

(a1,1x+a1,2y+a1,3) l +(a1,2x+a2,2y+a2,3)m = 0⇒⇒ (a1,1lx+a1,2ly+a1,3)+(a1,2mx+a2,2my+a2,3m) = 0⇒⇒ (a1,1l +a1,2m)x+(a1,2l +a2,2m)y+(a1,3l +a2,3m) = 0.

The direction of the diameter is (−(a1,2l +a2,2m) ,(a1,1l +a1,2m)). The diameteris an axis if its direction is perpendicular to (l,m) and hence if their scalar productis null:

(a1,2l +a2,2m) l− (a1,1l +a1,2m)m = 0⇒a1,2l2 +a2,2lm−a1,1lm−a1,2m2 = 0⇒

a1,2l2 +(a2,2−a1,1) lm−a1,2m2 = 0.

If we solve this equation in the variable l we have that the discriminant is

((a2,2−a1,1)m)2 +4a21,2m2

Page 260: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

242 6 An Introduction to Geometric Algebra and Conics

which is always positive. Hence, it always has two solutions that is the direction oftwo axes, respectively

l1 =−(a2,2−a1,1)m+

√((a2,2−a1,1)m)

2+4a2

1,2m2

2a1,2

l2 =−(a2,2−a1,1)m−

√((a2,2−a1,1)m)

2+4a2

1,2m2

2a1,2.

Since ellipses and hyperbolas have two perpendicular directions of the axes thenhave two axes perpendicular to each other. ��

When the directions of the axes are determined the equation of the axis is ob-tained by imposing that the axis passes through the center of the conic, which is thecenter of the family of diameters. Let the direction of an axis be (l,m) and C bethe center of the conic having coordinates (xc,yc) the equation of the correspondingaxis is

x− xc

l=

y− yc

m.

Corollary 6.1. In a circumference every diameter is axis.

Proof. If the conic is a circumference it has equation x2 + y2 = R, thus a1,1 = a2,2

and a1,2 = 0. It follows that the equation

a1,2l2 +(a2,2−a1,1) lm−a1,2m2 = 0

is always verified. Hence every diameter is axis. ��

Example 6.27. Let us consider the conic having equation

9x2 +4xy+6y2−10 = 0.

The associated matrix ⎛

⎝9 2 02 6 00 0 −10

is non-singular. Hence, the conic is non-degenerate.The submatrix (

9 22 6

)

has positive determinant. Hence, the conic is an ellipse.The equation of the family of diameters is

(9x+2y) l +(2x+6y)m = (9l +2m)x+(2l +6m)y = 0.

Page 261: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 243

From the equation of the family of diameters we can obtain the coordinates ofthe center by solving the following system of linear equations

{9x+2y = 0

2x+6y = 0.

The coordinates of the center are (0,0). In order to find the direction of the axes(l,m) it is imposed that

−(2l +6m) l +(9l +2m)m = 0⇒−2l2 +3lm+2m2 = 0.

Posing μ = ml and dividing the equation by l2 we obtain

2μ2 +3μ−2 = 0

whose solutions areμ = 1

2μ =−2.

Hence the directions of the axes are(1, 1

2

)and (1,−2). The corresponding equa-

tions of the axes, i.e. equations of lines having these directions and passing throughthe center of the conic are

x−2y = 02x+ y = 0.

Theorem 6.9. Let A be the matrix associated with a parabola and (a1,1x+a1,2

y+a1,3) l +(a1,2x+a2,2y+a2,3)m be the equation of the family of its parallel di-ameters. The axis of a parabola is only one and is parallel to its diameters. Thecoefficients of the equation ax+by+ c = 0 of the axis are equal to the result of thefollowing matrix product

(a b c

)=(

a1,1 a1,2 0)

Ac.

Corollary 6.2. The coefficients of the equation of the axis of a parabola can also befound as (

a b c)=(

a2,1 a2,2 0)

Ac.

Example 6.28. The conic having equation

x2 +4xy+4y2−6x+1 = 0

has associated matrix ⎛

⎝1 2 −32 4 0−3 0 1

which is non-singular. The conic is non-degenerate.

Page 262: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

244 6 An Introduction to Geometric Algebra and Conics

The submatrix (1 22 4

)

is singular. The conic is a parabola.The family of diameters have equation

(x+2y−3) l +(2x+4y)m = 0.

To find the axis of the conic let us calculate

(1 2 0

)⎛

⎝1 2 −32 4 0−3 0 1

⎠=(

5 10 −3).

The equation of the axis is 5x+10y−3 = 0.

Although an in depth understanding of the axis of the parabola is outside thescopes of this book, it may be useful to observe that the procedure is, at the firstglance, very different with respect to that described for ellipse and hyperbola. How-ever, the procedures are conceptually identical after the assumption that the centerof the parabola exists and is outside the plane where the parabola lays. This centeris a so called point at infinity which is a notion of Projective Geometry, see [17].

Definition 6.16. The vertex of a conic is the intersection of the conic with its axes.

Example 6.29. Let us find the vertex of the parabola above. We simply need to findthe intersections of the conic with its axis, i.e. we need to solve the following systemof equations: {

x2 +4xy+4y2−6x+1 = 0

5x+10y−3 = 0.

By substitution we find that x = 1775 and y = 14

75 .

Definition 6.17. An asymptote of a conic is a line passing through its center andhaving as its direction the asymptotic direction.

An ellipse has no asymptotes because it has no asymptotic directions. An hyper-bola has two asymptotes, one per each asymptotic direction. A parabola, althoughhas one asymptotic direction, has no (univocally defined) center, and thus no asymp-tote.

Example 6.30. Let us consider again the hyperbola having equation

−2x2 +2y2− x+3xy+5y+1 = 0

We know that the asymptotic directions are (1,−2) and(1, 1

2

).

Page 263: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 245

The center of the conic can be easily found by soling the following system oflinear equations: {

−2x+ 32 y− 1

2 = 032 x+2y+ 5

2 = 0

whose solution is xc =− 1925 and yc =− 17

25 .The equations of the asymptotes are

x+ 1925

1=

y+ 1725

−2

andx+ 19

25

1=

y+ 1725

12

Example 6.31. Let us consider the equation of the following conic

x2−2y2 +4xy−8x+6 = 0.

The associated matrix is ⎛

⎝1 2 −42 −2 0−4 0 6

is non-singular. Hence, the conic is non-degenerate. The determinant of the matrix(

1 22 −2

)

is −6 that is < 0. Hence the conic is an hyperbola.Let us search for the asymptotic directions of the conic by solving the equation

−2μ2 +4μ +1 = 0.

The solutions are 1−√

32 and 1+

√32 , respectively. The asymptotic directions

are then

(1,1−

√32

)and

(1,1+

√32

).

Let us find the coordinates of the center{

x+2y−4 = 0

2x−2y = 0

Page 264: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

246 6 An Introduction to Geometric Algebra and Conics

which yields to xc =43 and yc =

43 . Let us now write the equations of the asymptotes:

x− 43

1=

y− 43

1−√

32

x− 43

1=

y− 43

1+√

32

.

6.5.6 Canonic Form of a Conic

Let us consider a generic conic having equation

a1,1x2 +2a1,2xy+2a1,3x+a2,2y2 +2a2,3y+a3,3 = 0,

and its associated matrices Ac and I3,3. The expression of a conic in its canonic formis a technique of obtaining the conic in its simplified formulation by changing thereference system, i.e. by rotating and translating the reference system so that theequations in Sect. 6.4 can be used in a straightforward way. In some cases, the trans-formation into a canonic form can be extremely convenient and lead to a simplifiedmathematical description of the conic. On the other hand, the transformation itselfcan be computationally onerous as it requires the solution of a nonlinear systemof equation. Two different procedures are illustrated in the following paragraphs,the first is for conics having a center, i.e. ellipses and hyperbolas, the second is forparabolas.

Canonic Form of Ellipse and Hyperbola

If the conic is an ellipse or an hyperbola and thus has a center, the canonic form isobtained by choosing a reference system whose center coincides with the center ofthe conic and whose axes coincide with the axes of the conic. The equation of thecanonic form of an ellipse or an hyperbola is

LX2 +MY 2 +N = 0

where ⎧⎪⎨

⎪⎩

LMN = det(Ac)

LM = det(I3,3)

L+M = tr(I3,3) .

Example 6.32. The conic having equation

x2−2xy+3y2−2x+1 = 0

Page 265: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 247

is non-degenerate since det(Ac) = −1 and is ellipse since det(I3,3) = 2. The traceof I3,3 is 4. To write it in its canonic form, we may write

⎧⎪⎨

⎪⎩

LMN =−1

LM = 2

L+M = 4.

The solutions of this system are

L = 2−√

2,M = 2+√

2,N =− 12

L = 2+√

2,M = 2−√

2,N =− 12 .

(6.17)

This means that we have two canonic form for the ellipse, that is

(2−

√2)

X2 +(

2+√

2)

Y 2− 12= 0

and

(2+

√2)

X2 +(

2−√

2)

Y 2− 12= 0.

The ellipse of the two equations is obviously the same but it corresponds, in onecase, to an ellipse whose longer part is aligned the abscissa’s axis and, in the othercase, to an ellipse whose longer axis is aligned to the ordinate’s axis.

Canonic Form of the Parabola

If the conic is a parabola it does not have a center in the same plane where the coniclies. In order to have the conic written in its canonic form, the reference system ischosen to have its origin coinciding with the vertex of the parabola, the abscissa’saxis aligned with the axis of the parabola, and the ordinate’s axis perpendicularto the abscissa’s axis and tangent to the vertex. The equation of a parabola in itscanonic form is

MY 2 +2BX = 0

where {−MB2 = det(Ac)

M = tr(I3,3) .

Example 6.33. The parabola having equation

x2−2xy+ y2−2x+6y−1 = 0

Page 266: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

248 6 An Introduction to Geometric Algebra and Conics

has det(Ac) =−4 and tr(I3,3) = 2. To find M and B we write the system

{−MB2 =−4

M = 2.

The equations of this parabola in its canonic form are

2Y 2 +2√

2X = 02Y 2−2

√2X = 0.

The two equations refer to a parabola which lies on the positive (right) semiplaneand on the negative (left) semiplane, respectively.

Exercises

6.1. Identify the direction of the line having equation 4x−3y+2 = 0

6.2. Identify, if they exist, the intersection points of the following two lines:

3x−2y+4 = 04x+ y+1 = 0.

6.3. Identify, if they exist, the intersection points of the following two lines:

3x−2y+4 = 09x−6y+1 = 0.

6.4. Check whether or not the conic having equation

4x2−2y2 +2xy−4y+8 = 0

is degenerate or not. Classify then the conic.

6.5. Check whether or not the conic having equation

4x2 +2y2 +2xy−4y−6 = 0

is degenerate or not. Classify then the conic.

6.6. Check whether or not the conic having equation

x2 + y2 +2xy−8x−6 = 0

is degenerate or not. Classify then the conic.

Page 267: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

6.5 Matrix Representation of a Conic 249

6.7. Check whether or not the conic having equation

x2 +2xy−7x−8y+12 = 0

is degenerate or not. Classify then the conic.

6.8. Check whether or not the conic having equation

x2−16y2 +6xy+5x−40y+24 = 0

is degenerate or not. Classify then the conic.

Page 268: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Part IIElements of Linear Algebra

Page 269: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 7An Overview on Algebraic Structures

7.1 Basic Concepts

This chapter recaps and formalizes concepts used in the previous sections of thisbook. Furthermore, this chapter reorganizes and describes in depth the topics men-tioned at the end of Chap. 1, i.e. a formal characterization of the abstract algebraicstructures and their hierarchy. This chapter is thus a revisited summary of conceptspreviously introduced and used and provides the mathematical basis for the follow-ing chapters.

Definition 7.1. Let A be a nonempty set. An internal binary operation or internalcomposition law is a function (mapping) f : A×A→ A.

Example 7.1. The sum + is an internal composition law over the set of natural num-bers N, i.e. as we know, the sum of two natural numbers is always a natural number.

Definition 7.2. Let A and B be two nonempty sets. An external binary operation orexternal composition law is a function (mapping) f : A×B→ A where the set B �= A.

Example 7.2. The product of a scalar by a vector is an external composition law overthe sets R and V3. Obviously if λ ∈ R and #»v ∈ V3, #»w +λ #»v ∈ V3.

Let us focus at the beginning on internal composition laws.

Definition 7.3. The couple composed of a set A and an internal composition law ∗defined over the set is said algebraic structure.

As mentioned in Chap. 1, algebra is the study of the connections among objects.Consequently, an algebraic structure is a collection of objects (a set) which can berelated to each other by means of a composition law.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_7

253

Page 270: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

254 7 An Overview on Algebraic Structures

7.2 Semigroups and Monoids

If we indicate with ∗ a generic operator and a and b two set elements, the internalcomposition law of a and b is indicated with a∗b.

Definition 7.4. Let a, b, and c be three elements of A. An internal composition law∗ is said to be associative when

(a∗b)∗ c = a∗ (b∗ c) .

An associative composition law is usually indicated with ·.

Definition 7.5. The couple of a set A with an associative internal composition law ·,is said semigroup and is indicated with (A, ·).

It can easily be observed that the composition of three elements a,b,c of a semi-group can be univocally represented as a ·b ·c without the use of parentheses. Giventhe string a ·b ·c we can choose to calculate a ·b first, and then (a ·b) ·c or b ·c first,and then a · (b · c). We would attain the same result.

Definition 7.6. Let a and b are two elements of A. An internal composition law ∗ issaid to be commutative when a ·b = b ·a.

Definition 7.7. A semigroup (A, ·) having a commutative internal composition lawis said commutative semigroup.

Example 7.3. The algebraic structure composed of the set of real numbers R andthe multiplication, (R, ·) is a commutative semigroup since both associative andcommutative properties are valid for real numbers.

Example 7.4. The algebraic structure composed of the set of square matrices Rn,n

and the multiplication of matrices (R2,2, ·) is a semigroup because the multiplicationis associative (it is not commutative, though).

Example 7.5. The algebraic structure composed of the set of real numbers R and thedivision, (R,/) is not a semigroup since the division of numbers is not an associativeoperator. For example,

(6/2)/3 �= 6(2/3)

that is (62

)

3�= 6

(23

) .

Definition 7.8. Let B ⊂ A. The subset B is said to be closed with respect to thecomposition law · when ∀b,b′ ∈ B : b ·b′ ∈ B.

Example 7.6. As we know from the Fundamental Theorem of Algebra the set ofnatural numbers N, which can be seen as a subset of R, is closed with respect to thesum +.

Page 271: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.2 Semigroups and Monoids 255

Definition 7.9. The neutral element of a semigroup (A, ·) is that special elemente ∈ A such that ∀a ∈ A : a · e = e ·a = a.

Example 7.7. The neutral element of N with respect to the sum + is 0. The neutralelement of N with respect to the product is 1.

Proposition 7.1. Let (A, ·) be a semigroup and e its neutral element. The neutralelement is unique.

Proof. Let us assume, by contradiction that also e′ is a neutral element. It followsthat e · e′ = e′ · e = e. Since also e is neutral element e′ · e = e · e′ = e′. Hence e = e′.��

Definition 7.10. A semigroup (A, ·) having neutral element is said monoid and isindicated with (M, ·).

Example 7.8. The semigroup (R,+) is a monoid where the neutral element is 0.

Example 7.9. The semigroup (Rn,n, ·) composed of square matrices and their prod-uct is a monoid and its neutral element is the identity matrix.

Definition 7.11. Let (M, ·) be a monoid and e its neutral element. If a ∈ M, theinverse element of a is that element b ∈ M such that a · b = e and is indicated witha−1.

Example 7.10. The monoid (Q, ·) has neutral element e = 1. For all the elementsa ∈Q its inverse is 1

a since it always occurs that a 1a = 1 regardless of a.

Proposition 7.2. Let (M, ·) be a monoid and e its neutral element. Let a ∈ M. Theinverse element of a, if exists, is unique.

Proof. Let b ∈M be the inverse of a. Let us assume, by contradiction, that c is alsoan inverse element of a. Hence it follows that

a ·b = e = a · c

andb = b · e = b · (a · c) = (b ·a) · c = e · c = c.��

Example 7.11. Let us consider the monoid (Q, ·) and one element a ∈ Q that isa = 5. The only inverse element of a is 1

a = 15 .

Definition 7.12. Let (M, ·) be a monoid and a∈M. If the inverse element of a exists,a is said to be invertible.

It can be easily observed that neutral element of a monoid is always invertibleand its inverse is the neutral element itself.

Example 7.12. If we consider the monoid (R, ·), the neutral element is e = 1 and itsinverse is 1

1 = 1 = e.

Page 272: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

256 7 An Overview on Algebraic Structures

Proposition 7.3. Let (M, ·) be a monoid and e its neutral element. Let a be an in-vertible element of this monoid and a−1 its inverse element. It follows that a−1 isalso invertible and (

a−1)−1= a.

Proof. Since a−1 is the inverse element of a, it follows that a · a−1 = a−1 · a = e.Hence, one element i such that i · a−1 = a−1 · i = e exists and this element is i = a.This means that a−1 is invertible and its unique inverse is a, i.e.

(a−1

)−1= a. ��

Example 7.13. Let us consider the monoid (R, ·) and its element a = 5. The inverseelement of a is a−1 = 1

5 . We can easily verify that

(a−1)−1

=

(15

)−1

= 5 = a.

Example 7.14. Let us consider the monoid (R2,2, ·). It can be easily verified that theinverse matrix of the inverse of every non-singular matrix A is the matrix A itself.For example,

A =

(1 10 2

)

is non-singular and its inverse is

A−1 =

(1 −0.50 0.5

).

Let us calculate the inverse of the inverse:

(A−1)−1

=

(1 10 2

)= A.

Proposition 7.4. Let (M, ·) be a monoid and e its neutral element. Let a and b betwo invertible elements of this monoid. It follows that a ·b is invertible and its inverseis

(a ·b)−1 = b−1 ·a−1.

Proof. Considering that a and b are invertible let us calculate:(b−1 ·a−1

)· (a ·b) = b−1 ·

(a−1 ·a

)·b = b−1 · e ·b = b−1 ·b = e

(a ·b) ·(b−1 ·a−1

)= a ·

(b ·b−1

)·a−1 = a · e ·a−1 = a ·a−1 = e.

Hence, (a ·b) is invertible and its inverse is(b−1 ·a−1

). ��

Example 7.15. In the case of the monoid (Q, ·) the validity of Proposition 7.4 istrivially verified due to the commutativity of the product of numbers. For examplefor a = 5 and b = 2:

(a ·b)−1 = (5 ·2)−1 =110

=12· 1

5= b−1 ·a−1.

Page 273: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.2 Semigroups and Monoids 257

Example 7.16. Let us consider again the monoid (R2,2, ·) and the non-singular ma-trices

A =

(1 10 2

)

and

B =

(1 04 1

).

Let us calculate

AB =

(5 18 2

)

and

(AB)−1 =

(1 −0.5−4 2.5

).

Let us now calculate

B−1 =

(1 0−4 1

)

and

A−1 =

(1 −0.50 0.5

).

Let us multiply the two inverse matrices to verify Proposition 7.4

B−1A−1 =

(1 −0.5−4 2.5

).

It can be observed that the product A−1B−1 would lead to something else.

Example 7.17. Let us show how a monoid can be generated by means of a non-standard operator. Let us define an operator ∗ over Z. For two elements a and b ∈ Z,this operator is

a∗b = a+b−ab.

Let us prove that (Z,∗) is a monoid. In order to be a monoid, (Z,∗) must verifyassociativity and must have a neutral element. The associativity can be verified bychecking that

(a∗b)∗ c = a∗ (b∗ c)

which is

a∗ (b∗ c) = a+(b∗ c)−a(b∗ c) = a+(b+ c−bc)−a(b+ c−bc) == a+b+ c−bc−ab−ac+abc = (a+b−ab)+ c− c(a+b−ab) =

= (a∗b)+ c− c(a∗b) = (a∗b)∗ c.

Hence, the operator ∗ is associative. The neutral element is 0 since

a∗0 = a+0−a0 = a = 0∗a.

Page 274: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

258 7 An Overview on Algebraic Structures

Let us now look for the inverse element of a. This means that the inverse a−1 isan element of Z such that

a∗a−1 = 0.

This occurs when

a∗a−1 = a+a−1−aa−1 = 0⇒ a−1 =a

a−1.

In order to have a−1 ∈ Z, a must be either 0 or 2. Hence the invertible elementsof the monoid (Z,∗) are 0 and 2.

This example shows how, in general only some elements of a monoid are in-vertible. A special case would be that all the elements of the monoid are invertible.which introduce a new algebraic structure.

7.3 Groups and Subgroups

Definition 7.13. A group (G, ·) is a monoid such that all its elements are invertible.

This means that a group should have associative property, neutral element andinverse element for all its elements.

Example 7.18. The monoid (R,+) is a group since the sum is associative, 0 is theneutral element, and for every element a there is an element b=−a such that a+b=0. On the contrary the monoid (R, ·) is not a group because the element a = 0 hasno inverse.

Definition 7.14. A group (G, ·) is said to be abelian (or commutative) if the opera-tion · is also commutative.

Example 7.19. The group (R,+) is abelian because the sum is commutative. Also,(V3,+) is an abelian group because the sum of vectors is commutative and asso-ciative, has neutral element #»o and for every vector #»v another vector #»w =− #»v suchthat #»v + #»w = #»o exist.

Proposition 7.5. Let (G, ·) be a group. If ∀g ∈ G : g = g−1, then the group (G, ·) isabelian.

Proof. Let g and h ∈ G and g = g−1 and h = h−1. It follows that

g ·h = g−1 ·h−1 = (h ·g)−1 = h ·g.

Hence, the operator it is abelian. ��

Definition 7.15. Let (G, ·) be a group. If g ∈ G and z ∈ Z. The power gz is definedas

gz = g ·g · . . . ·g

Page 275: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.3 Groups and Subgroups 259

where the · operation is performed z−1 times (g on the right hand sire of the equa-tion appears z times).

Proposition 7.6. The following properties of the power are valid

• gm+n = gm ·gn

• gm·n = (gm)n.

Proposition 7.7. Let (G, ·) be a group. If g and h ∈ G, (gh)z = gz ·hz.

Definition 7.16. Let (S, ·) be a semigroup and a, b, and c ∈ S. This semigroup sat-isfies the cancellation law if

a ·b = a · c⇒ b = cb ·a = c ·a⇒ b = c.

Example 7.20. The semigroup (R, ·) satisfies the cancellation law. If we consider themonoid (Rn,n, ·) composed of square matrices and their product, we can see that thestatement AB = AC ⇒ B = C is true only under the condition that A is invertible.Hence, the statement is in general not true. A similar consideration can be done forthe semigroup (V3,⊗).

Proposition 7.8. A group (G, ·) always satisfies the cancellation law.

Proof. Let a, b, and c be ∈ (G, ·). Since in a group all the elements have an inverseelement. It follows that if a ·b = a · c then

a−1 ·a ·b = a−1 ·a · c⇒ b = c.

Analogously, if b ·a = c ·a then

b ·a ·a−1 = c ·a ·a−1 ⇒ b = c.

Hence, for all the groups the cancellation law is valid. ��

Example 7.21. Let us consider the monoid (R2,2, ·). This monoid is not a group sinceonly non-singular matrices are invertible. We can easily show that the cancellationlaw is not always verified. For example, let us consider the matrices

A =

(0 50 5

)

B =

(0 40 4

)

C =

(5 00 5

)

Page 276: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

260 7 An Overview on Algebraic Structures

The matrix products

AB =

(0 200 20

)

CB =

(0 200 20

)

lead to the same results. However, A �= C. Thus, the cancellation law is violated.

Definition 7.17. Let (G, ·) be a group, e its neutral element and H be a nonempty setsuch that H ⊂ G. The pair (H, ·) is said to be a subgroup of (G, ·) if the followingconditions are verified:

• H is closed with respect to ·, i.e. ∀x,y ∈ H : x · y ∈ H• e, neutral element of (G, ·), ∈ H• ∀x ∈ H : x−1 ∈ H

In other words, a subgroup is an algebraic structure derived from a group (bytaking a subset) that still is a group. A trivial example of subgroup is composed ofonly the neutral element e. When the subgroup contains other elements, besides theneutral element, the subgroup is said proper subgroup.

Example 7.22. Considering that (R,+) is a group, the couple ([−5,5] ,+) is not aproper subgroup because the set is not closed with respect to the sum.

Example 7.23. If we consider the group (Z,+), the structure (N,+) would not beits subgroup because inverse elements, e.g. −1,−2,−3, . . . are not natural numbers.

Example 7.24. Let us consider the group (Z12,+12) where

Z12 = {0,1,2,3,4,5,6,7,8,9,10,11}

and +12 is a cyclic sum, i.e. if the sum exceeds 1 of a quantity δ the result of +12 isδ . For example 11+1 = 0, 10+7 = 6, etc.

A subgroup of this group is (H,+12) where H = {0,2,4,6,8,10}. It can be easilyshown that the neutral element 0 ∈ H, that the set is closed with respect to +12 andthat the inverse elements are also contained in the set, e.g. the inverse element of 10is 2 and the inverse element of 8 is 4.

7.3.1 Cosets

Definition 7.18. Let (G, ·) be a group and (H, ·) its subgroup. Let us fix a certaing ∈ G. The set

Hg = {h ·g|h ∈ H}

Page 277: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.3 Groups and Subgroups 261

is said right coset of H in G while the set

gH = {g ·h|h ∈ H}

is said left coset of H in G.

Obviously, if the group is abelian, due to the commutativity of the operator, rightand left cosets coincide.

Example 7.25. In order to better clarify the notation of cosets, let us assume that theset G of the group (G, ·) is

G = {g1,g2, . . . ,gm}

and H is a subset of G (H ⊂ G) indicated as

H = {h1,h2, . . . ,hm}.

A coset is built up by selecting one element g ∈ G and operating it with all theelements in H. For example, we select g5 and we combine it with all the elementsof H. With reference to the right coset notation we have

Hg = {h1 ·g5,h2 ·g5, . . .hn ·g5, ·}.

Example 7.26. Let us consider the group (Z,+) and its subgroup (Z5,+) where Z5is the set of Z elements that are divisible by 5:

Z5 = {0,5,10,15,20, . . . ,−5,−10,−15,−20, . . .}.

It must be noted that the neutral element 0 is included in the subgroup. A right cosetis a set of the type g+h with a fixed g ∈ G and ∀h ∈ H. An example of right cosetis the set of 2+h, ∀h ∈ H that is

{2,7,12,17,22 . . .−3,−8,−13,−18 . . .}.

Since the operation is commutative (2+h = h+2) the left coset is the same.

Example 7.27. Let us consider again the group (Z12,+12) and its subgroup (H,+12)where H = {0,2,4,6,8,10}. Let us now consider 1 ∈ Z12 and build the coset H +1:{1,3,5,7,9,11}.

It must be remarked that a coset is not in general a subgroup, as in this case.Furthermore, if we calculate the coset H + 2 we obtain H. This occurs because2 ∈ H and H is closed with respect to +12. Therefore we have the same subgroup.The same results would have been achieved also with H + 0, H + 4, H + 6, H + 8,and H + 10. Also, the operation H + 1, H + 3, H + 5, H + 7, H + 9, H + 11 leadsto the same set {1,3,5,7,9,11}. Hence, starting from this group and subgroup onlytwo cosets can be generated. This fact is expressed saying that the index of H in Z12

is 2.

Page 278: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

262 7 An Overview on Algebraic Structures

7.3.2 Equivalence and Congruence Relation

Before introducing the concept of congruence relation, let us recall the definitionof equivalence relation ≡, see Definition 1.20, and of equivalence class, see Defini-tion 1.22. An equivalence relation defined over a set A is a relation R over A (thatis a subset of A×A = A2) that is

• reflexive: ∀x ∈ A it follows that x≡ x• symmetric: ∀x,y ∈ A it follows that if x≡ y then y≡ x• transitive: ∀x,y,z ∈ A it follows that if x≡ y and y≡ z then x≡ z

The equivalence class of an element a ∈ A, indicated with [a], is a subset of Acontaining all the elements belonging to A that are equivalent to a. More formally,and equivalence class [a]⊂ A is

[a] = {x ∈ A|x≡ a}.

Example 7.28. It is easy to see that parallelism among vectors is an equivalencerelation since

• every vector is parallel to itself• if #»u is parallel to #»v then #»v is parallel to #»v• if #»u is parallel to #»v and #»v is parallel to #»w then #»u is parallel to #»w .

The set of all the possible vectors parallel vectors is an equivalence class.

We can now introduce the following concept.

Definition 7.19. Let us consider a set A. A partition

P = {P1,P2, . . .Pn}

of the set A is a collection of subsets of A (set of subsets) having the followingproperties.

• Every set in P is not the empty set. More formally ∀i it follows that Pi �= /0.• For every element x ∈ A, there is a unique set Pi ∈P such that x ∈ Pi (the subsets

composing the partition never overlap) More formally, ∀x ∈ A it follows that ∃!isuch that x ∈ Pi. Equivalently, this statement can be expressed as ∀i and j distinctindices of the partition, it follows that Pi∩Pj = /0.

• The union of all the elements of the partition Pi is the set A/ This concept is alsoexpressed by saying that the sets in P cover the set A. More formally ∪n

i=1Pi =A.

It must be remarked that even though for simplicity we have indicated a partitionas a set composed of n sets (P1,P2, . . .Pn), if the set is composed of infinite elements,also the partition can be composed of infinite subsets.

Example 7.29. Let us consider the set

A = {1,2,3,4,5}.

Page 279: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.3 Groups and Subgroups 263

A partition P of the set A is

P = {P1,P2,P3}

whereP1 = {1,4}P2 = {2,3}P3 = {5}.

It can be easily seen that

• P1 �= /0, P2 �= /0, and P3 �= /0• P1 ∩P2 = /0, P2 ∩P3 = /0 and P1 ∩P3 = /0 (since the intersection is commutative

there are no more combinations)• P1∪P2∪P3 = A.

Figure 7.1 represents a partitioned set composed of sixteen elements. The parti-tion is composed of five subsets containing three, one, two, fours, and the remainingsix elements.

Fig. 7.1 Set of sixteen elements partitioned into five subsets

The following theorem is a general result about equivalence classes. However, itis reported in this section because it is of crucial importance for group theory.

Theorem 7.1. Let A = {a,b,c,d, . . .} be a set and ≡ be an equivalence relationdefined over A. Let [a] , [b] , [c] , [d] . . . be the all the possible corresponding equiva-lence classes over the set A. It follows that the equivalence relation ≡ partitions theset A, i.e. {[a] , [b] , [c] , [d] . . .} is a partition of A.

This means that the two following conditions are simultaneously satisfied.

• Given two elements a,b∈ A, either [a] and [b] are disjoint or coincide, i.e. ∀a,b∈A either [a] = [b] or [a]∩ [b] = /0.

• A is the union of all the equivalence classes, i.e. [a, ]∪ [b]∪ [c]∪ [d]∪·· ·= A

Page 280: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

264 7 An Overview on Algebraic Structures

Proof. To prove the first condition, let us consider that the intersection [a]∩ [b] iseither empty or is nonempty. If the intersection is the empty set then the classesare disjoint. In the second case, there exists and element x such that x ∈ [a]∩ [b],hence x ∈ [a] and x ∈ [b], i.e. x≡ a and x≡ b. By symmetry it is true that a≡ x. Bytransitivity, since a≡ x and x≡ b, it follows that a≡ b.

From the definition of equivalence class (see Definition 1.22), since a ≡ b itfollows that a ∈ [b]. Since it is also true that a ∈ [b], it follows that [a] ⊂ [b]. Sinceby symmetry b ≡ a, it follows that b ∈ [a] and [b] ⊂ [a]. Hence [a] = [b]. In otherwords, if two equivalence classes are not disjoint, then the they are coinciding. ��

Let UA = [a, ]∪ [b]∪ [c]∪ [d]∪ . . . be the union of the equivalence classes of theelements of A. To prove the second condition we need to consider that, an elementx ∈ A, due to the reflexivity (it is always true that x ≡ x) always belongs to at leastone class. Without a loss of generality, let us say that x ∈ [a]. Hence, every elementof A is also element of UA. Hence, A⊂UA.

An equivalence class [a] by definition (see Definition 1.22) is

[a] = {x ∈ A|x≡ a}.

Hence, the equivalence class [a] is a subset of A ([a]⊂ A).Thus, if we consider an element x ∈UA, x belongs to only one class (because, as

shown in the previous point, all the intersections between two classes are empty),that is for examples [a]. Consequently, x also belongs to A. Hence, UA ⊂ A.

Therefore, A =UA, i.e. A is the union of all the equivalence classes:

[a, ]∪ [b]∪ [c]∪ [d]∪·· ·= A.��

Example 7.30. In order to explain the meaning of Theorem 7.1, let us imagine a boxfilled with coloured balls. The balls are monochromatic and can be of one of thefollowing colours, blue, red, green, or yellow.

The box can be considered as a set and the balls as its elements. Let us name Athis set. Let us introduce a relation over this set defined by the predicate “to be of thesame colour”. It can be easily verified that this relation is an equivalence relation.More specifically, this relation

• is reflexive since every ball is of the colour of itself• is symmetric since for any two balls ball1 and ball2, if ball1 is of the same colour

of ball2 then ball2 is of the same colour of ball1• is transitive since for any three balls ball1, ball2, ball3, if ball1 and ball2 are of

the same colour (let us say blue) and if ball2 and ball3 are of the same colour,then ball1 and ball3 are of the same colour (still blue).

Thus, the relation “to be of the same colour” is an equivalence relation over theelements of the set A.

Let us imagine to select a ball and check its colour. Let us suppose we selected ared ball. Let us now select from the box the balls that are equivalent to it, that is theother red balls. When there are no more red balls in the box, let us imagine that weplace all the red balls in a red basket. This basket is an equivalence class of the red

Page 281: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.3 Groups and Subgroups 265

balls which we indicate with [r]. We can then define one equivalence class (and onebasket) per each colour, that is the class of blue balls [b], green balls, [g], and yellowballs [y].

Theorem 7.1 states that the relation “to be of the same colour” partitions the setA. This means that

• there is no ball in more than one basket: a ball is of only one colour, it cannotbe at the same time e.g. green and red. In other words, by strictly following theTheorem syntax, if we assume that a ball can be in two baskets, then it is of thecolour of the first and of the second basket. This may happen only if we considerthe same basket twice. If the balls are of different colour they are in separatebaskets and there is no way of having both of them in the same basket ([g] and[r] are disjoint).

• if the balls contained in each basket are placed back to the box (that is the unionof the equivalence classes), we obtain the box with its balls, that is the originalset A. The proof of this statement can be interpreted in the following way. A balltaken from a box is a ball also belonging to the basket. Conversely, a ball takenfrom a basket is also a ball belonging to the box.

Definition 7.20. Let (G, ·) be a group and (H, ·) its subgroup. Let x and y elements∈G. The right congruence relation modulo H x∼ y (or simply right congruence) isthe relation defined as : ∃h ∈H such that y = h ·x. Analogously, the left congruenceis y = x ·h.

Example 7.31. Let us consider the group (R, ·) and as its (improper) subgroup, thegroup (R, ·) itself. Let us consider two elements x,y ∈ R and pose the equation

y = h · x.

Since we can always find an h ∈R verifying this equation (it is enough to chooseh = y

x ), then x∼ y, i.e. x is congruent with y.

Example 7.32. Let us consider the group (Z,+) and its subgroup (Z5,+) with

Z5 = {. . . ,−15,−10,−5,0,5,10,15, . . .}.

Let us consider two elements x,y ∈ Z, i.e. x = 45 and y = 50. Since ∃ an elementh ∈ Z5 such that y = h+ x, that is h = 5, then x ∼ y. This congruence relation isalso known as congruence relation modulo 5. In an analogous way, we may definethe congruence relation modulo e.g. 2, 3, 10 etc. More generally, we may define thegeneric congruence relation modulo h.

Conversely, if x = 45 and y = 47 it follows that x �∼ y since there is no h ∈ Z5such that 47 = h+45.

Example 7.33. Let us consider again the group (Z12,+12) and its subgroup (H,+12)where H = {0,2,4,6,8,10}. Let us consider two elements x,y ∈ Z12, i.e. x = 4 andy = 2. We have x∼ y since ∃h ∈ H, that is h = 10, such that 2 = h+12 4.

Page 282: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

266 7 An Overview on Algebraic Structures

The following proposition gives an important property of the congruence relationwhich allows us to make a strong statement about groups.

Proposition 7.9. Let ∼ be the congruence relation modulo H of a group (G, ·). Itfollows that the congruence is an equivalence relation.

Proof. To prove the equivalence we need to prove reflexivity, symmetry and transi-tivity.

1. Within H there exists the neutral element e such that x = e · x ⇒ x ∼ x. Hence,the congruence relation is reflexive.

2. If ∃h ∈ H such that y = h · x, then for the definition of group the inverse elementh−1 ∈H also exists. Hence, we can write x = h−1 ·y⇒ x = h ·y⇒ y∼ x. Hence,the congruence relation is symmetric.

3. if x∼ y, then there exists a value h1 such that y = h1 ·x. if y∼ z, then there existsa value h2 such that z = h2 ·y. Hence, z = h1 ·h2 ·x. We know, since H is a group,that k = h1 ·h2 ∈H. Hence ∃k ∈H such that z = k · x, which means x∼ z. Hencethe congruence relation is transitive.

It follows that the congruence relation is an equivalence. ��

Example 7.34. Let us consider again the group (Z,+), its subgroup (Z5,+) and thecongruence relation x∼ y. We can verify that the congruence is

• reflexive since ∃h ∈ Z5 such that x = h+ x that is h = 0• symmetric since if ∃h ∈ Z5 such that y = h+ x then we may write x = −h+ y

with −h ∈ Z5• transitive since if ∃h ∈ Z5 such that y = h+x and ∃k ∈ Z5 such that z = k+y we

can substitute and obtainz = k+h+ x

with (k+h) ∈ Z5.

Thus, the congruence relation is an equivalence relation.

7.3.3 Lagrange’s Theorem

Let us consider a group (G, ·) and its subgroup (H, ·). If we fix an element g ∈G thecongruence relation∼ identifies the equivalence class (all the elements of G that arecongruent with g)

[g] = {x ∈ G|x∼ g}= {x ∈ G|∃h ∈ H|x = h ·g}= {h ·g ∈ G|h ∈ H}

that is the definition of (right) coset of H in G, i.e. [g] = Hg.

Example 7.35. Let us consider again the group (Z,+) and its subgroup (Z5,+). Letus arbitrarily select an element from Z, for example g= 52. The equivalence class [g]associated with the congruence relation would contain e.g.−3,2,7,12,17, . . .52,57 . . ..

Page 283: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.3 Groups and Subgroups 267

The equivalence class [g] would also be the coset Hg built up by adding 52 to all theelements of Z5.

In other words, a coset is an equivalence class associated with the congruencerelation. In this light, let us revisit the previous results in the context of group theoryby stating the following lemmas. More specifically, by applying Theorem 7.1, fromthe fact that congruence is an equivalence relation the following lemmas immedi-ately follow.

Lemma 7.1. Let (G, ·) be a group and (H, ·) its subgroup. Two right (left) cosets ofH in G either coincide or are disjoint.

Proof. Since two cosets are two equivalence classes of G, for Theorem 7.1, theyeither coincide or they are disjoint. ��

Lemma 7.2. Let (G, ·) be a group and (H, ·) its subgroup. The set G is equal to theunion of all the right (left) cosets:

G = ∪ni=1Hgi.

Proof. Since the cosets are equivalence classes of G, for Theorem 7.1, their unionis G. ��

Example 7.36. Let us consider again the group (Z12,+12) and its subgroup (H,+12)where H = {0,2,4,6,8,10}.

We know that two cosets can be generated

H +0 = {0,2,4,6,8,10}H +1 = {1,3,5,7,9,11}

We can easily see that these two cosets are disjoint and their union is Z12.

Definition 7.21. Let (A,∗) an algebraic structure. The order of an algebraic struc-ture is the cardinality of the set A associated with it and is indicated with |A|.

Definition 7.22. The algebraic structure (A,∗) is finite if its order is finite.

For simplicity of the notation, let us indicate here with |Hg| the cardinality of acoset (which is a set and not an algebraic structure).

Lemma 7.3. Let (G, ·) be a finite group and (H, ·) its subgroup. The cardinality ofevery right (left) coset Hg of H in G is equal to the order of (H, ·):

∀ j : |Hg j|= |H|.

Proof. Let us consider the subgroup (H, ·). Since (G, ·) is finite and H ⊂ G thenalso (H, ·) is finite. Thus, the set H has finite cardinality. Let us indicate with n thecardinality of H, i.e. |H|= n, and

H = {h1,h2, . . . ,hn}.

Page 284: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

268 7 An Overview on Algebraic Structures

Let Hg be one of the right cosets of H in G:

Hg = {h1 ·g,h2 ·g, . . . ,hn ·g}.

Let us define a function φ : H → Hg:

φ (h) = h ·g.

Let us consider two values h1 and h2 ∈H, such that h1 �= h2. The values taken bythe function φ (h) in h1 and h2 are

φ (h1) = h1 ·gφ (h2) = h2 ·g,

respectively. Since h1 �= h2, it follows that

h1 ·g ·g−1 �= h2 ·g ·g−1.

For the cancellation law, it follows that

h1 ·g �= h2 ·g,

which means that φ (h) is an injective function.Let us consider a generic y element of the coset, i.e. y ∈ Hg. Thus,

y ∈ {h1 ·g,h2 ·g, . . . ,hn ·g}.

This means that ∃ j such that y = h j ·g or, equivalently,

∃h ∈ H such that y = h ·g,

that is∃h ∈ H such that y = φ (h) .

This means that the function is φ (h) is also surjective.Since both injection and surjection properties are verified, it follows that φ is

bijective. Thus, for Proposition 1.4, the cardinality of H is equal to the cardinalityof the right coset Hg. This statement can be rephrased as the cardinality of a rightcoset of H in G is equal to the order of (H, ·). ��

The proof for a left coset is analogous.

Example 7.37. By using the same numbers of Example 7.36, we can immediatelysee that the cardinality of H as well as the cardinality of each coset is 6.

Theorem 7.2. Lagrange’s Theorem. Let (G, ·) be a finite group and (H, ·) its sub-group. Then, the order of H divides the order of G, i.e. the ratio of the cardinality of

Page 285: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.4 Rings 269

G by the cardinality of H is an integer number:

|G||H| = k

with k ∈ N and k �= 0.

Proof. Let Hg1,Hg2, . . . ,Hgk be all the right cosets of H in G. From Lemma 7.2, itfollows that

G = Hg1∪Hg2∪ . . .∪Hgk

and, for Lemma 7.1, the sets composing this union are disjoint. Since they are dis-joint we can write that the cardinality of G is equal to the sum of the cardinalities ofeach coset:

|G|= |Hg1|+ |Hg2|+ . . .+ |Hgk| .For the Lemma 7.3, the cardinality of each coset is equal to the cardinality of the

corresponding subgroup. Hence,

|G|= k |H| ⇒ |G||H| = k.��

Example 7.38. Let us consider again the group (Z12,+12) and its subgroup (H,+12)where H = {0,2,4,6,8,10}. We know that we have two cosets of cardinality 6 thatis also the cardinality of H. The cardinality of Z12 is 12. The Lagrange’s Theoremis hence verified since

|G||H| =

126

= 2

is an integer number.

7.4 Rings

As we know from Chap. 1 a ring is a set equipped with two operators. For conve-nience, let us report again Definition 1.34.

Definition 7.23. Ring. A ring R is a set equipped with two operations called sumand product. The sum is indicated with a + sign while the product operator is simplyomitted (the product of x1 by x2 is indicated as x1x2). The set R is closed with respectto these two operations and contains neutral elements with respect to both sum andproduct, indicated with 0R and 1R respectively. In addition, the following properties,namely axioms of a ring, must be valid.

• commutativity (sum): x1 + x2 = x2 + x1

• associativity (sum): (x1 + x2)+ x3 = x1 +(x2 + x3)• neutral element (sum): x+0R = x• inverse element (sum): ∀x ∈ R : ∃(−x) |x+(−x) = 0R

Page 286: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

270 7 An Overview on Algebraic Structures

• associativity (product): (x1x2)x3 = x1 (x2x3)• distributivity 1: x1 (x2 + x3) = x1x2 + x1x3

• distributivity 2: (x2 + x3)x1 = x2x1 + x3x1

• neutral element (product): x1R = 1Rx = x

Example 7.39. The algebraic structures (Z,+,), (Q,+,), (R,+,), and (C,+,) arerings.

Example 7.40. The algebraic structure (Rn,n,+,) composed of square matrices withsum and product is a ring. The neutral elements are the zero matrix for the sum andthe identity matrix for the product.

A few remarks can immediately be made on the basis only of the ring defini-tion. At first, a ring has two neutral elements. Then, commutativity is a requirementfor the sum but not for the product. The structure (Rn,n,+,) is a ring although theproduct is not commutative. Furthermore the existence of the inverse element withrespect to the product for all the elements of the set is also not a requirement. Hence,(Rn,n,+,) is a ring although square matrices are not always invertible.

Finally, a ring can be seen as the combination of a group (R,+) and a monoid(R,).

The latter observations constitute the theoretical foundation of the followingproposition.

Proposition 7.10. Let (R,+,) be a ring. The following properties are valid.

• there exists only one neutral element 0R with respect to the sum• for every element a ∈ R there exists only one element −a (this element is said

opposite element) such that a+(−a) = 0R

• cancellation law is valid with respect to the sum : a+b = c+b⇒ a = c• there exists only one neutral element 1R with respect to the product

Proof. Since (R,+) can be interpreted as a group, the first three statements are im-mediately proved by applying Proposition 7.1, Proposition 7.2, and Proposition 7.8,respectively.

Since (R,) can be interpreted as a monoid, for Proposition 7.1, the neutral ele-ment with respect to the second operator is unique. ��

Before entering into ring theory in greater details, let us convey that a− b =a+(−b).

Proposition 7.11. Let (R,+,) be a ring. It follows that ∀a ∈ R

a0R = 0Ra = 0R

Proof. If c = a0R then for distributivity a(0R +0R) = a0R + a0R = c+ c. Hencec = c+ c. Considering that it is always true that if the same quantity is added andsubtracted the result stays unvaried: c = c+ c− c, we can write

c = c+ c− c = c− c = 0R.

Page 287: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.4 Rings 271

Hence, the result of a0R is always 0R. ��

Proposition 7.12. Let (R,+,) be a ring. It follows that ∀a,b ∈ R

a(−b) =−(ab)

Proof. Let us directly check the result of the operation a(−b)+ab:

a(−b)+ab = a(−b+b) = a0R = 0R.��

Analogously it can be checked that (−a)b =−(ab).By using this proposition the following two corollaries can be easily proved.

Corollary 7.1. Let (R,+,) be a ring. It follows that ∀a ∈ R

a(−1R) = (−1R)a =−a.

Corollary 7.2. Let (R,+,) be a ring. It follows that

(−1R)(−1R) = 1R.

Proposition 7.13. Let (R,+,) be a ring. It follows that ∀a,b ∈ R

(−a)(−b) = ab.

Proof.

(−a)(−b) = a(−1R)b(−1R) = a(−1R)(−1R)b = a1Rb = ab.��

Definition 7.24. Let (R,+,) be a ring. If 0R = 1R the ring is said to be degenerate.

Example 7.41. Let us consider again the set Z12 where

Z12 = {0,1,2,3,4,5,6,7,8,9,10,11}

and the cyclic sum +12. We can also introduce another cyclic sum but with a differ-ent cycle, e.g. +6. For example, 4+6 2 = 0.

The algebraic structure (Z12,+12,+6) is a degenerate ring since 0 would be theneutral element with respect to both the operators.

Definition 7.25. Let (R,+,) be a ring and a,b ∈ R. The ring is said to be commuta-tive when ab = ba.

Example 7.42. Some examples of commutative rings are (Z,+,), (Q,+,), and(R,+,) while (Rn,n,+,) is not a commutative ring.

Example 7.43. Let us indicate with RR be a set of all the possible functions defined

on R and having codomain R. It can be verified by checking the ring axioms, thatthe algebraic structure

(RR,+,

)is a commutative ring and 0R = 0 and 1R = 1.

Page 288: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

272 7 An Overview on Algebraic Structures

Example 7.44. Let X be a nonempty set and P(X) be its power set. It can be provedthat the algebraic structure (P(X) ,Δ ,∩) where Δ is the symmetric difference is acommutative ring. This special structure is called Boolean Ring and constitutes thetheoretical foundation of Boolean Algebra, see Appendix A.

Definition 7.26. Let (R,+,) be a ring and a ∈ R. The nth power of a is the productof a calculated n times:

an = aaaa . . .aaaa.

Proposition 7.14. Let (R,+,) be a ring, a ∈ R, and n,m ∈ N. It follows that

• an+m = anam

• anm = (an)m.

In general, if (R,+,) is a ring and a ∈ R, it is not true that (ab)n = anbn. Thelatter equation is valid only if the ring is commutative.

Proposition 7.15. et (R,+,) be a commutative ring and a,b ∈ R. It follows that(ab)n = anbn.

Proof. Let us consider (ab)n. From the definition of power it follows that

(ab)n = ababababababab . . .

where the term ab appears n times.Since the ring is commutative we can re-write this equation as

(ab)n = abbaabbaabbaab . . .= ab2a2b2a2b2a2b . . . .

By iteratively applying commutativity and the definition of power we obtain

(ab)n = abn−1an−1b = anbn.��

For commutative rings the following theorem is also valid.

Theorem 7.3. Newton’s Binomial. Let (R,+,) be a commutative ring and a,b∈ R.It occurs that ∀n ∈ N

(a+b)n =n

∑i=0

(ni

)an−ibi

where

(ni

)is said binomial coefficient and defined as

(ni

)=

n!i!(n− i)!

with the initial/boundary condition that(

n0

)=

(nn

)= 1.

Page 289: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.4 Rings 273

Example 7.45. Newton’s binomial is a powerful formula that allows to represent abinomial of any power as a sum of monomials. For example the square of a binomial(a+b)2 can be written as

(a+b)2 =

(20

)a2b0 +

(21

)a1b1 +

(22

)a0b2 =

22

a2 +21

ab+22

b2

that is the formula of the square of a binomial a2 +b2 +2ab.

Definition 7.27. Let (R,+,) be a ring and S⊂ R with S �= /0. If (S,+,) is a ring then(S,+,) is said subring.

Example 7.46. It can be observed that (Z,+,) is a subring of (Q,+,) that is a sub-ring of (R,+,) that is a subring of (C,+,).

7.4.1 Cancellation Law for Rings

Proposition 7.10 states the validity of the cancellation law with respect to the sum.However, the properties of rings do not contain any statement about cancellationlaw with respect to the product. The reason is that, in general, the cancellation lawof the product is not valid.

Example 7.47. If (R,+,) and a,b,c ∈ R, the cancellation law of the product wouldbe

ab = ac⇒ b = c.

Let us consider the ring (R2,2,+,) of the square matrices of size 2 and let us pose

a =

(0 10 1

),

b =

(0 10 1

),

and

c =

(1 00 1

).

It results that

ab =

(0 10 1

)= ac

and still b �= c.

The cancellation law can be not valid also in the case of commutative rings.

Page 290: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

274 7 An Overview on Algebraic Structures

Example 7.48. Let us consider the ring of real functions(RR,+,

)and two functions

belonging to RR:

f (x) =

{x if x≥ 0

0 if x≤ 0

and

g(x) =

{x if x≤ 0

0 if x≥ 0.

If we now pose a = 0, b = f (x), and c = g(x) and calculate

ca = 0 = cb

while a �= b.

The latter example suggests that there is a relation between the cancellation law(more specifically its failure) and the fact that the product of two elements differentfrom the neutral element is null, i.e. 0R.

Definition 7.28. Let (R,+,) be a ring and a ∈ R such that a �= 0R. The element a issaid zero divisor if there exists an element b ∈ R with b �= 0R such that

ab = 0R.

In other words, if a ring contains zero divisors then the cancellation law of theproduct is not valid.

Example 7.49. Let us consider the ring (R2,2,+,) and the matrices

a =

(0 10 5

)

and

b =

(7 100 0

).

Obviously, neither a nor b are the null matrix. When we multiply a by b weobtain

ab =

(0 00 0

).

This means that although a �= 0R and b �= 0R still it happens that ab = 0R. Hence,we can conclude that (R2,2,+,) and b is a zero divisor of a.

A ring without zero divisors is a special ring formally introduced in the followingdefinition.

Definition 7.29. A commutative ring which does not contain any zero divisor is saidintegral domain.

Page 291: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.4 Rings 275

Proposition 7.16. Let (R,+,) be an integral domain. Then it occurs that the can-cellation law is valid, i.e. for all a,b,c ∈ R with c �= 0R

ac = bc⇒ a = b.

Proof. Let us consider three elements a,b,c ∈ R with c �= 0R such that ac = bc. Itfollows that

ac = bc⇒ (ac−bc) = 0R ⇒ (a−b)c = 0R.

Since (R,+,) is an integral domain (hence without zero divisors) and c �= 0R itfollows that necessarily (a−b) = 0R. This fact means that

a = b. ��

7.4.2 Fields

Definition 7.30. Let (R,+,) be a ring and a ∈ R. The element a is said to be in-vertible if there exists and element b ∈ R such that ab = 1R. The element b is saidinverse of the element a.

Proposition 7.17. Let (R,+,) be a ring and a ∈ R. The inverse element of a, whenit exists, is unique.

Proof. Let us assume, by contradiction, that a has two inverse elements and b,c areboth inverse elements of a. It follows that

b = b1R = b(ac) = (ba)c = 1Rc = c. ��

Example 7.50. The only invertible elements of the ring (Z,+,) are −1 and 1.

Example 7.51. The invertible elements of the ring (Rn,n,+,) are those square matri-ces of order n that are non-singular.

Example 7.52. In the case of the ring (Q,+,), all the elements of Q except 0 can beexpressed as a fraction. Therefore, all its elements are invertible.

Definition 7.31. A commutative ring (F,+,) such that all the elements of F exceptthe neutral element with respect to the sum 0F are invertible is said field.

In other words, a field can be seen as the combination of two groups (with oneexception about 0F ).

Example 7.53. From the previous example we can easily state that (Q,+,) is a field.Also (R,+,) and (C,+,) are fields.

Proposition 7.18. Every field is an integral domain.

Page 292: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

276 7 An Overview on Algebraic Structures

Proof. Let (F,+,) be a field and a ∈ F with a �= 0F . By definition, an integraldomain is a commutative ring that does not contain zero divisors. Let us considera generic element b ∈ F such that ab = 0F . Since in fields all the elements areinvertible a is also invertible and a−1a = 1F . It follows that

b = 1F b =(a−1a

)b = a−1 (ab) = a−10F = 0F .

Hence, since b = 0F , b is not a zero divisor of a. This means that there are nozero divisors. ��

The concept of field is the arrival point of this excursus on algebraic structuresand the basic instrument to introduce the topics of the following chapters.

7.5 Homomorphisms and Isomorphisms

Subsequent to this basic introduction to group and ring theories, this section showshow a mapping can be defined over algebraic structures. In particular, this sectionfocuses on a specific class of mappings that has interesting properties and practicalimplications.

Definition 7.32. Let (G, ·) and (G′,∗) be two groups. A mapping φ : G → G′ suchthat for all x,y ∈ G it follows that

φ (x · y) = φ (x)∗φ (y)

is said group homomorphism from G to G′ (or from (G, ·) to (G′,∗)).

Example 7.54. Let us consider the groups (Z,+) and (2Z,+) where 2Z is the set ofinteger even numbers. The mapping φ : Z→ 2Z defined as

φ (x) = 2x.

Let us show that this mapping is an homomorphism:

φ (x · y) = φ (x+ y) = 2(x+ y) = 2x+2y = φ (x)+φ (y) = φ (x)∗φ (y) .

In a similar way, the concepts of the other algebraic structures endowed withan operator can be defined, e.g. semigroup homomorphism and monoid homomor-phism. Regarding algebraic structures endowed with two operators, a separate defi-nition must be given.

Definition 7.33. Let (R,+,) and (R′,⊕,∗) be two rings. A mapping f : R→ R′ suchthat for all x,y ∈ R it follows that

• f (x+ y) = f (x)⊕ f (y)• f (xy) = f (x)∗ f (y)

Page 293: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.5 Homomorphisms and Isomorphisms 277

• f (1R) = 1R′

is said ring homomorphism from R to R′ (or from (R,+,) to (R′,⊕,∗)).Homomorphism, from ancient Greek “omos” and “morphé”, literally means “the

same form”. An homomorphism is a transformation that preserves the structure be-tween two algebraic structures. Let us better clarify this fact by means of the fol-lowing example.

Example 7.55. Let us consider the rings (R,+,) and (R2,2,+,). The mapping φ :R→ R2,2 defined as

φ (x) =

(x 00 x

)

where x ∈ R is an homomorphism. This fact is very easy to verify in this case. Letus check that φ (x+ y) = φ (x)+φ (y):

φ (x+ y) =

(x+ y 0

0 x+ y

)=

(x 00 x

)+

(y 00 y

)= φ (x)+φ (y) .

Let us now check that φ (xy) = φ (x)φ (y):

φ (xy) =

(xy 00 xy

)=

(x 00 x

)(y 00 y

)= φ (x)φ (y) .

Finally, considering that 1R = 1,

φ (1) =

(1 00 1

)= 1R2,2 .

In other words, the main feature of an homomorphism is a mapping that trans-forms a group into a group, a ring into a ring etc. However, there is no requirementfor an homomorphism to be a bijection. Intuitively, we may think of an homomor-phism as a transformation defined over the elements of an algebraic structure A thathas a results elements of another algebraic structure B. In general, we cannot obtainstarting from the algebraic structure B the elements of A. Let us see the followingexample.

Example 7.56. Let us consider the groups(R

3,+)

and(R

2,+)

and the mappingφ : R3 → R

2

φ (x) = φ (x,y,z) = (x,y) .

It can be easily shown that this mapping is an homomorphism. If we considertwo vectors x1 = (x1,y1,z1) and x2 = (x2,y2,z2) it follows that

φ (x1 +x2) = (x1 + x2,y1 + y2) = (x1,y1)+(x2,y2) = φ (x1)+φ (x2) .

Hence, this mapping is an homomorphism. On the other hand, if we start from avector (x,y) it is impossible to find the vector (x,y,z) that generated it. For example

Page 294: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

278 7 An Overview on Algebraic Structures

if we consider the vector (1,1) we cannot detect the point in R3 that generated it

because it could be (1,1,1), (1,1,2), (1,1,8), (1,1,3.56723) etc. More formally,this mapping is not injective. Hence, this mapping is not bijective.

The case of a bijective homomorphism is special and undergoes a separate defi-nition.

Definition 7.34. A bijective homomorphism is said isomorphism.

An intuitive way to describe isomorphisms is by means of the following quote ofthe mathematician Douglas Hofstadter:

The word ‘isomorphism’ applies when two complex structures can be mapped onto eachother, in such a way that to each part of one structure there is a corresponding part in theother structure, where ‘corresponding’ means that the two parts play similar roles in theirrespective structures.

If an isomorphism holds between two algebraic structures, then these algebraicstructures are said isomorphic. Isomorphism is an extremely important concept inmathematics and is a precious help in problem solving. When a problem is very hardto be solved in its domain (its algebraic structure), the problem can be transformedinto and isomorphic one and solved within the isomorphic algebraic structure. Thesolution in the isomorphic domain is then antitransformed to the original problemdomain.

An extensive example of isomorphism is presented in Chap. 12 within the contextof graph theory. The following examples give an idea of what an isomorphism is andhow it can be the theoretical foundation of several computational techniques.

Example 7.57. Let us consider the groups (N,+) and(10N,

)where 10N is the set

of the powers of 10 with natural exponent. The mapping φ : N→ 10N is

φ (x) = 10x.

Let us show that the mapping is an homomorphism:

φ (x+ y) = 10x+y = 10x10y = φ (x)φ (y) .

In order to verify that this homomorphism is an isomorphism let us show thatthis mapping is an injection and a surjection. It is an injection since if x1 �= x2 then10x1 �= 10x2 . It is a surjection since every positive number can be expressed as 10x.Hence, this mapping is an isomorphism.

Example 7.58. Let us indicate with R+ the set of positive real numbers. Let us con-

sider the groups (R+,) and (R,+) and the mapping f : R+ → R, f (x) = log(x)where log is the logarithm, see [18]. This mapping is an homomorphism since

f (xy) = log(xy) = log(x)+ log(y) = f (x)+ f (y) .

Page 295: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

7.5 Homomorphisms and Isomorphisms 279

The mapping is an isomorphism because it is injective as if x1 �= x2 thenlog(x1) �= log(x2) and it is surjective as every real number can be expressed as alogarithm of a (positive) number:

∀t ∈ R∃x ∈ R+� ‘ t = log(x) .

Obviously, it can be remarked that there is a relation between the fact that an ho-momorphism is an isomorphism and that the mapping is invertible. If we think aboutthe words, the prefix iso- is stronger than the prefix homo-. While ‘homo’ means‘same’, i.e. of the same kind, the word ‘iso’ means ‘identical’. In this light, whilean homomorphism transforms an algebraic structure into a structure of the samekind, an isomorphism transforms an algebraic structure into a structurally identicalalgebraic structure. For this reason, the latter unlike the first is also reversible.

Example 7.59. The Laplace Transform is an isomorphism between differential equa-tions and complex algebraic equations, see [19].

Exercises

7.1. Considering the set A = {0,1,2,4,6} verify whether or not (A,+) is an alge-braic structure, semigroup, monoid, or group.

7.2. Considering the set of the square matrices Rn,n and the product of matrices·, verify whether or not (Rn,n, ·) is an algebraic structure, semigroup, monoid, orgroup.

7.3. Let Z8 be {0,1,2,3,4,5,6,7} and +8 be the cyclic sum with cyclic sum definedas:

a+8 b = a+b if(a+b)≤ 7;∀a,b ∈ Z8

a+8 b = a+b−8 if(a+b)> 7;∀a,b ∈ Z8.

Determine whether or not (H,+8) with H = {0,2,4,6} is a subgroup. Representthe cosets and verify the Lagrange’s Theorem in the present case.

7.4. Let (Q,∗) be an algebraic structure where the operator ∗ is defined as

a∗b = a+5b.

Verify whether or not (Q,∗) is a monoid and identify, if they exist, its inverseelements. If the structure is a monoid verify whether or not this monoid is a group.

7.5. Let us consider the groups (R,+) and (R+,). Verify whether or not the mappingf : R→ R

+, f (x) = ex is an homomorphism and an isomorphism.

Page 296: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 8Vector Spaces

8.1 Basic Concepts

This chapter revisits the concept of vector bringing it to an abstract level. Through-out this chapter, for analogy we will refer to vectors using the same notation as fornumeric vectors.

Definition 8.1. Vector Space. Let E to be a non-null set (E �= /0) and K to be ascalar set (in this chapter and in Chap. 10 we will refer with K to either the set ofreal numbers R or the set of complex numbers C). Let us name vectors the elementsof the set E. Let “+” be an internal composition law, E ×E → E. Let “·” be anexternal composition law, K×E → E. The triple (E,+, ·) is said vector space of thevector set E over the scalar field (K,+,) if and only if the following ten axioms,namely vector space axioms are verified. As in the case of the product of a scalar bya vector, see Chap. 4, the symbol of external composition law · will be omitted.

• E is closed with respect to the internal composition law: ∀u,v ∈ E : u+v ∈ E• E is closed with respect to the external composition law: ∀u ∈ E and ∀λ ∈ K :

λu ∈ E• commutativity for the internal composition law: ∀u,v ∈ E : u+v = v+u• associativity for the internal composition law: ∀u,v,w ∈ E ×E : u+(v+w) =

(u+v)+w• neutral element for the internal composition law: ∀u ∈ E : ∃!o ∈ E|u+o = u• opposite element for the internal composition law: ∀u∈E : ∃!−u∈E|u+−u= o• associativity for the external composition law: ∀u ∈ E and ∀λ ,μ ∈K : λ (μu) =

(λ μ)u = λ μu• distributivity 1: ∀u,v ∈ E and ∀λ ∈K : λ (u+v) = λu+λv• distributivity 2: ∀u ∈ E and ∀λ ,μ ∈K : (λ +μ)u = λu+λu• neutral elements for the external composition law: ∀u ∈ E : ∃!1 ∈K|1u = u

where o is the null vector.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_8

281

Page 297: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

282 8 Vector Spaces

In order to simplify the notation, in this chapter and in Chap. 10, with K we willrefer to the scalar field (K,+,).

Example 8.1. The following triples are vector spaces.

• The set of geometric vector V3, the sum between vectors and the product of ascalar by a geometric vector, (V3,+,).

• The set of matrices Rm,n, the sum between matrices and the product of a scalarby a matrix, (Rm,n,+,).

• The set of numeric vectors Rn with n ∈ N, the sum between vectors and the

product of a scalar by a numeric vector, (Rn,+,). In the latter case if n = 1, theset of numeric vectors is the set of real numbers, which still is a vector space.

Thus, numeric vectors with sum and product is a vector space but a vector spacesis a general (abstract) concept that deals with the sets and composition laws thatrespect the above-mentioned ten axioms.

8.2 Vector Subspaces

Definition 8.2. Vector Subspace. Let (E,+, ·) be a vector space, U ⊂E, and U �= /0.The triple (U,+, ·) is a vector subspace of (E,+, ·) if (U,+, ·) is a vector space overthe same field K with respect to both the composition laws.

Proposition 8.1. Let (E,+, ·) be a vector space, U ⊂ E, and U �= /0. The triple(U,+, ·) is a vector subspace of (E,+, ·) if and only if U is closed with respectto both the composition laws + and ·, i.e.

• ∀u,v ∈U : u+v ∈U• ∀λ ∈K and ∀u ∈U : λu ∈U.

Proof. Since the elements of U are also elements of E, they are vectors that sat-isfy the eight axioms regarding internal and external composition laws. If U is alsoclosed with respect to the composition laws then (U,+, ·) is a vector space and sinceU ⊂ E, U is vector subspace of (E,+, ·). ��

If (U,+, ·) is a vector subspace of (E,+, ·), then it is a vector space. Thus, the tenaxioms, including the closure with respect of the composition laws, are valid. ��

Proposition 8.2. Let (E,+, ·) be a vector space over a field K. Every vector sub-space (U,+, ·) of (E,+, ·) contains the null vector.

Proof. Considering that 0 ∈ K, it follows that ∀u ∈U : ∃λ |λu = o. Since (U,+, ·)is a vector subspace, the set U is closed with respect to the external compositionlaw, o ∈U . ��

Proposition 8.3. For every vector space (E,+, ·), at least two vector subspaces ex-ist, i.e. (E,+, ·) and ({o},+, ·).

Page 298: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.2 Vector Subspaces 283

Example 8.2. Let us consider the vector space(R

3,+, ·)

and its subset U ⊂ R3:

U = {(x,y,z) ∈ R3|3x+4y−5z = 0}

and let us prove that (U,+, ·) is a vector subspace of(R

3,+, ·).

We have to prove the closure with respect to the two composition laws.

1. Let us consider two arbitrary vectors belonging to U , u1 = (x1,y1,z1) and u2 =(x2,y2,z2). These two vectors are such that

3x1 +4y1−5z1 = 0

3x2 +4y2−5z2 = 0.

Let us calculateu1 +u2 = (x1 + x2,y1 + y2,z1 + z2) .

In correspondence to the vector u1 +u2,

3(x1 + x2)+4(y1 + y2)−5(z1 + z2) =

= 3x1 +4y1−5z1 +3x2 +4y2−5z2 = 0+0 = 0.

This means that ∀u1,u2 ∈U : u1 +u2 ∈U .2. Let us consider an arbitrary vector u = (x,y,z)∈U and an arbitrary scalar λ ∈R.

We know that 3x+4y−5z = 0. Let us calculate

λu = (λx,λy,λ z) .

In correspondence to the vector λu,

3λx+4λy−5λ z =

= λ (3x+4y−5z) = λ0 = 0.

This means that ∀λ ∈K and ∀u ∈U : λu ∈U .Thus, we proved that (U,+, ·) is a vector subspace

(R

3,+, ·).

Example 8.3. Let us consider the vector space(R

3,+, ·)

and its subset U ⊂ R3:

U = {(x,y,z) ∈ R3|8x+12y−7z+1 = 0}.

Since the null vector o �∈U , (U,+, ·) is not a vector space.Although it is not necessary, let us check that the set U is not closed with re-

spect to the internal composition law. In order to do this, let us consider two vectors(x1,y1,z1) and (x2,y2,z2). The sum vector (x1 + x2,y1 + y2,z1 + z2) is

8(x1 + x2)+4(y1 + y2)−5(z1 + z2)+1 =

= 8x1 +4y1−5z1 +8x2 +4y2−5z2 +1.

Page 299: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

284 8 Vector Spaces

If we consider that 8x2 + 4y2− 5z2 + 1 = 0 it follows that 8x1 + 4y1− 5z1 �= 0.Hence,

8(x1 + x2)+4(y1 + y2)−5(z1 + z2)+1 �= 0.

This means that (x1 + x2,y1 + y2,z1 + z2) /∈U . The set U is not closed with re-spect to the internal composition law.

Analogously, if (x,y,z) ∈U , then (λx,λy,λ z), with lambda scalar, is

8(λx)+4(λy)−5(λ z)+1

which in general is not equal to zero. Hence, (λx,λy,λ z) /∈U .

Vector spaces are a general concept which applies not only to numeric vectors.

Example 8.4. Let us consider the set F of the real-valued functions continuous onan interval [a,b]. We can show that the triple (F ,+, ·) is a vector space over the realfield R.

We need to show the closure with respect to the two composition laws. For thisaim, let us consider two continuous functions f (x) ,g(x) ∈F .

Considering that the sum of two continuous functions

f (x)+g(x)

is a continuous function, the set is closed with respect to the internal compositionlaw.

Since ∀λ ∈ R it follows thatλ f (x)

is also continuous, the set is closed also with respect to the external compositionlaw.

Thus, (F ,+, ·) is a vector space.

Theorem 8.1. Let (E,+, ·) be a vector space. If (U,+, ·) and (V,+, ·) are two vectorsubspaces of (E,+, ·), then (U ∩V,+, ·) is a vector subspace of (E,+, ·).

Proof. For the Proposition 8.1 it would be enough to prove the closure of the setU ∩V with respect to the composition laws to prove that (U ∩V,+, ·) is a vectorsubspace of (E,+, ·).

1. Let u,v be two arbitrary vectors ∈U ∩V . If u ∈U ∩V then u ∈U and u ∈ V .Analogously, if v∈U∩V then v∈U and v∈V . Since both u,v∈U and (U,+, ·)is a vector space, then u+ v ∈U . Since u,v ∈ V and (V,+, ·) is a vector space,then u+ v ∈ V . It follows that u+ v belongs to both U and V , i.e. it belongs totheir intersection U ∩V . This means that U ∩V is closed with respect to the +operation.

Page 300: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.2 Vector Subspaces 285

2. Let u be an arbitrary vector ∈U ∩V and λ an arbitrary scalar ∈K. If u ∈U ∩Vthen u ∈ U and u ∈ V . Since (U,+, ·) is a vector space, then λu ∈ U . Since(V,+, ·) is a vector space, then λu ∈V . Thus, λu belongs to both U and V , i.e. itbelongs to their intersection U ∩V . This means that U ∩V is closed with respectto the · operation.Thus, since U ∩ V is closed with respect to both the composition laws,(U ∩V,+, ·) is a vector subspaces of (E,+, ·). ��

Corollary 8.1. Let (E,+, ·) be a vector space. If (U,+, ·) and (V,+, ·) are two vec-tor subspaces of (E,+, ·), then U ∩V is always a non-empty set as it contains atleast the null vector.

It must be observed than if (U,+, ·) and (V,+, ·) are two vector subspaces of(E,+, ·) their union is in general not a subspace of (E,+, ·). On the contrary, itcan be easily proved that (U ∪V,+, ·) is a vector subspace of (E,+, ·) if U ⊂ V orV ⊂U .

Example 8.5. Let us consider the vector space(R

2,+, ·)

and its subsets U ⊂R2 and

V ⊂ R2:

U = {(x,y) ∈ R2|−5x+ y = 0}

V = {(x,y) ∈ R2|3x+2y = 0}.

It can be easily shown that both (U,+, ·) and (V,+, ·) are vector subspaces of(R

2,+, ·). The intersection U ∩V is composed of those (x,y) values belonging to

both the sets, i.e. satisfying both the conditions above. This means that U ∩V iscomposed of those (x,y) values satisfying the following system of linear equations:

{−5x+ y = 0

3x+2y = 0.

This is an homogeneous system of linear equations which is determined (theincomplete matrix associated with the system is non-singular). Hence the only solu-tion is (0,0), that is the null vector o. A geometric interpretation of the system aboveis the intersection of two lines passing through the origin of a reference system andintersecting in it, that is the null vector. As stated by Theorem 8.1, (U ∩V,+, ·) isa vector subspace of

(R

2,+, ·). In this case, the vector subspace is the special one

({o},+, ·).

Example 8.6. Let us consider the vector space(R

2,+, ·)

and its subsets U ⊂R2 and

V ⊂ R2:

U = {(x,y) ∈ R2|x−5y = 0}

V = {(x,y) ∈ R2|3x+2y−2 = 0}.

It can be easily shown that while (U,+, ·) is a vector subspace of(R

2,+, ·),

(V,+, ·) is not a vector space. Regardless of this fact the intersection U ∩V can be

Page 301: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

286 8 Vector Spaces

still calculated and the set composed of those (x,y) values satisfying the followingsystem of linear equations: {

x−5y = 0

3x+2y = 2

that is(

1017 ,

217

). Since U ∩V does not contain the null vector, obviously (U ∩V,+, ·)

is a not vector space.

Example 8.7. Let us consider the vector space(R

2,+, ·)

and its subsets U ⊂R2 and

V ⊂ R2:

U = {(x,y) ∈ R2|−5x+ y = 0}

V = {(x,y) ∈ R2|−15x+3y = 0}.

It can be easily shown that both (U,+, ·) and (V,+, ·) are vector subspaces of(R

2,+, ·). The intersection U ∩V is composed of those (x,y) satisfying the follow-

ing system of linear equations:{−5x+ y = 0

−15x+3y = 0.

Since the system is homogeneous the system is compatible and at least the nullvector is its solution. By applying Rouchè-Capelli Theorem, since the rank is lowerthan the number of variables the system is undetermined, i.e. it has ∞ solutions. Thesystem can be interpreted as two overlapping lines. This means that all the points inU are also points of V and the two sets coincide U =V . Hence, U ∩V =U =V and(U ∩V,+, ·) is a vector subspace of

(R

2,+, ·).

Example 8.8. Let us consider the vector space(R

3,+, ·)

and its subsets U ⊂R2 and

V ⊂ R3:

U = {(x,y,z) ∈ R3|3x+ y+ z = 0}

V = {(x,y,z) ∈ R3|x− z = 0}.

It can be easily verified that both (U,+, ·) and (V,+, ·) are vector subspaces of(R

3,+, ·).

The intersection set U ∩V is given by{

3x+ y+ z = 0

x− z = 0.

This is an homogeneous system of two linear equations in three variables. Be-sides the null vector, by applying Rouchè-Capelli Theorem, since the rank of theassociated matrix is 2 and there are three variables, the system has ∞ solutions. Thesystem above can be interpreted as the intersection of two planes.

Page 302: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.2 Vector Subspaces 287

The second equations can be written as x= z. By substituting the second equationinto the first one, we obtain

4x+ y = 0⇒ y =−4x.

Hence, if we fix a value of x = a, a vector (a,−4a,a) satisfies the system oflinear equations. This means that the intersection set U ∩V contains ∞ elements andis given by:

U ∩V = {(a,−4a,a) |a ∈ R}.The resulting triple (U ∩V,+, ·), for Theorem 8.1, is a vector space.

Definition 8.3. Let (E,+, ·) be a vector space. Let (U,+, ·) and (V,+, ·) be twovector subspaces of (E,+, ·). The sum subset is a set S =U +V defined as

S =U +V = {w ∈ E|∃u ∈U,v ∈V |w = u+v}.

Theorem 8.2. Let (E,+, ·) be a vector space. If (U,+, ·) and (V,+, ·) are two vectorsubspaces of (E,+, ·), then (S =U +V,+, ·) is a vector subspace of (E,+, ·).

Proof. For the Proposition 8.1 it would be enough to prove the closure of the set Swith respect to the composition laws to prove that (S,+, ·) is a vector subspace of(E,+, ·).

1. Let w1,w2 be two arbitrary vectors belonging to S. From the definition of thesum subset we can write that

∃u1 ∈U and ∃v1 ∈V |w1 = u1 +v1

∃u2 ∈U and ∃v2 ∈V |w2 = u2 +v2.

The sum of w1 and w2 is equal to

w1 +w2 = u1 +v1 +u2 +v2 = (u1 +u2)+(v1 +v2) .

Since U and V are vector spaces, u1 +u2 ∈U and v1 +v2 ∈V .Thus, according to the definition of sum subset w1+w2 =(u1 +u2)+(v1 +v2)∈S.

2. Let w be an arbitrary vector∈ S and λ an arbitrary scalar∈K. From the definitionof sum set

S =U +V = {w ∈ E|∃u ∈U,v ∈V |w = u+v}.If we compute the product of λ by w, we obtain

λw = λ (u+v) = λu+λv

where, since U and V are vector spaces, λu ∈U and λv ∈ V . Thus λw = λu+λv ∈ S. ��

Page 303: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

288 8 Vector Spaces

The following figure illustrates the concept of sum set. The white circles repre-sent the vectors in the vector subspaces (U,+, ·) and (V,+, ·) while the black circlesare vectors belonging to the sum set S. It can be noticed that a vector w ∈ S can bethe sum of two (or more) different pairs of vectors, i.e. w = u1+v1 and w = u2+v2in figure. Furthermore, at least the null vector o belongs to both U and V and thus atleast o ∈U ∩V . Other vectors can also belong to the intersection.

E Sum Set

U

V

w = u1 +v1 = u2 +v2

u1u2

o

v1v2

Example 8.9. Let us consider the vector space(R

2,+, ·)

and its subsets U ⊂R2 and

V ⊂ R2:

U = {(x,y) ∈ R2|y = 0}

V = {(x,y) ∈ R2|x = 0}.

It can be easily proved that (U,+, ·) and (V,+, ·) are vector subspaces. The twosubsets can be rewritten as

U = {(a,0) |a ∈ R}V = {(0,b) |b ∈ R}.

The only intersection vector is the null vector, i.e. U ∩V = {o}. If we now cal-culate the sum subset S =U +V we obtain

S =U +V = {(a,b) |a,b ∈ R}

that coincides with the entire R2. For Theorem 8.2, (S,+, ·) is a vector subspace of(

R2,+, ·

). In this case the vector subspace is

(R

2,+, ·). The latter is obviously a

vector space.

Page 304: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.2 Vector Subspaces 289

Example 8.10. Let us consider the vector space(R

2,+, ·)

and its subsets U ⊂ R2

and V ⊂ R2:

U = {(x,y) ∈ R2|−2x+ y = 0}

V = {(x,y) ∈ R2|3x+ y = 0}.

The triples (U,+, ·) and (V,+, ·) are vector subspaces. The two subsets can berewritten as

U = {(a,2a) |a ∈ R}V = {(b,−3b) |b ∈ R}.

Also in this case U ∩V = {o}. Let us calculate the sum subset S =U +V :

S =U +V = {(a+b,2a−3b) |a,b ∈ R}.

For Theorem 8.2, (S,+, ·) is a vector subspace of(R

2,+, ·). Again, by vary-

ing (a,b) ∈ R2 the entire R

2 is generated. Hence again the sum vector subspace is(R

2,+, ·).

Example 8.11. Let us consider the vector space(R

3,+, ·)

and its subsets U ⊂ R3

and V ⊂ R3:

U = {(x,y,0) ∈ R3|x,y ∈ R}

V = {(x,0,z) ∈ R3|x,z ∈ R}.

The triples (U,+, ·) and (V,+, ·) are vector subspaces. The intersection of thetwo subspaces is U ∩V = {(x,0,0) ∈ R

3|x ∈ R}, i.e. it is not only the null vector.The sum is again the entire R

3.

Definition 8.4. Let (E,+, ·) be a vector space. Let (U,+, ·) and (V,+, ·) be twovector subspaces of (E,+, ·). If U ∩V = {o} the subset sum S =U +V is indicatedas S =U ⊕V and named subset direct sum.

The triple (S =U ⊕V,+, ·) is a vector subspace of (E,+, ·), as it is a special caseof (S,+, ·), and the subspaces (U,+, ·) and (V,+, ·) are said supplementary.

Theorem 8.3. Let (E,+, ·) be a vector space. Let (U,+, ·) and (V,+, ·) be two vec-tor subspaces of (E,+, ·). The sum vector subspace (U +V,+, ·) is a direct sumvector subspace (U ⊕V,+, ·) (U ∩V = {o}) if and only if

S =U +V = {w ∈ E|∃!u ∈U and ∃!v ∈V |w = u+v}.

Page 305: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

290 8 Vector Spaces

Proof. If S is a subset direct sum then U ∩V = {o}. By contradiction, let us assumethat ∃u1,u2 ∈U and ∃v1,v2 ∈V with u1 �= u2 and v1 �= v2 such that

{w = u1 +v1

w = u2 +v2.

Under this hypothesis,

o = u1 +v1−u2−v2 = (u1−u2)+(v1−v2) .

By rearranging this equation we have

(u1−u2) =−(v1−v2)

where

• (u1−u2) ∈ U and (v1−v2) ∈ V , respectively, since (U,+, ·) and (V,+, ·) aretwo vector spaces (and thus their sets are closed with respect to the internal com-position law)

• −(v1−v2) ∈V (for the axiom of the opposite element)• (u1−u2) ∈V and (v1−v2) ∈U because the vectors are identical

Thus, (u1−u2) ∈U ∩V and (v1−v2) ∈U ∩V .Since U ∩V = {o} we cannot have non-null vectors in the intersection set. Thus,

{(u1−u2) = o(v1−v2) = o

⇒{

u1 = u2

v1 = v2��

If S = {w ∈ E|∃!u ∈U and ∃!v ∈ V |w = u+ v} let us assume by contradictionthat U ∩V �= {o}. Thus

∃t ∈U ∩V

with t �= o.Since (U,+, ·) and (V,+, ·) are two vector subspaces of (E,+, ·), for the Theo-

rem 8.1 (U ∩V,+, ·) is a vector subspace of (E,+, ·).Since (U ∩V,+, ·) is a vector space, if t ∈U ∩V also −t ∈U ∩V .We may think that

t ∈U−t ∈V.

Since also (S,+, ·) is also a vectors space o ∈ S. Thus, we can express the nullvector o ∈ S as the sum of an element of U and an element of V (as in the definitionof sum set)

o = t+(−t) .

On the other hand, o can be also expressed as

o = o+o

Page 306: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.2 Vector Subspaces 291

where the first o is considered an element of U and the second o is considered anelement of V .

For hypothesis ∀w ∈ S : ∃!u ∈ U and ∃!v ∈ V |w = u+ v. We expressed o thatis an element of S as sum of two different pairs of vectors. This is a contradiction.Thus t must be equal to o and, in other words, U ∩V = o. ��

A graphical representation of the direct sum set is given in the following, everytime the intersection of U and V is composed only by the null vector then only oneelement of U and only one element of V can contribute to the sum.

E Direct Sum Set

U

V

w = u+v

u

o

v

Example 8.12. As shown above the sum associated with the sets

U = {(a,0) |a ∈ R}V = {(0,b) |b ∈ R}.

is a direct sum since U ∩V = {o}. The sum set is the entire R2 generates as

S =U +V = {(a,b) |a,b ∈ R}.

Obviously, there is only one way to obtain (a,b) from (a,0) and (0,b).On the contrary, for the sets

U = {(x,y,0) ∈ R3|x,y ∈ R}

V = {(x,0,z) ∈ R3|x,z ∈ R},

whose intersection is not only the null vector, each vector (a,b,c) can be obtainedin infinite ways. For example the if we consider the vector (1,2,3), we know that it

Page 307: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

292 8 Vector Spaces

can be expressed as(1,2,3) = (x1,y,0)+(x2,0,z)

which leads to the following system of linear equations:⎧⎪⎨

⎪⎩

x1 + x2 = 1

y = 2

z = 3.

This system has ∞ solutions depending on x1 and x2. This example can be in-terpreted as the intersection of two planes, which is a line (infinite points) passingthrough the origin of a reference system.

8.3 Linear Dependence in n Dimensions

Definition 8.5. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E andthe scalars λ1,λ2, . . . ,λn ∈K. The linear combination of the n vectors v1,v2, . . . ,vnby means of n scalars λ1,λ2, . . . ,λn is the vector λ1v1 +λ2v2 + . . .+λnvn.

Definition 8.6. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E.These vectors are said to be linearly dependent if the null vector o can be expressedas linear combination by means of the scalars λ1,λ2, . . . ,λn �= 0,0, . . . ,0.

Definition 8.7. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E.These vectors are said to be linearly independent if the null vector o can be ex-pressed as linear combination only by means of the scalars 0,0, . . . ,0.

Proposition 8.4. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E.The vectors v1,v2, . . . ,vn are linearly dependent if and only if at least one of themcan be expressed as linear combination of the others.

Proof. If the vectors are linearly dependent then

λ1,λ2, . . . ,λn �= 0,0, . . . ,0� ‘o = λ1v1 +λ2v2 + . . .+λnvn.

Let us assume that λn �= 0 and rearrange the expression

−λnvn = λ1v1 +λ2v2 + . . .+λn−1vn−1.

and

vn =−λ1

λnv1−

λ2

λnv2− . . .− λn−1

λnvn−1.��

Page 308: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.3 Linear Dependence in n Dimensions 293

If one vector can be expressed as a linear combination of the others (let us assumevn) then

vn = k1v1 + k2v2 + . . .+ kn−1vn−1.

We can rearrange the expression as

o = k1v1 + k2v2 + . . .+ kn−1vn−1−vn

that is the null vector expressed by the linear combination of scalars that are not allzeros, i.e.

k1,k2, . . . ,kn−1,−1 �= 0,0, . . .0. ��

Example 8.13. Let us consider the following vectors ∈ R3

v1 = (4,2,0)v2 = (1,1,1)v3 = (6,4,2) .

These vectors are linearly dependent since

(0,0,0) = (4,2,0)+2(1,1,1)− (6,4,2)

that is v3 as a linear combination of v1 and v2

(6,4,2) = (4,2,0)+2(1,1,1) .

Proposition 8.5. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E.

If v1 �= oIf v2 is not linear combination of v1If v3 is not linear combination of v1 and v2. . .If vn is not linear combination of v1,v2, . . . ,vn−1

It follows that v1,v2, . . . ,vn are linearly independent.

Proof. Let us assume, by contradiction that the vectors are linearly dependent, i.e.exists a n-tuple λ1,λ2, . . . ,λn �= 0,0 . . . ,0 such that o = λ1v1 +λ2v2 . . .+λnvn.

Under this hypothesis, we can guess that λn �= 0 and write

vn =−λ1

λnv1−

λ2

λnv2 + . . .− λn−1

λnvn−1.

Since one vector has been expressed as linear combination of the others wereached a contradiction. ��

Example 8.14. Linear dependence and independence properties seen for V3 inChap. 4 are generally valid and thus also in the context of vector spaces.

Page 309: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

294 8 Vector Spaces

Let us consider the following vectors ∈ R3:

v1 = (1,0,1)v2 = (1,1,1)v3 = (2,1,2) .

These vectors are linearly dependent since

o = λ1v1 +λ2v2 +λ3v3

with λ1,λ2,λ3 = 1,1,−1.In this case we can write

v3 = λ1v1 +λ2v2

with λ1,λ2 = 1,1.Let us consider now the following vectors

v1 = (1,0,1)v2 = (1,1,1)v3 = (0,0,2) .

There is no way to express any of these vectors as a linear combination of theother two. The vectors are linearly independent.

Theorem 8.4. Let (E,+, ·) be a vector space. Let the vectors v1,v2, . . . ,vn ∈ E. Ifthe n vectors are linearly dependent while n−1 are linearly independent, there is aunique way to express one vector as linear combination of the others:

∀vk ∈ E,∃!λ1,λ2, . . . ,λk−1,λk+1, . . . ,λn �= 0,0, . . . ,0� ‘vk = λ1v1 +λ2v2 + . . .+λk−1vk−1 +λk+1vk+1 + . . .+λnvn

Proof. Let us assume by contradiction that the linear combination is not unique:

• ∃λ1,λ2, . . . ,λk−1,λk+1, . . . ,λn �= 0,0, . . . ,0 such that

vk = λ1v1 +λ2v2 . . .+λk−1vk−1 +λk+1vk+1 + . . .+λnvn

• ∃μ1,μ2, . . . ,μk−1,μk+1, . . . ,μn �= 0,0, . . . ,0 such that

vk = μ1v1 +μ2v2 . . .+μk−1vk−1 +μk+1vk+1 + . . .+μnvn

where λ1,λ2, . . . ,λk−1,λk+1, . . . ,λn �= μ1,μ2, . . . ,μk−1,μk+1, . . . ,μn �= 0,0, . . . ,0|vk.Under this hypothesis, we can write that

o = (λ1−μ1)v1 +(λ2−μ2)v2 . . .+(λk−1−μk−1)vk−1 +(λk+1−μk−1)vk+1 +

+ . . .+(λn−μn)vn

Page 310: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.3 Linear Dependence in n Dimensions 295

Since the n−1 vectors are linearly independent

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

λ1−μ1 = 0

λ2−μ2 = 0

. . .

λk−1−μk−1 = 0

λk+1−μk+1 = 0

. . .

λn−μn = 0

⎧⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎩

λ1 = μ1

λ2 = μ2

. . .

λk−1 = μk−1

λk+1 = μk+1

. . .

λn = μn.

Thus, the linear combination is unique. ��

Example 8.15. Let us consider again the following linearly dependent vectors ∈ R3

v1 = (1,0,1)v2 = (1,1,1)v3 = (2,1,2) .

Any pair of them is linearly independent. Let us express �� as a linear combina-tion of the other two vectors. We write

(2,1,2) = λ1 (1,0,1)+λ2 (1,1,1)

which results into the system⎧⎪⎨

⎪⎩

λ1 +λ2 = 2

λ2 = 1

λ1 +λ2 = 2

which is determined and has only one solution, that is λ1,λ2 = 1,1.

Example 8.16. Let us consider the following vectors

v1 = (1,0,1)v2 = (1,1,1)v3 = (2,0,2) .

Since v3 = 2v1, the vectors are linearly dependent. If we try to express v2 as a linearcombination of v1 and v3 we obtain

(1,1,1) = λ1 (1,0,1)+λ2 (2,0,2)

which results into the system⎧⎪⎨

⎪⎩

λ1 +2λ2 = 1

0 = 1

λ1 +2λ2 = 1

Page 311: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

296 8 Vector Spaces

which is obviously impossible. This fact occurred since the remaining n−1 vectors,i.e. v1 and v3 were not linearly independent.

We can interpret geometrically this fact by considering v1 and v3 as parallelvectors while v2 has a different direction. We have attempted to express a vectoras the sum of two parallel vectors which is obviously impossible unless the threevectors are all parallel.

Proposition 8.6. Let (E,+, ·) be a vector space and v1,v2, . . . ,vn be its n vectors. Ifone of these vectors is equal to the null vector o, these vectors are linearly depen-dent.

Proof. Let us assume that vn = o and let us pose

o = λ1v1 +λ2v2 + . . .+λn−1vn−1 +λno.

Even if λ1,λ2, . . . ,λn−1 = 0,0, . . . ,0 the equality is verified for any scalar λn ∈K.Thus, the vectors are linearly dependent. ��

Example 8.17. Let us consider the following vectors

v1 = (0,0,3)v2 = (3,1,1)v3 = (0,0,0)

and pose(0,0,0) = λ1 (0,0,3)+λ2 (3,1,1)+λ3 (0,0,0) .

For example λ1,λ2,λ3 = 0,0,5 satisfies this equation.

8.4 Linear Span

Definition 8.8. Let (E,+, ·) be a vector space. The set containing the totality of allthe possibly linear combinations of the vectors v1,v2, . . . ,vn ∈ E by means of nscalars is named linear span (or simply span) and is indicated with L(v1,v2, . . . ,vn)⊂ E or synthetically with L:

L(v1,v2, . . . ,vn) = {λ1v1 +λ2v2 + . . .+λnvn|λ1,λ2, . . . ,λn ∈K}.

In the caseL(v1,v2, . . . ,vn) = E,

the vectors are said to span the set E or, equivalently, are said to span the vectorspace (E,+, ·).

Page 312: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.4 Linear Span 297

Example 8.18. The vectors v1 = (1,0) ;v2 = (0,2) ;vn = (1,1) span the entire R2

since any point (x,y) ∈ R2 can be generated from

λ1v1 +λ2v2 +λ3v3

withλ1,λ2,λ3 ∈ R.

Theorem 8.5. The span L(v1,v2, . . . ,vn) with the composition laws is a vector sub-space of (E,+, ·).

Proof. In order to prove that (L,+, ·) is a vector subspace, for Proposition 8.1, it isenough to prove the closure of L with respect to the composition laws.

1. Let u and w be two arbitrary distinct vectors ∈ L. Thus,

u = λ1v1 +λ2v2 + . . .+λnvn

w = μ1v1 +μ2v2 + . . .+μnvn.

Let us compute u+w,

u+w = λ1v1 +λ2v2 + . . .+λnvn +μ1v1 +μ2v2 + . . .+μnvn =

= (λ1 +μ1)v1 +(λ2 +μ2)v2 + . . .+(λn +μn)vn.

Hence u+w ∈ L.2. Let u be an arbitrary vector ∈ L and μ and arbitrary scalar ∈K. Thus,

u = λ1v1 +λ2v2 + . . .+λnvn.

Let us compute μu

μu = μ (λ1v1 +λ2v2 + . . .+λnvn) =

= μλ1v1 +μλ2v2 + . . .+μλnvn.

Hence, μu ∈ L. ��

Example 8.19. Let us consider the following vectors ∈ R3:

v1 = (1,0,1)v2 = (1,1,1)v3 = (0,1,1)v4 = (2,0,0) .

These vectors span R3 and

(L(v1,v2,v3,v4) ,+, ·)

is a vector space.

Page 313: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

298 8 Vector Spaces

Theorem 8.6. Let (L(v1,v2, . . . ,vn) ,+, ·) be a vector subspace of (E,+, ·). Let s ∈N with s < n. If s vectors v1,v2, . . . ,vs are linearly independent while each of theremaining n− s vectors is linear combination of the linearly independent s vectors,then L(v1,v2, . . . ,vn) = L(v1,v2, . . . ,vs) (the two spans coincide).

Proof. Without a generality loss, let us assume that the first s vectors in the vectorsubspace L(v1,v2, . . . ,vn) are linearly independent. For hypothesis, we can expressthe remaining vectors as linear combinations of the first s vectors.

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

vs+1 = hs+1,1v1 +hs+1,2v2 + . . .+hs+1,svs

vs+2 = hs+2,1v1 +hs+2,2v2 + . . .+hs+2,svs

. . .

vn = hn,1v1 +hn,2v2 + . . .+hn,svs

For the definition 8.8 ∀v ∈ L(v1,v2, . . . ,vn) :

v = λ1v1 +λ2v2 + . . .+λsvs +λs+1vs+1 + . . .+λnvn =

= λ1v1 +λ2v2 + . . .+λsvs +

+λs+1 (hs+1,1v1 +hs+1,2v2 + . . .+hs+1,svs)+ . . .

+λn (hn,1v1 +hn,2v2 + . . .+hn,svs) =

= (λ1 +λs+1hs+1,1 + . . .+λnhn,1)v1 +

+(λ2 +λs+1hs+1,2 + . . .+λnhs+1,2)v2 +

+ . . .+

+(λs +λs+1hs+1,s + . . .+λnhn,s)vs.

This means that

∀v ∈ L(v1,v2, . . . ,vn) : v ∈ L(v1,v2, . . . ,vs)

i.e.L(v1,v2, . . . ,vn)⊂ L(v1,v2, . . . ,vs) .

Let us consider the definition 8.8 again. ∀w ∈ L(v1,v2, . . . ,vs) :

w = l1v1 + l2v2 + . . .+ lsvs = l1v1 + l2v2 + . . .+ lsvs +0vs+1 +0vs+2 + . . .+0vn.

This means that

∀w ∈ L(v1,v2, . . . ,vs) : w ∈ L(v1,v2, . . . ,vn) ,

i.e.L(v1,v2, . . . ,vs)⊂ L(v1,v2, . . . ,vn) .

Since L(v1,v2, . . . ,vn) ⊂ L(v1,v2, . . . ,vs) and L(v1,v2, . . . ,vs) ⊂ L(v1,v2, . . . ,vn), then

L(v1,v2, . . . ,vs) = L(v1,v2, . . . ,vn) .��

Page 314: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.4 Linear Span 299

Example 8.20. The following vectors

v1 = (0,0,1)v2 = (0,1,0)v3 = (1,0,0)

are linearly independent and span the entire set R3, i.e. we can generate any vectorw ∈ R

3 by linear combination

w = λ1v1 +λ2v2 +λ3v3

with λ1,λ2,λ3 ∈ R.If we add the vector

v4 = (1,1,1) ,

it results that v4 is linear combination of v1, v2, and v3 (it is their sum).It follows that any vector w ∈ R

3 can be obtained by linear combination of

w = λ1v1 +λ2v2 +λ3v3 +λ4v4

with λ1,λ2,λ3,λ4 ∈ R. This can be easily verified by posing λ4 = 0.This fact can be written as

L(v1,λ2v2,v3,v4) = L(v1,λ2v2,v3) = R3.

Theorem 8.7. Let 1−2− . . .−n be the fundamental permutation of the first n num-bers ∈ N. Let σ (1)−σ (n)− . . .−σ (n) be another permutation of the same first nnumbers ∈ N. The sets generated by the linearly independent vectors are equal:

L(v1,v2, . . . ,vn) = L(vσ(1),vσ(2), . . . ,vσ(n)

).

Proof. From the Definition 8.8, we know that ∀v ∈ L(v1,v2, . . . ,vn) : v = λ1v1 +λ2v2 + . . .+λnvn. Due to the commutativity we can rearrange the terms of the sumin a way such that v = λσ(1)vσ(1) +λσ(2)vσ(2) + . . .+λσ(n)vσ(n). This means that

∀v ∈ L(v1,v2, . . . ,vn) : v ∈ L(vσ(1),vσ(2), . . . ,vσ(n)

).

Hence, L(v1,v2, . . . ,vn)⊂ L(vσ(1),vσ(2), . . . ,vσ(n)

).

From the Definition 8.8, we know that ∀w ∈ L(vσ(1),vσ(2), . . . ,vσ(n)

): w =

μσ(1)vσ(1) + μσ(2)vσ(2) + μσ(n)vσ(n). Due to the commutativity we can rearrangethe terms of the sum in a way such that v = μ1v1 + μ2v2 + . . .+ μnvn. This meansthat

∀w ∈ L(vσ(1),vσ(2), . . . ,vσ(n)

): w ∈ L(v1,v2, . . . ,vn) .

Hence, L(vσ(1),vσ(2), . . . ,vσ(n)

)⊂ L(v1,v2, . . . ,vn).

Thus, L(v1,v2, . . . ,vn) = L(vσ(1),vσ(2), . . . ,vσ(n)

). ��

Page 315: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

300 8 Vector Spaces

Example 8.21. This theorem simply states that both set of vectors

v1 = (0,0,1)v2 = (0,1,0)v3 = (1,0,0)

and

v1 = (1,0,0)v2 = (0,1,0)v3 = (0,0,1)

span the same set, that is R3.

Proposition 8.7. Let L(v1,v2, . . . ,vn) be a span. If w ∈ L(v1,v2, . . . ,vn) and w issuch that

w = λ1v1 +λ2v2 + . . .+λivi + . . .+λnvn

with λi �= 0, then

L(v1,v2, . . . ,vi, . . . ,vn) = L(v1,v2, . . . ,w, . . . ,vn) .

Proof. Since w = λ1v1 +λ2v2 + . . .+λivi + . . .+λnvn and λi �= 0, then

vi =1λi

w− λ1

λiv1−

λ2

λiv2− . . .− λi−1

λivi−1−

λi+1

λivi+1 . . .−

λn

λivn.

∀v ∈ L(v1,v2, . . . ,vn) : there exist scalars μ1,μ2, . . . ,μn such that we can write vas v= μ1v1+μ2v2+ . . .+μivi+ . . .+μnvn. We can substitute vi with the expressionabove and thus express any vector v as linear combination of v1,v2, . . . ,w . . . ,vn:

v = k1v1 + k2v2 + . . .+ ki−1vi−1 + ki+1vi+1 + · · ·+ knvn + kww

with k j = μ j− λ jλi

for j = 1,2, . . . ,n and j �= i. Moreover, kw = 1λi

.Hence, v ∈ L(v1,v2, . . . ,w, . . . ,vn) and consequently

L(v1,v2, . . . ,vn)⊂ L(v1,v2, . . . ,w, . . . ,vn) .

Analogously, ∀v ∈ L(v1,v2, . . . ,w, . . . ,vn) : there exist scalars

μ1,μ2, . . . ,μi−1,μw,μi+1, . . . ,μn

such that we can write v as

v = μ1v1 +μ2v2 + . . .+μww+ . . .+μnvn.

We can substitute w with the expression of w above and thus express any vectorv as linear combination of v1,v2, . . . ,vi, . . . ,vn:

v = k1v1 + k2v2 + · · ·+ kivi + . . .+ knvn

Page 316: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.4 Linear Span 301

with k j = μ j +μwλ j for j = 1,2, . . . ,n and j �= i. Moreover, ki = μwλi.Hence, v ∈ L(v1,v2, . . . ,vi, . . . ,vn) and consequently

L(v1,v2, . . . ,w, . . . ,vn)⊂ L(v1,v2, . . . ,vn) .

Thus, L(v1,v2, . . . ,vi, . . . ,vn) = L(v1,v2, . . . ,w, . . . ,vn). ��

Example 8.22. If we consider again

v1 = (0,0,1)v2 = (0,1,0)v3 = (1,0,0)

and

w = (1,1,1) ,

we have

L(v1,v2,v3) = R3

and

w = λ1v1 +λ2v2 +λ3v3

with λ1,λ2,λ3 = 1,1,1.We can check that

L(v1,v2,w) = R3.

In order to achieve this aim let us consider a vector u = (3,4,5). We can generateu by means of v1,v2,v3 with λ1,λ2,λ3 = 5,4,3.

We can obtain u also by means of v1,v2,w. It is enough to write

(3,4,5) = μ1 (0,0,1)+μ2 (0,1,0)+μ3 (1,1,1)

which leads to the following system of linear equations⎧⎪⎨

⎪⎩

μ3 = 3

μ2 +μ3 = 4

μ1 +μ3 = 5

whose solution is μ1,μ2,μ3 = 2,1,3

Example 8.23. Let us consider the following vectors

v1 = (0,1)v2 = (1,0) .

The span L(v1,v2) = R2. If we consider the vectors

w = (5,0)

Page 317: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

302 8 Vector Spaces

we can writew = λ1v1 +λ2v2

with λ1 = 0 and λ2 = 5.Proposition 8.7 tells us that

L(v1,v2) = L(v1,w)

sinceL((0,1) ,(1,0)) = L((0,1) ,(5,0)) = R

2.

On the contrary,L(v1,v2) �= L(w,v2)

since λ1 = 0. We may verify this fact considering that

L((5,0) ,(1,0)) �= R2.

The latter span is the line of the plane having second coordinate 0 (horizontalline having equation y = 0).

Lemma 8.1. First Linear Dependence Lemma. Let v1,v2, . . . ,vn be n linearly de-pendent vectors and v1 �= o, then ∃ index j ∈ {2,3, . . . ,n} such that

vj ∈ L(v1,v2, . . . ,vj−1

)

Proof. Since v1,v2, . . . ,vn are n linearly dependent vectors,

∃λ1,λ2, . . . ,λn �= 0,0, . . . ,0� ‘o = λ1v1 +λ2v2 + . . .+λnvn.

Since v1 �= o and λ1,λ2, . . . ,λn �= 0,0, . . . ,0 at least one scalar λk among λ2, . . . ,λn

is non-null. This would be the only way we could have that the sum is equal to o.Let us apply commutativity and arrange the vectors in a way that the j non-null

coefficient are sorted from the smallest to the largest. Thus, the largest non-nullscalar is λ j. All the scalars whose index is greater than j are null. Hence, we canwrite

vj =−λ1

λ jv1−

λ2

λ jv2− . . .− λ j−1

λ jvj−1,

i.e. vj ∈ L(v1,v2, . . . ,vj−1

). ��

Example 8.24. Let us consider the following linearly dependent vectors

v1 = (0,1)v2 = (1,0)v3 = (1,1) .

We can observe thatv3 ∈ L(v1,v2) .

Page 318: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.4 Linear Span 303

Example 8.25. In order to appreciate the hypothesis v1 �= o of Lemma 8.1 let usconsider the following linearly dependent vectors

v1 = (0,0)v2 = (1,0)v3 = (0,1) .

In this casev3 �∈ L(v1,v2) .

Lemma 8.2. Second Linear Dependence Lemma. Let v1,v2, . . . ,vn be n linearlydependent vectors and v1 �= o, then one vector can be removed from the span: ∃index j ∈ {2,3, . . . ,n} such that

L(v1,v2, . . . ,vj, . . . ,vn

)= L

(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

)

Proof. Let us consider a generic vector v. ∀v∈ L(v1,v2, . . . ,vn) it follows that thereexist scalars μ1,μ2, . . . ,μn such that

v = μ1v1 +μ2v2 + . . .+μ jvj + . . .+μnvn.

If we substitute the expression of vj from the First Linear Dependence Lemmainto the span, we obtain that, after the removal of vj, the vectors v1,v2, . . . ,vj−1,vj+1 . . . ,vn still span the vector space, i.e.

v = k1v1 + k2v2 + . . .+ k j−1vj−1 +μ j+1vj+1 + . . .+μnvn

with ki = μi−μ jλiλ j

for i = 1, . . . , j−1.

This means that v ∈ L(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

)and thus

L(v1,v2, . . . ,vj, . . . ,vn

)⊂ L

(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

).

Analogously, ∀v ∈ L(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

)it follows that

v = μ1v1 +μ2v2 + . . .+μi−1vi−1 +μi+1vi+1 . . .+μnvn

which can be re-written as

v = μ1v1 +μ2v2 + . . .+μi−1vi−1 +0vj +μi+1vi+1 . . .+μnvn.

Hence v ∈ L(v1,v2, . . . ,vj, . . . ,vn

). It follows that

L(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

)⊂ L

(v1,v2, . . . ,vj, . . . ,vn

).

Hence, the two spans coincide:

L(v1,v2, . . . ,vj, . . . ,vn

)= L

(v1,v2, . . . ,vj−1,vj+1 . . . ,vn

).��

Page 319: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

304 8 Vector Spaces

Example 8.26. Let us consider again the vectors

v1 = (0,0,1)v2 = (0,1,0)v3 = (1,0,0)v4 = (1,1,1) .

These vectors are linearly dependent.We know that v4 can be expressed as a linear combination of the other vectors.

This fact means thatv4 ∈ L(v1,v2,v3)

that is the first linear dependence lemma.Furthermore, as seen above

L(v1,v2,v3) = L(v1,v2,v3,v4) = R3,

that is the second linear dependence lemma.

8.5 Basis and Dimension of a Vector Space

Definition 8.9. Let (E,+, ·) be a vector space. The vector space (E,+, ·) is saidfinite-dimensional if ∃ a finite number of vectors v1,v2, . . . ,vn, such that the vectorspace (L,+, ·) = (E,+, ·) where the span L is L(v1,v2, . . . ,vn). In this case we saythat the vectors v1,v2, . . . ,vn span the vector space.

Example 8.27. A finite-dimensional vector space is (L((1,0,0) ,(0,1,0) ,(0,0,1)) ,+, ·). This vector span can generate any vector ∈R

3. Although, infinite-dimensionalsets and vector space do not fall within this scopes of this book, it is important toconsider that for example a set R∞ can be defined as the Cartesian product of R

performed and infinite amount of times.

Definition 8.10. Let (E,+, ·) be a finite-dimensional vector space. A basis B ={v1,v2, . . . ,vn} of (E,+, ·) is a set of vectors ∈ E that verify the following prop-erties.

• v1,v2, . . . ,vn are linearly independent• v1,v2, . . . ,vn span E, i.e. E = L(v1,v2, . . . ,vn).

Example 8.28. Let us consider the vector space R3. A basis B of R3

(0,0,1)

(0,1,0)

(1,0,0)

as they are linearly independent and all the numbers in R3 can be derived by their

linear combination.

Page 320: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 305

A set of vectors spanning R3, i.e. the span L, is given by

(0,0,1)

(0,1,0)

(1,0,0)

(1,2,3)

as they still allow to generate all the numbers in R3 but are not linearly independent.

Hence, a basis always spans a vector space while a set of vectors spanning a spaceis not necessarily a basis.

Lemma 8.3. Steinitz’s Lemma. Let (E,+, ·) be a finite-dimensional vector spaceand ∈ L(v1,v2, . . . ,vn) = E its span. Let w1,w2, . . . ,ws be s linearly independentvectors ∈ E.

It follows that s ≤ n, i.e. the number of a set of linearly independent vectorscannot be higher than the number of vectors spanning the vector space.

Proof. Let us assume by contradiction that s > n.Since w1,w2, . . . ,ws are linearly independent, for Proposition 8.6 they are all

different from the null vector o. Hence, we know that w1 �= o.Since L(v1,v2, . . . ,vn) spans E and w1 ∈ E, there exists a tuple λ1,λ2, . . . ,λn

such that

w1 = λ1v1 +λ2v2 + . . .+λnvn.

Since w1 �= o, it follows that λ1,λ2, . . . ,λn �= 0,0, . . .0.Without a loss of generality let us assume that λ1 �= 0. We can now write

v1 =1λ1

(w1−λ2v2− . . .−λnvn) .

Thus, any vector u ∈ E that would be represented as

u = a1v1 +a2v2 + . . .+anvn == (w1−λ2v2− . . .−λnvn)+a2v2 + . . .+anvn == k1w1 + k2v2 + . . .+ knvn.

This means that any vector u ∈ E can be represented of linear combination ofw1,v2, . . . ,vn. This means that

L(w1,v2, . . . ,vn) = E.

We can now express w2 ∈ E as

w2 = μ1w1 +μ2v2 + . . .+μnvn

where μ1,μ2, . . . ,μn �= 0,0, . . . ,0 (it would happen that w2 = o and hence for Propo-sition 8.6 the vectors linearly dependent). Furthermore, w2 cannot be expressed as

Page 321: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

306 8 Vector Spaces

w2 = μ1w1 (they are linearly independent). Hence, there exists j ∈ {2,3, . . . ,n} suchthat μ j �= 0. We can then assume that μ2 �= 0 and state that any vector u ∈ E can beexpressed as

u = l1w1 + l2w2 + l3v3 . . .+ łnvn.

This means thatL(w1,w2, . . . ,vn) = E.

At the generic kth step we have

wk = γ1w1 + γ2w2 + . . .+ γk−1wk−1 + γkvk · · ·+ γnvn.

Since wk cannot be expressed as the linear combination of w1,w2, . . . ,wk−1 then∃ j ∈ {k,k+1, . . .n}� ‘γ j �= 0. Assuming that γ j = γk we have

L(w1,w2, . . . ,wk, . . . ,vn) = E.

Reiterating until the nth step, we have that any vector u ∈ E can be expressed as

u = h1w1 +h2w2 +h3w3 . . .+hnwn.

This means thatL(w1,w2, . . . ,wn) = E.

Since by contradiction s > n there are no more v vectors while still there are s−nw vectors.

In particular, wn+1 ∈ E and hence can be written as

wn+1 = δ1w1 +δ2w2 +δ3w3 . . .+δnwn.

Since wn+1 has been expressed as linear combination of the others then for The-orem 8.4 the vectors are linearly dependent. This is against the hypothesis and acontradiction has been reached. ��

Example 8.29. As shown above, a set of vectors spanning R3, i.e. the span L, is

given by

v1 = (0,0,1)

v2 = (0,1,0)

v3 = (1,0,0)

v4 = (1,2,3) .

Let us consider a set of linearly independent vectors ∈ R3:

w1 = (1,4,0)

w2 = (0,5,0)

w3 = (0,2,1) .

Page 322: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 307

We can see that these linearly independent vectors are less than the vectors span-ning R

3. This is essentially the sense of Steinitz’s lemma.Taking R

3 as an example, we know from Theorem 4.6 that four vectors are al-ways linearly dependent. Thus, in R

3 at most three linearly independent vectorsmay exist. Conversely, at least three vectors are needed to span R

3. If we take intoconsideration w1 and w3 would not be enough to generate any vector ∈ R

3. For ex-ample, the vector t = (50,0,20) could not be generated as a linear combination ofw1 and w3. In order to check this, let us write

(50,0,20) = λ1 (1,4,0)+λ3 (0,2,1)

which leads to ⎧⎪⎨

⎪⎩

λ1 = 50

4λ1 +2λ3 = 0

λ3 = 20.

This system is impossible, i.e. t cannot be generated by w1 and w3. We canconclude that w1 and w3 do not span R

3.

Theorem 8.8. Let (E,+, ·) be a finite-dimensional vector space and ∈ L(v1,v2, . . . ,vn) = E its span and B = {w1,w2, . . . ,ws} be its basis. It follows that s≤ n.

Proof. The vectors composing the basis are linearly independent. For the Steinitz’sLemma, it follows immediately that s≤ n. ��

Example 8.30. From the previous example, B = {w1,w2,w3} is a basis since itsvectors are linearly independent and span R

3. There is totally three vectors in thisbasis, which is less than the number of vectors v1,v2,v3,v4 spanning R

3.

Definition 8.11. The number of vectors composing a basis is said order of a basis.

Theorem 8.9. Let (E,+, ·) be a finite-dimensional vector space. All the bases of avector spaces have the same order.

Proof. Let B1 = {v1,v2, . . . ,vn} and B2 = {w1,w2, . . . ,ws} be two arbitrary basesof (E,+, ·).

If B1 is a basis of (E,+, ·), then L(v1,v2, . . . ,vn) = E. If w1,w2, . . . ,ws arelinearly independent vectors ∈ E, then w1,w2, . . . ,ws ∈ L(v1,v2, . . . ,vn). For theLemma 8.3, s≤ n.

If B2 is a basis of (E,+, ·), then L(w1,w2, . . . ,ws) = E. If v1,v2, . . . ,vn arelinearly independent vectors ∈ E, then v1,v2, . . . ,vn ∈ L(w1,w2, . . . ,ws). For theLemma 8.3, n≤ s.

Hence, the bases have the same order s = n. ��

Example 8.31. If we consider two bases of R3, they will have the same order. Weknow that in R

3 at most three vectors can be linearly independent, thus a basis of R3

can be composed of at most three vectors. We have seen that at least three vectorsare needed to span R

3. Thus each basis must have three vectors.

Page 323: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

308 8 Vector Spaces

Definition 8.12. Let (E,+, ·) be a finite-dimensional vector space. The order of abasis of (E,+, ·) is said dimension of (E,+, ·) and is indicated with dim(E,+, ·) orsimply with dim(E).

Theorem 8.10. Let (E,+, ·) be a finite-dimensional vector space.The dimension dim(E,+, ·) = n of a vector space (or simply dim(E)) is

• the maximum number of linearly independent vectors of E;• the minimum number of vectors spanning E

Proof. If dim(E,+, ·) = n, then ∃ a basis

B = {v1,v2, . . . ,vn}.

The basis, by definition, contains n linearly independent vectors spanning E andthe order of the basis is the number of vectors n.

Let us assume, by contradiction, that n is not the maximum number of linearlyindependent vectors.

Let us assume that there exist n+1 linearly independent vectors in E:

w1,w2, . . . ,wn,wn+1.

Since B is a basis, its elements span the vector space (E,+, ·), i.e.

L(v1,v2, . . . ,vn) = E.

For the Steinitz Lemma, Lemma 8.3, the number of linearly independent vectorsn+ 1 cannot be higher than the number of vectors n that span the vector subspace.Thus,

n+1≤ n,

that is a clear contradiction. This means that the maximum number of linearly inde-pendent vectors is n. ��

In order to prove that n is also the minimum number of vectors spanning a space,let us assume, by contradiction, that n− 1 vectors span the vector space (E,+, ·),i.e.

L(u1,u2, . . . ,un−1) = E.

Since, for the hypotheses dim(E,+, ·) = n, the order of a basis B is n, i.e. ∃ nlinearly independent vectors:

v1,v2, . . . ,vn.

For the Lemma 8.3, the number of linearly independent vectors n cannot behigher than the number of vectors n−1 that generate the vector subspace,

n≤ n−1,

that is a clear contradiction. This means that n is the minimum number of vectorsspanning a space. ��

Page 324: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 309

Example 8.32. Again, in the case of R3, we know that each basis is composed ofthree vectors. For definition of dimension dim

(R

3)= 3. We already know that in

R3 at most three linearly independent vectors there exist and at least three vectors

are needed to span the vector space. Thus, the dimension of the vector space isthe maximum number of linearly independent vectors and the minimum number ofspanning vectors.

Theorem 8.11. Let (E,+, ·) be a finite-dimensional vector space and let n be itsdimension (i.e. dim(E,+, ·) = n). Let v1,v2, . . . ,vn be n vectors ∈ E. The vec-tors v1,v2, . . . ,vn span the vector space (i.e. L(v1,v2, . . . ,vn) = E) if and only ifv1,v2, . . . ,vn are linearly independent.

Proof. If v1,v2, . . . ,vn span a vector space, then L(v1,v2, . . . ,vn) = E. Let us as-sume, by contradiction, that v1,v2, . . . ,vn are linearly dependent. Amongst thesen linearly dependent vectors, r < n of them must be linearly independent vectors.These vectors are indicated with vσ(1),vσ(2), . . . ,vσ(r). For the Second Linear De-pendence Lemma we can remove one vector from L(v1,v2, . . . ,vn) and still havean equal linear span. We can reiterate the reasoning until only linearly independentvectors compose the linear span:

L(vσ(1),vσ(2), . . . ,vσ(r)

)= L(v1,v2, . . . ,vn) .

This means that also that the r vectors vσ(1),vσ(2), . . . ,vσ(r) span E:

L(vσ(1),vσ(2), . . . ,vσ(r)

)= E.

On the other hand, since dim(E,+, ·) = n, for Theorem 8.10, the minimum num-ber of vectors spanning the vector subspace is n. Thus, it is impossible that r < n.��

By hypothesis, we now consider v1,v2, . . . ,vn linearly independent. Let us as-sume, by contradiction, that the vectors v1,v2, . . . ,vn do not span E, i.e. L(v1,v2, . . . ,vn) �= E. This fact can be stated as the vectors v1,v2, . . . ,vn are not enoughto span E and more vectors are needed (at least one more vector is needed).

Thus, we add a vector u ∈ E to obtain span of the vector space:

L(v1,v2, . . . ,vn,u) = E.

We have then n+ 1 vectors spanning E. These vectors must be linearly inde-pendent because if u is a linear combination of the others, for the Second LinearDependence Lemma it can be removed from the span:

L(v1,v2, . . . ,vn,u) = L(v1,v2, . . . ,vn) .

Since dim(E,+, ·) = n, , for Theorem 8.10, the maximum number of linearlyindependent vectors in E is n. Thus, it is impossible that n+1 linearly independentvectors exist. ��

Page 325: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

310 8 Vector Spaces

Example 8.33. Let us consider the following linearly independent vectors ∈ R3

v1 = (1,0,1)v2 = (0,2,0)v3 = (1,0,2) .

Any vector ∈ R3 can be generated as linear combination of v1,v2 and v3. For

example the vector t = (21,8,2) can be expressed as

(21,8,2) = λ1 (1,0,1)+λ2 (0,2,0)+λ3 (1,0,2)

which leads to the following system⎧⎪⎨

⎪⎩

λ1 +λ3 = 21

λ2 = 8

λ1 +2λ3 = 2

whose solution is λ1,λ2,λ3 = 40,8,−19. We can always represent a vector of R3

since v1,v2 and v3 are linearly independent.Let us now consider the following linearly dependent vectors

w1 = (1,0,1)w2 = (0,2,0)w3 = (1,2,1)

and let us attempt to express t = (21,8,2)

(21,8,2) = λ1 (1,0,1)+λ2 (0,2,0)+λ3 (1,2,1)

which leads to the following system⎧⎪⎨

⎪⎩

λ1 +λ3 = 21

λ2 +λ3 = 8

λ1 +λ3 = 2

which is impossible. Three linearly dependent vectors cannot span R3.

Example 8.34. Let us consider the vector space (E,+, ·) where

E = {(x,y,z) ∈ R3|x−3y−7z = 0}.

In order to determine span and basis of this vector space, let us assume that y=α ,z = β , and let us solve the equation with respect to x : x = 3α + 7β . Hence, thereare ∞2 solutions of the kind (3α +7β ,α,β ). This expression can be written as

(3α +7β ,α,β ) = (3α,α,0)+(7β ,0,β ) == α (3,1,0)+β (7,0,1) .

Hence, E = L((3,1,0) ,(7,0,1)).

Page 326: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 311

By applying the Proposition 8.5, (3,1,0) �= o and thus linearly independent.In addition, (7,0,1) is not linear combination of (3,1,0). Thus, the two vec-tors are linearly independent and compose a basis B = {(3,1,0) ,(7,0,1)}. Thus,dim(E,+, ·) = 2.

Example 8.35. Let us consider now the vector space (E,+, ·) where

E =

{

(x,y,z) ∈ R3|{

x−3y+2z = 0

x+ y− z = 0

}

.

Since the rank of the system is 2, it has ∞1 solutions. A solution is:(

det

(−3 21 −1

),−det

(1 21 −1

),det

(1 −31 1

))= (1,3,4) .

Hence, L((1,3,4)) = E and B = {(1,3,4)}. It follows that dim(E,+, ·) = 1.

Example 8.36. Let us consider now the vector space (E,+, ·) where

E =

⎧⎪⎨

⎪⎩(x,y,z) ∈ R

3|

⎧⎪⎨

⎪⎩

x− y = 0

y+ z = 0

3x+ z = 0

⎫⎪⎬

⎪⎭.

Since the incomplete matrix is non-singular, the only solution of the linear sys-tem is (0,0,0). Hence, L((0,0,0)) = E. In this special case, the vector space iscomposed only of the null vector. Since there are no linearly independent vectors,dim(E,+, ·) = 0.

More generally, if a vector subspace of R3 is identified by three linear equationsin three variables,

• if the rank of the system is 3, then dim(E,+, ·) = 0. The geometrical interpreta-tion of this vector subspace is the origin of a system of coordinates in the threedimensional space (only one point).

• if the rank of the system is 2, the system has ∞1 solutions and dim(E,+, ·) = 1.The geometrical interpretation of this vector subspace is a line passing throughthe origin.

• if the rank of the system is 1, the system has ∞2 solutions and dim(E,+, ·) = 2.The geometrical interpretation of this vector subspace is a plane passing throughthe origin.

As previously seen in Proposition 8.2, if the origin, i.e. the null vector, was notincluded in the vector subspace, the vector space axioms would not be verified.

Example 8.37. Let us consider the vector space (E,+, ·) where

E =

⎧⎪⎨

⎪⎩(x,y,z) ∈ R

3|

⎧⎪⎨

⎪⎩

x+2y+3z = 0

x+ y+3z = 0

x− y = 0

⎫⎪⎬

⎪⎭.

Page 327: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

312 8 Vector Spaces

The matrix associated with this system of linear equations is⎛

⎝1 2 31 1 31 −1 0

whose determinant is null. The rank of this matrix 2. Hence the system has ∞1

solutions. In order to find a general solution, from the last equation we can writex = y = α . By substituting in the first equation we have

α +2α +3z = 0⇒ z =−α.

The infinite solutions of the system are proportional to (α,α,−α) =α (1,1,−1).This means that L((1,1,−1)) = E and a basis of this vector space is B =

{(1,1,−1)}. The latter statement is true because this vector is not the null vector(and hence linearly independent). The dimension of this vector space is dim(E,+, ·)= 1.

Example 8.38. Let us consider the vector space (E,+, ·) where

E =

⎧⎪⎨

⎪⎩(x,y,z) ∈ R

3|

⎧⎪⎨

⎪⎩

x+2y+3z = 0

2x+4y+6z = 0

3x+6y+9z = 0

⎫⎪⎬

⎪⎭.

The matrix associated with this system of linear equations⎛

⎝1 2 32 4 63 6 9

is singular as well as all its order 2 submatrices. Hence the rank of the matrix is 1and the system has ∞2 solutions. If we pose y=α and z= β we have x=−2α−3β .Hence, the solutions are proportional to

(−2α−3β ,α,β )

which can written as

(−2α−3β ,α,β ) = (−2α,α,0)+(−3β ,0,β ) = α (−2,1,0)+β (−3,0,1) .

These couples of vectors solve the system of linear equations. In order to showthat these two vectors compose a basis we need to verify that they are linearly inde-pendent. By definition, this means that

λ1v1 +λ2v2 = o

only if λ1,λ2 = 0,0.

Page 328: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 313

In our case this means that

λ1 (−2,1,0)+λ2 (−3,0,1) = o

only if λ2,λ2 = 0,0. This is equivalent to say that the system of linear equations⎧⎪⎨

⎪⎩

−2λ1−3λ2 = 0

λ1 = 0

λ2 = 0

is determined. The only values that satisfy the equations are λ2,λ2 = 0,0. Thismeans that the vectors are linearly independent and hence compose a basis B ={(−2,1,0) ,(−3,0,1)}. The dimension is then dim(E,+, ·) = 2.

Example 8.39. Let us consider the following vectors ∈ R3:

u = (2,−1,1)v = (3,1,2)

The associated matrix A has rank 2. Hence, the vectors are linearly independent.These two vectors could compose a basis B = {u,v} and thus could span a vectorspace having dimension 2. These vectors cannot span R

3.

Example 8.40. Let us consider the following vectors ∈ R3:

u = (2,−1,3)

v = (1,0,−1)

w = (2,1,−2)

The associated matrix is

A =

⎝2 −1 31 0 −12 1 −2

whose rank is 3. Hence, these vectors are linearly independent and compose a basisB.

Let us now consider the vector t = (0,2,0). Let us express t in the basis B. Thismeans that we need to find the coefficients λ ,μ ,ν such that t = λu+μv+νw:

t = λu+μv+νw =

= λ (2,−1,3)+μ (1,0,−1)+ν (2,1,−2) =

= (2λ +μ +2ν ,−λ +ν ,3λ −μ−2ν) .

Page 329: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

314 8 Vector Spaces

Thus, we can write the following system of linear equations⎧⎪⎨

⎪⎩

2λ +μ +2ν = 0

−λ +ν = 2

3λ −μ−2ν = 0.

The matrix associated with this system is non-singular. Hence, the system hasonly one solution λ ,μ ,ν that allows to express t in the basis B.

Theorem 8.12. Basis Reduction Theorem. Let (E,+, ·) be a finite-dimensionalvector space and L(v1,v2, . . . ,vm) =E one of its spans. If some vectors are removeda basis of (E,+, ·) is obtained.

Proof. Let us consider the span L(v1,v2, . . . ,vm) and apply the following iterativeprocedure.

• Step 1: If v1 = o, it is removed, otherwise left in the span• Step k: if vk ∈ L(v1,v2, . . . ,vk−1), it is removed otherwise left in the span

The procedure is continued until there are vectors available. For the First LinearDependence Lemma the n remaining vectors span the vector space, i.e. L(v1,v2, . . . ,vn) = E. For the Proposition 8.5, the vectors are linearly independent. Hence, theycompose a basis. ��

Example 8.41. Let us consider the following vectors ∈ R4:

u = (2,−1,1,3)

v = (0,2,1,−1)

w = (1,2,0,1)

a = (3,4,2,3)

b = (2,4,0,2)

Let us consider the span L(u,v,w,a,b). The first vector, u �= o and therefore itis left in the span. The second vector, v is not a linear combination of u or, in otherwords v /∈ L(u). Hence v is left in the span. We can verify that w is not a linearcombination of u and v. Also, a is not a linear combination of u, v, and w.

On the contrary, we can observe that b is a linear combination of the other fourvectors:

b = λ1u+λ2v+λ3w+λ4a

where λ1 = λ2 = λ4 = 0 and λ3 = 2. Hence, b is removed from the span. The updatedspan is

L(u,v,w,a) = E.

The vectors are linearly independent and hence compose a basis B = {u,v,w,a}of R4.

Page 330: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 315

Theorem 8.13. Basis Extension Theorem. Let (E,+, ·) be a finite-dimensionalvector space and w1,w2, . . . ,ws be s linearly independent vectors of the vectorspace. If w1,w2, . . . ,ws are not already a basis, they can be extended to a basis(by adding other linearly independent vectors).

Proof. Let us consider a list of linearly independent vectors w1,w2, . . . ,ws. Since(E,+, ·) is finite-dimensional ∃ a list of vectors v1,v2, . . . ,vn that spans E, i.e.∃v1,v2, . . . ,vn such that L(v1,v2, . . . ,vn) = E. Let us apply the following iterativeprocedure.

• Step 1: If v1 ∈ L(w1,w2, . . . ,ws) then the span is left unchanged otherwise thespan is updated to L(w1,w2, . . . ,ws,v1)

• Step k: If vk ∈ L(w1,w2, . . . ,ws,v1,v2, . . .vk−1) (after having properly renamedthe indices) then the span is left unchanged otherwise the span is updated toL(w1,w2, . . . ,ws,v1,v2, . . .vk)

Considering how the span has been constructed, the new span is composed oflinearly independent vectors. Since L(v1,v2, . . . ,vn) = E (the vectors were alreadyspanning E), from the construction procedure, the new list of vectors also spansE, L(w1,w2, . . . ,ws,v1,v2, . . .vk) = E (the indices have been properly arranged).Hence, we found a new basis. ��Example 8.42. Let us consider the following vectors belonging to R

4:

v1 = (1,0,0,0)v2 = (0,1,0,0)v3 = (0,0,1,0)v4 = (0,0,0,1) .

It can be easily shown that these vectors are linearly independent and compose abasis of R4. Let us now consider the following vectors belonging to R

4:

w1 = (5,2,0,0)w2 = (0,6,0,0) .

These two vectors are linearly independent. Let us now apply the Basis ExtensionTheorem to find another basis. Let us check whether or not v1 ∈ L(w1,w2). Thevector v1 ∈ L(w1,w2) since ∃λ1,λ2 ∈R such that v1 = λ1w1+λ2w2, that is λ1,λ2 =15 ,−

115 .

This result was found by simply imposing

(1,0,0,0) = λ1 (5,2,0,0)+λ2 (0,6,0,0)

which leads to the following system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

5λ1 +0λ2 = 1

2λ1 +6λ2 = 0

0λ1 +0λ2 = 0

0λ1 +0λ2 = 0.

Page 331: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

316 8 Vector Spaces

The last two equations are always verified. Hence, this is a system of two equa-tions in two variables which is determined and its solutions are λ1,λ2 =

15 ,−

115 .

Thus, we do not add v1 to the span.We check now whether or not v2 ∈ L(w1,w2). The vector belongs to the span

since v2 = λ1w1 +λ2w2 with λ1,λ2 = 0, 16 . Thus we do not add it to the span.

We check now whether or not v3 ∈ L(w1,w2). In order to achieve this aim weneed to check whether or not ∃λ1,λ2 ∈ R such that v3 = λ1w1 +λ2w2:

(0,0,1,0) = λ1 (5,2,0,0)+λ2 (0,6,0,0)

which leads to the following system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

5λ1 +0λ2 = 0

2λ1 +6λ2 = 0

0λ1 +0λ2 = 1

0λ1 +0λ2 = 0.

The last equation is always verified. The third equation is never verified. Hence,the system is impossible, those λ1,λ2 values do not exist. This means that w1,w2,v3are linearly independent. The vector v3 can be added to the span which becomes

w1 = (5,2,0,0)w2 = (0,6,0,0)v3 = (0,0,1,0) .

By applying the same reasoning we can easily find that also w1,w2,v3,v4 arelinearly independent and can be added to the span. Since we added all the vec-tors of the span (unless already contained in it through linear combinations ofthe others), L(w1,w2,v3,v4) = E. Hence, we have found a new basis, that isB = {w1,w2,v3,v4}.

Theorem 8.14. Grassmann’s Formula. Let (E,+, ·) be a finite-dimensional vectorspace. Let (U,+, ·) and (V,+, ·) be vector subspaces of (E,+, ·). Then,

dim(U +V )+dim(U ∩V ) = dim(U)+dim(V ) .

Proof. Let us suppose that dim(U) = r and dim(V ) = s, i.e. ∃ two bases

BU = {u1,u2, . . . ,ur}BV = {v1,v2, . . . ,vs}

of (U,+, ·) and (V,+, ·), respectively. For the Theorem 8.1, (U ∩V,+, ·) is a vectorsubspace of (E,+, ·). Let us suppose that one of its bases is BU∩V = {t1, t2, . . . , tl}.

Since all the vectors contained in BU∩V are also vectors in U , for the Theoremof Basis extension, we can obtain BU from BU∩V , by adding one by one the vectorsfrom BU :

BU = {t1, t2, . . . , tl,ul+1,ul+2, . . . ,ur} ,

Page 332: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.5 Basis and Dimension of a Vector Space 317

where ul+1,ul+2, . . . ,ur are some vectors from BU after the indices have been rear-ranged.

Since all the vectors contained in BU∩V are also vectors in V , for the Theoremof Basis extension, we can obtain BV from BU∩V , by adding one by one the vectorsfrom BV :

BV = {t1, t2, . . . , tl,vl+1,vl+2, . . . ,vs} ,where vl+1,vl+2, . . . ,vr are some vectors from BV after the indices have been rear-ranged.

For the Definition 8.3,

S =U +V = {w ∈ E|∃u ∈U,v ∈V |w = u+v}.Thus, we can write the generic w = u+v by means of infinite scalars.

w = u+v = λ1t1 +λ2t2 + . . .+λltl +al+1ul+1 +al+2ul+2 + . . .+arur

+μ1t1 +μ2t2 + . . .+μltl +bl+1vl+1 +bl+2vl+2 + . . .+bsvs =

= (λ1 +μ1) t1 +(λ2 +μ2) t2 + . . .(λl +μl) tl +

+al+1ul+1 +al+2ul+2 + . . .+arur +bl+1vl+1 +bl+2vl+2 + . . .+bsvs

Hence, by means of a linear combination we can represent all the vectors w∈U+V . In other words, the r+ s− l vectors t1, t2, . . . , tl,ul+1,ul+2, . . . ,ur,vl+1,vl+2, . . . ,vs span (U +V,+, ·):

L(t1, t2, . . . , tl,ul+1,ul+2, . . . ,ur,vl+1,vl+2, . . . ,vs) =U +V.

Let us check now the linear independence of these r+s− l vectors. Let us imposethat

α1t1 +α2t2 + . . .+αltl +

+βl+1ul+1 +βl+2ul+2 + . . .+βrur +

+γl+1vl+1 + γl+2vl+2 + . . .+ γsvs = o.

Hence, we could write where

α1t1 +α2t2 + . . .+αltl +

+βl+1ul+1 +βl+2ul+2 + . . .+βrur = d =

=−(γl+1vl+1 + γl+2vl+2 + . . .+ γsvs)

Since d can be expressed as linear combination of vl+1,vl+2, . . . ,vs, d ∈V . Sinced can be expressed as linear combination of the elements of a basis of U , d ∈U .Hence, d ∈ U ∩V . This means that d can be expressed as linear combination oft1, t2, . . . , tl:

d = α ′1t1 +α ′

2t2 + . . .+α ′l tl

Page 333: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

318 8 Vector Spaces

Since t1, t2, . . . , tl are linearly independent, there is only one way, for the Theo-rem 8.4, to represent d as linear combination of them. Thus, βl+1 = βl+2 = . . . =βr = 0 and α1 = α ′

1, α2 = α ′2, . . .αl = α ′

l .Hence, we can write the expression above as

α1t1 +α2t2 + . . .+αltl +

+γl+1vl+1 + γl+2vl+2 + . . .+ γsvs = o.

Since t1, t2, . . . , tl,vl+1,vl+2, . . . ,vs compose a basis they are linearly independent.Thus, α1 = α2 = . . .= αl = γl+1 = γl+2 = . . .= γs = 0.

Since the null vector o can be expressed as linear combination of the vectorst1, t2, . . . , tl,ul+1,ul+2, . . . ,ur,vl+1,vl+2, . . . ,vs only by means of null coefficients,the above r+ s− l vectors are linearly independent. Thus these vectors compose abasis BU+V :

BU+V = {t1, t2, . . . , tl,ul+1,ul+2, . . . ,ur,vl+1,vl+2, . . . ,vs}.

It follows thatdim(U +V ) = r+ s− l

where r = dim(U), s = dim(V ), and l = dim(U ∩V ), i.e.

dim(U +V ) = dim(U)+dim(V )−dim(U ∩V ) .��

Example 8.43. Let us consider the vector space(R

3,+, ·)

and two vector subspaces:(U,+, ·) and (V,+, ·), respectively.

Let us verify/interpret the Grassmann’s formula in the following cases:

• if U = {(0,0,0)} and V =R3 then dim(U) = 0 dim(V ) = 3. In this case U∩V =

(0,0,0) =U and U +V = R3 =V . It follows that dim(U +V )+dim(U ∩V ) =

3+0 = dim(U)+dim(V ) = 0+3.• If the dimension of both U and V is 1, i.e. only one linearly independent vector

and thus one line, we can distinguish two subcases

– the two vectors in U and V , respectively, represent two lines passing throughthe origin. The intersection U ∩V = (0,0,0) is the origin, while the sum U +V is the plane that contains the two vectors. It follows that dim(U +V ) +dim(U ∩V ) = 2+0 = dim(U)+dim(V ) = 1+1

– the two vectors in U and V , respectively, represent two coinciding lines. Bothintersection and sum coincide with the vector, i.e. U ∩V =U +V =U =V . Itfollows that dim(U +V )+dim(U ∩V ) = 1+1 = dim(U)+dim(V ) = 1+1

• if the dimension of U is 1 while that of V is 2, i.e. one line passing through theorigin and one plane passing through the origin, we can distinguish two subcases:

– the line does not lay in the plane. It follows that U ∩V = (0,0,0) and U +V =R

3. Hence, dim(U +V )+dim(U ∩V ) = 3+0 = dim(U)+dim(V ) = 1+2

Page 334: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.6 Row and Column Spaces 319

– the line lays in the plane. It follows that U ∩V = U and U +V = V . Hence,dim(U +V )+dim(U ∩V ) = 2+1 = dim(U)+dim(V ) = 1+2

• If the dimension of both U and V is 2, i.e. two linearly independent vectors andthus two planes passing through the origin, we can distinguish two subcases

– the planes do not coincide. It follows that U ∩V is a line while U +V = R3.

Hence, dim(U +V )+dim(U ∩V ) = 3+1 = dim(U)+dim(V ) = 2+2– the planes coincide. It follows that U ∩V = U +V and U +V = U = V , i.e.

intersection and sum are the same coinciding plane. Hence, dim(U +V ) +dim(U ∩V ) = 2+2 = dim(U)+dim(V ) = 2+2

8.6 Row and Column Spaces

Let us consider a matrix A ∈Km,n:

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .am,1 am,2 . . . am,n

⎟⎟⎠.

This matrix contains m row vectors r1, r2, . . ., rm ∈Kn

r1 = (a1,1,a1,2, . . . ,a1,n)

r2 = (a2,1,a2,2, . . . ,a2,n)

. . .

rn = (am,1,am,2, . . . ,am,n)

and n column vectors c1, c2, . . ., cn ∈Km

c1 = (a1,1,a2,1, . . . ,am,1)

c2 = (a1,2,a2,2, . . . ,am,2)

. . .

cn = (a1,n,a2,n, . . . ,am,n)

Definition 8.13. The row space and column space of a matrix A ∈ Km,n are thevector spaces (Kn,+, ·) and (Km,+, ·) generated by row vectors and column vectors,respectively, of the matrix.

Page 335: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

320 8 Vector Spaces

Theorem 8.15. Let a matrix A ∈ Km,n. The maximum number p of linearly inde-pendent row vectors is at most equal to the maximum number q of linearly columnvectors.

Proof. Without a loss of generality let us consider a matrix A ∈K4,3

A =

⎜⎜⎝

a1,1 a1,2 a1,3

a2,1 a2,2 a2,3

a3,1 a3,2 a3,3

a4,1 a4,2 a4,3

⎟⎟⎠

and let us suppose that the maximum number of linearly independent column vec-tors is q = 2 and the third is linear combination of the other two. Let us suppose thatc1 and c2 are linearly independent while c3 is linear combination of them:

c3 = λc1 +μc2 ⇒

⎜⎜⎝

a1,3

a2,3

a3,3

a4,3

⎟⎟⎠= λ

⎜⎜⎝

a1,1

a2,1

a3,1

a4,1

⎟⎟⎠+μ

⎜⎜⎝

a1,2

a2,2

a3,2

a4,2

⎟⎟⎠ .

This equation can be written as

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,3 = λa1,1 +μa1,2

a2,3 = λa2,1 +μa2,2

a3,3 = λa3,1 +μa3,2

a3,3 = λa4,1 +μa4,2.

We can write the row vectors as

r1 = (a1,1,a1,2,λa1,1 +μa1,2) = (a1,1,0,λa1,1)+(0,a1,2,μa1,2)

r2 = (a2,1,a2,2,λa2,1 +μa2,2) = (a2,1,0,λa2,1)+(0,a2,2,μa2,2)

r3 = (a3,1,a3,2,λa3,1 +μa3,2) = (a3,1,0,λa3,1)+(0,a3,2,μa3,2)

r4 = (a4,1,a4,2,λa4,1 +μa4,2) = (a4,1,0,λa4,1)+(0,a4,2,μa4,2) .

These row vectors can be written as

r1 = a1,1 (1,0,λ )+a1,2,(0,1,μ)r2 = a2,1 (1,0,λ )+a2,2,(0,1,μ)r3 = a3,1 (1,0,λ )+a3,2,(0,1,μ)

r4 = a4,1 (1,0,λ )+a4,2,(0,1,μ) .

Page 336: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.6 Row and Column Spaces 321

Hence, the row vectors are linear combination of (1,0,λ ) and (0,1,μ). This isdue to the fact that one column vector was supposed to be linear combination of theother two column vectors. We have p = q = 2. ��

Theorem 8.16. Let a matrix A ∈ Km,n. The maximum number q of linearly inde-pendent column vectors is at the most equal to the maximum number p of linearlyindependent row vectors.

Corollary 8.2. The dimension of a row (column) space is equal to the rank of theassociated matrix.

Example 8.44. Let us consider the following matrix:

A =

⎜⎜⎝

3 2 51 1 20 1 11 0 1

⎟⎟⎠

where the third column is the sum (and thus linear combination) of the first twocolumns.

The rows of the matrix can be written as

A =

⎜⎜⎝

3 2 3+21 1 1+10 1 0+11 0 1+0

⎟⎟⎠

and then

A =

⎜⎜⎝

3 0 31 0 10 0 01 0 1

⎟⎟⎠+

⎜⎜⎝

0 2 20 1 10 1 00 0 0

⎟⎟⎠ .

This can written as

A =

⎜⎜⎝

3(1,0,1)1(1,0,1)0(1,0,1)1(1,0,1)

⎟⎟⎠+

⎜⎜⎝

2(0,1,1)1(0,1,1)1(0,1,1)0(0,1,1)

⎟⎟⎠ .

This means that all the rows can be expressed as linear combination of two vec-tors, i.e. (1,0,1) and(0,1,1), respectively. Hence, the matrix has two linearly inde-pendent columns and two linearly independent rows. It can be appreciated that 2 isalso the rank of the matrix A.

Page 337: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

322 8 Vector Spaces

Exercises

8.1. Determine whether or not (U,+, ·), (V,+, ·), and (U ∩V,+, ·) are vector spaceswhere

U = {(x,y,z) ∈ R3|5x+5y+5z = 0}

V = {(x,y,z) ∈ R3|5x+5y+5z+5 = 0}.

8.2. Let (U,+, ·) and (V,+, ·) be two vector subspaces of (E,+, ·). Prove that ifU ⊂V or V ⊂U , then (U ∪V,+, ·) is a vector subspace of (E,+, ·).

8.3. Let us consider the vector spaces (U,+, ·) and (V,+, ·) where

U = {(x,y,z) ∈ R3|x− y+4z = 0}

V = {(x,y,z) ∈ R3|y− z = 0}

where + and · are sum of vectors and product of a vector by a scalar, respectively.

1. Find the intersection set U ∩V of the vector space (U ∩V,+, ·)2. Find the sum set S =U +V of the vector space (S,+, ·)3. Determine whether or not the vector space (S,+, ·) is a direct sum (S,⊕, ·)4. Verify the Grassman’s Formula for the vector spaces (U,+, ·) and (V,+, ·).

8.4. Let us consider the vector space (E,+, ·) where

E =

⎧⎪⎨

⎪⎩(x,y,z) ∈ R

3|

⎧⎪⎨

⎪⎩

x+2y+3z = 0

2x+4y+6z = 0

3x+6y+9z = 0

⎫⎪⎬

⎪⎭.

Identify a basis of the vector space. Determine the dimension of the vector space.

8.5. Find a basis and dimension of the vector space (U,+, ·) where

U =

{

(x,y,z) ∈ R3|

⎧⎪⎨

⎪⎩

x+ y+2z = 0

2x+ y+3z = 0

y+ z = 0

}

.

and + and · are sum of vectors and product of a vector by a scalar, respectively.

8.6. Let us consider the vector space (E,+, ·) where

E =

⎧⎪⎨

⎪⎩(x,y,z) ∈ R

3|

⎧⎪⎨

⎪⎩

5x+2y+ z = 0

15x+6y+3z = 0

10x+4y+2z = 0

⎫⎪⎬

⎪⎭.

Identify a basis of the vector space and verify that the vectors spanning the vectorspace are linearly independent. Determine the dimension of the vector space.

Page 338: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

8.6 Row and Column Spaces 323

8.7. Let us consider the following vectors ∈ R4:

u = (2,2,1,3)

v = (0,2,1,−1)

w = (2,4,2,2)

a = (3,1,2,1)

b = (0,5,0,2) .

Find a basis by eliminating a linearly dependent vector.

Page 339: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 9An Introduction to Inner Product Spaces:Euclidean Spaces

9.1 Basic Concepts: Inner Products

Definition 9.1. Inner Product. Let (E,+, ·) be a finite-dimensional vector spaceover the field K. The mapping

φ : E×E →K

is said inner product and is indicated with

〈x,y〉

when, ∀ vectors x, y and z, it verifies the following properties

• conjugate symmetry: 〈x,y〉= ˙〈y,x〉• distributivity: 〈x+ z,y〉= 〈x,y〉+ 〈z,y〉• homogeneity: ∀λ ∈K λ 〈x,y〉= 〈λx,y〉• positivity: 〈x,x〉 ≥ 0• definiteness: 〈x,x〉= 0 if and only if x = o

The inner product is a general concept which includes but is not limited to nu-meric vectors.

Example 9.1. Let us consider a vector space (F ,+, ·) whose vectors are continuousreal valued functions on the interval [−1,1]. If f (x) and g(x) are two continuousfunctions on the interval [−1,1], an example of inner product is the integral of theirproduct

〈 f ,g〉=∫ 1

−1f (x)g(x)dx.

Definition 9.2. Hermitian Product. Let (E,+, ·) be a finite-dimensional vectorspace over the complex field C with E ⊆ C

n. The Hermitian product is the innerproduct

φ : E×E → C

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_9

325

Page 340: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

326 9 An Introduction to Inner Product Spaces: Euclidean Spaces

defined as

〈x,y〉= xTy =n

∑i=1

xiyi.

where x and y ∈ E.

Example 9.2. Let us consider the following two vectors

x =

⎝2

1+ j5−7 j

and

y =

⎝−310

⎠ .

The Hermitian product is

〈x,y〉= xTy =(

2 (1− j) (5+7 j))⎛

⎝−310

⎠=−6+1− j+0 =−5− j.

9.2 Euclidean Spaces

The Hermitian product is an example of inner product. A restriction to real numbersof the Hermitian product is the scalar product that is a special case of inner product.

Definition 9.3. Scalar Product. Let (E,+, ·) be a finite-dimensional vector spaceover the field R. The Scalar Product is the inner product

φ : E×E → R

defined as

〈x,y〉= xTy = xy =n

∑i=1

xiyi.

The properties of the inner product in the special case of the scalar product canbe written as:

• commutativity: ∀x,y ∈ E : xy = yx• distributivity: ∀x,y,z ∈ E : x(y+ z) = xy+xz• homogeneity: ∀x,y ∈ E and ∀λ ∈ R (λx)y = x(λy) = λxy• identity property: ∀x ∈ E : xx≥ 0 and xx = 0 if and only if x = o

The scalar product can be seen as a special case of the Hermitian product whereall the complex numbers have null imaginary part.

Page 341: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.2 Euclidean Spaces 327

In order to distinguish the symbol of the scalar product from the symbol used forthe product of a scalar by a vector · (external composition law), let us indicate with• the scalar product operator.

Definition 9.4. The triple (En,+,•) is said Euclidean space.

The symbol •will be used when a Euclidean space is mentioned. However, whenscalar product operation of two vectors is described, e.g. xy, no symbol will be used.

It must be remarked that since the scalar product is not an external compositionlaw, a Euclidean space is not a vector space. In vector spaces the result of the exter-nal composition law is a vector, i.e. an element of the set E. In the case of Euclideanspaces the result of a scalar product is a scalar and thus not a vector (not an elementof E).

Example 9.3. The triple (V3,+,), i.e. the set of geometric vectors with the oper-ations of (1) sum between vectors; (2) scalar product of geometric vectors, is aEuclidean space.

Analogously,(R

2,+,•)

and(R

3,+,•)

are also Euclidean spaces.

Definition 9.5. Let x,y ∈ En where En is a Euclidean space. These two vectors areorthogonal if xy = 0.

Proposition 9.1. Let (En,+,•) be a Euclidean space. Every vector belonging to aEuclidean space is orthogonal to the null vector: ∀x ∈ En : xo = 0.

Proof. Considering that o = o−o, it follows that

xo = x(o−o) = xo−xo = o.��

Proposition 9.2. Let (En,+,•) be a Euclidean vector space and x1,x2, . . . ,xn be nnon-null vectors belonging to it. If the vectors x1,x2, . . . ,xn are all orthogonal toeach other, i.e. ∀ indexes i, j : xi is orthogonal to xj, then the vectors x1,x2, . . . ,xnare linearly independent.

Proof. Let us consider the linear combination of the vectors x1,x2, . . . ,xn by meansof the scalars λ1,λ2, . . . ,λn ∈ R and let us impose that

λ1x1 +λ2x2 + . . .+λnxn = o.

Let us now multiply (scalar product) this linear combination by x1 and we findthat

x1 (λ1x1 +λ2x2 + . . .+λnxn) = 0.

Due to the orthogonality, this expression is equal to

λ1x1x1 = 0.

For hypothesis x1 �= o, then the expression can be equal to 0 only if λ1 = 0. Thelinear combination can be multiplied by x2 to find that the expression is equal to 0

Page 342: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

328 9 An Introduction to Inner Product Spaces: Euclidean Spaces

only if λ2 = 0, . . ., by xn to find that the expression is equal to 0 only if λn = 0. Ifwe impose that the linear combination is equal to the null vector, we find that all thescalars are null. Hence, the vectors are linearly independent. ��

Example 9.4. The following vectors of the Euclidean space(R

2,+,•)

are orthogo-nal:

v1 = (1,5)v2 = (−5,1)

Let us check the linear dependence:

(0,0) = λ1 (1,5)+λ2 (−5,1)

which leads to{

λ1−5λ2 = 0

5λ1 +λ2 = 0.

The system is determined and the vectors are linearly independent.

Example 9.5. The following vectors of the Euclidean space(R

3,+,•)

v1 = (1,0,0)v2 = (0,1,0)v3 = (0,0,1)

are obviously all orthogonal (each pair of vectors is orthogonal) and linearly inde-pendent. If we added another arbitrary vector v4, we would have linearly dependentvectors and that not all the pairs would be orthogonal.

Definition 9.6. Let (En,+,•) be a Euclidean space and U ⊂ En with U �= /0. If(U,+,•) is also a Euclidean space then it is said Euclidean subspace of (En,+,•).

Definition 9.7. Let (En,+,•) be a Euclidean space and (U,+,•) be its sub-space.Let us indication with u be the generic element (vector) of U . The set of all thevectors orthogonal to all the vectors of U

Uo = {x ∈ En|xu = 0,∀u ∈U}

is said orthogonal set to the set U .

Proposition 9.3. Let (En,+,•) be a Euclidean space and (U,+, ·) be its sub-space.The orthogonal set Uo with sum and product of a scalar by a vector is a vector space(Uo,+, ·) namely orthogonal space to (U,+,•).

Proof. In order to prove that (Uo,+, ·) is a vector space we have to prove that theset Uo is closed with respect to sum and product of a scalar by a vector.

Let us consider two vectors x1,x2 ∈Uo. Let us calculate (x1 +x2)u = 0+0 = 0∀u ∈U . This means that (x1 +x2) ∈Uo.

Page 343: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.3 Euclidean Spaces in Two Dimensions 329

Let λ ∈ R and x ∈Uo. Let us calculate λxu = 0 ∀u ∈U . This means that λu ∈Uo.

Hence, (Uo,+, ·) is a vector space. ��

Example 9.6. Let us consider the vectors

u1 = (1,0,0)u2 = (0,1,0)

and the set spanned by themU = L(u1,u2) .

The set U can be interpreted as a plane in the space. We may now think about aset Uo composed of all those vectors that are orthogonal to U , i.e. orthogonal to theplane spanned by u1 and u2. The set Uo would be

Uo = α (0,0,1)

with α ∈ R.We can easily verify that (Uo,+, ·) is a vector space.

Definition 9.8. Let a vector x∈ En. The module of the vector x, indicated with ‖ x ‖,is equal to

√xx.

Example 9.7. The module of the following vector of(R

2,+,•)

(1,2)

is √1+4 =

√5.

9.3 Euclidean Spaces in Two Dimensions

This section refers to the special Euclidean space(R

2,+,•).

Lemma 9.1. Let us consider two orthogonal vectors e y belonging to R2 and such

thate �= oy �= o.

It follows that for every vector x ∈ R2, ∃ two scalars α,β ∈ R such that x can be

expressed asx = αe+βy.

Proof. Let us write the equation x = αe+βy as

x−αe = βy.

Page 344: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

330 9 An Introduction to Inner Product Spaces: Euclidean Spaces

Let us multiply the equation by e:

xe−αee = βye = 0

since y is orthogonal to e.It follows that

xe = α ‖ e ‖2

and thusα =

xe‖ e ‖2 .

Since e �= o then ee =‖ e ‖2 �= 0. Thus, α exists.Let us write again the equation

x = αe+βy

and write it asx−βy = αe.

Let us multiply the equation by y and obtain

xy−βyy = αey = 0

since e and y are orthogonal.It follows that

xy = β ‖ y ‖2

andβ =

xy‖ y ‖2 .

Since y �= o, it follows that yy =‖ y ‖2 �= 0 and that the scalar β also exists.Thus there exist two scalars α and β such that x = αe+βy always exist. ��

In essence Lemma 9.1 says that a vector can always be decomposed along twoorthogonal directions.

Definition 9.9. Let us consider a Euclidean space(R

2,+,•)

and a vector x ∈ R2.

The equationx = αe+βy

is named decomposition of the vector x along the orthogonal directions of e and y.

Example 9.8. Let us consider the vector of(R

2,+,•): x = (5,2).

If we want to decompose this vector along the orthogonal directions of e = (1,1)and y = (−1,1) we need to find

α =xe

‖ e ‖2 =72

Page 345: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.3 Euclidean Spaces in Two Dimensions 331

and

β =xy

‖ y ‖2 =−32.

It follows that

(5,2) =72(1,1)− 3

2(−1,1)

Definition 9.10. Let us consider a Euclidean space(R

2,+,•)

and a vector x ∈ R2.

Let us decompose x along the directions of two orthogonal vectors e and y

x = αe+βy. (9.1)

The vector αe is named orthogonal projection of the vector x on the direction of e.

Remark 9.1. The n-dimensional version of the orthogonal decomposition would be

x =n

∑i=1

αiei

with all the pairs of vectors orthogonal, i.e. eTi ej = 0 ∀i, j.

Proposition 9.4. The maximum length of the orthogonal projection of a vector x isits module ‖ x ‖:

‖ αe ‖≤‖ x ‖ .

Proof. Considering that x = αe+βy and ey = 0, we can write

‖ x ‖2= xx = (αe+βy)(αe+βy) =

=‖ αe ‖2 + ‖ βy ‖2≥‖ αe ‖2 .

This inequality leads to‖ αe ‖≤‖ x ‖ .��

Example 9.9. Let us consider again the vector x = (5,2) and its orthogonal projec-tion αe 7

2 (1,1). The two modules are

√52 +22 =

√29≥

√(72

)2

+

(72

)2

=

√492

=√

24.5.

Theorem 9.1. Cauchy-Schwarz Inequality. Let (En,+,•) be a Euclidean vectorspace. For every x and y ∈ En, the following inequality holds:

‖ xy ‖≤‖ x ‖‖ y ‖ .

Proof. If either x or y is equal to the null vector, then the Cauchy-Schwarz inequalitybecomes 0 = 0, that is always true.

In the general case, let us suppose that neither x nor y are equal to the null vector.Let us now indicate with αy the orthogonal projection of the vector x onto the

Page 346: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

332 9 An Introduction to Inner Product Spaces: Euclidean Spaces

direction of y. For the Lemma 9.1 we can always express x = αy+ z where yz = 0.On the basis of this statement we can write

xy = (αy+ z)y = αyy = α ‖ y ‖2= α ‖ y ‖‖ y ‖ .

By computing the module of this equation we obtain

‖ xy ‖=‖ α ‖‖ y ‖‖ y ‖

where the module of a scalar is the absolute value of the scalar itself, i.e.

‖ α ‖=| α |‖ xy ‖=| xy | .

Furthermore, since α is a scalar it follows that

‖ α ‖‖ y ‖‖ y ‖=‖ αy ‖‖ y ‖ .For the Proposition 9.4 ‖ αy ‖≤‖ x ‖. Hence,

‖ xy ‖≤‖ x ‖‖ y ‖ . ��

The Cauchy-Schwartz inequality is generally true but the proof provided aboverefers to the bidimensional case since it makes use of the orthogonal decomposition.

Example 9.10. Let us consider the following vectors: x = (3,2,1) and y = (1,1,0).The modules of these two vectors are ‖ x ‖=

√14 and ‖ y ‖=

√2, respectively.

The scalar product is xy = 5. Considering that ‖ 5 ‖= 5. It follows that 5 ≤√2√

14≈ 5.29.

Theorem 9.2. Minkowski’s Inequality. Let (En,+,•) be a Euclidean space. Forevery x and y ∈ En, the following inequality holds:

‖ x+y ‖≤‖ x ‖+ ‖ y ‖ .

Proof. By the definition of module

‖ x+y ‖2= (x+y)(x+y) = xx+xy+yx+yy =

‖ x ‖2 + ‖ y ‖2 +2xy

Still considering that the module of a scalar is its absolute value and thus

‖ xy ‖=| xy |={

xy if xy≥ 0

−xy if xy < 0.

In other words,xy≤| xy |=‖ xy ‖ .

Page 347: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.4 Gram-Schmidt Orthonormalization 333

In this light, let us now compute the module of the equation:

‖ x+y ‖2=‖ x ‖2 + ‖ y ‖2 +2xy≤‖ x ‖2 + ‖ y ‖2 +2 ‖ xy ‖ .

For the Cauchy-Schwarz inequality 2 ‖ xy ‖≤‖ 2 ‖ x ‖‖ y ‖. Hence,

‖ x+y ‖2≤‖ x ‖2 + ‖ y ‖2 +2 ‖ x ‖‖ y ‖= (‖ x ‖+ ‖ y ‖)2 ⇒⇒‖ x+y ‖≤‖ x ‖+ ‖ y ‖ .��

Example 9.11. Let us consider again the vectors: x = (3,2,1) and y = (1,1,0). Asshown above, the modules of these two vectors are ‖ x ‖=

√14 and ‖ y ‖=

√2,

respectively.The sum x+ y = (4,3,1) has module

√26. It follows that

√26 ≈ 5.10 ≤

√2+√

14≈ 5.15.

Theorem 9.3. Pythagorean Formula. Let (En,+,•) be a Euclidean space. For ev-ery x and y ∈ En, and x, y orthogonal, the following equality holds:

‖ x+y ‖2=‖ x ‖2 + ‖ y ‖2

Proof. By the definition of module

‖ x+y ‖2= (x+y)(x+y) = xx+xy+yx+yy =

‖ x ‖2 + ‖ y ‖2

since for the perpendicularity xy = 0.

Example 9.12. Let us consider the vectors x = (2,−1,1) and y = (1,2,0). It canbe easily verified that the scalar product xy = 0, i.e. the vectors are orthogonal.If we calculate the modules of these vectors we obtain, ‖ x ‖2= 6 and ‖ y ‖2= 5,respectively.

The sum is x+ y = (3,1,1) which has square module ‖ x+ y ‖= 11, which isobviously equal to 6+5.

9.4 Gram-Schmidt Orthonormalization

Definition 9.11. Let a1,a2, . . . ,an be n vectors belonging to a Euclidean space. TheGram determinant or Gramian is the determinant of the following matrix, namelyGram matrix, ⎛

⎜⎜⎝

a1a1 a1a2 . . . a1ana2a1 a2a2 . . . a2an. . . . . . . . . . . .

ana1 ana2 . . . anan

⎟⎟⎠ .

The Gram determinant is indicated with G(a1,a2, . . . ,an).

Page 348: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

334 9 An Introduction to Inner Product Spaces: Euclidean Spaces

Theorem 9.4. If the vectors a1,a2, . . . ,an are linearly dependent, then the Gramdeterminant G(a1,a2, . . . ,an) is equal to 0.

Proof. If the vectors are linearly dependent for the Proposition 8.4 one vector canbe expressed as linear combination of the others. Thus, let us write

an = λ1a1 +λ2a2 + . . .+λn−1an−1

where λ1,λ2, . . . ,λn−1 ∈ R.If an is multiplied by a generic ai for i = 1,2, . . . ,n−1 we obtain

anai = λ1a1ai +λ2a2ai + . . .+λn−1an−1ai.

Thus, if we substitute the elements of the last line of the Gram matrix with thelinear combination above, we have expressed the nth row as a linear combination ofall the other rows by means of the scalars λ1,λ2, . . . ,λn−1. Hence, the Gramian is 0.��

Example 9.13. Let us consider the following vectors:

v1 = (0,0,1)v2 = (0,1,0)v3 = (0,2,2) .

It can be easily checked that these vectors are linearly dependent since

v3 = λ1v1 +λ2v2

with λ1,λ2 = 2,2.Let us calculate the Gram matrix

⎝v1v1 v1v2 v1v3v2v1 v2v2 v2v3v3v1 v3v2 v3v3

⎠=

⎝1 0 20 1 22 2 8

⎠ .

The Gramian determinant is

G(v1,v2,v3) = 8+0+0−4−4−0 = 0.

Thus, as stated in the theorem above, the Gramian determinant associated withlinearly dependent vectors is null.

Theorem 9.5. If the vectors a1,a2, . . . ,an are linearly independent the Gram deter-minant G(a1,a2, . . . ,an)> 0.

The proof of this theorem is given in Appendix B.

Page 349: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.4 Gram-Schmidt Orthonormalization 335

Example 9.14. Let us consider the following linearly independent vectors:

v1 = (0,0,1)v2 = (0,1,0)v3 = (1,0,0) .

The Gram matrix is⎛

⎝v1v1 v1v2 v1v3v2v1 v2v2 v2v3v3v1 v3v2 v3v3

⎠=

⎝1 0 00 1 00 0 1

⎠ ,

whose determinant is 1 > 0.

Remark 9.2. In addition, it must be observed that the latter two theorems give ageneralization of the Cauchy-Schwarz inequality. It can be seen that the Gramianassociated with two vectors x and y is

det

(xx xyxy yy

)=‖ x ‖2‖ y ‖2 − ‖ xy ‖2≥ 0⇒‖ xy ‖≤‖ x ‖‖ y ‖ .

Definition 9.12. Let a vector x ∈ En. The versor of the vector x is

x =

(x||x||

).

Definition 9.13. Let (En,+,•) be a Euclidean space. An orthonormal basis of aEuclidean space is a basis composed of versors where each arbitrary pair of vectorsis orthogonal.

Obviously the Gramian associated with an orthonormal basis is 1 since the Grammatrix would be the identity matrix.

Theorem 9.6. Every Euclidean space has an orthonormal basis.

Gram-Schmidt Orthonormalization Algorithm

In a Euclidean space having dimension equal to n, every basis B = {x1,x2 . . . ,xn}can be transformed into an orthonormal basis Be = {e1,e2 . . . ,en} by applying theso-called Gram-Schmidt method. This method consists of the following steps:

• The first versor can be obtained as

e1 =x1

‖ x1 ‖

Page 350: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

336 9 An Introduction to Inner Product Spaces: Euclidean Spaces

• The second versor will have the direction of

y2 = x2 +λ1e1.

We impose the orthogonality:

0 = e1y2 = e1x2 +λ1e1e1 = e1x2 +λ1 ‖ e1 ‖2 .

Considering that the module a versor is equal to 1 (‖ e1 ‖= 1) If follows that

λ1 =−e1x2

andy2 = x2− e1x2e1.

Hence,e2 =

y2

‖ y2 ‖.

• The third versor will have the direction of

y3 = x3 +λ1e1 +λ2e2

We impose the orthogonality:

0 = y3e2 = x3e2 +λ1e1e2 +λ2e2e2 = x3e2 +λ2. (9.2)

It follows thatλ2 =−e2x3

andy3 = x3 +λ1e1− e2x3e2.

Hence,e3 =

y3

‖ y3 ‖.

• The nth versor has direction given by

yn = xn +λ1e1 +λ2e2 + . . .+λn−1en−1− en−1xnen−1.

By imposing the orthogonality we obtain

λn−1 =−en−1xn.

Hence,en =

yn

‖ yn ‖.

This method is a simple and yet powerful instrument since orthogonal bases arein general much more convenient to handle and make mathematical models simpler

Page 351: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

9.4 Gram-Schmidt Orthonormalization 337

(all the angles among reference axes is the same and the scalar product of any pairis null) but not less accurate.

The pseudocode describing the Gram-Schmidt orthonormalization given in Al-gorithm 9.

Algorithm 9 Gram-Schmidt OrthonormalizationInput x1,x2, . . . ,xne1 =

x1‖x1‖

for j = 2 : n doλ j−1 =−ej−1xjΣk = 0for k = 1 : j−1 do

Σk = Σk +λkekend foryj = xj +Σk

end for

Example 9.15. Let us consider the following two vectors of R2: x1 = (3,1) and x2 =(2,2). It can be easily shown that these two vectors span the entire R

2 and that theyare linearly independent. The latter can be shown by checking that

λ1 (3,1)+λ2 (2,2) = o

only if λ1,λ2 = 0,0. This statement is equivalent to say that the homogeneous sys-tem of linear equations {

3λ1 +2λ2 = 0

λ1 +2λ2 = 0

is determined.Thus, B = {x1,x2} is a basis of the vector space

(R

2,+, ·).

Furthermore, we know that in R2 the scalar product can be defined (as a scalar

product of vectors). Hence,(R

2,+,•)

is a Euclidean space.Let us now apply the Gram-Schmidt method to find an orthonormal basis BU =

{e1,e2}. The first vector is

e1 =x1

‖ x1 ‖=

(3,1)√10

=

(3√10

,1√10

).

For the calculation of the second vector the direction must be detected at first.The direction is that given by

y2 = x2 +λ1e1 = (2,2)+λ1

(3√10

,1√10

).

Page 352: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

338 9 An Introduction to Inner Product Spaces: Euclidean Spaces

Let us find the orthogonal direction by imposing that y2e1 = 0. Hence,

y2e1 = 0 = x2e1 +λ1e1e1 = (2,2)

(3√10

,1√10

)+λ1,

which leads to

λ1 =− 6√10− 2√

10=− 8√

10.

The vector y2 is

y2 = x2 +λ1e1 = (2,2)+

(− 8√

10

)(3√10

,1√10

)= (2,2)+

(−24

10,− 8

10

)

= (−0.4,1.2) .

Finally, we can calculate the versor

e2 =y2

‖ y2 ‖=

(−0.4,1.2)1.26

=

(− 0.4

1.26,

1.21.26

).

The vectors e1,e2 are an orthonormal basis of(R

2,+, ·).

Exercises

9.1. Let us consider the following two vectors

x = (2,5,7)y = (−4,0,12) .

Verify Cauchy-Schwarz and Minkowski’s inequalities.

9.2. Let us consider the following two linearly independent vectors of R2: x1 =

(2,1) and x2 = (0,2). Apply the Gram-Schmidt orthogonalization algorithm to findan orthonormal basis of R2.

Page 353: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 10Linear Mappings

10.1 Introductory Concepts

Although the majority of the topics in this book (all the topics taken into accountexcluding only complex polynomials) are related to linear algebra, the subject “lin-ear algebra” has never been introduced in the previous chapters. More specifically,while the origin of the term algebra has been mentioned in Chap. 1, the use of theadjective linear has never been discussed. Before entering into the formal defini-tions of linearity, let us illustrate the subject at the intuitive level. Linear algebracan be seen as a subject that studies vectors. If we consider that vector spaces arestill vectors endowed with composition laws, that matrices are collections of row(or column) vectors, that systems of linear equations are vector equations, and thata number can be interpreted as a single element vector, we see that the concept ofvector is the elementary entity of linear algebra. As seen in Chap. 4, a vector is gen-erated by a segment of a line. Hence, the subject linear algebra studies “portions” oflines and their interactions, which justifies the adjective “linear”.

Before entering into the details of this subject let us define again the concept ofmapping shown in Chap. 1 by using the notions of vector and vector space.

Definition 10.1. Let (E,+, ·) and (F,+, ·) be two vector spaces defined over thescalar field K. Let f : E → F be a relation. Let U be a set such that U ⊂ E. Therelation f is said mapping when

∀u ∈U : ∃!w ∈ F � ‘ f (u) = w.

The set U is said domain and is indicated it with dom( f ).A vector w such that

w = f (u)

is said to be the mapped (or transformed) of u through f .

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_10

339

Page 354: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

340 10 Linear Mappings

Definition 10.2. Let f be a mapping E → F , where E and F are sets associated withthe vector spaces (E,+, ·) and (F,+, ·). The image of f , indicated with Im( f ), is aset defined as

Im( f ) = {w ∈ F |∃u ∈ E � ‘ f (u) = w} .

Example 10.1. Let (R,+, ·) be a vector space. An example of mapping R→ R isf (x)= 2x+2. The domain of the mapping dom( f )=R while the image Im( f )=R.The reverse image of R through f is R.

Example 10.2. Let (R,+, ·) be a vector space. An example of mapping R→ R isf (x) = ex. The domain of the mapping dom( f ) =R while the image Im( f ) = ]0,∞[.The reverse image of ]0,∞[ through f is R.

Example 10.3. Let (R,+, ·) be a vector space. An example of mapping R→ R isf (x) = x2 + 2x + 2. The domain of the mapping dom( f ) = R while the imageIm( f ) = [1,∞[. The reverse image of [1,∞[ through f is R.

Example 10.4. Let(R

2,+, ·)

and (R,+, ·) be two vector spaces. An example ofmapping R

2 →R is f (x,y) = x+2y+2. The domain of the mapping dom( f ) =R2

while the image Im( f ) = R. The reverse image of R through f is R2.

Example 10.5. From the vector space(R

2,+, ·)

an example of mapping R2 →R

2 isf (x,y) = (x+2y+2,8y−3).

Example 10.6. From the vector spaces(R

2,+, ·)

and(R

3,+, ·)

an example of map-ping R

3 → R2 is f (x,y,z) = (x+2y+−z+2,6y−4z+2).

Example 10.7. From the vector spaces(R

2,+, ·)

and(R

3,+, ·)

an example of map-ping R

2 → R3 is f (x,y) = (6x−2y+9,−4x+6y+8,x− y).

Definition 10.3. The mapping f is said surjective if the image of f coincides withF :

Im( f ) = F.

Example 10.8. The mapping R→R, f (x)= 2x+2 is surjective because Im( f )=R,i.e. its image is equal to the entire set of the vector space.

Example 10.9. The mapping R→ R, f (x) = ex is not surjective because Im( f ) =]0,∞[, i.e. its image is not equal to the entire set of the vector space.

Definition 10.4. The mapping f is said injective if

∀u,v ∈ E with u �= v⇒ f (u) �= f (v) .

An alternative and equivalent definition of injective mapping is: f is injective if

∀u,v ∈ E with f (u) = f (v)⇒ u = v.

Example 10.10. The mapping R→ R, f (x) = ex is injective because ∀x1,x2 suchthat x1 �= x2, it follows that ex1 �= ex2 .

Page 355: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.1 Introductory Concepts 341

Example 10.11. The mapping R→R, f (x) = x2 is not injective because ∃x1,x2 withx1 �= x2 such that x2

1 = x22. For example if x1 = 3 and x2 =−3, thus x1 �= x2, it occurs

that x21 = x2

2 = 9.

Example 10.12. The mapping R→ R, f (x) = x3 is injective because ∀x1,x2 suchthat x1 �= x2, it follows that x3

1 �= x32.

Definition 10.5. The mapping f is said bijective if f is injective and surjective.

Example 10.13. The mapping R → R, f (x) = ex is injective but not surjective.Hence, this mapping is not bijective.

Example 10.14. The mapping R → R, f (x) = 2x + 2 is injective and surjective.Hence, this mapping is bijective.

Example 10.15. As shown above, the mapping R→ R, f (x) = x3 is injective. Themapping is also surjective as its image is R. Hence, this mapping is bijective.

Definition 10.6. Let f be a mapping E → F , where E and F are sets associated withthe vector spaces (E,+, ·) and (F,+, ·). The mapping f is said linear mapping if thefollowing properties are valid:

• additivity: ∀u,v ∈ E : f (u+v) = f (u)+ f (v)• homogeneity: ∀λ ∈K and ∀v ∈ E : f (λv) = λ f (v)

The two properties of linearity can be combined and written in the followingcompact way:

∀λ1,λ2 ∈K;∀u,v ∈ E : f (λ1u+λ2v) = λ1 f (u)+λ2 f (v)

or extended in the following way

∀λ1,λ2, . . . ,λn

∀v1,v2, . . . ,vnf (λ1v1 +λ2v2 + . . .+λnvn) == λ1 f (v1)+λ2 f (v2)+ . . .+λn f (vn) .

Example 10.16. Let us consider again the following mapping f : R→ R

∀x : f (x) = ex

and let us check its linearity.Let us consider two vectors (numbers in this case) x1 and x2. Let us calculate

f (x1 + x2) = ex1+x2 . From basic calculus we know that

ex1+x2 �= ex1 + ex2 .

The additivity is not verified. Hence the mapping is not linear. We know fromcalculus that an exponential function is not linear.

Page 356: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

342 10 Linear Mappings

Example 10.17. Let us consider the following mapping f : R→ R

∀x : f (x) = 2x

and let us check its linearity.Let us consider two vectors (numbers in this case) x1 and x2. We have that

f (x1 + x2) = 2(x1 + x2)f (x1)+ f (x2) = 2x1 +2x2.

It follows that f (x1 + x2) = f (x1)+ f (x2). Hence, this mapping is additive. Letus check the homogeneity by considering a generic scalar λ . We have that

f (λx) = 2λxλ f (x) = λ2x.

It follows that f (λx) = λ f (x). Hence, since also homogeneity is verified thismapping is linear.

Definition 10.7. Let f be a mapping E → F , where E and F are sets associated withthe vector spaces (E,+, ·) and (F,+, ·). The mapping f is said affine mapping if themapping

g(v) = f (v)− f (o)

is linear.

Example 10.18. Let us consider the following mapping f : R→ R

∀x : f (x) = x+2

and let us check its linearity.Let us consider two vectors (numbers in this case) x1 and x2. We have that

f (x1 + x2) = x1 + x2 +2f (x1)+ f (x2) = x1 +2+ x2 +2 = x1 + x2 +4.

It follows that f (x1 + x2) �= f (x1) + f (x2). Hence, this mapping is not linear.Still, f (0) = 2 and

g(x) = f (x)− f (0) = x

which is a linear mapping. This means that f (x) is an affine mapping.

Example 10.19. Let us consider the following mapping f : R3 → R2

∀x,y,z : f (x,y,z) = (2x−5z,4y−5z)

and let us check its linearity.

Page 357: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.1 Introductory Concepts 343

If it is linear then the two properties of additivity and homogeneity are valid. Iftwo vectors are v = (x,y,z) and v′ = (x′,y′,z′), then

f(v+v′

)= f

(x+ x′,y+ y′,z+ z′

)=(2(x+ x′

)−5

(z+ z′

),4(y+ y′

)−5

(z+ z′

))=

((2x−5z,4y−5z)+

(2x′ −5z′,4y′ −5z′

))= f (v)+ f

(v′)

and

f (λv) = f (λx,λy,λ z) = (λ2x−λ5z,λ4y−λ5z) =

= λ (2x−5z,4y−5z) = λ f (v) .

The mapping is linear.

Example 10.20. Let us consider the following mapping f : V3 → R

∀ #»v : f ( #»v ) = ( #»u #»v )

Let us check the additivity of this mapping:

f(

#»v + #»v ′)= #»u

(#»v + #»v ′

)=

= #»u #»v + #»u #»v ′ = f ( #»v )+ f ( #»v ) .

Let us check now the homogeneity

f (λ #»v ) = #»u (λ #»v ) = λ ( #»u #»v ) = λ f ( #»v ) .

Hence this mapping is linear.

Proposition 10.1. Let f be a linear mapping E → F. Let us indicate with oE and oFthe null vectors of the vector spaces (E,+, ·) and (F,+, ·), respectively. It followsthat

f (oE) = oF.

Proof. Simply let us write

f (oE) = f (0oE) = 0 f (oE) = oF.��

Example 10.21. Let us consider now the following mapping f : R3 → R4

∀x,y,z : f (x,y,z) = (23x−51z,3x+4y−5z,32x+5y−6z+1,5x+5y+5z)

and let us check its linearity.If we calculate

f (0,0,0) = (0,0,1,0) �= oR4 .

Page 358: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

344 10 Linear Mappings

This is against Proposition 10.1. Hence the mapping is not linear.Nonetheless,

g(x,y,z) = f (x,y,z)− f (0,0,0) =

= (23x−51z,3x+4y−5z,32x+5y−6z+1,5x+5y+5z)− (0,0,1,0) =

= (23x−51z,3x+4y−5z,32x+5y−6z,5x+5y+5z)

is linear. Hence, the mapping is affine.

Proposition 10.2. Let f be a linear mapping E → F. It follows that

f (−v) =− f (v) .

Proof. We can write

f (−v) = f (−1v) =−1 f (v) =− f (v) . ��

Example 10.22. Let us consider the following linear mapping f : R→R, f (x) = 2x.With reference to the notation of Proposition 10.1, we can easily see that oE = 0 andoF = 0. Then, if we calculate

f (oE) = f (0) = (2)(0) = 0 = oF.

Furthermore, considering the vector v = x, which in this case is a number wehave

f (−v) = f (−x) = (2)(−x) =−2x =− f (v) .

Example 10.23. Let us consider the following linear mapping f : R2 →R, f (x,y) =2x+ y. Considering that oE = (0,0), oF = 0, and v = (x,y), let us check the twopropositions:

f (oE) = f (0,0) = (2)(0)+0 = 0 = oF

and

f (−v) = f (−x,−y) = (2)(−x)− y =−2x− y =−(2x+ y) =− f (v) .

10.2 Linear Mappings and Vector Spaces

Definition 10.8. Let f be a mapping U ⊂ E → F . The image of U through f , indi-cated with f (U), is a set defined as

f (U) = {w ∈ F |∃u ∈U � ‘ f (u) = w} .

Theorem 10.1. Let f : E → F be a linear mapping and (U,+, ·) be a vector sub-space of (E,+, ·). Let f (U) be the set of all the transformed vectors of U. It followsthat the triple ( f (U) ,+, ·) is a vector subspace of (F,+, ·).

Page 359: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.2 Linear Mappings and Vector Spaces 345

Proof. In order to prove that ( f (U) ,+, ·) is a vector subspace of (F,+, ·) we haveto show that the set f (U) is closed with respect to the two composition laws. Bydefinition, the fact that a vector w ∈ (U) means that ∃v ∈U such that f (v) = w.

Thus, if we consider two vectors w,w′ ∈ f (U) then

w+w′ = f (v)+ f(v′)= f

(v+v′

).

Since for hypothesis (U,+, ·) is a vector space, then v+v′ ∈U . Hence, f (v+v′) ∈f (U). The set f (U) is closed with respect to the internal composition law.

Let us now consider a generic scalar λ ∈K and calculate

λw+λ f (v) = f (λv) .

Since for hypothesis (U,+, ·) is a vector space, then λv∈U . Hence, f (λv)∈ f (U).The set f (U) is closed with respect to the external composition law.

Since the set f (U) is closed with respect to both the composition laws the triple( f (U) ,+, ·) is a vector subspace of (F,+, ·). ��

Example 10.24. Let us consider the vector space (R,+, ·) and the linear mappingf : R→ R defined as f (x) = 5x.

The theorem above states that ( f (R) ,+, ·) is also a vector space. In this case, theapplication of the theorem is straightforward since f (R) =R and (R,+, ·) is clearlya vector space.

Example 10.25. Let us consider the vector space(R

2,+, ·)

and the linear mappingf : R2 → R defined as f (x) = 6x+4y.

In this case f(R

2)= R and (R,+, ·) is a vector space.

Example 10.26. Let us consider the vector space (U,+, ·) where

U = {(x,y,z) ∈ R3 | x+2y+ z = 0}

and the linear mapping f : R3 → R2 defined as

f (x,y,z) = (3x+2y,4y+5z) .

The set U , as we know from Chap. 8, can be interpreted as a plane of the spacepassing through the origin of the reference system. The linear mapping f simplyprojects the points of this plane into another plane, that is the two-dimensional spaceR

2. Thus, f (U) is a plane passing through the origin (0,0,0) which clearly is avector space.

Example 10.27. Let us consider the mapping f : R2 → R2

f (x,y) = (x+ y,x− y)

and the setU = {(x,y) ∈ R

2|2x− y = 0}.

Page 360: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

346 10 Linear Mappings

It can be easily seem that U is a line passing through the origin and then (U,+, ·)is a vector space.

This set can be represented by means of the vector

U = α (1,2)

with α ∈ R.Let us now calculate f (U) by replacing (x,y) with (α,2α):

f (U) = (α +2α,α−2α) = (3α,−α) = α (3,−1)

that is a line passing through the origin. Hence also

( f (U) ,+, ·)

is a vector space.

Corollary 10.1. Let f : E → F be a linear mapping. If f (E) = Im( f ) then Im( f )is a vector subspace of (F,+, ·).

Definition 10.9. Let f be a mapping E →W ⊂ F . The inverse image of W throughf , indicated with f−1 (W ), is a set defined as

f−1 (W ) = {u ∈ E| f (u) ∈W} .

Theorem 10.2. Let f : E → F be a linear mapping. If (W,+, ·) is a vector subspaceof (F,+, ·), then

(f−1 (W ) ,+, ·

)is a vector subspace of (E,+, ·).

Proof. In order to prove that(

f−1 (W ) ,+, ·)

is a vector subspace of (E,+, ·) wehave to prove the closure of f−1 (W ) with respect to the two composition laws. If avector v ∈ f−1 (W ) then f (v) ∈W .

We can write for the linearity of f

f(v+v′

)= f (v)+ f

(v′).

Since (W,+, ·) is a vector space, f (v)+ f (v′) ∈W . Hence, f (v+v′) ∈W and v+v′ ∈ f−1 (W ). Thus, the set f−1 (W ) is closed with respect to the first compositionlaw.

Let us consider a generic scalar λ ∈K and calculate

f (λv) = λ f (v) .

Since (W,+, ·) is a vector space, λ f (v) ∈W . Since f (λv) ∈W the λv ∈ f−1 (W ).Thus, the set f−1 (W ) is closed with respect to the second composition law.

Hence,(

f−1 (W ) ,+, ·)

is a vector subspace of (E,+, ·). ��

Page 361: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.3 Endomorphisms and Kernel 347

10.3 Endomorphisms and Kernel

Definition 10.10. Let f be a linear mapping E → F . If E = F , i.e. f : E → E, thelinear mapping is said endomorphism.

Example 10.28. The linear mapping f :R→R, f (x)= 2x is an endomorphism sinceboth the sets are R.

Example 10.29. The linear mapping f : R2 → R, f (x,y) = 2x− 4y is not an endo-morphism since R

2 �= R.

Example 10.30. The linear mapping f : R2 → R2, f (x,y) = (2x+3y,9x−2y) is an

endomorphism.

Definition 10.11. A null mapping O : E → F is a mapping defined in the followingway:

∀v ∈ E : O(v) = oF.

It can easily be proved that this mapping is linear.

Example 10.31. The linear mapping f : R→ R, f (x) = 0 is a null mapping.

Example 10.32. The linear mapping f : R2 → R, f (x,y) = 0 is a null mapping.

Example 10.33. The linear mapping f : R2 →R2, f (x,y) = (0,0) is a null mapping.

Definition 10.12. An identity mapping I : E → F is a mapping defined in the fol-lowing way:

∀v ∈ E : I (v) = v.

It can easily be proved that this mapping is linear and is an endomorphism.

Example 10.34. The linear mapping f : R→ R, f (x) = x is an identity mapping.

Example 10.35. The linear mapping f :R2 →R2, f (x,y) = (x,y) is an identity map-

ping.

Example 10.36. If we consider a linear mapping f : R2 → R, we cannot define anidentity mapping since. Of course, for a vector (x,y) ∈R

2 we cannot have f (x,y) =(x,y) as it would not be defined within R. This explains why identity mappingsmake sense only for endomorphisms.

Proposition 10.3. Let f : E → E be an endomorphism. If v1,v2, . . . ,vn ∈ E are lin-early dependent then f (v1) , f (v2) , . . . , f (vn) ∈ F are also linearly dependent.

Proof. If v1,v2, . . . ,vn ∈ E are linearly dependent then ∃ scalars λ1,λ2, . . . ,λn �=0,0, . . . ,0 such that

oE = λ1v1 +λ2v2 + . . .+λnvn.

Page 362: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

348 10 Linear Mappings

Let us apply the linear mapping to this equation:

f (oE) = f (λ1v1 +λ2v2 + . . .+λnvn) .

For the linearity of the mapping we can write

f (λ1v1 +λ2v2 + . . .+λnvn) =

= f (λ1v1)+ f (λ2v2)+ . . .+ f (λnvn) =

= λ1 f (v1)+λ2 f (v2)+ . . .+λn f (vn) = f (oE) .

Since for Proposition 10.1 f (oE) = oF we have

oF = λ1 f (v1)+λ2 f (v2)+ . . .+λn f (vn)

with λ1,λ2, . . . ,λn �= 0,0, . . . ,0, i.e. f (v1) , f (v2) , . . . , f (vn) are linearly dependent.��

Example 10.37. To understand the meaning of the proposition above let us considerthe following vectors of R2:

v1 = (0,1)v2 = (0,4)

and the linear mapping f : R2 → R2 defined as

f (x,y) = (x+ y,x+2y) .

The two vectors are clearly linearly dependent as v2 = 4v1. Let us check thelinear dependence of the mapped vectors:

f (v1) = (1,2)f (v2) = (4,8) .

These vectors are also linearly dependent since f (v2) = 4 f (v1).

Remark 10.1. It must be observed that there is no dual proposition for linearly in-dependent vectors, i.e. if v1,v2, . . . ,vn ∈ E are linearly independent then we cannotdraw conclusions on the linear dependence of f (v1) , f (v2) , . . . , f (vn) ∈ F .

Example 10.38. Let us now consider the following linearly independent vectors ofR

2:v1 = (0,1)v2 = (1,0)

and the linear mapping: f : R2 → R2 defined as

f (x,y) = (x+ y,2x+2y) .

Page 363: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.3 Endomorphisms and Kernel 349

We obtainf (v1) = (1,2)f (v2) = (1,2) .

We have a case where the transformed of linearly independent vectors are linearlydependent.

Definition 10.13. Let f : E → F be a linear mapping. The kernel of f is the set

ker( f ) = {v ∈ E| f (v) = oF} .

The following examples better clarify the concept of kernel.

Example 10.39. Let us find the kernel of the linear mapping f : R→ R defined asf (x) = 5x In this case the kernel ker = {0}. This can be easily calculated imposingf (x) = 0, i.e. 5x = 0.

Example 10.40. Let us consider the linear mapping f : R2 →R defined as f (x,y) =5x− y. To find the kernel means to find the (x,y) values such that f (x,y) = 0, i.e.those (x,y) values that satisfy the equation

5x− y = 0.

This is an equation in two variables. For the Rouché Capelli Theorem this equa-tion has ∞1 solutions. These solutions are all proportional to (α,5α), ∀α ∈ R. Thismeans that the kernel of this linear mapping is the composed of the point a linebelonging to R

2 and passing through the origin.More formally, the kernel is

ker( f ) = {(α,5α) ,α ∈ R}.

Example 10.41. Let us consider the linear mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,x+ y+2z) .

The kernel of this mapping is the set of (x,y,z) such that the mapping is equal tooF. This means that the kernel of this mapping is the set of (x,y,z) such that

⎧⎪⎨

⎪⎩

x+ y+ z = 0

x− y− z = 0

x+ y+2z = 0.

It can be easily verified that this homogeneous system of linear equations is de-termined. Thus,

ker( f ) = {(0,0,0)}= {oE}.

Example 10.42. Let us consider now the linear mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z) .

Page 364: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

350 10 Linear Mappings

To find the kernel means to solve the following system of linear equations:⎧⎪⎨

⎪⎩

x+ y+ z = 0

x− y− z = 0

2x+2y+2z = 0.

We can easily verify that

det

⎝1 1 11 −1 −12 2 2

⎠= 0

and the rank of the system is ρ = 2. Thus, this system is undetermined and has ∞1

solutions. If we pose x = α we find out that the infinite solutions of the system areα (0,−1,1), ∀α ∈ R. Thus, the kernel of the mapping is

ker( f ) = {α (0,1,−1) ,α ∈ R}.

Theorem 10.3. Let f : E → F be a linear mapping. The triple (ker( f ) ,+, ·) is avector subspace of (E,+, ·).Proof. Let us consider two vectors v,v′ ∈ ker( f ). If a vector v∈ ker( f ) then f (v) =oF. Thus,

f(v+v′

)= f (v)+ f

(v′)= oF +oF = oF

and f (v+v′) ∈ ker( f ). Thus, ker( f ) is closed with respect to the first compositionlaw. Let us consider a generic scalar λ ∈K and calculate

f (λv) = λ f (v) = λoF = oF.

Hence, f (λv)∈ ker( f ) and ker( f ) is closed with respect to the second compositionlaw.

This means that (ker( f ) ,+, ·) is a vector subspace of (E,+, ·). ��As shown in the examples above, the calculation of ker f can always be con-

sidered as the solution of a homogeneous system of linear equations. Thus, ker falways contains the null vector. This confirms the statement of the theorem above,i.e. (ker( f ) ,+, ·) is a vector space. The next example further clarifies this fact.

Example 10.43. Let us consider again the linear mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z) .

We already know that

ker( f ) = {α (0,1,−1) ,α ∈ R}.

This means at first that ker( f ) ⊂ R3 and, more specifically, can be seen as a

line of the space passing through the origin of the reference system. From its for-

Page 365: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.3 Endomorphisms and Kernel 351

mulation, it can be observed that (ker( f ) ,+, ·) is a vector space having dimensionone.

Theorem 10.4. Let f : E → F be a linear mapping and u,v ∈ E. It follows that

f (u) = f (v)

if and only ifu−v ∈ ker( f ) .

Proof. If f (u) = f (v) then

f (u)− f (v) = oF ⇒ f (u)+ f (−v) = oF ⇒⇒ f (u−v) = oF.

For the definition of kernel u−v ∈ ker( f ). ��If u−v ∈ ker( f ) then

f (u−v) = oF ⇒ f (u)− f (v) = oF ⇒⇒ f (u) = f (v) .��

Example 10.44. Again for the linear mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z)

we consider the following two vectors u,v, e.g.

u = (6,4,−7)v = (6,5,−8) .

Let us calculate their difference

u−v = (6,4,−7)− (6,5,−8) = (0,−1,1)

which belongs to ker( f ).Let us calculate the mapping of these two vectors:

f (v) = (6+4−7,6−4+7,12+8−14) = (3,9,6)f (v′) = (6+5−8,6−5+8,12+10−16) = (3,9,6) .

As stated from the theorem the mapped values are the same.

Theorem 10.5. Let f : E → F be a linear mapping. The mapping f is injective ifand only if

ker( f ) = {oE} .Proof. Let us assume that f is injective and, by contradiction, let us assume that

∃v ∈ ker( f )

with v �= oE.

Page 366: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

352 10 Linear Mappings

For definition of kernel

∀v ∈ ker( f ) : f (v) = oF.

On the other hand, for Proposition 10.1, f (oE) = oF. Thus,

f (v) = f (oE) .

Since f is injective, for definition of injective mapping this means that v = oE.We have reached a contradiction.

Hence, every vector v in the kernel is oE, i.e.

ker( f ) = {oE} .��

Let us assume that ker( f ) = {oE} and let us consider two vectors u,v ∈ E suchthat f (u) = f (v). It follows that

f (u) = f (v)⇒ f (u)− f (v) = oF.

It follows from the linearity of f that

f (u−v) = oF.

For the definition of kernel

u−v ∈ ker( f ) .

However, since for hypothesis

ker( f ) = {oE}

thenu−v = oE.

Hence, u = v.Since, ∀u,v ∈ E such that f (u) = f (v) it follows that u = v then f is injective.

��

Example 10.45. Let us consider once again, the mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z) .

We know that

ker( f ) = {α (0,1,−1)} �= oE = (0,0,0) .

From the theorem above we expect that this mapping is not injective. A mappingis injective if it always occurs that the transformed of different vectors are different.

Page 367: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.3 Endomorphisms and Kernel 353

In this case if we consider the following vectors

u = (0,8,−8)v = (0,9,−9)

it follows that u �= v. The transformed vectors are

f (u) = (0,0,0)f (v) = (0,0,0) .

Thus, in correspondence to u �= v we have f (u) = f (v). In other words thismapping is not injective, as expected.

Example 10.46. If we consider the mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,x+ y+2z)

we know that its kernel is oE. We can observe that if we take two different vectorsand calculate their transformed vectors we will never obtain the same vector. Thismapping is injective.

As a further comment we can say that if the homogeneous system of linear equa-tions associated with a mapping is determined (i.e. its only solution is the null vec-tor) then the kernel is only the null vector and the mapping is injective.

Example 10.47. A linear mapping f : R→ R defined as

f (x) = mx

with m finite and m �= 0 is injective. It can be observed that its kernel is

ker( f ) = {0}.

In the special case m = ∞, f is not a mapping while in the case m = 0, f is amapping and is also linear. The function is not injective and its kernel is

ker( f ) = {α (1) ,α ∈ R},

i.e. the entire set R.This result can be achieved looking at the equation mx = 0 as a system of one

equation in one variable. If m = 0 the matrix associated with system is singular andhas null rank. Hence the system has ∞1 solutions

Intuitively, we can observe that for m �= 0 the mapping transforms a line into aline while for m = 0 the mapping transforms a line into a constant (a point). Hencewe can see that there is a relation between the kernel and the deep meaning of themapping. This topic will be discussed more thoroughly below.

Theorem 10.6. Let f : E → F be a linear mapping. Let v1,v2, . . . ,vn be n linearlyindependent vectors ∈ E. If f is injective then f (v1) , f (v2) , . . . , f (vn) are alsolinearly independent vectors ∈ F.

Page 368: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

354 10 Linear Mappings

Proof. Let us assume, by contradiction that ∃λ1,λ2, . . . ,λn �= 0,0, . . . ,0 such that

oF = λ1 f (v1)+λ2 f (v2)+ · · ·+λn f (vn) .

For the Proposition 10.1 and linearity of f we can write this expression as

f (oE) = f (λ1v1 +λ2v2 + · · ·+λnvn) .

Since for hypothesis f is injective, it follows that

oE = λ1v1 +λ2v2 + · · ·+λnvn

with λ1,λ2, . . . ,λn �= 0,0, . . . ,0.This is impossible because v1,v2, . . . ,vn are linearly independent. Hence we

reached a contradiction and f (v1) , f (v2) , . . . , f (vn) must be linearly independent.��

Example 10.48. Let us consider the injective mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,x+ y+2z)

and the following linearly independent vectors of R3:

u = (1,0,0)v = (0,1,0)w = (0,0,1) .

The transformed of these vectors are

f (u) = (1,1,1)f (v) = (1,−1,1)f (w) = (1,−1,2) .

Let us check their linear dependence by finding, if they exist, the values of λ ,μ ,νsuch that

o = λ f (u)+μ f (v)+ν f (w) .

This is equivalent to solving the following homogeneous system of linear equa-tions: ⎧

⎪⎨

⎪⎩

λ +μ +ν = 0

λ −μ−ν = 0

λ +μ +2ν = 0.

The system is determined; thus, its only solution is (0,0,0). It follows that thevectors are linearly independent.

We can put into relationship Proposition 10.3 and Theorem 10.6: while linearlydependent is always preserved by a linear mapping, linearly independent is pre-served only by injective mapping, i.e. by mappings whose kernel is null.

Page 369: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 355

10.4 Rank and Nullity of Linear Mappings

Definition 10.14. Let f : E → F be a linear mapping and Im( f ) its image. Thedimension of the image dim(Im( f )) is said rank of a mapping.

Definition 10.15. Let f : E → F be a linear mapping and ker( f ) its kernel. Thedimension of the image dim(ker( f )) is said nullity of a mapping.

Example 10.49. If we consider again the linear mapping f : R3 → R3 defined as

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z)

and its kernelker( f ) = {α (0,1,−1) ,α ∈ R}

we can immediately see that (ker( f ) ,+, ·) is a vector space having dimension one.Hence, the nullity of the mapping is one.

In order to approach the calculation of the image, let us intuitively consider thatthis mapping transforms vectors of R3 into vectors that are surely linearly depen-dent as the third component is always twice the value of the first component. Thismeans that this mapping transforms points of the space into points of a plane, i.e.(Im( f ) ,+, ·) is a vector space having dimension two. The rank of this mapping istwo.

Theorem 10.7. Rank-Nullity Theorem. Let f : E → F be a linear mapping where(E,+, ·) and (F,+, ·) are vector spaces defined on the same scalar field K. Let(E,+, ·) be a finite-dimensional vector space whose dimension is dim(E) = n.

Under these hypotheses the sum of rank and nullity of a mapping is equal to thedimension of the vector space (E,+, ·):

dim(ker( f ))+dim(Im( f )) = dim(E) .

Proof. This proof is structured into three parts:

• Well-posedness of the equality• Special (degenerate) cases• General case

Well-posedness of the Equality

At first, let us prove that the equality considers only finite numbers. In order to provethis fact, since

dim(E) = n

is a finite number we have to prove that also dim(ker( f )) and dim(Im( f )) are finitenumbers.

Since, by definition of kernel, the ker( f ) is a subset of E, then

dim(ker( f ))≤ dim(E) = n.

Hence, dim(ker( f )) is a finite number.

Page 370: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

356 10 Linear Mappings

Since (E,+, ·) is finite-dimensional,

∃ a basis B = {e1,e2, . . . ,en}

such that every vector v ∈ E can be expressed as

v = λ1e1 +λ2e2 + . . .+λnen.

Let us apply the linear transformation f to both the terms in the equation

f (v) = f (λ1e1 +λ2e2 + . . .+λnen) == λ1 f (e1)+λ2 f (e2)+ . . .+λn f (en) .

Thus,Im( f ) = L( f (e1) , f (e2) , . . . , f (en)) .

It follows thatdim(Im( f ))≤ n.

Hence, the equality contains only finite numbers.

Special Cases

Let us consider now two special cases:

1. dim(ker( f )) = 02. dim(ker( f )) = n

If dim(ker( f )) = 0, i.e. ker( f ) = {oE}, then f injective. Hence, if a basis of(E,+, ·) is

B = {e1,e2, . . . ,en}also the vectors

f (e1) , f (e2) , . . . , f (en) ∈ Im( f )

are linearly independent for Theorem 10.6. Since these vectors also span (Im( f ) ,+, ·),they compose a basis.

It follows thatdim(Im( f )) = n

and dim(ker( f ))+dim(Im( f )) = dim(E).If dim(ker( f )) = n, i.e. ker( f ) = E. Hence,

∀v ∈ E : f (v) = oF

andIm( f ) = {oF} .

Thus,dim(Im( f )) = 0

and dim(ker( f ))+dim(Im( f )) = dim(E).

Page 371: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 357

General Case

In the remaining cases, dim(ker( f )) is �= 0 and �= n. We can write

dim(ker( f )) = r ⇒∃Bker = {u1,u2, . . .ur}dim(Im( f )) = s⇒∃BIm = {w1,w2, . . .ws}

with 0 < r < n and 0 < s < n.By definition of image

w1 ∈ Im( f )⇒∃v1 ∈ E| f (v1) = w1w2 ∈ Im( f )⇒∃v2 ∈ E| f (v2) = w2. . .ws ∈ Im( f )⇒∃vs ∈ E| f (vs) = ws.

Moreover, ∀x ∈ E, the corresponding linear mapping f (x) can be expressed aslinear combination of the elements of BIm by means of the scalars h1,h2, . . . ,hs

f (x) = h1w1 +h2w2 + · · ·+hsws == h1 f (v1)+h2 f (v2)+ · · ·+hs f (vs) == f (h1v1 +h2v2 + · · ·+hsvs) .

We know that f is not injective because r �= 0. On the other hand, for the Theo-rem 10.4

u = x−h1v1−h2v2−·· ·−hsvs ∈ ker( f ) .

If we express u as a linear combination of the elements of Bker by means of thescalars l1, l2, . . . , lr, we can rearrange the equality as

x = h1v1 +h2v2 + · · ·+hsvs + l1u1 + l2u2 + · · ·+ lrur.

Since x has been arbitrarily chosen, we can conclude that the vectors

v1,v2, . . . ,vs,u1,u2, . . . ,ur

span E:E = L(v1,v2, . . . ,vs,u1,u2, . . . ,ur) .

Let us check the linear independence of these vectors. Let us consider the scalarsa1,a2, . . .as,b1,b2, . . . ,br and let us express the null vector as linear combination ofthe other vectors

oE = a1v1 +a2v2 + · · ·+asvs +b1u1 +b2u2 + · · ·+brur.

Let us calculate the linear mapping of this equality and apply the linear properties

f (oE) = oF = f (a1v1 +a2v2 + · · ·+asvs +b1u1 +b2u2 + · · ·+brur) == a1 f (v1)+a2 f (v2)+ · · ·+as f (vs)+b1 f (u1)+b2 f (u2)+ · · ·+br f (ur) == a1w1 +a2w2 + · · ·+asws +b1 f (u1)+b2 f (u2)+ · · ·+br f (ur) .

Page 372: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

358 10 Linear Mappings

We know that since u1,u2, . . . ,ur ∈ ker( f ) then

f (u1) = oFf (u2) = oF. . .f (ur) = oF.

It follows that

f (oE) = oF = a1w1 +a2w2 + · · ·+asws.

Since w1,w2, . . . ,ws compose a basis, they are linearly independent. It followsthat a1,a2, . . . ,as = 0,0, . . . ,0 and that

oE = a1v1 +a2v2 + · · ·+asvs +b1u1 +b2u2 + · · ·+brur == b1u1 +b2u2 + · · ·+brur.

Since u1,u2, . . . ,ur compose a basis, they are linearly independent. Hence, alsob1,b2, . . . ,br = 0,0, . . . ,0.

It follows that v1,v2, . . . ,vs,u1,u2, . . . ,ur are linearly independent. Since thesevectors also span E, they compose a basis. We know, for the hypothesis, thatdim(E) = n and we know that this basis is composed of r + s vectors, that isdim(ker( f ))+dim(Im( f )). Hence,

dim(ker( f ))+dim(Im( f )) = r+ s = n = dim(E) . ��

Example 10.50. The rank-nullity theorem expresses a relation among dim(ker( f )),dim(Im( f )), and dim(E). Usually, dim(Im( f )) is the hardest to calculate and thistheorem allows an easy way to find it.

Let us consider the two linear mappings R3 → R3 studied above, which will be

renamed f1 and f2 to avoid confusion in the notation, i.e.

f1 (x,y,z) = (x+ y+ z,x− y− z,x+ y+2z)

and

f2 (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z) .

We know that ker( f1) = {(0,0,0)}, i.e. dim(ker( f )) = 0 and dim(R

3)= 3.

For the rank-nullity theorem dim(Im( f )) = 3. As a geometrical interpretation, thismapping transforms points (vectors) of the (three-dimensional) space into points ofthe space.

Regarding f2, we know that ker( f2) = α (0,−1,1), i.e. dim(ker( f )) = 1 anddim

(R

3)= 3. For the rank-nullity theorem dim(Im( f )) = 2. As stated above, the

mapping f2 transforms points of the space into points of a plane in the space.

Page 373: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 359

Example 10.51. Let us check the rank-nullity theorem for the following mappings:

f1 : R→ R

f1 (x) = 5x

andf2 : R2 → R

f2 (x,y) = x+ y.

Regarding f1, the detection of the kernel is very straightforward:

5x = 0⇒ x = 0⇒ ker( f1) = {0}.

It follows that the rank of f1 is zero. Since dim(R,+, ·) = 1, we have that thenullity, i.e. dim(Im( f1) ,+, ·), is one. This mapping transforms the points of a line(x axis) into another line (having equation 5x).

Regarding f2, the kernel is calculated as

x+ y = 0⇒ (x,y) = α (1,−1) ,α ∈ R

from which it follows that

ker( f2) = α (1,−1) .

We can observe that dim(ker( f2)) = 1. Since dim(R

2)= 2, it follows that

dim(Im( f2)) = 1. This means that the mapping f2 transforms the points of the plane(R2) into the points of a line in the plane.

Example 10.52. Let us consider the linear mapping R3 → R

3 defined as

f (x,y,z) = (x+2y+ z,3x+6y+3z,5x+10y+5z) .

The kernel of this linear mapping is the set of points (x,y,z) such that⎧⎪⎨

⎪⎩

x+2y+ z = 0

3x+6y+3z = 0

5x+10y+5z = 0.

It can be checked that the rank of this homogeneous system of linear equations isρ = 1. Thus ∞2 solutions exists. If we pose x = α and z = γ with α,γ ∈ R we havethat the solution of the system of linear equations is

(x,y,z) =

(α,−α + γ

2,γ),

that is also the kernel of the mapping:

ker( f ) =

(α,−α + γ

2,γ).

Page 374: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

360 10 Linear Mappings

It follows that dim(ker( f ) ,+, ·) = 2. Since dim(R

3,+, ·)= 3, it follows from

the rank-nullity theorem that dim(Im( f )) = 1. We can conclude that the mapping ftransforms the points of the space (R3) into the points of a line of the space.

If we consider endomorphisms f : R3 → R3 we can have four possible cases:

• the corresponding system of linear equations is determined (has rank ρ = 3): thedimension of the kernel is dim(ker( f )) = 0 and the mapping transforms pointsof the space into points of the space

• the corresponding system of linear equations has rank ρ = 2: the dimension ofthe kernel is dim(ker( f )) = 1 and the mapping transforms points of the spaceinto points of a plane in the space

• the corresponding system of linear equations has rank ρ = 1: the dimension ofthe kernel is dim(ker( f )) = 2 and the mapping transforms points of the spaceinto points of a line in the space

• the corresponding system of linear equations has rank ρ = 0 (the mapping is thenull mapping): the dimension of the kernel is dim(ker( f )) = 3 and the mappingtransforms points of the space into a constant, that is (0,0,0)

Corollary 10.2. Let f : E → E be an endomorphism where (E,+, ·) is a finite-dimensional vector space.

• If f is injective then it is also surjective.• If f is surjective then it is also injective.

Proof. Let dim(E) = n. If f is injective ker( f ) = {oE}. Thus,

dim(ker( f )) = 0

and for the Rank-Nullity Theorem

n = dim(E) = dim(ker( f ))+dim(Im( f )) = dim(Im( f ))

Since f : E → E is an endomorphism, Im( f ) ⊆ E, the fact that dim(E) =dim(Im( f )) implicates that Im( f ) = E, i.e. f is surjective. ��

If f is surjectivedim(Im( f )) = n = dim(E)

For the Rank-Nullity Theorem

n = dim(E) = dim(ker( f ))+dim(Im( f )) .

It follows that dim(ker( f )) = 0 that is equivalent to say that f is injective. ��

Example 10.53. In order to better understand the meaning of this corollary let usremind the meaning of injective and surjective mappings.

In general, a mapping f : A → B is injective when it occurs that ∀v1,v2 ∈ A, ifv1 �= v2 then f (v1) �= f (v2).

Page 375: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 361

If the mapping is linear, it is injective if and only if its kernel is the null vector,see Theorem 10.5. For example, the mapping f : R3 → R

3 defined as

f (x,y,z) = (x− y+2z,x+ y+ z,−5x+2y+ z)

is injective (the matrix associated with the system is non-singular and then the sys-tem is determined).

We know that dim(Im( f ) ,+, ·) = 3 and that this mapping transforms points ofthe space (R3) into points of the space (R3). In our case B = R

3 and the image ofthe mapping is also Im( f ) = R

3, i.e. B = Im( f ). This statement is the definition ofsurjective mapping.

Thus, an injective linear mapping is always also surjective. On the other hand, theequivalence of injection and surjection would not be valid for non-linear mappings.

Example 10.54. Let us give an example for a non-injective mapping f : R3 → R3

f (x,y,z) = (x− y+2z,x+ y+ z,2x−2y+4z) .

We can easily see that this mapping is not injective since dim(ker( f ) ,+, ·) = 1.It follows that dim(Im( f ) ,+, ·) = 2 �= dim

(R

3,+·)= 3. This mapping is then not

surjective.

Example 10.55. Let us consider the mapping f : R2 → R

f (x,y) = (x+ y) .

Of course, this mapping is not an endomorphism and not injective since its ker-nel is ker( f ) = α (1,2) with α ∈ R. Hence, dim(ker( f )) = 1 and for the rank-nullity theorem dim(E) = 2 = dim(ker( f ))+dim(Im( f )) = 1+1. This means thatdim(Im( f )) = 1. The mapping is surjective. In other words, the Corollary abovestates that injective endomorphisms are also surjective and vice-versa. On the otherhand, a mapping which is not an endomorphism could be surjective and not injectiveor injective and not surjective.

Example 10.56. Let us consider the mapping f : R2 → R3

f (x,y) = (x+ y,x− y,3x+2y) .

Let us check the injection of this mapping by determining its kernel:⎧⎪⎨

⎪⎩

x+ y = 0

x− y = 0

3x+2y = 0.

The rank of the system is ρ = 2. Hence, only (0,0) is solution of the system.The kernel is then ker( f ) = {(0,0)} and its dimension is dim(ker( f )) = 0. Thismeans that the mapping is injective. From the rank-nullity theorem we know that

Page 376: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

362 10 Linear Mappings

dim(E) = 2 = dim(Im( f )) �= dim(F) = 3 where F = R3. Thus the mapping is not

surjective.

The latter two examples naturally lead to the following corollaries.

Corollary 10.3. Let f : E →F be a linear mapping with (E,+, ·) and (F,+, ·) finite-dimensional vector spaces. Let us consider that dim(E) > dim(F). It follows thatthe mapping is not injective.

Proof. Since Im( f ) ⊂ F , it follows that dim(Im( f )) ≤ dim(F). Hence from therank-nullity theorem

dim(E) = dim(ker( f ))+dim(Im( f ))⇒dim(ker( f )) = dim(E)−dim(Im( f ))≥ dim(E)−dim(F)> dim(F)−dim(F) = 0.

In other words, dim(ker( f )) > 0. Thus, ker( f ) cannot be only the null vector.This means that the mapping cannot be injective. ��

Corollary 10.4. Let f : E →F be a linear mapping with (E,+, ·) and (F,+, ·) finite-dimensional vector spaces. Let us consider that dim(E) < dim(F). It follows thatthe mapping is not surjective.

Proof. For the rank-nullity theorem we know that

dim(E) = dim(ker( f ))+dim(Im( f ))⇒⇒ dim(Im( f )) = dim(E)−dim(ker( f ))≤ dim(E)< dim(F) .

Thus, dim(Im( f ))< dim(F). The mapping cannot be surjective. ��

10.4.1 Matrix Representation of a Linear Mapping

Proposition 10.4. Every linear mapping is a multiplication of a matrix by a vector.

Proof. Let f : E → F be a linear mapping where (E,+, ·) and (F,+, ·) are finite-dimensional vector spaces defined on the same field K and whose dimension is nand m, respectively. Let us consider a vector x ∈ E

x = (x1,x2, . . .xn)

and a vector y ∈ Fy = (y1,y2, . . .ym) .

Let us consider now the expression y = f (x) which can be written as

(y1,y2, . . .ym) = f (x1,x2, . . .xn) .

Page 377: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 363

Since f is a linear mapping it can be written as

(y1,y2, . . .ym) =

⎜⎜⎝

a1,1x1 +a1,2x2 . . .a1,nxn,a2,1x1 +a2,2x2 . . .a2,nxn,

. . .am,1x1 +am,2x2 . . .am,nxn

⎟⎟⎠ .

This means thaty1 = a1,1x1 +a1,2x2 . . .a1,nxn,y2 = a2,1x1 +a2,2x2 . . .a2,nxn,

. . .ym = am,1x1 +am,2x2 . . .am,nxn.

Furthermore, since all these equations need to be simultaneously verified, theseequations compose a system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

y1 = a1,1x1 +a1,2x2 . . .a1,nxn,

y2 = a2,1x1 +a2,2x2 . . .a2,nxn,

. . .

ym = am,1x1 +am,2x2 . . .am,nxn.

This is a matrix equationy = Ax

where

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . .am,1 am,2 . . . am,n

⎟⎟⎠ . ��

Corollary 10.5. The matrix A characterizing a linear mapping y = f (x) = Ax isunique.

Example 10.57. Let us consider the linear mapping f : R3 → R3, f (x+ y− z,x− z ,

3x+2y+ z). Let us consider a vector (1,2,1). The mapped vector f (1,2,1) =(2,0,8).

Let us calculate the same mapped value as a product of a matrix by a vector:⎛

⎝1 1 −11 0 −13 2 1

⎝121

⎠=

⎝208

⎠ .

They vectors are clearly the same.

Proposition 10.5. Let f : E → F be a linear mapping where (E,+, ·) and (F,+, ·)are finite-dimensional vector spaces defined on the same field K and whose dimen-

Page 378: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

364 10 Linear Mappings

sion is n and m, respectively. The mapping y = f (x) is expressed as a matrix equa-tion y = Ax. It follows that the image of the mapping Im( f ) is spanned by thecolumn vectors of the matrix A:

Im( f ) = L(

a1,a2, . . .an)

whereA =

(a1,a2, . . .an

).

Proof. Without a loss of generality let us assume that f is an endomorphism. Let usconsider a vector x ∈ E

x = (x1,x2, . . .xn)

and a vector y ∈ F = Ey = (y1,y2, . . .yn) .

Let us consider now the expression y = f (x) which can be written as

(y1,y2, . . .yn) = f (x1,x2, . . .xn) .

The linear mapping f can be written as

(y1,y2, . . .ym) =

⎜⎜⎝

a1,1x1 +a1,2x2 . . .a1,nxn,a2,1x1 +a2,2x2 . . .a2,nxn,

. . .an,1x1 +an,2x2 . . .an,nxn

⎟⎟⎠

that isy1 = a1,1x1 +a1,2x2 . . .a1,nxn,y2 = a2,1x1 +a2,2x2 . . .a2,nxn,

. . .ym = an,1x1 +an,2x2 . . .an,nxn.

These equations can be written in the vectorial form⎛

⎜⎜⎝

a1,1

a2,1

. . .an,1

⎟⎟⎠x1 +

⎜⎜⎝

a1,2

a2,2

. . .an,2

⎟⎟⎠x2 + . . .+

⎜⎜⎝

a1,n

a2,n

. . .an,n

⎟⎟⎠xn =

⎜⎜⎝

y1

y1

. . .yn

⎟⎟⎠ .

This means thata1x1 +a2x2 + · · ·+anxn = y.

Every time a vector

x =

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠

Page 379: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 365

is chosen, a corresponding vector

y =

⎜⎜⎝

y1

y2

. . .yn

⎟⎟⎠ ∈ Im( f )

is identified.In other words, the vector space (Im( f ) ,+, ·) is spanned by the column of the

matrix A, a1,a2, . . . ,an:

Im( f ) = L(

a1,a2, . . . ,an).��

Example 10.58. Let us consider the linear mapping f :R3 →R2 defined by the bases

BR3 = {e1,e2,e3} and B

R2 ={

e′1,e′2

}as well as the matrix

A =

(1 −2 13 1 −1

).

This representation of the mapping is equivalent to f : R3 → R2 defined as

f (x1,x2,x3) = (x1−2x2 + x3,3x1 + x2− x3) .

Let us find the ker( f ). By definition of kernel

ker( f ) ={

x ∈ R3| f (x) = o

R2

}=

={(x1,x2,x3) ∈ R

3| f (x1,x2,x3) = (0,0)}.

This means {x1−2x2 + x3 = 0

3x1 + x2− x3 = 0

This system has rank 2. Thus, it has ∞1 solutions proportional to (1,4,7). Hence,

ker( f ) = L((1,4,7))

and it has dimension equal to 1. Since the dimension of the kernel is not 0, then themapping is not injective.

Let us find the Im( f ). As shown above the image is spanned by the columns ofthe associated matrix:

Im( f ) = L( f (e1) , f (e2) , f (e3)) =

= L((1,3) ,(−2,1) ,(1,−1)) .

Page 380: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

366 10 Linear Mappings

It can be easily seen that out of these three vectors, two are linearly independent.Hence, the dimension of Im( f ) is equal to 2. This is in agreement with the rank-nullity theorem as 1+2 = 3 = dim

(R

3). Since the dimension of Im( f ) is 2 as well

as the dimension of R2, the mapping is surjective.Let us compute the mapping in the point (−2,1,0):

f (−2,1,0) = ((1)(−2)+(−2)1+(1)0,(3)(−2)+(1)1+(−1)0) =

(−4,−5)

The same result can be achieved by calculating the linear combination of thecolumns of the matrix associated with the mapping:

−2

(13

)+1

(−21

)+0

(1−1

)=

(−4−5

)

Example 10.59. Let us consider now the linear mapping f : R2 →R3 defined by the

bases BR3 = {e1,e2} and B

R2 ={

e′1,e′2,e

′3

}as well as the matrix

A =

⎝2 −43 −1−2 4

⎠ .

The mapping can equivalently be expressed as⎧⎪⎨

⎪⎩

y1 = 2x1−4x2

y2 = 3x1− x2

y3 =−2x1 +4x2

or

∀(x1,x2) : f (x1,x2) = (y1,y2,y3) = (2x1−4x2,3x1− x2,2x1 +4x2)

that leads to

f (e1) = 2e′1 +3e′2−2e′3f (e2) =−4e′1− e′2 +4e′3.

Let us find the kernel of this mapping, i.e. by applying the definition, let us solvethe following homogeneous system of linear equations.

⎧⎪⎨

⎪⎩

2x1−4x2 = 0

3x1− x2 = 0

−2x1 +4x2 = 0

.

Page 381: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 367

It can be easily seen that only oR2 solves the system. Hence, ker( f ) = {o

R2} andits dimension is 0. This means that the mapping is injective.

Example 10.60. Let us find the image of the mapping:

Im( f ) = ( f (e1) , f (e2)) = ((2,3,−2) ,(−4,−1,4)) .

These two vectors are linearly independent. Thus, these two vectors compose abasis. Hence, the dimension of the image is 2 unlike the dimension of R3 (that is 3).The mapping is not surjective.

Example 10.61. Let us consider the linear mapping f : R3 → R3 defined as

f (x1,x2,x3) = (x1− x2 +2x3,x2 +2x3,x1 +4x3) .

The matrix associated with this mapping is

A =

⎝1 −1 20 1 21 0 4

⎠ .

Let us find the kernel of f . This means that we have to solve the following systemof linear equation ⎧

⎪⎨

⎪⎩

x1− x2 +2x3 = 0

x2 +2x3 = 0

x1 +4x3 = 0

.

The system is undetermined and has ∞1 solutions proportional to (4,2,−1). Inother words,

ker( f ) = L((4,2,−1))

andBker( f ) = B{(4,2,−1)} .

It follows that the dimension of the kernel is 1. Hence, f is not injective.If we consider the image

Im( f ) = L((1,0,1) ,(−1,1,0))

has dimension 2 as the three columns of the matrix A are linearly dependent (thethird can be obtained as the sum of the first multiplied by 4 and the second columnmultiplied by 2). The mapping is not surjective.

Page 382: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

368 10 Linear Mappings

10.4.2 A Linear Mapping as a Matrix: A Summarizing Scheme

For a given linear mapping f : E → F , with (E,+, ·) and (F,+, ·) vector spaces, ifwe pose

dim(E) = ndim(F) = m

the mapping is identified by a matrix A whose size is m×n.This matrix can be represented in terms of row vectors as

A =

⎜⎜⎝

K1K2. . .Km

⎟⎟⎠

and in terms of column vectors as

A =(

I1,I2, . . . ,In).

If we consider a vector x of n elements, it follows that

f (x) = Ax

which, equivalently, can be expressed as

Im( f ) = L(I1,I2, . . . ,In)

that is the vector space (Im( f ) ,+, ·) image of the mapping is spanned by the columnvectors of the matrix A.

In order to find the set kernel ker( f ) the following system of linear equationsmust be solved

Ax = o.

This means that the vector space (ker( f ) ,+, ·) kernel of the mapping is spannedby the solutions of Ax = o.

Let us indicate with ρ the rank of the matrix A. Among the vectors spanning theker( f ) only n−ρ are linearly independent. This means that

dim(ker( f )) = n−ρ .

From the rank-nullity theorem we can immediately check that

dim(Im( f )) = ρ

that is the number of linearly independent column vectors in the matrix A and thenumber of linearly independent vectors in (Im( f ) ,+, ·). Of course, it is not a coin-cidence that the term rank recurs to describe the rank of a matrix and the dimension

Page 383: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 369

of the of the image space of a linear mapping. As shown, although the two conceptsmay appear distinct, they indeed coincide.

10.4.3 Invertible Mappings

Definition 10.16. Let f : E → F be a linear mapping where (E,+, ·) and (F,+, ·)are finite-dimensional vector spaces. The mapping is said to be invertible if thereexists a mapping g : F → E such that

∀x ∈ E : x = g(( f (x))

and∀y ∈ F : y = f ((g(y)) .

Proposition 10.6. Let f : E → E be an endomorphism where (E,+, ·) is a finite-dimensional vector space and let f be identified to the matrix A. The mapping fis invertible if and only if f is bijective and its inverse g is identified by the matrixA−1.

Proof. The mapping f can be seen as the matrix equation y = Ax. We know fromCorollary 10.2 that an injective endomorphism is always also surjective and thusbijective.

If f is injective it follows that ker( f )= {oE}. This occurs when the homogeneoussystem of linear equations Ax = oF is determined and has the null vector as its onlysolution. This means that the matrix A is non-singular and thus invertible. It followsthat there exists an inverse matrix A−1 such that

x = A−1Ax

andy = AA−1y.

Thus, if f is a mappingy = f (x)

equivalent toy = Ax

then, we have found a mapping g

x = g(y)

that isx = A−1y. ��

If f is invertible there exists an inverse function g. Let us take the function gas x = A−1y. The inverse matrix A−1 exists only if A is non-singular. Under these

Page 384: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

370 10 Linear Mappings

conditions, Ax = oF is a determined system of linear equations. Its only solution,kernel of the mapping, is the null-vector. This means that ker( f ) = {oE} and thus fis injective and thus bijective. ��

Corollary 10.6. Let f : E → E be an endomorphism. If the inverse mapping exists,then it is unique.

Proof. The mapping f is identified by the matrix A and its inverse is g by its inverseA−1. Since the inverse of a matrix is unique the inverse mapping g is unique. ��

Example 10.62. Let us consider again the endomorphism f : R3 → R3, f (x,y,z) =

(x+ y− z,x− z,3x+2y+ z). The matrix associated with the mapping is

A =

⎝1 1 −11 0 −13 2 1

⎠ .

The homogeneous system of linear equations⎧⎪⎨

⎪⎩

x+ y− z = 0

x− z = 0

3x+2y+ z = 0

is determined and thus ker{oE}, i.e. the mapping is injective. It follows that thematrix A is invertible and its inverse is

A−1 =−14

⎝2 −3 −1−4 4 02 1 −1

⎠ .

Equivalently, we may state that the inverse mapping of f is g : R3 → R3

g(x,y,z) =

(−1

4(2x−3y− z) ,−1

4(−4x+4y) ,−1

4(2x+ y− z)

).

We know that f (1,2,1) = (2,0,8). Let us calculate the inverse vector by meansof the inverse mapping g of f :

A−1 =−14

⎝2 −3 −1−4 4 02 1 −1

⎝208

⎠=

⎝121

⎠ .

Example 10.63. Let us consider again the endomorphism f : R3 →R3, f (x+ y− z,

x− z,2x+ y−2z). The matrix associated with the mapping is

A =

⎝1 1 −11 0 −12 1 −2

⎠ .

Page 385: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 371

Since the matrix A is singular the ker( f ) �= {oE}, i.e. f is not injective. Equiva-lently, since A is singular, then A is not invertible and g does not exist.

Corollary 10.7. Let f : E → F be a linear mapping with dim(E) �= dim(F). Theinverse mapping of f does not exist.

Proof. Since the matrix associated with the mapping is rectangular, it has no inverse.Thus, the mapping is not invertible. ��

Example 10.64. Let us consider again the endomorphism f : R3 →R2, f (x+ y− z ,

x+5y− z). The mapping is not invertible.

Remark 10.2. As a further observation, if dim(E)< dim(F) is surely not surjectiveand if dim(E) > dim(F) the mapping is surely not injective. A basic requirementfor a mapping to be bijective and thus invertible is that it is an endomorphism.

10.4.4 Similar Matrices

Proposition 10.7. A change of basis is a bijective linear mapping.

Proof. Let (E,+, ·) be a fine-dimensional vector space and x ∈ E be its vector. Letthe vector x have its components

x = (x1,x2, . . . ,xn)

in the basis of EB = {e1,e2, . . . ,en} .

Thus, we can then express x as

x = x1e1 + x2e2 + . . .+ xnen.

Let us consider now another basis of the same vector space, i.e.

B′ ={

p1,p2, . . . ,pn}.

where the vectors p1,p2, . . . ,pn in the basis B have the following components

p1 =

⎜⎜⎝

p1,1

p2,1

. . .pn,1

⎟⎟⎠

p2 =

⎜⎜⎝

p1,2

p2,2

. . .pn,2

⎟⎟⎠

Page 386: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

372 10 Linear Mappings

. . .

pn =

⎜⎜⎝

p1,n

p2,n

. . .pn,n

⎟⎟⎠ .

Let us now represent x in the basis B′. This means that we should find the com-ponents (

x′1,x′2, . . . ,x

′n

)

such thatx = x′1p1 + x′2p2 + . . .+ x′npn.

This means that⎧⎪⎪⎪⎨

⎪⎪⎪⎩

x1 = x′1 p1,1 + x′2 p1,2 + . . .+ x′n p1,n

x2 = x′1 p2,1 + x′2 p2,2 + . . .+ x′n p2,n

. . .

xn = x′1 pn,1 + x′2 pn,2 + . . .+ x′n pn,n

that isx = Px′

where

P =

⎜⎜⎝

p1,1 p1,2 . . . p1,n

p2,1 p2,2 . . . p2,n

. . . . . . . . . . . .pn,1 pn,2 . . . pn,n

⎟⎟⎠=

(p1 p2 . . . pn

)

x′ =

⎜⎜⎝

x′1x′2. . .x′n

⎟⎟⎠ .

Thus, a basis transformation of a vector x in the basis B into a vector x′ in thebasis B′ is achieved by a matrix multiplication

x = Px′ = g(x′)x′ = P−1x = f (x)

where the columns of the matrix P are the vectors of the basis B′ (the matrix P is thusinvertible). Thus, the basis of change consists of an application of a linear mapping.��

Page 387: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 373

Example 10.65. Let us consider the vector space(R

3,+, ·)

and its orthonormal basisB{e1,e2,e3} where

e1 = (1,0,0)e2 = (0,1,0)e3 = (0,0,1) .

The following three vectors

p1 = (1,0,2)p2 = (0,5,1)p3 = (1,0,0)

in the basis B are linearly independent and span R3. Thus, p1,p2,p3 are a basis of

R3.The transformation matrix is

P =

⎝1 0 10 5 02 1 0

whose inverse matrix is

P−1 =

⎝0 −0.1 0.50 0.2 01 0.1 −0.5

⎠ .

Let x = (1,1,1) be a vector of R3 in the basis B.If we want to express the vector x = (1,1,1) in the new basis B′ = {p1,p2,p3},

we can simply writex′ = P−1x = (0.4,0.2,0.6) .

This fact was known already from Chap. 4 where, in the case of V3, it was shownhow to express a vector in a new basis. We already knew that to express a vector ina new basis a solution of a system of linear equations that is a matrix inversion wasrequired.

By using the same notation of Chap. 4 if we want to express x in the basis of p1,p2, and p3 we may write

(1,1,1) = x′1 (1,0,2)+ x′2 (0,5,1)+ x′3 (1,0,0)

which leads to the following system of linear equations⎧⎪⎨

⎪⎩

x′1 + x′3 = 1

5x′2 = 1

2x′1 + x′2 = 1

Page 388: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

374 10 Linear Mappings

that is, essentially, the inversion of the matrix associated with the system:

P =

⎝1 0 10 5 02 1 0

⎠ .

The vector in the new basis is the solution of the system of linear equations. Thisvector is λ ,μ ,ν = 0.4,0.2,0.6 = x′.

Thus, we can writePx′ = x⇒ x′ = P−1x.

In conclusion, the change of basis by matrix transformations is a generalizationto all vector sets and an extension to n variables of what has been shown for vectorsin the space.

Remark 10.3. Let us consider an endomorphism f : E → E and a finite-dimensionalvector space(E,+·) whose dimension is n. Let x,y ∈ E and the linear mapping f besuch that

y = f (x) .

We know that the endomorphism can be expressed as a product of a matrix A bythe vector x:

y = f (x) = Ax.

Let us apply the change of basis by means of a matrix P:

y = Py′

x = Px′.

The endomorphism can be expressed as

Py′ = APx′.

This meansy′ = P−1APx′ = A′x′

where A′ = P−1AP.

Definition 10.17. Let A and A′ be two square matrices. These two matrices are saidsimilar and are indicated with

A∼ A′

when exists a non-singular matrix P such that

A′ = P−1AP.

Considering that the matrices A and A′ represent two endomorphisms, also thetwo endomorphis are said to be similar.

Theorem 10.8. Let A and A′ be two similar matrices. These two matrices have samedeterminant and trace.

Page 389: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 375

Proof. Considering the similarity and remembering that det(P−1

)= 1

det(P)

det(A′)= det

(P−1AP

)= det

(P−1

)det(A)det(P) =

= det(A)det(

P−1)

det(P) = det(A)1

det(P)det(P) = det(A) . ��

Regarding the trace, we can remember that tr(AB) = tr(BA)

tr(A′)= tr

(P−1AP

)= tr

(P−1 (AP)

)=

= tr((AP)P−1

)= tr

(A(P)P−1

)= tr(A) . ��

Example 10.66. Let us consider the following matrix:

A =

⎝2 2 00 5 00 0 1

corresponding to the endomorphism f : R3 → R3

y = f (x) = (2x1 +2x2,5x2,x3)

where y = (y1,y2,y3).Let us calculate the function value for x = (1,1,1). The corresponding function

value is y = (4,5,1).Let us consider again the transformation matrix

P =

⎝1 0 10 5 02 1 0

and

P−1 =

⎝0 −0.1 0.50 0.2 01 0.1 −0.5

⎠ .

We can calculate x′ and y′

x′ = P−1x = (0.4,0.2,0.6)y′ = P−1y = (0,1,4) .

Let us calculate now

A′ = P−1AP =

⎝1 −2 00 5 01 12 2

⎠ .

Page 390: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

376 10 Linear Mappings

This means that the endomorphism y = f (x) can be represented in the new basis(in a new reference system) as y′ = f ′ (x′), that is

y′ = f ′(x′)= A′x′ =

(x′1−2x′2,5x′2,x

′1 +12x′2 +2x′3

).

We can verify that for x′ = (0.4,0.2,0.6) we have

y′ = A′x′ =

⎝1 −2 00 5 01 12 2

⎝0.40.20.6

⎠=

⎝014

⎠ .

Since the matrices A and A′ are similar, as we can easily check,

det(A) = det(A′)= 10

andtr(A) = tr

(A′)= 8.

Proposition 10.8. The similarity of matrices is an equivalence relation.

Proof. Let us consider three matrices A, A′, and A′′ and let us check the three prop-erties of the equivalence relations.

• Reflexivity: A∼ A.if ∃ a non-singular matrix P � ‘

A = P−1AP.

If we take the matrix P equal to the identity matrix I (P = I) this equation isalways verified. Thus, the similarity is reflexive.

• Symmetry: A∼ A′ ⇒ A′ ∼ A.Since A∼ A′ then it ∃ a non-singular matrix P � ‘

A′ = P−1AP.

We can then rewrite this equation as

PA′P−1 = A.

Let us pose Q = P−1 and write

A = Q−1A′Q,

i.e. A′ ∼ A. Since Q is surely invertible (it is the inverse of P), this relation issymmetric.

• Transitivity: (A′′ ∼ A′) and (A′ ∼ A)⇒ A′′ ∼ A.We may then write that ∃ a non-singular matrix P1 � ‘

A′ = P1−1AP1.

Page 391: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 377

and ∃ a non-singular matrix P2 � ‘

A′′ = P2−1A′P2.

By manipulating the latter two equations we have

A′′ = P2−1P1

−1AP1P2.

On the basis of Proposition 2.17, let us re-write this equation as

A′′ = (P1P2)−1 AP1P2.

Let us pose R = P1P2 and then

A′′ = R−1AR.

Both the matrices P1 and P2 are non-singular, i.e. det(P1) �= 0 and det(P2) �= 0.The matrix R is surely non-singular since

det(R) = det(P1P2) = det(P1)det(P2) �= 0.

Thus, the relation is transitive.The similarity of matrices (and linear mappings) is an equivalence relation. ��

This fact means that if a linear mapping is difficult to solve, it can be transformedinto an equivalent one, solved and anti-transformed to find the solution of the origi-nal problem.

10.4.5 Geometric Mappings

Let us consider a mapping f : R2 → R2. This mapping can be interpreted as an

operators that transforms a point in the plane into another point in the plane. Underthese conditions, the mapping is said geometric mapping in the plane.

Let us now consider the following mapping f : R2 → R2:

(y1

y2

)=

(s 00 s

)(x1

x2

)=

(sx1

sx2

).

It can be easily seen that this mapping is linear. This mapping is called uniformscaling. If the diagonal elements of the matrix are not equal this linear mapping iscalled non-uniform scaling and is represented by:

(y1

y2

)=

(s1 00 s2

)(x1

x2

)=

(s1x1

s2x2

).

Page 392: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

378 10 Linear Mappings

In the following figures, the basic points are indicated with a solid line while thetransformed points are indicated with a dashed line.

O

The following linear mapping is called rotation and is represented by(

y1

y2

)=

(cosθ −sinθsinθ cosθ

)(x1

x2

)=

(x1 cosθ − x2 sinθx1 sinθ + x2 cosθ

).

O

The following linear mapping is called shearing and is represented by(

y1

y2

)=

(1 s1

s2 1

)(x1

x2

)=

(x1 + s1x2

s2x1 + x2

).

If, as in figure, the coefficient s2 = 0 then this mapping is said horizontal shear-ing. If s1 = 0 the mapping is a vertical shearing.

O

The following two linear mappings are said reflection with respect to vertical andhorizontal axes. (

y1

y2

)=

(−1 00 1

)(x1

x2

)=

(−x1

x2

)

Page 393: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.4 Rank and Nullity of Linear Mappings 379

and (y1

y2

)=

(1 00 −1

)(x1

x2

)=

(x1

−x2

).

The reflection with respect to the origin of the reference system is given by(

y1

y2

)=

(−1 00 −1

)(x1

x2

)=

(−x1

−x2

).

O

Let us consider now the following mapping:

y = f (x) = x+ t

where

y1 = x1 + t1y2 = x2 + t2

where t = (t1, t2). This operation, namely translation moves the points a constantdistance in a specific direction (see figure below). Unlike the previous geometricmapping, a translation is not a linear mapping as the linearity properties are notvalid and a matrix representation by means of R2,2 matrices is not possible. Morespecifically, a translation is an affine mapping.

O

t1

t2 O′

In order to give a matrix representation to affine mappings let us introduce theconcept of homogeneous coordinates, i.e. we algebraically represent each point x ofthe plane by means of three coordinates where the third is identically equal to 1:

x =

⎝x1

x2

x3

⎠=

⎝x1

x2

1

⎠ .

Page 394: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

380 10 Linear Mappings

We can now give a matrix representation to the affine mapping translation in aplane:

⎝y1

y2

y3

⎠=

⎝1 0 t10 1 t20 0 1

⎝x1

x2

1

⎠=

⎝x1 + t1x2 + t2

1

⎠ .

All the linear mappings can be written in homogeneous coordinates simplyadding a row and a column to the matrix representing the mapping. For example,the scaling and rotation can be respectively performed by multiplying the followingmatrices by a point x:

⎝s1 0 00 s2 00 0 1

and ⎛

⎝cosθ −sinθ 0sinθ cosθ 0

0 0 1

If we indicate with M the 2×2 matrix representing a linear mapping in the planeand with t the translation vector of the plane, the generic geometric mapping is givenby a matrix (

M t0 1

).

The geometric mappings in the space can be operated in a similar way by addingone dimension. For example, the rotations around the three axes are given by

⎜⎜⎝

cosθ −sinθ 0 0sinθ cosθ 0 0

0 0 1 00 0 0 1

⎟⎟⎠ ,

⎜⎜⎝

cosθ 0 sinθ 00 1 0 0

−sinθ 0 cosθ 00 0 0 1

⎟⎟⎠ ,

and ⎛

⎜⎜⎝

1 0 0 00 cosθ −sinθ 00 sinθ cosθ 00 0 0 1

⎟⎟⎠ .

Page 395: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 381

The translation in the space is given by the following matrix⎛

⎜⎜⎝

1 0 0 t10 1 0 t20 0 1 t30 0 0 1

⎟⎟⎠ .

10.5 Eigenvalues, Eigenvectors, and Eigenspaces

In order to introduce the new concept of this section, let us consider the followingexample.

Example 10.67. Let us consider the following linear mapping f : R2 → R2

f (2x− y,3y)

corresponding to the matrix

A =

(2 −10 3

).

Let us now consider a vector

x =

(11

)

and let us calculate

f

(11

)= Ax =

(13

)

which can be graphically represented as

O

x

f (x)

For analogy, we may think that a linear mapping (at least R2 → R2) can be rep-

resented by a clock where one pointer is the input and the other is the output. Sinceboth the vectors are applied in the origin, a linear mapping varies the input in lengthand rotates it around the origin, that is the null vector of the vector space.

Page 396: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

382 10 Linear Mappings

Definition 10.18. Let f : E → E be an endomorphism where (E,+, ·) is a finite-dimensional vector space defined on the scalar field K whose dimension is n. Everyvector x such that f (x) = λx with λ scalar and x ∈ E \{oE} is said eigenvector ofthe endomorphism f related to the eigenvalue λ .

The concepts of eigenvectors and eigenvalues are extremely important as well astricky in mathematics. These concepts appear in various contexts and have practicalimplementation in various engineering problems. The most difficult aspect of theseconcepts is that they can be observed from different perspectives and take, on eachoccasion, a slightly different meaning.

As an initial interpretation by imposing f (x) = λx we are requiring that a linearmapping simply scales the input vector. In other words, if we think to vectors in thespace, we are requiring that the mapping changes only the module of a vector whileit keeps its original direction.

O

x

f (x) = λx

The search of eigenvectors is the search of those vectors belonging to the domain(the identification of a subset of the domain) whose linear mapping application be-haves like a multiplication of a scalar by a vector. This scalar is the eigenvalue.

For endomorphisms R→R, the detection eigenvectors and eigenvalues is trivialbecause the endomorphisms are already in the form f (x) = λx.

Example 10.68. Let us consider the endomorphism f : R→ R defined as

f (x) = 5x.

In this case, any vector x (number in this specific case) is a potential eigenvectorand λ = 5 would be the eigenvalue.

Example 10.69. When the endomorphism is between multidimensional vector spaces,the search of eigenvalues and eigenvectors is not trivial.

Let us consider the following endomorphism f : R2 → R2

f (x,y) = (x+ y,2x) .

By definition, an eigenvector (x,y) and an eigenvalue λ , respectively, verify thefollowing equation

f (x,y) = λ (x,y) .

Page 397: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 383

By combining the last two equations we have{

x+ y = λx

2x = λy⇒

{(1−λ )x+ y = 0

2x−λy = 0.

A scalar λ with a corresponding vector (x,y) that satisfy the homogeneous sys-tem of linear equations are an eigenvalue and its eigenvector, respectively.

Since the system is homogeneous the only way for it to be determined is if(x,y) = (0,0). If this situation occurs, regardless of the value of λ , the equationsof the system are verified. Since by definition an eigenvector x ∈ E \ {oE}, it fol-lows that (x,y) = (0,0) = oE is not an eigenvector.

On the other hand, if we fix the value of λ such that the matrix associated withthe system is singular, we have infinite eigenvectors associated with λ .

Theorem 10.9. Let f : E → E be an endomorphism. The set V (λ )⊂ E with λ ∈K

defined asV (λ ) = {oE}∪{x ∈ E| f (x) = λx}

with the composition laws is a vector subspace of (E,+, ·).

Proof. Let us prove the closure of V (λ ) with respect to the composition laws.Let us consider two generic vectors x1,x2 ∈V (λ ). For the definition of V (λ )

x1 ∈V (λ )⇒ f (x1) = λx1

x2 ∈V (λ )⇒ f (x2) = λx2.

It follows that

f (x1 +x2) = f (x1)+ f (x2) = λx1 +λx2 = λ (x1 +x2) .

Hence, since (x1 +x2) ∈ V (λ ), the set V (λ ) is closed with respect to the internalcomposition law.

Let us consider a scalar h ∈K. From the definition of V (λ ) we know that

x ∈V (λ )⇒ f (x) = λx.

It follows thatf (hx) = h f (x) = h(λx) = λ (hx) .

Hence, since (hx) ∈V (λ ), the set V (λ ) is closed with respect to the external com-position law.

We can conclude that (V (λ ) ,+, ·) is a vector subspace of (E,+, ·). ��

Definition 10.19. The vector subspace (V (λ ) ,+, ·) defined as above is said eigen-space of the endomorphism f related to the eigenvalue λ . The dimension of theeigenspace is said geometric multiplicity of the eigenvalue λ and is indicated withγm.

Page 398: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

384 10 Linear Mappings

Example 10.70. Let us consider again the endomorphism f : R2 → R2

f (x,y) = (x+ y,2x) .

We know that the condition for determining eigenvalues and eigenvectors is givenby the system of linear equations

{(1−λ )x+ y = 0

2x−λy = 0.

In order to identify an eigenvalue we need to pose that the matrix associated withthe system is singular:

det

((1−λ ) 1

2 −λ

)= 0.

This means that

(1−λ )(−λ )−2 = 0⇒ λ 2−λ −2 = 0.

The solutions of this polynomial would be the eigenvalues of this endomorphism.The solutions are λ1 =−1 and λ2 = 2, that are the eigenvalues of the endomorphism.

Let us choose λ1 for the homogeneous system above:{(1−λ1)x+ y = 0

2x−λ1y = 0⇒

{2x+ y = 0

2x+ y = 0.

As expected, this system is undetermined and ha ∞1 solutions of the type(α,−2α) = α (1,−2) with the parameter α ∈ R. The generic solution α (1,−2)can be interpreted as a set. More specifically this can be interpreted as a line withinthe plane (R2).

The theorem above says that (α (1,−2) ,+, ·) is a vector space (and referred to aseigenspace) and a subspace of

(R

2,+, ·). The set α (1,−2) is indicated with V (λ1)

to emphasize that it has been built after having chosen the eigenvalue λ1.

10.5.1 Method for Determining Eigenvalues and Eigenvectors

This section conceptualizes in a general fashion the method for determining eigen-values for any R

n → Rn endomorphisms.

Let f : E → E be an endomorphism defined over K and let (E,+, ·) be a finite-dimensional vector space having dimension n. A matrix A ∈ Rn,n is associated withthe endomorphism:

y = f (x) = Ax

Page 399: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 385

where the matrix A is

A =

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠ ,

the vector x is

x =

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠

and the vector y is

y =

⎜⎜⎝

y1

y2

. . .yn

⎟⎟⎠ .

Thus we can write⎛

⎜⎜⎝

y1

y2

. . .yn

⎟⎟⎠=

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠ .

Let us impose thatf (x) = λx = y

that is ⎛

⎜⎜⎝

a1,1 a1,2 . . . a1,n

a2,1 a2,2 . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n

⎟⎟⎠

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠= λ

⎜⎜⎝

x1

x2

. . .xn

⎟⎟⎠ .

This matrix equation corresponds to the following system of linear equations

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

a1,1x1 +a1,2x2 + . . .+a1,nxn = λx1

a2,1x1 +a2,2x2 + . . .+a2,nxn = λx2

. . .

an,1x1 +an,2x2 + . . .+an,nxn = λxn

⎧⎪⎪⎪⎨

⎪⎪⎪⎩

(a1,1−λ )x1 +a1,2x2 + . . .+a1,nxn = 0

a2,1x1 +(a2,2−λ )x2 + . . .+a2,nxn = 0

. . .

an,1x1 +an,2x2 + . . .+(an,n−λ )xn = 0.

Page 400: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

386 10 Linear Mappings

This is a homogeneous system of linear equations in the components of the eigen-vectors related to the eigenvalue λ . Since it is homogeneous, this system always hasone solution that is 0,0, . . . ,0. The null solution is not relevant in this context aseigenvectors cannot be null. If this system has infinite solutions then we can findeigenvectors and eigenvalues. In order to have more than a solution, the determinantof the matrix associated with this system must be null:

det

⎜⎜⎝

a1,1−λ a1,2 . . . a1,n

a2,1 a2,2−λ . . . a2,n

. . . . . . . . . . . .an,1 an,2 . . . an,n−λ

⎟⎟⎠= det(A− Iλ ) = 0.

If the calculations are performed a n order polynomial in the variable λ is ob-tained:

p(λ ) = (−1)n λ n +(−1)n−1 kn−1λ n−1 + . . .+(−1)k1λ + k0.

This polynomial is said characteristic polynomial of the endomorphism f . Inorder to find the eigenvalues we need to find those values of λ such that p(λ ) = 0and λ ∈ K. This means that although the equation has n roots, some values of λsatisfying the identity to 0 of the characteristic polynomial can be �∈K and thus noteigenvalues. This can be the case for an endomorphism defined over the R field. Inthis case, some roots of the characteristic polynomial can be complex and thus notbe eigenvalues.

As a further remark, since the characteristic polynomial is the determinant asso-ciated with a homogeneous system of linear equations (that always has at least onesolution), this polynomial has at least one root (there is at least one value of λ suchthat the determinant is null).

Equivalently to what written above, a vector x is an eigenvector if Ax = λx.Hence, when the eigenvalue has been determined the corresponding eigenvector isfound by solving the homogeneous system of linear equations

(A− Iλ )x = o

where the eigenvalue λ is a constant.As it can be observed by the examples and on the basis of the vector space theory,

if the system (A− Iλ )x = o has ∞k solutions, the geometric multiplicity of theeigenvalue λ is γm = k.

Let us say that If we indicate with ρ the rank of (A− Iλ ) then for a fixed eigen-value λ it follows that

γm = n−ρ .

This statement can be reformulated considering that (A− Iλ ) represents a matrixassociated with an endomorphism R

n → Rn. The kernel of this endomorphism is

the solution of the system (A− Iλ )x = o. Thus, the geometric multiplicity γm is thedimension of the kernel.

Page 401: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 387

This is the number of linearly independent eigenvectors associated with theeigenvalue λ that is the dimension of the associated eigenspace.

Definition 10.20. Let f : E → E be an endomorphism. Let p(λ ) be the order n char-acteristic polynomial related to the endomorphism. Let λ0 be a zero of the charac-teristic polynomial. This characteristic polynomial is said of algebraic multiplicityr ≤ n if it is divisible by (λ −λ0)

r and not by (λ −λ0)r+1.

Example 10.71. Let us consider an endomorphism f : R2 → R2 over the field R

represented byf (x,y) = (3x+2y,2x+ y)

corresponding to the following matrix

A =

(3 22 1

).

Let us compute the eigenvalues. At first let us calculate the characteristic poly-nomial

det

(3−λ 2

2 1−λ

)= (3−λ )(1−λ )−4 =

= 3−3λ −λ +λ 2−4 = λ 2−4λ −1.

The roots of the polynomial are λ1 = 1+√

32 and λ2 = 1−

√3

2 . They are botheigenvalues. In order to find the eigenvectors we need to solve the two followingsystems of linear equations:

(2−

√3

2 2

2 −√

32

)(x1

x2

)=

(00

)

and (2+

√3

2 2

2√

32

)(x1

x2

)=

(00

).

Example 10.72. Let us consider now the endomorphism f : R3 → R3 defined over

the field R and associated with the following matrix

A =

⎝0 1 0−2 −3 1

20 0 0

⎠ .

In order to find the eigenvalues we have to calculate

det

⎝−λ 1 0−2 −3−λ 1

20 0 −λ

⎠=−λ(λ 2 +3λ +2

).

Page 402: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

388 10 Linear Mappings

Hence, the eigenvalues are λ1 = 0, λ2 = −2, and λ3 = −1. By substituting theeigenvalues into the matrix (A− Iλ ) we obtain three homogeneous systems of linearequations whose solutions are the eigenvectors.

Theorem 10.10. Let f : E → E be an endomorphism and let (E,+, ·) be a finite-dimensional vector space having dimension n. Let x1,x2, . . . ,xp be p eigenvectorsof the endomorphism f related to the eigenvalues λ1,λ2, . . . ,λp. Let these eigenval-ues be all distinct roots of the characteristic polynomial p(λ ). It follows that theeigenvectors are all linearly independent.

Proof. Let us assume, by contradiction, that the eigenvectors are linearly dependent.Without a loss of generality, let us assume that the first r < p eigenvectors are theminimum number of linearly dependent vectors. Thus, we can express one of themas lineal combination of the others by means of l1, l2, . . . , lr−1 scalars:

xr = l1x1 + l2x2 + . . .+ lr−1xr−1.

From this equation, we derive two more equations. The first is obtained by mul-tiplying the terms by λr

λrxr = λrl1x1 +λrl2x2 + . . .+λrlr−1xr−1

while the second is obtained by calculating the linear mapping of the terms

f (xr) = λrxr = f (l1x1 + l2x2 + . . .+ lr−1xr−1) =

l1 f (x1)+ l2 f (x2)+ . . .+ lr−1 f (xr−1) =

λ1l1x1 +λ2l2x2 + . . .+λr−1lr−1xr−1.

Thus, the last two equations are equal. If we subtract the second equation fromthe first one, we obtain

oE = l1 (λr−λ1)x1 + l2 (λr−λ2)x2 + . . .+ l1 (λr−λr−1)xr−1.

Thus, the null vector is expressed as linear combination of r− 1 linearly inde-pendent vectors. This may occur only if the scalars are all null:

l1 (λr−λ1) = 0

l2 (λr−λ2) = 0

. . .

lr−1 (λr−λr−1) = 0.

Since for hypothesis the eigenvalues are all distinct

Page 403: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 389

(λr−λ1) �= 0

(λr−λ2) �= 0

. . .

(λr−λr−1) �= 0.

Hence, it must be that l1, l2, . . . , lr−1 = 0,0, . . . ,0. It follows that

xr = l1x1 + l2x2 + . . .+ lr−1xr−1 = oE.

This is impossible because an eigenvector is non-null by definition. Hence, wereached a contradiction. ��

Example 10.73. We know that for the endomorphism f : R2 → R2

f (x,y) = (x+ y,2x)

V (λ1)=α (1,−2) and (1,−2) is an eigenvector. Let us determine V (λ2). For λ2 = 2the system is

{(1−λ2)x+ y = 0

2x−λ2y = 0⇒

{−x+ y = 0

2x−2y = 0

whose generic solution is α (1,1) with α ∈R. Thus, (1,1) is an eigenvector associ-ated with λ2. Theorem 10.10 states that since λ1 �= λ2 (are distinct roots of the samepolynomial) then the corresponding eigenvectors are linearly independent.

We can easily check that (1,−2) and (1,1) are linearly independent.Let us verify that these vectors are eigenvectors

(1 12 0

)(1−2

)=

(−12

)= λ1

(1−2

)

and(

1 12 0

)(11

)=

(22

)= λ2

(11

).

These two vectors, separately, span two eigenspaces:

V (−1) = L((1,−2))V (2) = L((1,1)) .

The geometric multiplicity of both the eigenvalues is equal to 1.

Page 404: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

390 10 Linear Mappings

Let us graphically visualize some of these results. If we consider the eigenvectorx = (1,1) (solid line) and the transformed vector f (x) = (2,2) (dashed line) wehave

O

x

f (x)

In general, we can interpret an eigenvector x as a vector such that its transformedf (x) is parallel to x. The vector space (V (λ2) ,+, ·), with λ2 = 2, is the infinite lineof the plane R

2 having the same direction of the eigenvector and its transformed(dotted line):

O

x

f (x)

V (λ 2)

This fact can be expressed by stating that all the vectors on the dotted line, suchas (0.1,0.1), (3,3), (30,30), and (457,457), are all eigenvectors.

If we consider a vector which is not an eigenvector and its transformed they arenot parallel. For example for v = (1,3) its transformed is f (v) = (4,2). The twovectors are not parallel:

O

vf (v)

Page 405: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 391

Example 10.74. Let us consider the following endomorphism f : R2 → R2

f (x,y) = (x+3y,x− y) .

An eigenvalue of this endomorphism is a value λ such that f (x,y) = λ (x,y):{

x+3y = λx

x− y = λy⇒

{(1−λ )x+3y = 0

x+(−1−λ )y = 0.

The system in undetermined (the associated incomplete matrix is singular) when

(1−λ )(−1−λ )−3 = λ 2−4 = 0.

This equation is verified for λ1 = 2 and λ2 =−2.In order to calculate the eigenvector associated with λ1 = 2 we write

{(1−λ1)x+3y = 0

x+(−1−λ1)y = 0⇒

{−x+3y = 0

x−3y = 0

whose solution is α (3,1) with α ∈ R.For the calculation of the eigenvector associated with λ2 =−2 we write

{(1−λ2)x+3y = 0

x+(−1−λ2)y = 0⇒

{3x+3y = 0

x+ y = 0

whose solution is α (1,−1) with α ∈ R.Again, we have distinct eigenvalues and linearly independent eigenvectors (3,1)

and (1,−1). These two vectors, separately, span two eigenspaces:

V (2) = L((3,1))V (−2) = L((1,−1)) .

The geometric multiplicity of λ1 and λ2 is 1.

Example 10.75. For the following mapping f : R2 → R2 defined as

f (x,y) = (3x,3y)

let us impose that f (x,y) = λ (x,y).The following system of linear equation is imposed

{3x = λx

3y = λy⇒

{(3−λ )x = 0

(3−λ )y = 0.

Page 406: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

392 10 Linear Mappings

The determinant of the matrix associated with the system, (3−λ )2, is null onlyfor λ = 3, which is a double eigenvalue. If we substitute λ = 3 we obtain

{0x = 0

0y = 0

which is always verified. The system is still of two equations in two variables. Therank of the associated matrix is ρ = 0. Hence, there exist ∞2 solutions of the type(α,β ) with α,β ∈ R.

The generic solution of the system is α (1,0) + β (0,1). The eigenspace isspanned by the two vectors (1,0) and (0,1):

V (3) = L((1,0) ,(0,1))

that is the entire plane R2. This means that every vector, except for the null vector,

is an eigenvector.The geometric multiplicity of the eigenvalue λ = 3 is 2.

Example 10.76. Let us consider the following linear mapping f : R3 → R3 defined

asf (x,y,z) = (x+ y,2y+ z,−4z) .

Let us search the eigenvalues⎧⎪⎨

⎪⎩

x+ y = λx

2y+ z = λy

−4z = λ z

⎧⎪⎨

⎪⎩

(1−λ )x+ y = 0

(2−λ )y+ z = 0

(−4−λ )z = 0

whose determinant of the associated matrix is

det

⎝(1−λ ) 1 0

0 (2−λ ) 10 0 (−4−λ )

⎠= (1−λ )(2−λ )(−4−λ ) .

The eigenvalues are all distinct λ1 = 1, λ2 = 2, and λ3 =−4.Let us substitute λ1 = 1 into the system:

⎧⎪⎨

⎪⎩

y = 0

y+ z = 0

−5z = 0.

The associate solution is α (1,0,0), with α ∈R\(0,0,0). Nonetheless, the null vec-tor belongs to the eigenspace:

V (1) = L((1,0,0)) .

We can conclude that the geometric multiplicity of the eigenvalue λ1 = 1 is 0.

Page 407: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.5 Eigenvalues, Eigenvectors, and Eigenspaces 393

Let us substitute λ2 = 2 into the system:⎧⎪⎨

⎪⎩

−x+ y = 0

z = 0

−6z = 0

whose solution is α (1,1,0) with α ∈ R. The eigenspace is

V (2) = L((1,1,0)) .

Let us substitute λ3 =−4 into the system:⎧⎪⎨

⎪⎩

−3x+ y = 0

−2y+ z = 0

0z = 0.

The last equation is always verified. By posing x = α we have y = 3α and z = 6α ,i.e. the solution is α (1,3,6) and the eigenspace, is

V (−4) = L((1,3,6)) .

Example 10.77. Let us analyse another case where the eigenvalues are not distinct,i.e. the following linear mapping f : R3 → R

3

f (x,y,z) = (x+ z,2y,−x+3z) .

By applying the definition of eigenvalue we write⎧⎪⎨

⎪⎩

x+ z = λx

2y = λy

−x+3z = λ z

⎧⎪⎨

⎪⎩

(1−λ )x+ z = 0

(2−λ )y = 0

−x+(3−λ )z = 0.

This system is undetermined when

det

⎝(1−λ ) 0 1

0 (2−λ ) 0−1 0 (3−λ )

⎠= (2−λ )3 = 0

that is when λ = 2. This means that only one eigenvector can be calculated, i.e. thethree eigenvectors are linearly dependent.

By substituting into the system we have⎧⎪⎨

⎪⎩

−x+ z = 0

0y = 0

−x+ z = 0.

Page 408: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

394 10 Linear Mappings

The second equation is always verified while the first and the third say that x = z.Equivalently, we can see that this system has rank ρ = 1 and thus ∞2 solutions. Ifwe pose x = α and y = β we have that the generic solution (α,β ,α) = α (1,0,1)+β (0,1,0). The eigenspace is thus spanned by the vectors (1,0,1) and (0,1,0), thatcan be interpreted as a plane of the space.

Example 10.78. Finally, let us calculate eigenvalues, eigenvectors, and eigenspacefor the following mapping f : R3 → R

3 defined as

f (x,y,z) = (5x,5y,5z) .

From the system of linear equations⎧⎪⎨

⎪⎩

5x = λx

5y = λy

5z = λ z

⎧⎪⎨

⎪⎩

(5−λ )x = 0

(5−λ )y = 0

(5−λ )z = 0

we can see that the determinant associated with the matrix is (λ −5)3 = 0. It followsthat the only eigenvalue is triple and λ = 5.

By substituting the eigenvalue into the system we have⎧⎪⎨

⎪⎩

0x = 0

0y = 0

0z = 0

whose rank is ρ = 0. We have ∞3 solutions of the type (α,β ,γ) with α,β ,γ ∈ R

that isα (1,0,0)+β (0,1,0)+ γ (0,0,1) .

The span of the resulting eigenspace is

V (5) = L((1,0,0) ,(0,1,0) ,(0,0,1)) .

This means that every vector of the space, except for the null vector, is an eigen-vector. This means that the eigenspace is the entire space R

3.The geometric multiplicity of the eigenvalue λ = 5 as well as its algebraic mul-

tiplicity is 3.

Proposition 10.9. Let f : E → E be an endomorphism. Let p(λ ) be the order ncharacteristic polynomial related to the endomorphism. Let γm and αm be the geo-metric and algebraic multiplicity, respectively, of the characteristic polynomial. Itfollows that

1≤ γm ≤ αm ≤ n.

Page 409: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 395

Definition 10.21. Let f : E → E be and endomorphism and λ1,λ2, . . . ,λn the eigen-values associated with it. The set of the eigenvalues

Sp = {λ1,λ2, . . . ,λn}

is said spectrum of the endomorphism while

sr = maxi|λi|

is said spectral radius.

Theorem 10.11. Gerschgorin’s Theorem. Let A ∈ Cn,n be a matrix associatedwith an endomorphism f : Cn → C

n. Let us consider the following circular setsin the complex plane:

Ci =

{

z ∈ C|∣∣z−ai, j

∣∣≤

n

∑j=1,i �= j

∣∣ai, j

∣∣}

Di =

{

z ∈ C|∣∣z−ai, j

∣∣≤

n

∑i=1,i �= j

∣∣ai, j

∣∣}

.

For each eigenvalue λ it follows that

λ ∈ (∪ni =Ci)∩ (∪n

i = Di) .

Although the proof and details of the Gerschgorin’s Theorem are out of the scopeof this book, it is worthwhile picturing the meaning of this result. This theorem, fora given endomorphism and thus its associated matrix, allows to make an estimationof the region of the complex plane where the eigenvalues will be located. Of course,since real numbers are a special case of complex numbers, this result is valid alsofor matrices ∈ Rn,n.

10.6 Matrix Diagonalization

Theorem 10.12. Let A and A′ be two similar matrices. These two matrices have thesame characteristic polynomial:

det(A′ − Iλ

)= det(A− Iλ ) .

Proof. If the two matrices are similar then ∃ a non-singular matrix P such that

A′ = P−1AP.

Page 410: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

396 10 Linear Mappings

Hence, considering that the identity matrix, being the neutral element of the prod-uct between matrices, is similar to itself (I = P−1IP with P arbitrary non-singularmatrix),

det(A′ − Iλ

)= det

(P−1AP− Iλ

)=

= det(

P−1AP−(

P−1IP)

λ)= det

(P−1 (A− Iλ )P

)=

=1

det(P)det(A− Iλ )det(P) = det(A− Iλ ) . ��

This means that two similar matrices have also the same eigenvalues.

Example 10.79. From Example 10.66 we know that the following two matrices aresimilar:

A =

⎝2 2 00 5 00 0 1

and

A′ =

⎝1 −2 00 5 01 12 2

⎠ .

By calculatingdet(A−λ I)

and

det(A′ −λ I

)

we may verify that the characteristic polynomial in both cases is

−λ 3 +8λ 2−17λ +10.

The eigenvalues of both the matrices are λ1 = 2, λ2 = 1, λ3 = 5.

As mentioned in Chap. 2 a diagonal matrix is a matrix whose extra-diagonalelements are all zeros. Hence, a diagonal matrix is of the form

⎜⎜⎜⎜⎝

γ1,0,0, . . . ,00,γ2,0, . . . ,00,0,γ3, . . . ,0

. . .0,0,0, . . . ,γn

⎟⎟⎟⎟⎠.

Page 411: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 397

Definition 10.22. Let f : E → E be an endomorphism. The endomorphism is diag-onalizable if there exists a basis spanning (E,+, ·) with respect to which the matrixdefining this mapping is diagonal.

In other words, the endomorphism is diagonalizable if it can transformed, by abasis transformation (a coordinate transformation), into a diagonal mapping.

If we remember that a basis spanning (E,+, ·) means a transformation matrixP whose columns are the vectors composing the basis, we can give an equivalentdefinition from the perspective of matrices.

Definition 10.23. A square matrix A is diagonalizable if it is similar to a diagonalmatrix: ∃ a non-singular matrix P such that

D = P−1AP

where D is a diagonal matrix and P is said transformation matrix.

By combining the latter definition with Theorem 10.12, for a diagonalizable ma-trix A, there exists a diagonal matrix D with the same eigenvalues.

Theorem 10.13. Let f : E → E be a finite-dimensional endomorphism being asso-ciated with a matrix A having order n. Let λ1,λ2, . . . ,λn be a set of scalars andx1,x2, . . . ,xn be n vectors having n dimensions.

Let P be a n×n matrix whose columns are the vectors x1,x2, . . . ,xn:

P =(

x1 x2 . . . xn).

and let D be a diagonal matrix whose diagonal elements are the scalarsλ1,λ2, . . . ,λn:

D =

⎜⎜⎜⎜⎝

λ1,0,0, . . . ,00,λ2,0, . . . ,00,0,λ3, . . . ,0

. . .0,0,0, . . . ,λn

⎟⎟⎟⎟⎠.

It follows that if A and D are similar, i.e.

D = P−1AP,

then λ1,λ2, . . . ,λn are the eigenvalues of the mapping and x1,x2, . . . ,xn are the cor-responding eigenvectors.

Proof. If A and D are similar then

D = P−1AP⇒ PD = AP

it follows that

AP = A(

x1 x2 . . . xn)=(

Ax1 Ax2 . . . Axn)

Page 412: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

398 10 Linear Mappings

and

PD =(

x1 x2 . . . xn)

⎜⎜⎝

λ1 0 . . . 00 λ2 . . . 0. . . . . . . . . . . .0 0 . . . λn

⎟⎟⎠=

(λ1x1 λ2x2 . . . λnxn

).

Since AP = PD, it follows that

(Ax1 Ax2 . . . Axn

)=(

λ1x1 λ2x2 . . . λnxn).

that is

Ax1 = λ1x1Ax2 = λ2x2. . .Axn = λ2xn.

This means that λ1,λ2, . . . ,λn are the eigenvalues of the mapping andx1,x2, . . . ,xn are the corresponding eigenvectors. ��

The diagonalization can be seen from two equivalent perspectives. According tothe first one, the diagonalization is a matrix transformation that aims at generatinga diagonal matrix. According to the second one, the diagonalization is a basis trans-formation into a reference system where the contribution of each component is onlyalong one axis.

As a combination of these two perspectives, if the matrix A is seen like a matrixassociated with a system of linear equations, the diagonalization transforms the orig-inal system into an equivalent system (i.e. having the same solutions) where all thevariables are uncoupled, i.e. every equation is in only one variable. The transforma-tion matrix associated with the basis transformation is a matrix P whose columnsare the eigenvectors of the mapping. Then the diagonal matrix D is calculated asD = P−1AP.

The result above can be rephrased in the following theorem.

Theorem 10.14. Let f : E → E be an endomorphism having n dimensions (it is thusfinite-dimensional) associated with the matrix A. If the mapping is diagonalizablethen

D = P−1AP

where

D =

⎜⎜⎝

λ1 0 . . . 00 λ2 . . . 0. . . . . . . . . . . .0 0 . . . λn

⎟⎟⎠

with λ1,λ2, . . . ,λn eigenvalues of the mapping (not necessarily distinct) and

P =(

x1 x2 . . . xn)

with x1,x2, . . . ,xn eigenvectors corresponding to the eigenvalues λ1,λ2, . . . ,λn.

Page 413: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 399

The following theorems describe the conditions under which an endomorphismis diagonalizable.

Proposition 10.10. Let f : E →E be an endomorphism defined by an order n matrixA. If the matrix (and thus the endomorphism) is diagonalizable, then its eigenvectorsare linearly independent.

Proof. If the matrix is diagonalizable, then there exists a non-singular matrix P suchthat D = P−1AP, with D diagonal.

For Theorem 10.13, the columns of the matrix P are the eigenvectors. Sincethe matrix P is invertible, then it is non-singular. Thus, the columns of P, i.e. theeigenvectors of the mapping, are linearly independent. ��

If the n eigenvectors are all linearly independent, they can be placed as columnsof the matrix P which would result non-singular. Thus, for Theorem 10.13 it resultsthat D = P−1AP is diagonal. Thus, A is diagonalizable.

Theorem 10.15. Diagonalization Theorem. Let f : E → E be an endomorphismdefined by a matrix A. The matrix (and thus the endomorphism) is diagonalizable ifand only if has n linearly independent eigenvectors, i.e. one of the following condi-tion occurs:

• all the eigenvalues are distinct• the algebraic multiplicity of each eigenvalue coincides with its geometric multi-

plicity.

The first condition can be easily proved by considering that the eigenvectorsassociated with distinct eigenvalues are linearly independent and thus the matrixP would be non-singular. It would easily follow that D = P−1AP is diagonal and Adiagonalizable.

Example 10.80. Let us consider an endomorphism associated with the followingmatrix

A =

⎝1 2 00 3 02 −4 2

Let us find the eigenvalues

det

⎝1−λ 2 0

0 3−λ 02 −4 2−λ

⎠= (1−λ )(2−λ )(3−λ ) .

The roots of the characteristic polynomial are λ1 = 3, λ2 = 2, and λ3 = 1. Sincethe eigenvalues are all distinct, the matrix is diagonalizable.

Page 414: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

400 10 Linear Mappings

In order to find the corresponding eigenvectors we need to solve the followingsystems of linear equations

⎝−2 2 00 0 02 −4 −1

⎝x1

x2

x3

⎠=

⎝000

whose ∞1 solutions are proportional to⎛

⎝−1−12

⎠ ,

then,⎛

⎝−1 2 00 1 02 −4 0

⎝x1

x2

x3

⎠=

⎝000

whose ∞1 solutions are proportional to⎛

⎝001

⎠ ,

and⎛

⎝0 2 00 2 02 −4 1

⎝x1

x2

x3

⎠=

⎝000

whose ∞1 solutions are proportional to⎛

⎝−102

⎠ .

Hence, the transformation matrix P is given by

P =

⎝−1 0 −1−1 0 02 1 2

⎠ .

The inverse of this matrix is

P−1 =

⎝0 −1 02 0 1−1 1 0

⎠ .

Page 415: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 401

It can be observed that

P−1AP =

=

⎝0 −1 02 0 1−1 1 0

⎝1 2 00 3 02 −4 2

⎝−1 0 −1−1 0 02 1 2

⎠=

= D =

⎝3 0 00 2 00 0 1

⎠ .

Example 10.81. Let us consider an endomorphism associated with the followingmatrix

A =

⎝−8 18 2−3 7 10 0 1

The characteristic polynomial

p(λ ) = det(A− Iλ ) = (2+λ )(λ −1)2

has roots λ1 =−2 with multiplicity 1 and λ2 = 1 with multiplicity 2.In order to find the eigenvector associated with λ1 = −2 we need to solve the

system of linear equations⎛

⎝−6 18 2−3 9 10 0 3

⎝x1

x2

x3

⎠=

⎝000

⎠ .

The ∞1 solutions of this system are proportional to⎛

⎝310

⎠ .

Hence, the eigenvalue λ1 has geometric multiplicity 1.In order to find the eigenvectors associated with λ2 = 1 we need to solve the

system of linear equations⎛

⎝−9 18 2−3 6 10 0 0

⎝x1

x2

x3

⎠=

⎝000

⎠ .

The ∞1 solutions of this system are proportional to

⎝161

361

Page 416: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

402 10 Linear Mappings

Hence, the eigenvalue λ2 has geometric multiplicity 1. Since the algebraic andgeometric multiplicities are not the same, the endomorphism is not diagonalizable.

Example 10.82. Let us finally consider an endomorphism associated with the fol-lowing matrix

A =

⎝8 −18 03 −7 00 0 −1

⎠ .

The characteristic polynomial is p(λ ) = (1+λ )2 (λ −2). Hence the eigenvaluesare λ1 = 2 with algebraic multiplicity 1 and λ2 =−1 with algebraic multiplicity 2.

In order to find the eigenvectors associated with λ1 = 2 we need to solve thesystem of linear equations

⎝6 −18 03 −9 00 0 −3

⎝x1

x2

x3

⎠=

⎝000

⎠ .

The ∞1 solutions of this system are proportional to⎛

⎝310

⎠ .

Thus, the geometric multiplicity of λ1 is 1.In order to find the eigenvectors associated with λ2 = −1 we need to solve the

system of linear equations⎛

⎝9 −18 03 −6 00 0 0

⎝x1

x2

x3

⎠=

⎝000

⎠ .

Since the first two rows are linearly dependent and the third is null, the rank ofthe system is 1 and the system has ∞2 solutions. The generic solution depends ontwo parameters α,β ∈ R and is ⎛

⎝2ααβ

⎠ .

The eigenvectors can be written as (2,1,0) and (0,0,1). Hence, the geometricmultiplicity of λ2 is 2. Thus, this endomorphism is diagonalizable.

A diagonal matrix of the endomorphism is

D =

⎝2 0 00 −1 00 0 −1

Page 417: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 403

and the corresponding transformation matrix is

P =

⎝3 2 01 1 00 0 1

10.6.1 Diagonalization of a Symmetric Mapping

We know that a symmetric matrix A is a square matrix such that

∀i, j : ai, j = a j,i

or, equivalently such that A = AT. We can give the following definition.

Definition 10.24. Let f : E → E be an endomorphism which can be expressed as

y = f (x) = Ax

where A is a symmetric matrix. This endomorphism is said symmetric mapping.

Example 10.83. The following mapping

y = f (2x1 + x2−4x3,x1 + x2 +2x3,−4x1 +2x2−5x3)

is associated with the matrix

A =

⎝2 1 −41 1 2−4 2 −5

is a symmetric mapping.

Let us recall the scalar product as in Definition 9.3. Given two vectors of realnumbers x and y their scalar product is

〈x,y〉= xTy.

Theorem 10.16. Let x and y be two n-dimensional real vectors and A be an n× nsymmetric matrix. It follows that

〈Ax,y〉= 〈x,Ay〉 .

Proof. Let us apply the definition of scalar product

〈Ax,y〉= (Ax)T y.

Page 418: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

404 10 Linear Mappings

For Theorem 2.1 this expression can be written as

(Ax)T y =(xTAT)y.

For associativity and symmetry of A we can write(xTAT)y = xT (Ay) = 〈x,Ay〉 .��

Example 10.84. Let us consider the following symmetric matrix A and the vectorsx and y:

A =

⎝1 0 40 2 34 3 5

⎠ ,

x =

⎝132

and

y =

⎝5−21

⎠ .

Let us calculate

Ax =

⎝9

1223

and

〈Ax,y〉=(

9 12 23)⎛

⎝5−21

⎠= 44.

Now let us calculate

Ay =

⎝9−119

and

〈x,Ay〉=(

1 3 2)⎛

⎝9−119

⎠= 44.

Let us recall now the definition of Hermitian product as in Definition 9.2 and letus extend this result to complex symmetric matrices. Given two vectors of complexnumbers x and y, the Hermitian product is

〈x,y〉= xTy

where xT is the transpose conjugate vector.

Page 419: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 405

Theorem 10.17. Let x and y be two n-dimensional complex vectors and A be ann×n symmetric matrix. It follows that the Hermitian product

〈Ax,y〉=⟨x, Ay

⟩.

Proof. By applying the definition

〈Ax,y〉= ˙(Ax)Ty

Let us consider thatAx = Ax

and apply Theorem 2.1: (Ax

)Ty =

(xTAT)y.

Thus, for associativity and symmetry of the matrix A(xTAT)y = xT (Ay

)=⟨x, Ay

⟩. ��

Example 10.85. Let us consider the following symmetric matrix A and the vectorsx and y:

A =

⎝2 1+ j 2

1+ j 5 52 5 4

⎠ ,

x =

⎝45 j1

and

y =

⎝11

2− j

⎠ .

Let us calculate

Ax =

⎝5+5 j

29+29 j12+25 j

Let us apply the Hermitian product

〈Ax,y〉=(Ax

)Ty = 13−96 j

and ⟨x, Ay

⟩= xT (Ay

)= 13−96 j.

Theorem 10.18. The eigenvalues of a symmetric mapping f : E → E associatedwith a matrix A ∈ Rn,n are all real.

Page 420: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

406 10 Linear Mappings

Proof. Let us assume by contradiction that λ is a complex eigenvalue of the sym-metric mapping. Let λ be the conjugate of this eigenvalue. Let x be the eigenvectorassociated with the eigenvalue λ (Ax = λx). Let us consider the Hermitian product〈x,x〉 and write

λ 〈x,x〉= 〈λx,x〉= 〈Ax,x〉= 〈x,Ax〉= 〈x,λx〉= λ 〈x,x〉 .

It follows thatλ = λ .

A complex number is equal to its conjugate only if the imaginary part is null, i.e.when it is a real number. Thus λ is a real number. ��

It should be remarked that a symmetric mapping has only real eigenvalues onlyif all the elements of the associated matrix are all real. Thus, a symmetric matrixwhose elements are complex numbers can have complex eigenvalues.

Example 10.86. The following symmetric endomorphism f : R2 → R2

f (x,y) = (2x+6y,6x+3y)

is associated with the matrix

A =

(2 66 3

)

has real eigenvalues λ1 =−3.52, λ2 = 8.52.

Example 10.87. The following symmetric endomorphism f : R2 → R2

f (x,y) = (4x+3y,3x+2y)

is associated with the matrix

A =

(4 33 2

)

has real eigenvaluesλ1 = 3−

√10 =−0.1623

λ2 = 3+√

10 = 6.1623.

Theorem 10.19. Let f : E → E be a symmetric mapping associated with the sym-metric matrix A ∈ Rn,n. Each pair of eigenvectors xi and xj corresponding to twodistinct eigenvalues λi and λ j are orthogonal.

Proof. Let f : E →E be a symmetric mapping associated with the symmetric matrixA ∈Rn,n. Let us consider two arbitrary distinct eigenvectors of this mapping, xi andxj and the corresponding distinct eigenvalues λi and λ j.

Let us calculate the scalar product

λi⟨xi,xj

⟩=⟨λixi,xj

⟩=⟨Axi,xj

⟩=⟨xi,Axj

⟩=⟨xi,λ jxj

⟩= λ j

⟨xi,xj

⟩.

Page 421: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 407

Since these two eigenvalues are distinct, i.e. λi �= λ j, it follows that the equationholds only if ⟨

xi,xj⟩= 0

that is, xi and xj are orthogonal. ��

Another way to express this concept is the following.

Remark 10.4. if A is a symmetric matrix, every pair of eigenvectors belonging todifferent eigenspaces are orthogonal.

Example 10.88. Let us consider the following symmetric mapping f : R2 → R2

f (x,y) = (5x+ y,x+5y)

which is associated with the following symmetric matrix

A =

(5 11 5

).

The characteristic polynomial is

det(A−λ I) = λ 2−10λ +24

whose roots areλ1 = 4λ2 = 6.

It can be noticed that the eigenvalues are real numbers. Let us calculate the cor-responding eigenspaces. For λ1 = 4 we have

V (4) =

{x+ y = 0

x+ y = 0

whose solution is α (1,−1).

V (6) =

{−x+ y = 0

x− y = 0

whose solution is α (1,1).Let us name x1 and x2 the eigenvectors associated with the eigenvalues λ1 and

λ2 respectively:

x1 =

(1−1

)

and

x2 =

(11

).

Page 422: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

408 10 Linear Mappings

It can be easily checked that

〈x1,x2〉= xT1 x2 = 0,

i.e. the two vectors belonging to different eigenspaces are orthogonal.

Example 10.89. Let us consider the following symmetric mapping f : R3 → R3

f (x,y,z) = (y+ z,x+ z,x+ y)

which is associated with the following symmetric matrix

A =

⎝0 1 11 0 11 1 0

⎠ .

The characteristic polynomial

det

⎝−λ 1 11 −λ 11 1 −λ

⎠=−λ 3 +3λ +2

whose roots areλ1 = 2λ2 =−1

where λ2 has algebraic multiplicity 2.Let us determine the corresponding eigenspaces.

V (2) =

⎧⎪⎨

⎪⎩

−2x+ y+ z = 0

x−2y+ z = 0

x+ y−2z = 0

has general solution α (1,1,1).

V (−1) =

⎧⎪⎨

⎪⎩

x+ y+ z = 0

x+ y+ z = 0

x+ y+ z = 0

has general solution α (−1,0,1)+β (−1,1,0).Thus a transformation matrix would be

P =(

x1 x2 x3)=

⎝1 −1 −11 0 11 1 0

⎠ .

Page 423: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 409

We can easily check that〈x1,x2〉= 0〈x1,x3〉= 0.

This fact is in agreement with Theorem 10.19 since x1 ∈V (2) and x2,x2 ∈V (−1).On the other hand, it can be observed that

〈x2,x3〉= 1,

that is x2 and x3 are not orthogonal.Let us apply the Gram-Schmidt orthonormalization to the column vectors of the

matrix P as shown in Sect. 9.4. The new matrix PG are

PG =(

e1 e2 e3)=

⎝0.57735 −0.70711 −0.408250.57735 0.00000 0.816500.57735 0.70711 −0.40825

⎠ .

We can easily verify that e1,e2,e3 are eigenvectors of the mapping. Furthermore,PG is an orthogonal matrix, i.e. P−1

G = PTG and

PTGAPG =

⎝2 0 00 −1 00 0 −1

⎠= D.

In other words, the transformation matrix P (in this case indicated with PG) isorthogonal. More specifically, in this case there exists an orthogonal transformationmatrix that diagonalizes the matrix A.

Definition 10.25. A matrix A is said orthogonally diagonalizable if ∃ an orthogonalmatrix P� ‘

D = PTAP

where D is a diagonal matrix exhibiting the eigenvalues on the diagonal and P is anorthogonal matrix whose columns are the eigenvectors.

Theorem 10.20. If a matrix A is orthogonally diagonalizable then A is symmetric.

Proof. Since A is orthogonally diagonalizable then ∃ an orthogonal matrix P� ‘

D = PTAP.

Since P is orthogonal P−1 = PT. Thus

A = PDPT.

Let us calculate the transpose

AT =(PDPT)T

.

Page 424: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

410 10 Linear Mappings

For Theorem 2.1 we can write the equation as

AT =(DPT)T

PT =(PT)T

DTPT = PDPT = A,

that is A is symmetric (A = AT). ��

Example 10.90. Let us consider the following symmetric mapping f : R2 → R2

f (x,y) = (x+3y,3x+3y)

whose associate matrix is

A =

(1 33 3

).

The characteristic polynomial is

p(λ ) = (1−λ )(3−λ )−9 = λ 2−4λ −6

whose roots areλ1 = 2−

√10 =−1.1623

λ2 = 2+√

10 = 5.1623.

Since the endomorphism has two distinct eigenvalues is diagonalizable and thediagonal matrix is

D =

(−1.1623 0

0 5.1623

)

and the transformation matrix P whose columns are the eigenvectors is

P =

(−0.81124 0.584710.58471 0.81124

).

It can be easily verified that the scalar product of the two columns of the matrixP is null. Thus, P is orthogonal and since

D = PTAP

the matrix A is orthogonally diagonalizable.

Theorem 10.21. Let f : Rn →Rn be a symmetric mapping associated with a matrix

A ∈ Rn,n. Let λ1,λ2, . . . ,λr be the r eigenvalues of the mapping and

V (λ1) ,V (λ2) , . . . ,V (λr)

be the corresponding eigenspaces.The vector space sum

V (λ1)+V (λ2)+ . . .+V (λr) = Rn.

Page 425: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.6 Matrix Diagonalization 411

Proof. Let us assume by contradiction that

V (λ1)+V (λ2)+ . . .+V (λr) =V �= Rn.

Let us assume thatdim(V ) = n−1.

Since V has n− 1 dimensions we may think about another set, W where thenth dimension lies and whose vectors are orthogonal to all the vectors in V . Thus,∀x ∈V and ∀w ∈W it follows that

〈x,w〉= 0.

Considering that x is an eigenvector associated with an eigenvalue λ (and thusAx = λx) it follows that

0 = 〈x,w〉= λ 〈x,w〉= 〈λx,w〉= 〈Ax,w〉= 〈x,Aw〉. (10.1)

Since x and Aw are orthogonal and only one direction orthogonal to all of thevectors in V exists, it follows that Aw ∈W , that w and Aw are parallel. This paral-lelism can be expressed by saying that ∃ a scalar λw � ‘

Aw = λww.

This fact means that λw is another eigenvalue of the mapping and w its corre-sponding eigenvector. Since w /∈ V where V is the sum set of all the eigenspaces,this is impossible.

Thus, V = Rn. ��

Example 10.91. Let us consider again the endomorphism in Example 10.88:

f (x,y) = (5x+ y,x+5x)

which is associated with the following symmetric matrix

A =

(5 11 5

).

The transformation matrix P whose columns are the eigenvector is

P =

(1 1−1 1

).

The eigenvectors are orthogonal and linearly independent. Thus, the columns ofP span R

2.

Example 10.92. Let us consider again the endomorphism from Example 10.89

f (x,y) = (y+ z,x+ z,x+ y)

Page 426: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

412 10 Linear Mappings

which is associated with the following symmetric matrix

A =

⎝0 1 11 0 11 1 0

⎠ .

The a transformation matrix P whose columns are eigenvectors is

P =(

x1 x2 x3)=

⎝1 −1 −11 0 11 1 0

⎠ .

We can easily verify that the eigenvectors are linearly independent and thus spanR

3.

Theorem 10.22. Let A ∈ Rn,n. If A is symmetric then it is diagonalizable.

Proof. Since A is symmetric, for Theorem 10.21 the sum of all the eigenspacesV = R

n. Thus dim(V ) = n. It follows that there exist n linearly independent eigen-vectors. This means that the matrix P is non-singular and thus invertible. Thus A isdiagonalizable. ��

Corollary 10.8. Let f : E → E be a symmetric mapping associated with a matrixA ∈ Rn,n. The mapping is orthogonally diagonalizable, i.e. ∃ an orthogonal trans-formation matrix P such that

D = PTAP

where D is a diagonal matrix exhibiting the eigenvalues of A on its diagonal.

10.7 Power Method

When a linear mapping is highly multivariate, the matrix associated with it is char-acterized by many columns (as many as the dimensions of the domain). In the caseof endomorphism, the number of variables is equal to the order of the associated ma-trix. Under these conditions, the calculation of the roots of the characteristic poly-nomial can be computationally onerous. This section describes an iterative methodfor determining one eigenvalue without calculating the roots of the characteristicpolynomial.

Definition 10.26. Let λ1,λ2, . . . ,λn be the eigenvalues associated with an endomor-phism f : Rn → R

n. The eigenvalue λ1 is said dominant eigenvalue if

|λ1|> |λi|

for i = 2, . . . ,n. The eigenvectors associated with the eigenvalue λ1 are said domi-nant eigenvectors.

Page 427: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.7 Power Method 413

The Power Method is an iterative method easily allowing the calculation of thedominant eigenvalue for endomorphisms having a dominant eigenvalue. Let us in-dicate with A the matrix associated with the endomorphism. The method processesan initial eigenvector guess x0 and is described in Algorithm 10.

Algorithm 10 Power Methodx1 = Ax0x2 = Ax1 = A2x0. . .xk = Axk−1 = Akx0

Example 10.93. Let us consider an endomorphism f : R2 → R2 represented by the

following matrix, see [20].

A =

(2 −121 −5

).

The characteristic polynomial is

det

(2−λ −12

1 −5−λ

)= (2−λ )(−5−λ )+12 = λ 2 +3λ +2

whose roots are λ1 =−1 and λ2 =−2. Hence, for the definition of dominant eigen-value λ2 is the dominant eigenvalue. The corresponding eigenvectors are derivedfrom

det

(4 −121 −3

)(x1

x2

)=

(00

)

whose ∞1 solutions are proportional to(

31

).

Let us reach the same result by means of the Power Method where the initialguess x0 = (1,1):

x1 = Ax0 =

(2 −121 −5

)(11

)=

(−10−4

)=−4

(2.51

)

x2 = Ax1 =

(2 −121 −5

)(−10−4

)=

(2810

)= 10

(2.81

)

x3 = Ax2 =

(2 −121 −5

)(2810

)=

(−64−22

)=−22

(2.91

1

)

x4 = Ax3 =

(2 −121 −5

)(−64−22

)=

(13646

)= 46

(2.96

1

)

Page 428: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

414 10 Linear Mappings

x5 = Ax4 =

(2 −121 −5

)(13646

)=

(−280−94

)=−94

(2.98

1

)

x6 = Ax5 =

(2 −121 −5

)(−280−94

)=

(568190

)= 190

(2.99

1

).

We have found an approximation of the dominant eigenvector. In order to findthe corresponding eigenvalue we need to introduce the following theorem.

Theorem 10.23. Rayleigh’s Quotient. Let f : Rn → Rn be an endomorphism and

x one of its eigenvectors. The corresponding eigenvalue λ is given by

λ =xTAxxTx

.

Proof. Since x is an eigenvector then Ax = λx. Hence,

xTAxxTx

=λxTxxTx

= λ . ��

Example 10.94. In the example above, the dominant eigenvalue is given by

λ =

(2.99,1)

(2 −121 −5

)(2.99

1

)

(2.99,1)

(2.99

1

) ≈ −209.94

≈−2.01.

We have found an approximation of the dominant eigenvalue.Since iterative multiplications can produce large numbers, the solutions are usu-

ally normalized with respect to the highest number in the vector. For example, if weconsider the matrix ⎛

⎝2 4 53 1 22 2 2

and apply the Power Method with an initial guess (1,1,1), we obtain

x1 =

⎝1166

⎠ .

Instead of carrying this vector, we can divide the vector elements by 11 and usethe modified x′1 for the following iteration.

x1 =

⎝1

0.540.54

⎠ .

Page 429: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.7 Power Method 415

This normalization is named scaling and the Power Method that applied the scal-ing at each iteration is said Power Method with scaling.

Let us now give a rigorous proof of the convergence of the Power Method.

Theorem 10.24. Let f :Rn →Rn be a diagonalizable endomorphism having a dom-

inant eigenvalue and A the matrix associated with it. It follows that ∃ a non-nullvector x0 such that for k = 1,2, . . .

xk = Akx0

approaches the dominant eigenvector.

Proof. Since A is diagonalizable, for Theorem 10.14 a basis of eigenvectorsx1,x2, . . . ,xn of Rn exists. These eigenvectors are associated with the correspond-ing eigenvalues λ1,λ2, . . . ,λn. Without a loss of generality, let us assume that λ1

is the dominant eigenvalue and x1 the corresponding dominant eigenvector. Sincethese eigenvectors compose a basis, they are linearly independent. We can choosean initial guess x0 such that

x0 = c1x1 + c2x2 + . . .+ cnxn

where the scalars c1,c2, . . . ,cn �= 0,0, . . . ,0 and c1 �= 0. Let us multiply the terms inthis equation by A:

Ax0 = A(c1x1 + c2x2 + . . .+ cnxn) =

= c1Ax1 + c2Ax2 + . . .+ cnAxn =

= c1λ1x1 + c2λ2x2 + . . .+ cnλnxn.

If we multiply the terms of the equation k times by the matrix A we obtain

Akx0 = c1λ k1 x1 + c2λ k

2 x2 + . . .+ cnλ kn xn

that leads to

Akx0 = λ k1

(c1x1 + c2

λ k2

λ k1

x2 + . . .+ cnλ k

n

λ k1

xn

)=

= λ k1

(

c1x1 + c2

(λ2

λ1

)k

x2 + . . .+ cn

(λn

λ1

)k

xn

)

.

Since λ1 is the largest eigenvalue in absolute value, the fractions

λ2

λ1,

λ3

λ1, . . . ,

λn

λ1

Page 430: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

416 10 Linear Mappings

are all smaller than 1. Hence, the fractions

(λ2

λ1

)k

,

(λ3

λ1

)k

, . . . ,

(λn

λ1

)k

approach 0 as k approaches infinity. It follows that

Akx0 = λ k1

(

c1x1 + c2

(λ2

λ1

)k

x2 + . . .+ cn

(λn

λ1

)k

xn

)

⇒ Akx0 ≈ λ k1 c1x1.

with c1 �= 0. This means that as k grows the method converges to a vector that isproportional to the dominant eigenvector. ��

Exercises

10.1. Let the endomorphism O : Rn → Rn be the null mapping. Determine its rank

and nullity. State whether or not this mapping is invertible. Justify the answer.

10.2. Determine kernel, nullity and rank of the following endomorphism f : R3 →R

3

f (x,y,z) = (x+ y+ z,x− y− z,2x+2y+2z)

Verify the validity of the rank-nullity theorem.Determine whether or not this mapping is (1) injective; (2) surjective.Determine the Image of the mapping.Provide a geometrical interpretation of the mapping.

10.3. Let us consider the linear mapping R3 → R

3 defined as

f (x,y,z) = (x+2y+ z,3x+6y+3z,5x+10y+5z) .

Determine kernel, nullity and rank of the endomorphism. Verify the validity ofthe rank-nullity theorem.

Determine whether or not this mapping is (1) injective; (2) surjective.Determine the Image of the mapping.Provide a geometrical interpretation of the mapping.

10.4. Determine eigenvalues and one eigenvector associated with the following en-domorphism:

f (x,y,z) = (x+2y,3y,2x−4y+2z)

Determine whether or not this endomorphism is diagonalizable.

Page 431: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

10.7 Power Method 417

10.5. Let us consider the following endomorphism f : R2 → R2

f (x,y) = (x+ y,2x) .

Determine, if they exist, the eigenvalues of the mapping. If possible, diagonalizethe matrix.

10.6. Let us consider the endomorphism associated with the matrix A. Apply thePower Method to determine the dominant eigenvector and the Rayleigh’s Theoremto find the corresponding eigenvalue.

A =

⎝−1 −6 02 7 01 2 −1

⎠ .

10.7. Apply the Power Method to the following matrix notwithstanding the fact thatthis matrix does not have a dominant eigenvalue.

A =

⎝1 1 03 −1 00 0 −2

⎠ .

Comment on the results.

Page 432: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 11An Introduction to ComputationalComplexity

This chapter is not strictly about algebra. However, this chapter offers a set of math-ematical and computational instruments that will allow us to introduce several con-cepts in the following chapters. Moreover, the contents of this chapter are related toalgebra as they are ancillary concepts that help (and in some cases allow) the under-standing of algebra. More specifically, this chapter gives some basics of complexitytheory and discrete mathematics and will attempt to answer to the question: “Whatis a hard problem?”

We already know that the hardness of a problem strictly depends on the solver.In a human context, the same problem, e.g. learning how to play guitar, can be fairlyeasy for someone and extremely hard for someone else. In this chapter we will referto problems that usually humans cannot solve (not in a reasonable time at least).Hence, we will refer to the harness of a problem for a computational machine.

11.1 Complexity of Algorithms and Big-O Notation

A decision problem is a question whose answer can be either “yes” or “no”. It can beproved that all the problems can be decomposed as a sequence of decision problems.Due to the physics of the machines, computers ultimately can solve only decisionproblems. Since complex problems can be decomposed into a sequence of decisionproblems, a computing machine can tackle a complex problem by solving, one byone, each decision problem that compose it.

An algorithm is a finite sequence of instructions that allows to solve a given prob-lem. For example, each cooking recipe is an algorithm as it provides for a numberof instructions: ingredients, measures, method, oven temperature, etc. The recipe ofa chocolate cake is an algorithm that allows in a finite number of steps to transformsa set of inputs, such as sugar, butter, flour, cocoa, into a delicious dessert. However,not every problem can be solved by an algorithm.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_11

419

Page 433: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

420 11 An Introduction to Computational Complexity

Definition 11.1. A Turing Machine is a conceptual machine able to write and readon a tape of infinite length and to execute a set of definite operations. At most oneaction is allowed for any given situation. These operations compose the algorithms.

Throughout this chapter, every time we will refer to a machine and to an al-gorithm running within it we will refer to the Turing Machine, unless otherwisespecified.

A problem is said decidable (or computable) if an algorithm that solves the prob-lem exists or, equivalently, if the problem can be solved in finite (even if enormous)amount of time. This means that for each instance of the input the correspondingproblem solution is returned. A problem is said undecidable (or uncomputable) oth-erwise.

A example of undecidable problem is the so-called problem “halting problem”,formulated by the British mathematician Alan Turing in 1936. The halting problemis the problem of determining, from a description of an arbitrary computer programand an input, whether the program will stop running or continue to run forever.

Theorem 11.1. The vast majority of the problems are uncomputable.

Proof. Let Alg and Pro be the sets of all possible algorithms and problems, respec-tively.

The elements of the set Alg are algorithms. We may think of them as computerprograms, i.e. set of instructions that run within a computer. As such, they are rep-resented within a machine as a sequence of binary numbers (binary string). We maythink that this sequence is a binary number itself. The number can be convertedinto base 10 number, which will be a positive integer. Hence every algorithm can berepresented as a natural number. In other words,

∀x ∈ Alg : x ∈ N.

The elements of the set Pro are problems. As stated above, each problem can berepresented as a sequence of decision problems. Hence, a problem can be seen as afunction p that processes some inputs to ultimately give an answer “yes” or “no”.Obviously {“yes”, “no” } can be modelled as {0,1}. Since an input can be seenas a binary string, it can also be seen as a natural number. The function p is thenp : N→{0,1}.

This function can be expressed by means of a table with infinite columns.0 1 2 . . . 100 . . .0 1 1 . . . 0 . . .

The second line of this table is an infinite binary string. An infinite binary string canbe interpreted as a real number. If we put a decimal (strictly speaking binary) pointright before the first digit, the binary string .011 . . .0 . . . can be interpreted as a realnumber between 0 and 1. In other words, every decision problem can be representedas a real number:

∀y ∈ Pro : y ∈ R.

Page 434: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.1 Complexity of Algorithms and Big-O Notation 421

We know that R is uncountably infinite while N is countably infinite. Moreoverwe know that N⊂R and that the cardinality of N is much smaller than the cardinal-ity of R because ∀a,b ∈N,∃ infinite numbers c ∈R such that a < c < b. Hence, thenumber of the algorithms is much smaller that the number of problems. This meansthat the vast majority of problems cannot be solved, i.e. are uncomputable. ��

Although, in general, the majority of problems is undecidable, in this chapter weare interested in the study of decidable problems and the comparison of several al-gorithms that solve them. Let us suppose we want to build a house. Let us imaginethat as a first action we hire several engineers and architects to perform the initialproject design. Let us imagine that a number of projects are then produced. Not allthe projects can be taken into account because they may violate some law require-ments, e.g. the use of appropriate materials, the safety requirements, the minimumdistance from surrounding buildings, etc. Even if the project is done within a perfectrespect of laws and regulations, we may not consider it viable because of personalnecessities. For example we may exclude a project due to its excessive cost or as-sociated construction time. In order to compare different projects we have to makeclear what our preferences are and what would be the most important requirement.A similar consideration can be done for algorithms. Before entering into the detailslet us consider that the algorithm is automatically performed by a machine. Underthese conditions, firstly, an algorithm must be correct, i.e. the must produce, at eachinput, the right output. Secondly, the algorithm must be efficient. In order to assessthe efficiency of an algorithm the complexity of the algorithm must be evaluated.Two types of complexities are taken into account.

• Space complexity: amount of memory necessary for the algorithm to return thecorrect result

• Time complexity: number of elementary operations that the processor must per-form to return the correct result

Hence, the efficiency of an algorithm can be seen as a function of the length ofthe input. In this book we will focus on the time complexity. For a given problemthere can be many algorithms that solve it. In this case, a natural question will be toassess which algorithm solves the problem in the best way. Obviously this problemcan be decomposed as a set of pairwise comparisons: for a given problem and twoalgorithms solving it how can we assess which algorithm is better and which one isworse? Before explaining this we should clarify what is meant with “better”. Herewe enter the field of analysis of algorithms and complexity theory. We do not intendto develop these topics in this book as it is about algebra. However, we will limitourselves to a few simple considerations. Once an algorithms has been developed, itis fundamental to estimate prior to the algorithm’s execution on a machine, the timewill take to complete the task. This estimation (or algorithm examination) is saidanalysis of feasibility of the algorithm. An algorithm is said feasible if its executiontime is acceptable with respect to the necessity of solving a problem. Althoughthis concept is fairly vague in this formulation, it is fairly easy to understand thata very accurate algorithm that requires 100 years to return the solution cannot be

Page 435: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

422 11 An Introduction to Computational Complexity

used in a real-time industrial process. Probably, a 100 year waiting time would beunacceptable also in the case of a design.

More formally, we can identify a function of the inputs t (input). This functionmakes correspond, to the inputs, the number of elementary operations needed tosolve the problem/return the desired result where the execution time of an elemen-tary operation is assumed to be constant. Obviously, the amount of operations withina machine is directly proportionate to the execution time. Hence, we may think that,for a given problem, each algorithm is characterized by its own function t (input).This piece of information is static, i.e. is related to a specific problem.

Let us consider that the problem is scalable, i.e. it can be defined for a growingamount of homogeneous inputs. For example, a distribution network can be asso-ciated with a certain problem and algorithm. The variation of the amount of usersmake the problem vary in size. The time required by the algorithm to solve the prob-lem also varies. The main issue is to assess the impact of the variation in size of theproblem on the time required by the machine to solve the problem itself.

Let us consider a simple example.

Example 11.1. Let a and b be two vectors of size 5. Hence, the two vectors area = (a1,a2,a3,a4,a5) and b = (b1,b2,b3,b4,b5) respectively. Let us now performthe scalar product between the two vectors

ab = a1b1 +a2b2 +a3b3 +a4b4 +a5b5.

The algorithm calculating the scalar products performs the five products (aibi)and four sums. Hence, the complexity of the scalar product solver for vectors com-posed of five elements is 5+ 4 = 9. More generally, a scalar product between twovectors of length n requires the calculation of n products and n−1 sums. Hence thetime complexity of a scalar product is 2n−1 elementary operations.

If we now consider the matrix product between two matrices having size n, wehave to perform a scalar product for each element of the product matrix. Thus, weneed to compute n2 scalar products. This means that the time complexity of a prod-uct between matrix of size n is

n2 (2n−1) = 2n3−n2.

In other words, for a given n value, if we double the dimensionality we approxi-mately double the corresponding time of scalar product while we make the calcula-tion time of the product between matrices extremely bigger. For example if n = 5,the complexity of the scalar product is 9 and of the matrix product 225. If n = 10,the complexity of the scalar product becomes 19 while the complexity of the matrixproduct 1900.

This example shows how algorithms can be characterized by a different com-plexity. In order to estimate the machine time of an algorithm execution, the exactnumber of elementary calculations is not too important. The actual interest of themathematician/computer scientist is to estimate which kind of relation is betweendimensionality and time complexity. In the previous example, we have linear and

Page 436: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.2 P, NP, NP-Hard, NP-Complete Problems 423

cubic growth, respectively. The following trends of complexity are usually takeninto account.

• k constant• log(n) logarithmic• n linear• n2 quadratic• n3 cubic• nt polynomial• kn exponential• n! factorial

These trends are indicated with the symbol O (·) and named big-O notation. Forexample if an algorithms presents a linear growth of the number of elementary op-erations in dependence on the problem dimensionality is said to have a O (n) com-plexity.

As it can be easily observed the big-O notation gives us an understanding ofthe order of magnitude of the complexity of the problem. It is not too relevant todistinguish the details of the growth of the complexity while it is fundamental to un-derstand the growth of the complexity when the dimensionality increases. In otherwords, an increase of the complexity according to n or 30n are substantially com-parable. Hence, the corresponding problems (and algorithms) belong to the sameclass. On the contrary, a growth kn is a completely different problem.

11.2 P, NP, NP-Hard, NP-Complete Problems

Definition 11.2. The class of problems that can be exactly solved by an algorithmwithin a finite time and such that the time complexity is of the kind O

(nk)

with kfinite number ∈ R is said to have a polynomial complexity. This class of problemscomposes a set that will be indicated with P, see [21].

These problems are important because they are the problems that can surely besolved by a machine in a finite time, see e.g. [22]. Those problems that can be solvedby an algorithm within polynomial time are often referred to as feasible problemswhile the solving algorithm is often said to be efficient. It must be remarked thatalthough we may use the words feasible and efficient, the solution of the problemcan be extremely time-consuming if k is a large number. For example if k = 10252

the waiting time in a modern computer would likely be unreasonable even thoughthe problem is feasible and the algorithm is efficient.

Definition 11.3. A Nondeterministic Turing Machine is a Turing Machine where therules can have multiple actions for a given situation (one situation is prescribed intotwo or more rules by different actions).

Example 11.2. A simple Turing Machine may have the rule “If the light is ON turnsright” and no more rules about the light being ON. A Nondeterministic Turing Ma-

Page 437: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

424 11 An Introduction to Computational Complexity

chine may have both the rules “If the light is ON turns right” and “If the light is ONturns left”.

Definition 11.4. An algorithm that runs with a polynomial time complexity on aNondeterministic Turing Machine is said to have a Nondeterministic Polynomialcomplexity. The corresponding class of algorithms is indicated with NP.

An alternative and equivalent way to define and characterize NP problems isgiven by the following definition.

Definition 11.5. Let A be a problem. The problem A is a Nondeterministic Poly-nomial problem, NP problem, if and only if a given solution requires at most apolynomial time to be verified.

It can be easily observed that all the problems in P are also in NP, i.e. P ⊂ NP.Obviously many problems in NP are not also in P. In other words, many problemsrequire a non-polynomial, e.g. exponential time, to be solved but a polynomial timeto be verified.

Example 11.3. Let us consider the following discrete set of numbers

{1,2,3, . . . ,781}.

We want to compute the sum of these numbers. This is a very easy task becausefrom basic arithmetic we know that

n

∑i=1,i∈N

i =n(n+1)

2=

n2 +n2

.

Hence the problem above would simply be 781×7822 . In general the sum on n

natural numbers requires a constant number of operations regardless of n. In otherwords, this problem is characterized by O (k).

Let us consider, now, the sum of n generic numbers such as

{−31,57,6,−4,13,22,81}.

The sum of these numbers requires n−1 operations, hence the complexity of thisproblem is linear, i.e. O (n).

For the same set of numbers, we may want know whether or not there is a subsetsuch that its sum is 24. If we asked this question to a machine, 27 − 1 operationsshould be performed by checking all the possible grouping. In general, if we con-sider a set of n numbers, this problem requires 2n − 1 calculations. Hence, this isnot a P problem. More precisely this is an EXP problem since the time complex-ity associated with the problem is exponential. However, if a solution is given, e.g.{6,−4,22}, it will take only two operations to verify whether or not their sum is 24.In general, given a candidate solution of m numbers, we will perform m− 1 oper-ations to verify it. This means that the search of the solution requires more than apolynomial time while the verification of any solution can be performed in a poly-nomial time. This problem belongs to NP.

Page 438: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.2 P, NP, NP-Hard, NP-Complete Problems 425

Some mathematicians and computer scientists are investigating whether or not Pand NP coincide. The fact that the search of the solution is very different in termsof hardness/complexity is an argument to claim that they are different. On the otherhand, the fact that the verification of a solution is equally easy make the look the twosets as the same concept. Whether or not P and NP are coinciding sets is an openquestion in computer science that is still a hot topic of discussion and is beyond thescopes of this book.

Several problems can be solved by transforming the original problem into a dif-ferent problem. Let us consider a generic problem A and let us assume we want tosolve it. This problem may be very hard to solve but can be transformed into a mir-ror problem B that is easier. We could then transform the input from A to B space,solve by an algorithm in B and anti-transform the solution of B back to the A space.In this way we obtain a solution of the our original problem. The set of step justdescribe are said reduction of the problem A to the problem B. This fact is the basicconcept behind the following definition.

Definition 11.6. A decision problem H is said NP-hard when every NP problem Lcan be reduced to H within a polynomial time.

Equivalently, we can give an alternative definition of NP-hard problems.

Definition 11.7. A decision problem H is said NP-hard when is at least as hard asthe hardest NP problem.

The class of NP-hard problems is very large (actually infinite) and includes all theproblems that are at least as hard as the hardest NP problem. This means that the vastmajority of NP-hard problems are not in NP. For example, undecidable problems,such as the above-mentioned halting problem, are always NP-hard. A special role isplayed by a subset of NP-hard that is composed also by NP problems.

Definition 11.8. A problem is NP-complete if the problem is both NP-hard, and inNP.

Thus, NP-complete problems lay in the intersection between NP and NP-hardproblems. These problems are the hardest NP problems that can be found. Manyexamples can be made, especially from modern games. However, for the purposeof this book, that is to have an initial understanding of computational complexity,the same example shown above will be considered again. Given the set of integernumbers {−31,57,6,−4,13,22,81} we want to find a non-null subset whose sumis 24. We have intuitively shown that this problem is in NP. It can be proved byreduction that problems of this type, namely subset sum problem, are also NP-hard.A famous proof of this fact is performed by reduction using an important problem incomputational complexity, namely Boolean satisfiability problem. As an outcome,the subset sum problem is NP-complete, see e.g. [23] for the proof.

In order to clarify the contents of this section and give an intuitive representationof computational complexity, the following diagram is presented. All the problemsof the universe are represented over a line. Let us imagine we ideally sort them

Page 439: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

426 11 An Introduction to Computational Complexity

from the easiest (on the left) to the most difficult (on the right). The solid part ofthis line represents the set of decidable problems while the dashed part undecidableproblems. The sets of P and NP problems are highlighted as well as the class ofproblems EXP that can be solved within an exponential time. Also, NP-hard andNP-complete (grey rectangle) sets are represented.

P

NP

EXP

NP-hard

decidable undecidable

NP-complete

11.3 Representing Information

An important challenge in applied mathematics and theoretical computer scienceis the efficient representation and manipulation of the information. This challenge,albeit not coinciding with the computational complexity, it is related to it. In this sec-tion, a technique to efficiently represent data within a machine, the Huffman coding,and a representation of arithmetic operations to efficiently exploit the architectureof a machine, the polish and reverse polish notations, are given.

11.3.1 Huffman Coding

The Huffman coding is an algorithm to represent data in a compressed way byreserving the shorter length representation for frequent pieces of information andlonger for less frequent pieces of information, see [24]. Since the details are out-side the scopes of this book, let us explain the algorithmic functioning by meansof an example and a graphical representation. Let us consider the sentence “Missis-sippi river”. This sentence contains 17 characters. Considering that each characterrequires eight bits, the standard representation of this sentence requires 136 bits intotal.

Let us see for this example, how Huffman coding can lead to a substantial savingof the memory requirements. In order to do that, let us write the occurrences foreach letter appearing in the sentence:

Page 440: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.3 Representing Information 427

M �→ 1I �→ 5S �→ 4P �→ 2R �→ 2V �→ 1E �→ 1− �→ 1

where “–” indicates the blank space and �→ relates the occurrences to the letter. Thefirst step of the Huffman coding simply consists of sorting the letters from the mostfrequent to the least frequent.

I 5 S 4 P 2 R 2 M 1 V 1 E 1 - 1

From this diagram, we now connect the vertices associated with the least occur-rence and sum the occurrences:

I 5 S 4 P 2 R 2 M 1 V 1 E 1E 1 - 1

E- 2MV 2

The operation can be iterated to obtain:

I 5 S 4 P 2 R 2 M 1 V 1 E 1E 1 - 1

E- 2MV 2

MVE- 4

PR 4

Page 441: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

428 11 An Introduction to Computational Complexity

Eventually the complete scheme is the following:

I 5 S 4 P 2 R 2 M 1 V 1 E 1E 1 - 1

E- 2MV 2

MVE- 4

PR 4

PRMVE- 8

IS 9

ISPRMVE- 17

where in the top circle the number 17, i.e. the total number of characters, appears.Now let us label each edge of the construction by indicating with 0 the edge

incident on the left of the circle while with 1 the edge incident on the right of thecircle. Then, each bit is concatenated starting from the top circle down until theletter. Hence the scheme above becomes the following:

Page 442: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.3 Representing Information 429

I 5 S 4 P 2 R 2 M 1 V 1 E 1E 1 - 1

E- 2MV 2

MVE- 4

PR 4

PRMVE- 8

IS 9

ISPRMVE- 17

1010

10

0

1

0

01

0

1

1

and the Huffman coding of the letters is

I = 01S = 00P = 100R = 101M = 1100V = 1101E = 1110−= 1111.

It can be observed that the letters with the highest frequency have the shortestbit representation. On the contrary, the letters with the lowest frequency have thelongest bit representation. If we write again the “Mississippi River” sentence by

Page 443: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

430 11 An Introduction to Computational Complexity

means of the Huffman coding we will need 46 bits instead of the 136 bits for thestandard 4-bit binary representation. It must be appreciated that this massive mem-ory saving has been achieved without any loss in the delivered information and onlyby using an intelligent algorithmic solution.

11.3.2 Polish and Reverse Polish Notation

At the abstract level, a simple arithmetic operation can be interpreted as an operationinvolving two operands and one operator. For example the operation sum of a andb involves the operands a and b with the operator +. Normally, this operation isrepresented as

a+b

where the operator is written between the two operands. This way of writing theoperation is named infix notation. Although this notation may appear naturally un-derstandable for a human, it is indeed not the most efficient for an electronic calcu-lator. The logician Jan Łukasiewicz proposed an alternative notation for arithmeticoperations consisting of representing the operator before the operand or after theoperands:

+abab+ .

These two notations are said prefix and postfix notation, respectively. These nota-tions are also named polish and reverse notation, respectively, see [25].

These notations have essentially three advantages. In order to understand thefirst advantage let us focus on the a+b example. If this operation is performed in amachine, the operands must be loaded into the memory, the lifted into the computingunit when the operation can then be performed. Hence, the most natural way for acompiler to prioritize the instructions is the following:

Algorithm 11 a+b from the Compiler PerspectiveLoad memory register R1 with aLoad memory register R2 with bAdd what is in R1 with what is in R2 and write the answer into the memory register R3.

Since a machine has to execute the instructions in this order, the most efficientway to pass the information to a machine is by following the same order. In thisway, the machine does not require to interpret the notation and can immediatelystart performing the operations as they are written.

The second advantage is that the polish notation and especially the reverse polishnotation work in the same way as a stack memory of a calculator works. A stackmemory saves (pushes) and extracts (pops) the items sequentially. The stack mem-ory architecture requires that the first item to be popped is the last that has been

Page 444: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

11.3 Representing Information 431

pushed. If we consider for example the arithmetic expression (the symbol ∗ indi-cates the multiplication)

a+b∗ c,

in reverse polish notation becomes

abc∗+,

which corresponds exactly to the most efficient way to utilize a stack memory. Morespecifically, the calculation of the arithmetic expression above is achieved, from theperspective of the stack memory, by the following steps

Algorithm 12 a+b∗ c from the Stack Memory Perspectivepush apush bpush cpop cpop bcompute d = b∗ cpush dpop dpop acompute e = a+dpush epop e,

where the variables d and e are indicated just for explanation convenience (but arenot actual variables). The same set of instructions are graphically represented in thediagram below.

a

b

c

Stack Memory

d=b*c

Processor

a

d

Stack Memory

e=a+da

Stack MemoryProcessor

This sequence of instructions is essentially the very same of what representedby the reverse polish notation. In other words, the reverse polish notation explainsexactly and in a compact way what the memory stack of a machine supposed to do.

The third advantage is that the reverse polish notation allows to univocally writeall the arithmetic expressions without the need to writing parentheses. This was

Page 445: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

432 11 An Introduction to Computational Complexity

the reason why Łukasiewicz originally introduced it, i.e. to simplify the notation inlogical proofs. Let us consider the following expression:

(a+b)∗ c.

In this case the parentheses indicate that the sum must be performed before themultiplication. If we removed the parentheses the arithmetic expression would meansomething else, that is the multiplication of b by c first and then the sum of theresult with a. Thus, when we write with infix notation, the use of parentheses canbe necessary to avoid ambiguities. In polish or reverse polish notation, arithmeticexpressions can be written without ambiguities without the aid of parentheses. Inparticular, the expression (a+b)∗ c in reverse polish notation is:

cab+∗.

The operations of a complex arithmetic expression described in reverse polishnotation are performed from the most internal towards the most external.

Example 11.4. Let us consider the following arithmetic expression:

5∗ (4+3)+2∗6.

In reverse polish notation it can be written as

543+∗26∗+.

Page 446: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 12Graph Theory

In this chapter we introduce a notion of fundamental importance for modelling inschematic way a large amount of problems. This is the concept of a graph. Thisconcept applies not only to computer science and mathematics, but even in fieldsas diverse as chemistry, biology, physics, civil engineering, mapping, telephone net-works, electrical circuits, operational research, sociology, industrial organization,the theory of transport, artificial intelligence.

We will present some concepts of graph theory, those that seem most relevant forour purposes, omitting many others. A complete discussion of graph theory, on theother hand, would require more than a chapter. These pages are only an introductionto this fascinating theory.

12.1 Motivation and Basic Concepts

Historically graph theory was born in 1736 with Leonard Euler’s when he solvedthe so called Königsberg bridges problem, see [26]. The problem consisted of thefollowing. The Prussian town of Königsberg (Kaliningrad, in our days) was dividedinto four parts by the Pregel river, one of these parts being an island in the river.The four regions of the town were connected by seven bridges (Fig. 12.1). On sunnySundays the people of Königsberg used to go walking along the river and over thebridges. The question was the following: is there a walk using all the bridges once,that brings the pedestrian back to its starting point? The problem was solved byEuler, who showed that such a walk is not possible.

The importance of this result lies above all in the idea that Euler introduced tosolve this problem, and that is precisely gave rise to the theory of graphs. Euler real-ized that to solve the problem it was necessary to identify its essential elements, ne-glecting accessory or irrelevant items. For this purpose, Euler considered the modelin Fig. 12.2.

As it will be shown later, the general result obtained by Euler allows to solve theseven edges problem.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_12

433

Page 447: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

434 12 Graph Theory

Fig. 12.1 The Königsberg bridges

Definition 12.1. A digraph or directed graph G is a pair of sets (V,E) consistingof a finite set V �= /0 of elements called vertices (or nodes) and a set E ⊆ V ×V ofordered pairs of distinct vertices called arcs or directed edges.

Definition 12.2. Let G be a graph composed of the sets (V,E). A graph SG com-posed of (SV ⊂V,SE ⊂ E) is said subgraph of G.

A directed edge represents an element e = (v,w) ∈ E as an edge oriented fromvertex v, called starting point, until vertex w, called end point. The edges describethe links of the vertices.

Definition 12.3. Let G be a graph composed of the sets (V,E). Two vertices w andv ∈V are said adjacent if (v,w) ∈ E.

If the vertices w and v are adjacent they are also called neighbours. The set ofneighbours of a vertex v is said its neighbourhood N (v).

Definition 12.4. Let G be a graph composed of the sets (V,E). Two edges are adja-cent edges if they have a vertex in common.

Example 12.1. The graph G=(V,E) represented in the following figure is a digraph,where V = {v1,v2,v3,v4,v5,v6}, E = {(v1,v1) ,(v1,v2) ,(v2,v3) ,(v5,v6)}.

Page 448: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.1 Motivation and Basic Concepts 435

Fig. 12.2 Königsberg bridges graph

v1

v2

v3

v4

v5

v6

To model a problem, it is often not necessary that the edges of a graph are ori-ented: for example, to make a map of the streets of a city where every road is pass-able in both senses enough to indicate the arc between two points of the city and notthe direction of travel.

Definition 12.5. An undirected graph, or simply graph G is a pair G = (V,E) whichconsists of a finite set V �= /0 and a set E of unordered pairs of elements (not neces-sarily distinct from V ).

Example 12.2. An undirected graph is given by G = (V,E) where V = {v1,v2,v3,v4,v5,v6} and E = {(v1,v2) ,(v1,v3) ,(v6,v1)}

Page 449: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

436 12 Graph Theory

v1

v2

v3

v4

v5

v6

As a further characterization, if vi and v j are vertices of directed graph then ingeneral (vi,v j) �= (v j,vi) (they would be two different edges). On the contrary in anundirected graph is follows that (vi,v j) = (v j,vi).

In general, given a graph G = (V,E), when not specified whether it is directed orundirected, it is assumed to be undirected. We mostly consider undirected graphs.Hence, when we speak of a graph without further specification, we will refer to anundirected graph.

Definition 12.6. The order of a graph is the number of its vertices, while the size ofa graph is the number of its edges. Usually a graph of order n and size m is denotedby G(n,m).

Proposition 12.1. Let G(n,m) be a graph of order n and size m. The graph G(n,m)

can have at the most

(n2

)edges:

0≤ m≤(

n2

)

where

(n2

)= n!

2!(n−2)! is the Newton’s binomial coefficient.

In the extreme cases:

1. The case m = 0 corresponds to the null graph (which is often indicated with Nn).A null graph consists of n vertices v1,v2,v3, . . . ,vn, without any connection.

Example 12.3. An example of null graphs is shown in the following figure.

v1

v2

v3

v4

v5

v6

Page 450: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.1 Motivation and Basic Concepts 437

2. The case m =

(n2

)corresponds to the case in which each vertex is connected

with all the others.

Definition 12.7. A complete graph on n vertices, indicated with Kn, is a graph

G

(n,

(n2

)), i.e. a graph having n vertices and an edge for each pair of distinct

vertices.

Example 12.4. The chart below shows the graphs K1, . . . ,K4

v1

K1

v1

v2

K2

v1

v2

v3

K3

v1

v2

v3

v4

K4

Page 451: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

438 12 Graph Theory

It may be observed that in a directed graph since E ⊆V×V the maximum numberof edges is n2, where n is the number of nodes.

Definition 12.8. An edge of the type (vi,vi) is called (self)-loop.

Definition 12.9. A walk of a graph G is a sequence of vertices v1,v2, . . . ,vn where(v1,v2) ,(v2,v3) ,(v3,v4) , . . . ,(vi,vi+1) , . . . ,(vn−1,vn) are edges of the graph. Ver-tices and edges may appear more than once.

Definition 12.10. A trail is a finite alternating sequence of vertices and edges, be-ginning and ending with vertices, such that no edge appears more than once. Avertex, however, may appear more than once.

Example 12.5. In the graph below the sequence v1,v4,v5,v6 is a trail while the se-quence v1,v4,v3,v1,v4,v5,v6 in the trail graph above is a walk (and not a trail).

v1

v2

v3

v4 v5

v6

trail

trail

trail

The initial and final vertices of a trail called terminal vertices. A trail may beginand end at the same vertex. A trail of this kind is called closed trail. A trail that isnot closed (i.e. the terminal vertices are distinct) is called open trail.

Definition 12.11. An open trail in which no vertex appears more than once is calleda path (also simple path or elementary path).

Definition 12.12. A graph in which there is more than one edge that connects twovertices is said multigraph. Otherwise, i.e. in the case where given any two vertices,there is at most one edge that connects them, the graph is said simple.

Example 12.6. The graph corresponding to the bridges of Königsberg is a multi-graph.

Definition 12.13. The length of a trail is the number of its edges.

In the trail above, the length is 3. It immediately follows that an edge which isnot a self-loop is a path of length one. It should also be noted that a self-loop can beincluded in a walk but not in a path.

Page 452: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.1 Motivation and Basic Concepts 439

Definition 12.14. The distance d (vi,v j) between two vertices vi and v j of a graphG is the minimal length between all the trails (if they exist) which link them. If thevertexes are not linked d (vi,v j) = ∞. A trail of minimal length between two verticesof a graph is said to be geodesic.

Example 12.7. In the graph above, a geodesic trail is marked out: another trail is forexample v1,v3,v4,v5,v6. The geodesic trail has length 3 while the latter has length 4.

Proposition 12.2. The distance in a graph satisfies all the properties of a metricdistance. For all vertices u, v, and w:

• d (v,w)≥ 0, with d (v,w) = 0 if and only if v = w• d (v,w) = d (w,v)• d (u,w)≤ d (u,v)+d (v,w)

Definition 12.15. The diameter of a graph G is the maximum distance between twovertices of G.

Definition 12.16. A circuit or cycle in a graph is a closed trail.

A circuit is also called elementary cycle, circular path, and polygon.

Definition 12.17. If a graph G has circuits, the girth of G is the length of the short-est cycle contained in G and the circumference is the length of the longest cyclecontained in G.

It can be easily seen that the length of a circuit v1,v2, . . . ,vn = v1 is n−1.

Definition 12.18. A circuit is said even (odd) if its length is even (odd).

Definition 12.19. A graph is connected if we can reach any vertex from any othervertex by travelling along a trail. More formally: a graph G is said to be connectedif there is at least one trail between every pair of vertices in G. Otherwise, G isdisconnected.

It is easy to see that one may divide each graph in connected subgraphs.

Definition 12.20. A connected subgraph containing the maximum number of (con-nected) edges is said connected component (or simply component) of the graph G.

Example 12.8. In the graph below, the subgraph v1,v2,v3 is connected but is not aconnected component. The subgraph v1,v2,v3,v4 is a connected component.

v1 v2

v3v4 v5

v6

Page 453: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

440 12 Graph Theory

A null graph of more than one vertex is disconnected.

Definition 12.21. A vertex that is not connected to any part of a graph is said to beisolated.

Obviously, the concept of connected component of a graph must not be confusedwith the concept of vector component seen in the previous chapters.

Definition 12.22. The rank of a graph ρ is equal to the number of vertices n minusthe number of components c:

ρ = n− c.

Definition 12.23. The nullity of a graph ν is equal to number of edges m minus therank ρ:

ν = m−ρ .

If we combine the two definitions above it follows that ν = m−n+c. Moreover,if the graph is connected then ρ = n−1 and ν = m−n+1.

Furthermore, the equation m = ρ +ν can be interpreted rank-nullity theorem forgraphs, see Theorem 10.7. Let us consider a mapping f that consists of connecting nfixed nodes by means m edges. The number of edges m is the dimension of a vectorspace, the rank ρ is the dimension of the image, and the nullity is the dimension ofthe kernel.

Proposition 12.3. Let G be a graph. If G is not connected then its rank is equal tothe sum of the ranks of each of its connected component. Its nullity is equal to thesum of the nullities of each of its connected component.

Graphs are mathematical entities like sets, matrices and vectors. As such, for agraph G, a set operations can be defined for graphs. Among all the possible opera-tions, some are listed in the following.

1. Vertex Removal. A vertex vi can be removed from the graph G. Unless vi is anisolated vertex, we obtain something that is not a graph, because there will beedges that have only one end. Hence, we are then forced to remove, along withvi, all the edges that pass through vi. Let us indicate with the notation G− vi thesubgraph obtained from G by removing vi with all the edges passing through vi.So G− vi is the largest subgraph of G that does not contain the vertex vi.

Example 12.9. If we consider the following graph

v1v2

v3 v4

v5

Page 454: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.1 Motivation and Basic Concepts 441

and we remove v5, we obtain

v1v2

v3 v4

2. Edge Removal. An edge can be removed from a graph. Unlike for the vertex re-moval, the edge removal results into the removal of the edge but not the vertices.

Example 12.10. If from the graph in the example above the edge v4,v5 is removedthe following graph is obtained.

v1v2

v3 v4

v5

3. Union of Graphs. Let G1 (V1,E1) and G2 (V2,E2) be two graphs. The union graphGU (VU ,EU ) = G1 ∪G2 is a graph such that VU = V1 ∪V2 and EU = E1 ∪E2. Inother words, the union graph contains all vertices and edges of both G1 and G2.

4. Intersection of Graphs. Let G1 (V1,E1) and G2 (V2,E2) be two graphs. The in-tersection graph GI (VI ,EI) = G1 ∩G2 is a graph such that VI = V1 ∩V2 andEI = E1∩E2. In other words, the intersection graph contains vertices and edgesbelonging to G1 and at the same time to G2.

5. Difference Between Graphs. Let G1 (V1,E1) and G2 (V2,E2) be two graphs. Thedifference graph GD (VD,ED) = G1−G2 is a graph containing the edges belong-ing to G1 but not to G2 and all the vertices associated with the edges ED.

Page 455: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

442 12 Graph Theory

Example 12.11. Let us name the following graph G1

v1v2

v3 v4

and the following G2

v1v2

v3 v4

The difference graph GD = G1−G2 is given by

v1v2

v3 v4

6. Ring Sum. Let G1 (V1,E1) and G2 (V2,E2) be two graphs. The ring sum graph isGR (VR,ER) = (G1∪G2)− (G1∩G2).

Definition 12.24. Let G be a graph and v one of its vertices. The vertex v is a cut-point if its removal causes the increase of amount of connected components of thegraph.

Proposition 12.4. Let G be a graph and vc one of its cut-points. There exist at leasta pair of vertices v1 and v2, such that the trail connecting these two vertices passesthrough vc.

Page 456: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.1 Motivation and Basic Concepts 443

Example 12.12. Let us consider the following graph

v1v2

v3 v4

v5

The node v5 is a cut-point. We may notice that its removal causes an increase inthe number of components:

v1v2

v3 v4

Furthermore, v1 and v4 are connected by means of a trail passing through v5. Thistrail is v1,v2,v5,v3,v4.

Definition 12.25. A graph G is said non-separable is it does not contain cut-points.

Example 12.13. The following graph would be non-separable since the removal ofany node would not result into an increase in the number of components.

v1v2

v3 v4

v5

Page 457: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

444 12 Graph Theory

12.2 Eulerian and Hamiltonian Graphs

In the same paper where Euler solved the “seven bridges problem”, he posed (andthen solved) the following more general problem: in what type of graph is it possibleto find a closed walk that passes through every edge of G only ones?

Definition 12.26. A cycle in a graph is said to be an Eulerian cycle if it contains alledges of the graph exactly once.

Example 12.14. In the graph above the path v1,v4,v3,v1 is a cycle; this circuit is oddbecause its length is 3. It is not Eulerian because there are edges not belonging tothis cycle.

Definition 12.27. Euler’s Graph. A graph which contains an Eulerian cycle iscalled Eulerian graph.

Example 12.15. The following graph is Eulerian since the cycle v1,v2, v3, v5, v4, v1,v2, v4, v3, v1 is Eulerian.

v1

v2

v3

v4

v5

On the contrary, the complete graph K4 is not Eulerian since a circuit includingall the edges obliges to run twice through at least one edge.

Definition 12.28. The degree of a vertex v is the number of edges incident to v(i.e. which pass through v). The degree of a vertex is denoted by deg(v). If all thedegrees of G are the same, then G is regular. The maximum degree in a graph isoften denoted by Δ .

Proposition 12.5. In a graph G, the sum of the degrees in all the vertices is twicethe number of edges:

n

∑i=1

deg(vi) = 2m.

For example, In the graph of Fig. 12.2 associated with the Königsberg bridges allvertices have degree 3, except that A has degree 5.

The following important theorem characterizes Eulerian graphs.

Page 458: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.2 Eulerian and Hamiltonian Graphs 445

Theorem 12.1. Euler’s Theorem. A graph G without any isolated vertices is Eule-rian if and only if

(a) is a connected graph(b) all vertices have even degree

Proof. Let us prove that Eulerian graphs are connected. Let v and w be two arbitrary,distinct vertices of G. Since the graph has no isolated vertices, v e w will belong toan edge. As the graph is Eulerian, it will contain an Eulerian cycle, passing throughall edges of the graph and thus containing the two vertices. Thus, G is connected.��

Now we prove that all vertices have even degree. Let v be a vertex. The vertex vbelongs to an Eulerian cycle, which surely exists. If we start from v and follow theEulerian cycle, at the end we will come back to v. If we go through v multiple times,we will go out from v (i.e. the times in which v is a starting point of an edge) thesame number of times in which we will come back in v (i.e. the times in which vappears as end point of an edge). Hence, the edges which go in or go out each vertexis an even number. ��

Let us prove that a connected graph with vertices having all even degree is Eu-lerian. We choose an arbitrary initial vertex, say v, and we walk along the edgeswithout walking over the same edge more than once. We continue until we get stuckto a vertex w: all outgoing edges from w have already been covered. There are twopossibilities:

• w �= v. This case cannot occur, because the degree of w would be an odd number,and this contradicts the hypothesis;

• w = v. This means that if we get stuck, we will be at the starting point. Thus, thearcs walked until they form a circuit is C = v1,v2, . . . ,vn where v1 = v = w = vn.

It may happen that there is another edge outgoing from some vertex vi of thecircuit C that there was not followed by our walk. We will call this situation a leakfrom the vertex vi. In this case, we replace the circuit C with the following pathP: vi,vi+1, . . . ,vn,v1,v2, . . . ,vi,u where u is the vertex of the edge outgoing from vi.This path contains the circuit C within it (since C = v1,v2, . . . ,vn).

From the newly constructed path P having last vertex u, we continue as previ-ously by adding edges and nodes to the path until a new circuit is identified. If a leakis identified, the algorithm is repeated. Since, each node has an even degree thereis always a returning path to a node without having to walk on the same edge morethan once. Eventually a circuit C′ without any leak is identified.

Let us prove that C′ contains all the edges of the graph. Let α be any edge in thegraph G, with terminating vertices x and y. Since G is connected there will certainlybe a trail that connects the initially chosen vertex v with x. Let us name this trialv,w1,w2, . . . ,x. The edge v,w1 must be on the cycle C′ (otherwise there would be aleak from v, which we excluded). Then w1 ∈C′ and also the edge w1,w2 must stayon the cycle C′ for the same reason. Iterating this process, w3, . . . ,x must belong tothe cycle. This means that the edge α connecting x and y must also belong to thesame cycle.

Page 459: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

446 12 Graph Theory

Since the cycle C′ contains all the edges and never counts the same edge morethan once, the cycle C′ is Eulerian. This means that the graph is Eulerian. ��

Thus, the Euler’s Theorem for Eulerian graphs allows to find out if a graph isEulerian simply by observing the degree of its vertices: if even only one vertex hasodd degree, the graph is not Eulerian. Notice that the above not only proves thetheorem, but also describes an algorithm to find an Eulerian cycle. At this point wehave all the elements on hand to give an answer to the problem of the bridges ofKönigsberg. The problem is clearly equivalent to determine if the associated withthe bridges of Königsberg is an Eulerian graph. To find that it is not Eulerian justcheck if it has a vertex which has odd degree, we have seen that all the vertices ofthe graph have odd degree, hence it is not an Eulerian graph. Thus, it is not possibleto walk over each of the seven bridges exactly once and return to the starting point.

In order to be able to formulate the Euler’s Theorem for directed graphs we needto introduce the concept of vertex-balance.

Definition 12.29. A vertex of a directed graph is balanced if the number of incom-ing edges equals the number of outgoing edges.

Proposition 12.6. Let G be a directed graph with no isolated vertices. The directedgraph G is Eulerian if and only if

1. the graph is connected2. each vertex is balanced

Definition 12.30. An Eulerian trail is a trail that passes through all the edges and issuch that initial and final vertices are not the same (unlike in circuits).

We will now analyse the case of a graph that contains an Eulerian trail.

Theorem 12.2. Let G be a graph with no isolated vertices. The graph G containsan Eulerian trail if and only if

(a) is connected(b) each vertex of G has even degree except exactly two vertices

We have briefly discussed the problem of when a graph contains an Euleriancycle, a closed walk traversing every edge exactly once. Let us now briefly introducethe analogous requirement for vertices: a cycle of a graph G that contains all thevertices of G exactly once.

Definition 12.31. Let G be a graph containing at least three vertices. Every walkthat includes all the vertices on G exactly once is named Hamiltonian cycle of G.

Definition 12.32. Let G be a graph. If G contains a Hamiltonian cycle, it is calledHamiltonian graph.

Obviously, for the walk to be a cycle, it is required that G contains at least threevertices. If this condition is not satisfied the walk is not closed.

Page 460: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.2 Eulerian and Hamiltonian Graphs 447

Definition 12.33. A path in G containing every vertex of G is an Hamiltonian pathand a graph containing a Hamiltonian path is said to be traceable.

Example 12.16. An example of Hamiltonian graph is given in the following. As itcan be easily checked, the cycle v1, v2, v3, v5, v6, v4 includes all the vertices exactlyonce.

v1

v2

v3

v4

v5

v6

To determine whether or not a given graph is Hamiltonian is much harder thandetermining whether or not it is Eulerian.

Hamiltonian graphs are named after Sir William Hamilton, an Irish Mathemati-cian (1805–1865), who invented a puzzle, called the Icosian game, which he soldfor 25 guineas to a game manufacturer in Dublin. The puzzle involved a dodeca-hedron on which each of the 20 vertices was labelled by the name of some capitaltown in the world. The aim of the game was to construct, using the edges of the do-decahedron a closed walk which traversed each town exactly once. In other words,one had essentially to form a Hamiltonian cycle in the graph corresponding to thedodecahedron.

Definition 12.34. A simple graph G is called maximal non-Hamiltonian if it is notHamiltonian and the addition of an edge between any two non-adjacent vertices ofit forms a Hamiltonian graph.

Proposition 12.7. A complete graph is always Hamiltonian.

Let us introduce the following theorem in order to inspect a graph G and checkthe existence of a Hamiltonian cycle within it.

Page 461: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

448 12 Graph Theory

Theorem 12.3. Dirac’s Theorem. A graph G(n,m) with n ≥ 3 vertices and inwhich each vertex has degree at least n

2 has, a Hamiltonian cycle.

Dirac’s theorem states that a specific class of graphs must have a Hamiltoniancycle. This is only a sufficient condition, other types of graphs can still be Hamilto-nian. Historically, Dirac’s theorem represented the starting point for the investiga-tion about the conditions that are required for a graph to be Hamiltonian. We reporthere the Ore’s Theorem that is a later result encompassing the previous research onHamiltonian cycles.

Theorem 12.4. Ore’s Theorem. Let G(n,m) be a graph containing n vertices. Iffor every two non-adjacent vertices u and w it occurs that deg(u)+ deg(w) ≥ n,then G contains a Hamiltonian cycle.

Proof. Let us suppose, by contradiction, that G contains no Hamiltonian cycles. Ifwe added edges to G, eventually a Hamilton cycle would be produced. Thus, let usadd edges avoiding to produce Hamiltonian cycles until a maximal non-HamiltonianG0 is obtained.

Let us consider two non-adjacent vertices u and w. If we added the edge (u,w) toG0, we would obtain a Hamiltonian cycle v1,v2, . . . ,vn in G0 with u= v1 and w= vn.

Since u and w are non adjacent it occurs that deg(u)+ deg(w) ≥ n. Thus, thereexist two vertices vi and vi+1 with w adjacent to vi and u adjacent to vi+1.

This means that if we consider the path u,v2, . . . ,vi,w,vn−1, . . . ,vi+1,u in G0, thispath is a Hamiltonian cycle. This fact is impossible since G0 is a maximal non-Hamiltonian. Hence, G has a Hamiltonian cycle. ��

If the last edge of a Hamiltonian cycle is dropped, we get a Hamiltonian path.However, a non-Hamiltonian graph can have a Hamiltonian path.

Example 12.17. In the following graphs, G1 has no Hamiltonian path as well as noHamiltonian cycle; G2 has the Hamiltonian path v1,v2,v3,v4 but no Hamiltoniancycle; G3 has the Hamiltonian cycle v1,v2,v3,v4,v1.

v1

v2

v3

v4

G1

Page 462: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.3 Bipartite Graphs 449

v1

v2

v3

v4

G2

v1

v2

v3

v4

G3

12.3 Bipartite Graphs

Definition 12.35. A graph is said bipartite if its vertices set V can be written as theunion of two disjoint sets V =V1∪V2 (with V1∩V2 = /0) such that each vertex of V1

is connected to at least one vertex of V2 while there are no connections within V1 norV2. In other words, if the edges connecting the vertices of the vertices of V1 to thoseof V2 are removed, the two sets V1 and V2 are composed of isolated vertices only. V1

and V2 are said classes of vertices.

Definition 12.36. Let G be a bipartite graph composed of the classes of vertices V1

and V2. Let V1 be composed of n elements and V2 of m elements. If there is an edgeconnecting all the vertices of V1 to all the vertices of V2 the graph is said bipartitecomplete and is indicated by the symbol Km,n.

Page 463: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

450 12 Graph Theory

Example 12.18. Examples of graphs K2,2 and K3,2 are shown in the following. Inthe first example V1 = {v1,v2} and V2 = {v3,v4} while in the second example V1 ={v1,v2,v5} and V2 = {v3,v4}.

v1v2

v3 v4K2,2

v1v2

v3 v4

v5

K3,2

Theorem 12.5. A graph G is bipartite if and only if it contains no odd circuits.

Proof. Let us assume that the graph G is bipartite. Suppose the bipartite graph G andV1 and V2 are the two classes of vertices. Let v1,v2 . . . ,vn = v1 be a circuit in G. Wecan assume, without loss of generality, that v1 belongs to V1. Then v2 belongs to V2,v3 ∈V1, and so on. In other words, vi ∈V1,∀i odd. Since vn = v1 is in V1 we have thatn is odd and then the circuit v1,v2, . . . ,vn is even. Hence, G contains no odd circuits.

Let us assume that the graph G does not contain odd circuits. We can assume,without loss of generality, that the graph is connected: otherwise, you can considerseparately the connected components (that are also bipartite). Let v1 be any vertexof G and V1 be the set containing v1 and vertices that have even distance from v1. V2

is the complement of V1. In order to show that G is bipartite, it is enough to provethat each edge of G joins each vertex of V1 with a vertex in V2. Let us suppose bycontradiction that there is an edge that connects two vertices x,y of V1. Under theseconditions, the union of all the geodesics from v1 to x, all the geodesic from v1 to yand of the edge x,y contains an odd circuit, which contradicts the hypothesis. ��

12.4 Planar Graphs

In graph theory an edge is identified solely by a pair of vertices. Length and shapeof the edges are not important.

Page 464: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 451

Example 12.19. The following two figures are two representations of the samegraph, that is K4.

v1v2

v3 v4

v1 v2

v3

v4

It is important to note how in the first representation two edges intersect, althoughtheir intersection is not a vertex. Such a situation takes the name of crossing. In thesecond representation there are no crossings.

Definition 12.37. A graph G is said to be planar if it can be drawn on a plane with-out crossings.

In other words, in a planar graph arcs intersect only at the vertices that have incommon. As we have just seen, the complete graph K4 is planar.

Example 12.20. Let us consider the complete graph K5. Two of its representationsare given in the following.

Page 465: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

452 12 Graph Theory

v1 v2

v3v4

v5

v1

v2v3

v4

v5

We can vary the number of crossings, but we can never eliminate them.

In order to visualize the practical applicability of the concept of planar/non-planar graphs, let A, B and C, be three houses, and E, F and G, the electric power,gas and water, respectively. One wonders if it is possible to connect each of the threehouses with each of the stations so that the pipes do not intersect. The graph thatmodels this situation is clearly the complete bipartite graph on six vertices K3,3 thatis not planar. So there is no way to build pipelines that connect the three units atthree power plants without overlap.

Many algorithms to assess whether or not a graph is planar, or to understand whatis the minimum number of crossings in the graph have been designed. Although anexhaustive analysis of these algorithms falls beyond the scopes of this book, a char-acterization of non-planar graphs, provided by the Polish mathematician Kuratowskiis reported here.

Definition 12.38. Let G be a finite graph. Let u and v be two vertices of G connectedby an edge. It is said that the edge joining u and v has been contracted if the edgehas been eliminated and the vertices u and v have been merged.

An example of contraction is shown in the following.

Page 466: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 453

Example 12.21. Let us consider the second representation of K4 and remove theedge between v3 and v4. Let us name vcol the collapsed vertex replacing the othertwo. The graph before and after the contraction are given in the following.

v1 v2

v3

v4

v1 v2

vcol

Definition 12.39. Let G be a graph. If the contraction operation is possible, thegraph G is said to be contractible for edges to the graph G′.

Theorem 12.6. (Kuratowski’s Theorem) A finite graph G is planar if and only if itcontains no subgraph contractible for edges to K5 or to K3,3.

Since the detection of these contractible subgraphs can be difficult, Kuratowski’scriterion is not very convenient to check the planarity (or non-planarity) of a graph.Many efficient algorithms in time O (n), i.e. linear complexity with respect to thenumber of vertices, to decide if and only if a graph is planar or not. The study ofthese algorithms falls beyond the objectives of this book.

Page 467: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

454 12 Graph Theory

Nonetheless, it is worthwhile to mention in this chapter the following criteria thathelp to easily recognize non-planar graphs.

Proposition 12.8. Let G be a simple graph, connected and planar with n ≥ 3 ver-tices and m edges. It follows that m≤ 3n−6.

Planar graphs have therefore a limitation in the number of edges. In order todetect the non-planarity of a graph, it may be enough to count the number of edgesin the sense that if m > 3n−6 the graph is surely not planar.

Example 12.22. Let us consider again a representation of K5.

v1 v2

v3

v4

v5

We know that this graph is simple and not planar. The number of nodes is n = 5and the number of edges is

m =

(n2

)=

n!2!(n−2)!

=n2−n

2= 10.

We can easily verify the Proposition above by noting that m > 3n−6 = 9.

Although a graph with at least 3n− 6 is always not planar, the vice-versa is nottrue: a graph with less than 3n−6 can still be non-planar. The following propositiongives another condition that occurs every time a graph is planar.

Proposition 12.9. Let G be a simple graph, connected and planar with n > 3 ver-tices and m edges. Let G be such that there are no cycles of length 3 (all the cyclesare of length at least 4). It follows that m≤ 2n−4.

This proposition says that if the graph has no short cycles (of length 3) then 2n−3edges are enough to conclude that it is not planar. The following example clarifiesthis fact.

Example 12.23. The graph K3,3 is simple, connected, has n = 6 vertices and m = 9edges. By checking the criterion in Proposition 12.8, m ≤ 3n− 6 = 18− 6 = 12.Thus, we cannot make conclusions about the planarity. However, the graph K3,3 has

Page 468: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 455

no cycles of length 3 (it has cycles of length at least 4). Thus, if it has more than2n− 4 edges, it surely is not planar. In this case 2n− 4 = 8. We know that in K3,3

there are m = 9. Thus, we can conclude K3,3 is not planar.

Definition 12.40. Let G be a planar graph. An internal region (or internal face) of agraph is a part of plane surrounded by edges. The part of plane not surrounded byedges is called external region of a graph.

In the following sections of this chapter when we refer to the regions of a graphor simply regions we generically mean either the internal regions or the externalone. A graph can thus be divided into regions, one being external and all the othersbeing internal.

Definition 12.41. Let G1 and G2 be two planar graphs. The graph G2 is constructedstarting from G1. Each vertex of G2 is placed in one region of G1 (only one ver-tex per region). Then, the edges of G2 are placed in that way such that each of G2

crosses each edge of G1 only once. The graph G2 is said geometric dual (or simplydual) of the graph G1.

Example 12.24. The graph below shows the graph G1 composed of it vertices vi andedges pictured in solid lines and the graph G2 composed of the vertices wi and edgespictured in dashed lines.

v1 v2 v3

v4v5

w1

w2

w3

w4

Page 469: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

456 12 Graph Theory

Proposition 12.10. Let G1 be a planar graph and G2 be its geometric dual. Then,the geometric dual of G2 is G1.

The existence of a dual is a very important concept in graph theory as it is a checkfor the planarity of a graph. The following Proposition explicitly states this fact.

Proposition 12.11. Let G be a planar graph. The graph G is planar if and only ifhas a dual.

Example 12.25. The following graph (solid edges) is planar and has a dual (dashededges).

v1 v2

v3

w1

w2

If we consider K5, which is not planar

v1 v2

v3

v4

v5

Page 470: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 457

we can represent it as

v1 v2

v3

v4

v5

Regardless of how we represent K5, still at least one crossing will appear. Hence,there will be no faces for constructing the dual.

Proposition 12.12. Let G be a planar graph. If the graph G is non-separable itsdual is non-separable.

12.4.1 Trees and Cotrees

Definition 12.42. A tree is a connected graph which contains no cycles.

Example 12.26. An example of tree is given in the following.

v1v2

v3 v4

v5

A graph composed of disconnected trees is called forest. So a forest is the disjointunion of trees. In other words, each connected component of a forest is a tree. Thefollowing theorem gives a characterizations of a tree.

Page 471: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

458 12 Graph Theory

Theorem 12.7. Let G be a tree with n vertices and m edges. It follows that m= n−1.

Proof. By hypothesis, G is a tree with n vertices and m edges. Let us eliminateone of the most peripheral edge, i.e. an edge such that its removal leaves a vertexisolated. Let us eliminate one by one all the edges but one. For every edge removal,one vertex remains isolated. Hence, after the removal of m−1 edges, m−1 verticeshave been left isolated. The last edge removal leaves two vertices isolated. Hence,the tree contains m edges and n = m+1 vertices. Thus, m = n−1. ��

Example 12.27. Considering the tree in the example above, we have four edges andfive vertices, i.e. m = n−1.

Theorem 12.8. Let G be a tree with n vertices and m edges. Every pair of verticesare joined by a unique path.

Proof. Let us consider two vertices v1 and v2 of the tree. Let us assume by contra-diction that at least two paths linking v1 to v2 exist. Two distinct paths linking v1 tov2 compose a cycle, against the definition of tree. The path must be unique. ��

Example 12.28. Considering again the tree in the example above, there is only oneway to “go” from e.g. v2 to v4.

Theorem 12.9. Let G be a tree with n vertices and m edges. If an arbitrary edge isremoved, the tree is then divided into two components.

Proof. Let us consider two adjacent vertices v1 and v2 of the tree. Let us remove theedge linking v1 to v2. Since a tree does not contain cycles, there are no alternativepaths to connect v1 to v2. The removal of the edge disconnects v1 from v2. Thismeans that the tree is divided into two components. ��

Example 12.29. If we consider again the tree above and remove an arbitrary edge,e.g. (v1,v5)

v1v2

v3 v4

v5

the resulting graph has two components.

The last theorem can also be equivalently expressed by the following proposition.

Proposition 12.13. Every tree is a bipartite graph.

Page 472: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 459

Proof. A tree contains no cycles. Then, if an arbitrary edge connecting the arbitraryvertices v and v′ is removed the two vertices will be disconnected. Hence the graphwill be composed of two components. ��

Definition 12.43. Let G be a graph having n vertices and m edges. A spanning treeof the graph G is a tree containing all the n vertices of G. The edges of a spanningtree are said branches.

Example 12.30. Let us consider the following graph

v1v2

v3 v4

v5

v6

A spanning tree is

v1v2

v3 v4

v5

v6

Definition 12.44. Let G be a graph and T one of its spanning trees. The cotree Cof the tree T is a graph composed of the n vertices of T (and G) and those edgesbelonging to G but not to T . The edges of the cotree are said chords.

Example 12.31. The cotree corresponding to the spanning tree above is

v1v2

v3 v4

v5

v6

Page 473: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

460 12 Graph Theory

Proposition 12.14. Let G(n,m) be a connected, planar, simple graph composed ofn vertices and m edges. Let ρ and ν be rank and nullity of G(n,m), respectively. Forevery arbitrary spanning tree, the rank ρ is equal to the number of branches whilethe nullity ν is equal to the number of chords of the corresponding cotree.

Proof. Any arbitrary spanning tree of the graph G(n,m) contains all the n nodesof the graph. We know from Theorem 12.7 that the spanning tree contains n− 1branches. The rank of the graph is ρ = n− c with c number of components. Sincethe graph is connected, it follows that ρ = n−1, that is the number of branches.

The cotree will contain the remaining m−n+1 edges, i.e. m−n+1 chords. Sinceby definition the nullity is ν = m−ρ = m− n+ 1, that is the number of chords ofthe cotree. ��

Proposition 12.15. Let G(n,m) be a connected, planar, simple graph and G′ itsdual. The number of branches of a spanning tree of G′ is equal to the numbers ofchords of a cotree of G.

Example 12.32. Let us consider again the graph above. We know that its spanningtree has n−1 = 5 branches and the corresponding cotree m−5 = 3 chords. Let usnow consider the corresponding dual graph.

v1v2

v3 v4

v5

v6

w1

w2

w3

w4

The dual graph (dashed line) has obviously eight edges (as many as the edges ofthe original graph) and four vertices (as many as the faces as the original graph).This means that its spanning tree has four vertices and thus three branches, that isthe number of chords of a cotree associated with the original graph.

Corollary 12.1. Let G(n,m) be a planar connected graph having m edges and G′

its dual. The sum of the number of branches of a spanning tree of G and the numberof branches of a spanning tree of G′ is m.

Page 474: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.4 Planar Graphs 461

12.4.1.1 Analogy Between Graphs and Vector Spaces

We can intuitively observe that there is an analogy between graphs and vectorspaces. In particular, we can define a vector space on the set of edges E. The basisof vectors is replaced, in graph theory, by the spanning tree. Similar to vectors thatmust be n to span an n-dimensional vector space, a spanning tree must contain (andconnect) all the n nodes. The concept of linear independence is replaced by the ab-sence of cycles within a spanning tree. The presence of a cycle can be interpreted asa redundancy since it corresponds to multiple paths to connect a pair of nodes.

Consequently, the rank of a graph can be interpreted as the number of edges(branches) of its spanning tree. This is analogous to the rank of a vector space thatis the number of vectors composing its basis. By recalling the rank-nullity theoremwe may think that the nullity is the dimension of another vector space such that,when it is summed up to the rank, the dimension of the entire set (of edges) isobtained. In this sense, the cotree can also be interpreted as the basis of a vectorspace whose dimension is its number of edges (chords), that is the nullity. The sumof rank and nullity is the total number of edges of the graph.

The subject that studies this analogy falls outside the scopes of this book and isnamed Matroids.

12.4.2 Euler’s Formula

A very important property for planar graphs is the Euler’s formula.

Theorem 12.10. Euler’s Formula. Let G(n,m) be a planar connected graph withn vertices and m edges. Let f be the number of faces. It follows that

n−m+ f = 2.

Proof. Let us consider a spanning tree T of the graph G(n,m). We know fromProposition 12.14 that T has n vertices and n−1 branches.

The dual graph G′ of G(n,m) has one vertex in each face of G. Hence, it has fvertices. A spanning tree of the dual graph G′ has f −1 branches.

From Corollary 12.1 it follows that

n−1+ f −1 = m⇒ n−m+ f = 2.��

Example 12.33. Let us consider the following graph.

Page 475: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

462 12 Graph Theory

v1

v2

v3

v4

We have n = 4, m = 5, f = 3, and n−m+ f = 4−5+3.

It must be remarked that Euler’s formula was originally derived for polyhedra(i.e. a solid bounded by polygons). For example, polyhedra are the so-called Platonicsolids: tetrahedron, cube, octahedron, dodecahedron, and icosahedron.

(a) tetrahedron (b) cube (c) octahedron

(d) dodecahedron (e) icosahedron

(a) tetrahedron (b) cube (c) octahedron

Euler found the relation between the number of faces F , vertices V , and edges Eof any simple (i.e. without holes) polyhedron:

V −E +F = 2.

Page 476: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 463

This formula is identical to that seen for graphs because a polyhedron can be canbe transformed into a simple, connected, planar, graph, taking the vertices of thepolyhedron as vertices of the graph, the sides of the polyhedron as arcs of the graph,the faces of the polyhedron in this way correspond to the faces of the graph.

Example 12.34. The following two graphs show a planar representation of tetrahe-dron and cube, respectively.

v1 v2

v3

v4

v1 v2

v3v4

v5 v6

v7v8

12.5 Graph Matrices

A useful way to represent a graph is through a matrix. This representation is con-ceptually very important as it links graph theory and matrix algebra, showing onceagain how mathematics is composed of interconnected concepts that are subject toexamination from various perspectives.

Page 477: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

464 12 Graph Theory

12.5.1 Adjacency Matrices

Definition 12.45. Given a simple graph G with n vertices, its adjacency matrix isthe n× n matrix which has 1 in position (i, j) if the vertex vi and the vertex v j areconnected by an edge, 0 otherwise.

Example 12.35. Let us consider the following graph.

v1v2

v3

v4 v5

v6

The adjacency matrix associated with this graph is

A =

⎜⎜⎜⎜⎜⎜⎝

0 1 1 1 0 11 0 0 0 0 01 0 0 1 0 01 0 1 0 1 00 0 0 1 0 01 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

.

The adjacency matrix of an undirected graph is clearly symmetric. In the case ofan oriented graph, the associated adjacency matrix exhibits a 1 in position (i, j) ifthere exists an edge from vertex vi to vertex v j. On the contrary, in position ( j, i)the will be 0. Hence, the adjacency matrix of an oriented graph is, in general, notsymmetric.

Example 12.36. Let us consider the following oriented graph.

Page 478: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 465

v1v2

v3

v4 v5

v6

The adjacency matrix associated with this graph is:

A =

⎜⎜⎜⎜⎜⎜⎝

0 1 1 1 0 10 0 0 0 0 00 0 0 1 0 00 0 0 0 0 00 0 0 1 0 00 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

.

In the case of non-oriented multigraphs, if there are multiple edges (let us say s)connecting the vertex vi with the vertex v j, the matrix exhibits the integer s in theposition (i, j) and in the position ( j, i). In the case of oriented multigraphs, if thereare s edges which go from vi to v j, the matrix exhibits s in the position (i, j) andif there are t edges that start at v j and go in vi the matrix exhibits t in the position( j, i), and 0 if there is no edge from v j to vi.

Example 12.37. The adjacency matrix of the graph of Konigsberg bridges is:

⎜⎜⎝

0 2 2 12 0 0 12 0 0 11 1 1 0

⎟⎟⎠ .

Definition 12.46. A graph is labelled if its vertices are distinguishable from one toanother because a name was given to them.

The encoding of a graph by means of its associated adjacency matrix is the mostsuitable method for communicating the structure of a graph on a computer.

Properties of the adjacency matrix A of an undirected graph:

• A is symmetric

Page 479: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

466 12 Graph Theory

• The sum of the elements of each row i equals the degree of vi

• If A1 and A2 are adjacency matrices that correspond to different labels of thesame graph, A1 is conjugated to A2, i.e. there exists an invertible matrix B suchthat A2 = B−1A1B

Properties of the adjacency matrix A of a directed graph

• A is not necessarily symmetric• The sum of the elements of the generic ith row equals the number of edges that

start from the vertex vi

• The sum of the elements of the generic ith column equals the number of edgeswhose second end vertex is vi

Example 12.38. The adjacency matrix of the complete graph K5 on five vertices.

A =

⎜⎜⎜⎜⎝

0 1 1 1 11 0 1 1 11 1 0 1 11 1 1 0 11 1 1 1 0

⎟⎟⎟⎟⎠

Note that it is a symmetric matrix, corresponding to an undirected graph, that hasall zeros on the main diagonal, given that there are no cycles.

Example 12.39. The following matrix

⎜⎜⎝

0 0 2 21 0 2 03 0 1 12 1 0 0

⎟⎟⎠

is the adjacency matrix of the following graph.

v1v2

v3

v4

Page 480: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 467

The adjacency matrix of a graph is not only an important tool to describe a graphbut it is also a coherent representation that allows graph manipulations by operatingwithin the algebraic space of matrices.

The definition of sum and multiplication of square matrices are valid also foradjacency matrices and have a meaning also on the resulting graphs. The meaningis analogous to that of union and Cartesian product between sets.

We know that, if A is the adjacency matrix of a (multi)graph G, the number thatis in the position i, j represents the number of edges connecting the vertex vi withthe vertex v j. The study of the powers of the matrix A gives us an important pieceof information about the graph. Specifically, as stated by the following proposition,the powers of the matrix A give information on the number of walks (see Defini-tion 12.10) of the graph.

Proposition 12.16. If A is the adjacency matrix of a graph G, then the number ofwalks in G from the vertex vi to the vertex v j of length k (k ≥ 1) is given by theelement i, j of the matrix Ak.

The proof of this proposition can be performed by induction on k.

Example 12.40. In order to calculate the amount of walks of length 2 in a graph, wehave to calculate the power A2 where A is the adjacency matrix of the graph. Let usconsider the following adjacency matrix.

A =

⎜⎜⎜⎜⎜⎜⎝

0 1 1 1 0 11 0 0 0 0 01 0 0 1 0 01 0 1 0 1 00 0 0 1 0 01 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

The matrix A2 is given by

A2 =

⎜⎜⎜⎜⎜⎜⎝

0 1 1 1 0 11 0 0 0 0 01 0 0 1 0 01 0 1 0 1 00 0 0 1 0 01 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎜⎜⎝

0 1 1 1 0 11 0 0 0 0 01 0 0 1 0 01 0 1 0 1 00 0 0 1 0 01 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎜⎜⎝

4 0 1 1 1 00 1 1 1 0 11 1 2 1 1 11 1 1 3 0 11 0 1 0 1 00 1 1 1 0 1

⎟⎟⎟⎟⎟⎟⎠

The walks from v1 to v1 of length 2 are 4, i.e. v1,v2,v1; v1,v6,v1; v1,v3,v1;v1,v4,v1 (remember that they are walks, not trails, then the edges can retrace). Thereis no walk from v1 to v2 of length 2 (a1,2 = 0). There are three walks from v4 to v4

of length 2 (a4,4 = 3) and so on.

Page 481: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

468 12 Graph Theory

The powers of the adjacency matrix of a graph also give us information on theconnection of the graph. The following proposition formalizes this statement.

Proposition 12.17. Let A be the adjacency matrix of a graph G with n vertices.Then

1. G is connected if and only if I+A+A2+ . . .+An−1 contains only strictly positiveintegers.

2. G is connected if and only if (I+A)n−1 contains only strictly positive integers.

12.5.2 Incidence Matrices

Definition 12.47. Let G be a graph containing n vertices and m edges and withoutself-loops. The vertex-edge incidence matrix (or simply incidence matrix) is thatn×m matrix displaying in position (i, j) a 1 if the edge e j terminates into the vertexvi, and a 0 otherwise.

Example 12.41. In order to clarify this concept, let us consider the graph used tointroduce the adjacency matrix but with labelled edges.

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

The incidence matrix associated with this graph is

Aa =

⎜⎜⎜⎜⎜⎜⎝

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

⎟⎟⎟⎟⎟⎟⎠

.

Page 482: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 469

It may be observed that the incidence matrix, in general, are not symmetric andnot square. However, incidence matrices have other features. At first, as it is obvi-ous from its definition, each column of a incidence matrix contains two 1 values.This fact be easily explained considering that the jth column displays a 1 for everyintersection between the edge e j and the vertices. Since each edge intersects alwaystwo vertices, then the jth column displays two 1 values. Let us now introduce thesum operation on the elements of incidence matrices.

0+0 = 0

1+0 = 1

0+1 = 1

1+1 = 0

An important property of incidence matrices is expressed in the following propo-sition.

Proposition 12.18. Let G be a graph containing n vertices and m edges. Let Aa bethe incidence matrix associated with the graph G. Let us indicate with ai the genericith column vector of the matrix Aa. It follows that

n

∑i=1

ai = o.

Proof. For an arbitrary j value, let us calculate ∑ni=1 ai, j. This is the sum of a column

vector which displays two 1 values. Hence, the sum is equal to 0. We can repeat thesame calculation ∀ j = 1, . . . ,m and we will obtain 0 every time. Hence,

n

∑i=1

ai =

(n

∑i=1

ai,1, . . . ,n

∑i=1

ai, j, . . . ,n

∑i=1

ai,m

)

= (0, . . . ,0, . . . ,0) = o. ��

Theorem 12.11. Let G be a connected graph containing n vertices and m edges. LetAa be the incidence matrix associated with the graph G. It follows that the rank ofG and the rank of the matrix Aa are the same.

Proof. If G is a connected graph then its rank is n− c = n− 1. The matrix Aa hassize n×m. Since ∑n

i=1 ai = o, then the rank of the matrix Aa is at most n−1.In order to prove that graph and matrix have the same rank, we need to prove that

the rank of the matrix Aa is at least n−1. This means that we need to prove that thesum of k < n row vectors is �= o. Let us assume, by contradiction, that there exist krow vectors such that ∑k

i=1 ai = o.Let us permute the rows of the matrix so that these k rows appear on the top of

the matrix. The columns of these k rows either contain two 1 values or all 0 values.The columns can be permuted in order to have the first l columns displaying two 1values and the remaining m− l columns composed of all 0 values. As a consequenceof these column swaps, the remaining n−k rows are arranged to display all 0 values

Page 483: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

470 12 Graph Theory

in the first l columns and two 1 values per column for the remaining m− l columns.The matrix appears mapped in the following way:

Aa =

(A1,1 o

o A2,2

).

This would be an incidence matrix associated with a graph composed of twocomponents, A1,1 and A2,2 respectively. The two components are clearly discon-nected because there is no edge connecting them (there is no column with only a1 in A1,1 and only a 1 in A2,2). This is impossible as, by hypothesis, the graph isconnected. Hence, the rank of the matrix is at least n−1 and, for what seen above,exactly n−1 just like the rank of the graph. ��

Example 12.42. Let us consider again the graph of the example above and its asso-ciated matrix Aa. The graph is composed of six nodes and one component. Hence,its rank is 5. The associated incidence matrix has n = 6 rows and m = 6 columns.The matrix is singular and has rank 5.

Corollary 12.2. Let G be a graph containing n vertices and m edges and composedof c components. Let Aa be the incidence matrix associated with the graph G. Therank of Aa is n− c.

Definition 12.48. Let G be a graph containing n vertices and m edges. Let Aa be theincidence matrix associated with the graph G. A reduced incidence matrix Af is any((n−1)×m) matrix obtained from Aa after the cancellation of a row. The vertexcorresponding to the deleted row in Af is said reference vertex.

Obviously, since the rank of an incidence matrix associated with a connectedgraph is n−1 the row vectors of a reduced incidence matrix are linearly independent.

Corollary 12.3. Let G be a graph containing n vertices. The reduced incidence ma-trix of G is non-singular if and only if G is a tree.

Proof. If G is a tree with n vertices, it is connected and contains n− 1 edges. Theincidence matrix associated with a tree has size n× ((n−1)) and rank n−1. If weremove one row, the reduced incidence matrix associated with this tree is a squarematrix having size ((n−1)× (n−1)) and rank n−1 for the Theorem 12.11. Sincethe size of the matrix is equal to its rank, the matrix is non-singular. ��

If the reduced incidence matrix is non-singular, it is obviously square and, morespecifically, for the hypothesis is ((n−1)× (n−1)). This means that the rank ofthe matrix is equal to its size, i.e. n− 1. The graph must be connected because,otherwise, its rank would be less than n−1 (if the graph had more than n−1 edgesthe matrix would not be square and we could not speak about singularity). Moreover,the graph associated with this reduced incidence matrix has n vertices and n− 1edges. Hence, the graph G is a tree. ��

Page 484: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 471

Example 12.43. Essentially, this theorem says that the reduced incidence matrix issquare when the associated graph is a tree. If the graph contained circuits, they willresult into extra columns in the incidence matrix. If the graph is disconnected, therank of the associated reduced incidence matrix would be < n− 1, i.e. the reducedincidence matrix would either be rectangular (an edge removal corresponds to acolumn removal) or a singular matrix (disconnected graph with at least one circuit).

Probably, this fact clarifies the analogy between spanning trees and vector basesand why the presence of a cycle is a redundancy.

Let us consider a tree and its incidence matrix.

v1v2

v3

v4 v5

v6

e1

e2

e3

e5

e4

Aa =

⎜⎜⎜⎜⎜⎜⎝

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

⎟⎟⎟⎟⎟⎟⎠

Let us take v6 as the reference vertex and write the reduced incidence matrix:

Af =

⎜⎜⎜⎜⎝

1 1 0 0 01 0 0 0 00 1 1 0 00 0 1 1 00 0 0 0 1

⎟⎟⎟⎟⎠.

It can be verified that Af is non-singular.If we added an edge we would have

Page 485: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

472 12 Graph Theory

v1v2

v3

v4 v5

v6

e1

e2

e3

e6

e5

e4

whose associated reduced incidence matrix would have dimensions 5×6. Thus, wecannot talk about singularity.

If the graph was disconnected as in the case of

v1v2

v3

v4 v5

v6

e1

e2

e3

e5

the resulting reduced incidence matrix would be of size 5×4.If the graph contains cycles and is disconnected the corresponding reduced inci-

dence matrix can be square.

v4 v5

v6e5

e6e4

Page 486: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 473

v1v2

v3

e1

e2

The associated matrix would have rank n− c = 6− 2 = 4. Thus, the reducedincidence matrix would be singular.

Corollary 12.4. Let G be a connected graph containing n vertices and m edges.Let Aa be the incidence matrix associated with the graph G. Let Ab be a (n−1)×(n−1) submatrix extracted from Aa. The matrix Ab is non-singular if and only ifthe matrix Ab is the reduced incidence matrix associated with a spanning tree of G.

Proof. For the hypothesis G is a connected graph with n vertices and m edges.Hence, m ≥ n− 1. The incidence matrix Aa is composed of n rows and m ≥ n− 1columns. A (n−1)× (n−1) submatrix Ab extracted from Aa is the reduced inci-dence matrix associated with a subgraph of Gb ⊂ G containing n vertices and n−1edges.

Let us assume that Ab is non-singular. The submatrix Ab is non-singular if andonly if its associated graph Gb is a tree. Since Gb contains n vertices and n−1 edges,it is a spanning tree. ��

Let us assume that Gb is a spanning tree. Hence, it has n vertices and n− 1edges. The associated reduced incidence matrix Ab is square and has size n−1. ForCorollary 12.3 the matrix of a tree is non-singular. ��

Example 12.44. Let us consider the following graph.

v1 v2

v3v4

e1

e2

e3

e4 e5

The corresponding incidence matrix is

Aa =

⎜⎜⎝

1 0 0 1 11 1 0 0 00 1 1 0 10 0 1 1 0

⎟⎟⎠ .

Page 487: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

474 12 Graph Theory

Let us cancel the second and third columns as well as the fourth row. Let us callAb the resulting sub-matrix

Ab =

⎝1 1 11 0 00 0 1

⎠ .

This matrix is non-singular and is the reduced incidence matrix of

v1 v2

v3v4

e1

e4 e5

that is a spanning tree of the graph.

12.5.3 Cycle Matrices

Definition 12.49. Let G be a graph containing n vertices and m edges. Let us assumethat the graph contains q cycles. The cycle matrix Ba is that q×m matrix displayingin position (i, j) a 1 if the edge e j belongs to the cycle zi and a 0 otherwise.

Example 12.45. Let us consider again the graph

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

Page 488: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 475

The only cycle appearing in this graph is z1 = (e2,e3,e5). Hence, in this case thecycle matrix is trivial and given by

Ba =(

0 1 1 0 1 0).

Theorem 12.12. Let G be a graph containing n vertices and m edges and no self-loops. Let Aa and Ba be the incidence and cycle matrices associated with the graph,respectively. Let the columns of the two matrices arranged in the same way, i.e. samelabelling of the edges. It follows that AaBT

a = ATa Ba = O.

Proof. Let vi be a vertex of the graph G and z j one of its cycles. If the vertex vi doesnot belong to the cycle z j, then there are no edged being incident the vertex vi andbelonging to the cycle. If vi belongs to z j, then exactly two edges belong to the cycleand are incident on vi.

Let us consider now the ith row of the matrix Aa and jth row Ba (which is the jth

column). Let us perform the scalar product between the two vectors: ∑mr=1 ai,rb j,r. If

we consider the edge er the following scenarios are possible.

1. er is not incident on vi and does not belong to z j. Hence, ai,r = 0, b j,r = 0 andai,rb j,r = 0

2. er is not incident on vi and belongs to z j. Hence, ai,r = 0, b j,r = 1 and ai,rb j,r = 03. er is incident on vi and does not belong to z j. Hence, ai,r = 1, b j,r = 0 and

ai,rb j,r = 04. er is incident on vi and belongs to z j. Hence, ai,r = 1, b j,r = 1 and ai,rb j,r = 1.

The product ai,rb j,r = 1 occurs exactly twice, for those two edges, r1 and r2, thatare incident on vi and belong to the cycle. Thus, the scalar product is the sum of nullterms except two: ∑m

r=1 ai,rb j,r = 0+0+ . . .+ai,r1b j,r1 + . . .+ai,r2b j,r2 + . . .+0 =ai,r1b j,r1 +ai,r2b j,r2 = 1+1 = 0. Each scalar product is 0 and then AaBT

a = O.If we consider the product AT

a Ba, we have scalar products between the columnsof the matrix Aa and the columns of the matrix Ba. Each column of Aa containsonly two 1 values. If the edge incident on the vertex also belongs to the cycle, thesituation 1+1= 0 described above is verified. All the other products return 0. HenceAT

a Ba = O.In general it is true that AaBT

a = ATa Ba = O. ��

Example 12.46. In order to understand Theorem 12.12, let us consider the followinggraph.

Page 489: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

476 12 Graph Theory

v1v2

v3

v4

e1

e2

e3

e4

e5

The associated incidence matrix is

Aa =

⎜⎜⎝

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

⎟⎟⎠ .

Totally, three cycles can be identified, i.e. (e1,e2,e4), (e2,e3,e5), and (e1,e3,e5,e4) The cycle matrix Ba is the following.

Ba =

⎝1 1 0 1 00 1 1 0 11 0 1 1 1

⎠ .

Let us compute

AaBTa =

⎜⎜⎝

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

⎟⎟⎠

⎜⎜⎜⎜⎝

1 0 11 1 00 1 11 0 10 1 1

⎟⎟⎟⎟⎠

=

⎜⎜⎝

1+1 1+1 1+11+1 0 1+11+1 1+1 1+1

0 1+1 1+1

⎟⎟⎠= O.

The first element of the product matrix is given by the scalar product

(1 1 1 0 0

)

⎜⎜⎜⎜⎝

11010

⎟⎟⎟⎟⎠

= 1+1+0+0+0.

The first 1 corresponds to the edge e1 inciding on the vertex v1 and belongingto the circuit (e1,e2,e4). The second 1 corresponds to the edge e2 inciding on thevertex v1 and belonging to the circuit (e1,e2,e4). The matrix product is necessarily

Page 490: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 477

zero because we have always exactly two edges belonging to the same circuit andinciding to the same node. A third edge belonging to the same circuit (such as e4)would not incide on the same node. Analogously, a third edge inciding on the samenode (such as e3) would not be part of the same circuit.

Definition 12.50. Let G be a connected graph having n vertices and m edges. Let Tbe a spanning tree of the graph G. The spanning tree univocally determines a cotreeC. If one arbitrary chord from C is added to T one cycle is identified. This cycle issaid fundamental cycle (or fundamental circuit).

Proposition 12.19. Let G be a connected graph having n vertices and m edges.Regardless of the choice of the spanning tree T , the spanning tree T has n−1 edgesand the graph G has m−n+1 fundamental cycles.

Proof. Since the graph G has n vertices, for Theorem 12.7, n−1 edges of the totalm edges belong to a spanning tree (branches). It follows that the remaining m−n+1edges belong to the cotree (chords). Every time one chord is added to the spanningtree a fundamental cycle is identified. Thus, each chord of the cotree corresponds toa fundamental cycle. Since there exist m− n+ 1 chords, then there exist m− n+ 1fundamental cycles. ��

Definition 12.51. Let G be a connected graph having n vertices and m edges. Thematrix Bf having size (m−n+1)×m and containing the fundamental cycles asso-ciated with an arbitrary spanning tree is said fundamental cycle matrix.

Obviously when we speak about spanning tree we refer to connected graph sincethe spanning tree must connect all the vertices of the graph.

Example 12.47. Let us consider the following graph.

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

e7

e8

e9

e10

Page 491: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

478 12 Graph Theory

The graph contains 10−6+1 = 5 fundamental cycles. If we consider the span-ning tree identified by the edges (e1,e2,e3,e4,e6), the fundamental cycles are

• e2,e3,e5

• e1,e4,e7

• e3,e4,e8

• e3,e4,e6,e9

• e10

The cycle matrix associated with these fundamental cycles is the following.

Bf =

⎜⎜⎜⎜⎝

0 1 1 0 1 0 0 0 0 01 0 0 1 0 0 1 0 0 00 0 1 1 0 0 0 1 0 00 0 1 1 0 1 0 0 1 00 0 0 0 0 0 0 0 0 1

⎟⎟⎟⎟⎠.

Let us now rearrange the columns to have the cotree’s chords first and the tree’sbranches then.

Bf =

⎜⎜⎜⎜⎜⎜⎝

e5 e7 e8 e9 e10 e1 e2 e3 e4 e6

1 0 0 0 0 0 1 1 0 00 1 0 0 0 1 0 0 0 00 0 1 0 0 0 0 1 1 00 0 0 1 0 0 0 1 1 10 0 0 0 1 0 0 0 0 0

⎟⎟⎟⎟⎟⎟⎠

.

The fundamental cycle matrix can be re-written as

Bf =(

I Bt).

where I is the identity matrix having size m−n+1 and Bt is the matrix character-izing the branches of the tree T .

Proposition 12.20. Let G be a connected graph with n vertices and m edges. Everyfundamental cycle matrix Bf associated with it can be partitioned as

Bf =(

I Bt)

where I is the identity matrix having size m− n+ 1 and Bt a rectangular matrixhaving size (m−n+1)× (n−1).

Page 492: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 479

Proof. Each circuit represented in Bf (fundamental circuit) is composed of somebranches of spanning tree and only one chord of cotree. Thus, if we arrange thecolumns (edges) of Bf so that the chords appear in the first columns and while in theremaining columns the branches of the tree appear:

Bf =(

Bc1 Bt1)

where Bc represents the cotree sub-matrix and Bt the tree sub-matrix.We know that a spanning tree contains n−1 branches and that the graph contains

m edges in total. Thus, there are m−n+1 cotree’s chords. This means that the sub-matrix Bc1 has m−n+1 columns. Since each cotree corresponds to a fundamentalcircuit, the matrix Bf (and then also the sub-matrix Bc1) has m− n + 1 rows. Itfollows that the sub-matrix Bc1 is square, displays only one 1 per row while all theother row elements are 0.

We can then swap the rows of the matrix and have the matrix Bf partitioned as

Bf =(

I Bt)

where I is the identity matrix having size m− n+ 1 and Bt a (m−n+1)× (n−1)rectangular matrix. ��

We can also verify that the relation AaBTa = AT

a Ba = O is valid also for funda-mental matrices.

Example 12.48. Let us consider the following graph.

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

e7

e8

e9

Page 493: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

480 12 Graph Theory

The associated incidence matrix is

Aa =

⎜⎜⎜⎜⎜⎜⎝

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

⎟⎟⎟⎟⎟⎟⎠

.

Let us remove the last row and we obtain

Af =

⎜⎜⎜⎜⎝

1 1 1 1 0 0 0 0 01 0 0 0 0 0 1 0 00 1 0 0 1 0 0 0 00 0 1 0 0 1 0 1 00 0 0 0 0 1 0 0 1

⎟⎟⎟⎟⎠.

A fundamental cycle matrix Bf is the following.

Bf =

⎜⎜⎝

0 1 1 0 1 0 0 0 01 0 0 1 0 0 1 0 00 0 1 1 0 0 0 1 00 0 0 0 0 1 0 1 1

⎟⎟⎠ .

Let us compute

AfBTf =

⎜⎜⎜⎜⎝

1 1 1 1 0 0 0 0 01 0 0 0 0 0 1 0 00 1 0 0 1 0 0 0 00 0 1 0 0 1 0 1 00 0 0 0 0 1 0 0 1

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎝

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

⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

1+1 1+1 1+1 00 1+1 0 0

1+1 0 0 01+1 0 0 1+1

0 0 0 1+1

⎟⎟⎟⎟⎠

= O.

Theorem 12.13. Let G be a connected graph having n vertices and m edges. Let Babe the cycle matrix associated with the graph. The rank of Ba indicated with ρBa , ism−n+1.

Page 494: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 481

Proof. Since Bf contains an identity matrix having order m−n−1 also Ba containsthe same matrix. Hence, the rank of Ba, ρBa is at least m−n+1:

ρBa ≥ m−n+1.

We know that AaBTa = O. For the Theorem 2.12, (Weak Sylvester’s Law of Nul-

lity)ρAa +ρBa ≤ m

with ρAa rank of the incidence matrix Aa.Since ρAa = n−1, we obtain

ρBa ≤ m−n+1.

Thus, we can conclude that

ρBa = m−n+1.��

Example 12.49. Let us consider the following graph

v1 v2

v3

v4e1

e2e3

e4

e5

The cycles of the graph aree1,e2,e5

e3,e4,e5

e1,e2,e3,e4

and the cycle matrix is

Ba =

⎝1 1 0 0 10 0 1 1 11 1 1 1 0

⎠ .

We can easily check that the determinant of all the order 3 sub-matrices is null,while we can find non-singular order 2 sub-matrices. In other words ρBa = 2. Con-sidering that m = 5 and n = 4, it follow that ρBa = m−n+1 = 5−4+1 = 2.

Theorem 12.14. Let G be a graph having n vertices, m edges, and c components.Let Ba be the cycle matrix associated with the graph. The rank of Ba indicated withρBa , is m−n+ c.

Page 495: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

482 12 Graph Theory

12.5.4 Cut-Set Matrices

Definition 12.52. Let G be a graph containing n vertices and m edges. A cut-set isa set composed of the minimum number of edges whose removal cause the increaseof components by exactly one.

Definition 12.53. An incidence cut-set is a cut-set such that one of the two compo-nents resulting from the edge removals is an isolated vertex.

Example 12.50. Let us consider the following graph again.

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

e7

e8

e9

The set e3,e4,e5,e7 is a cut-set while e6,e9 is an incidence cut-set.

Definition 12.54. Let G be a graph containing n vertices and m edges. Let us as-sume that the graph contains p cut-sets. The cut-set matrix Qa is that p×m matrixdisplaying in position (i, j) a 1 if the edge e j belongs to the cut-set csi and a 0otherwise.

Proposition 12.21. Let G(n,m) be a connected graph having n nodes and m edges.Let Qa be the cut-set matrix of the graph. It follows that

ρQa ≥ n−1

where ρQa is the rank of the matrix Qa.

Proof. In non-separable graphs, since every set of edges incident on a vertex is acut-set, every row of the incidence matrix Aa is also a row of the cut-set matrix Qa.Hence, the incidence matrix and the cut-set matrix coincide: Aa = Qa. Let us nameρAa the rank of the matrix Aa. Since ρAa = n−1, also ρQa = n−1.

In separable graphs, the incidence matrix is “contained” in the cut-set matrix. Inother words, the incidence matrix Aa is a submatrix of the cut-set matrix Qa.

Page 496: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 483

If follows that in general ρQa ≥ ρAa . Considering that, ρAa = n− 1, it followsthat

ρQa ≥ n−1. ��

Theorem 12.15. Let G be a graph containing n vertices and m edges and no self-loops. Let Qa and Ba be the cut-set and cycle matrices associated with the graph,respectively. Let the columns of the two matrices arranged in the same way, i.e. samelabelling of the edges. It follows that QaBT

a = QTa Ba = O.

Proof. Let us perform the product QaBTa . Let us consider now the ith row of the

matrix Qa and jth row Ba (which is the jth column). Let us perform the scalarproduct between the two vectors: ∑m

r=1 qi,rb j,r. There are two options. Either thereare no edges belonging to the cycle and the cut-set or the number of edges belongingto both cycle and cut-set is even. In both cases the scalar product would be 0. Sinceall the scalar products are 0, then QaBT

a = O. Since, for the transpose of the product,QT

a Ba =(QaBT

a)

T = OT, we have proved that QaBTa = QT

a Ba = O. ��

Theorem 12.16. Let G be a connected graph containing n vertices and m edges. LetAa and Qa be the incidence and cut-set matrices, respectively, associated with thisgraph. It follows that the two matrices have the same rank, which is also equal tothe rank of the graph G.

Proof. Since the graph is connected we know that

ρQa ≥ n−1.

Let us indicate with Ba the cycle matrix. Since cut-set and cycle have always aneven number of edges in common, the rows of Qa and Ba are orthogonal if the edgesof two matrices are arranged (labelled) in the same way. From Theorem 12.15 weknow that QaBT

a = BaQTa = O.

For the Theorem 2.12 (Sylvester’s Weak Sylvester’s Law of Nullity):

ρQa +ρBa ≤ m.

Since the rank of Ba is m−n+1 then

ρQa ≤ m−ρBa = n−1

Hence, ρQa = n−1 that is the rank of Aa and, by definition of rank of graph, therank of G. ��

Definition 12.55. Let G be a connected graph containing n vertices and m edges andT be a spanning tree associated with the graph. A fundamental cut-set with respectto the tree T is a cut-set that contains only one branch of spanning tree. Totally, n−1fundamental cut-sets exist.

Definition 12.56. Let G be a connected graph containing n vertices and m edges.The graph contains n−1 cut-sets with respect to a spanning tree T . The fundamental

Page 497: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

484 12 Graph Theory

cut-set matrix Qf is that (n−1)×m matrix displaying in position (i, j) a 1 if the edgee j belongs to the fundamental cut-set csi and a 0 otherwise. A fundamental cut-setmatrix

Example 12.51. In order to understand the concept of fundamental cut-set let usconsider again the following graph where with a solid line the spanning tree T isindicated while with a dashed line the cotree chords.

v1v2

v3

v4 v5

v6

e1

e2

e3

e4

e5

e6

e7

e8

e9

The cut-sets with respect to the spanning tree T are

• e2,e5

• e1,e7

• e6,e9

• e3,e5,e8,e9

• e4,e7,e8,e9

The n−1 cut-set above are the fundamental cut-set and can be represented in thefollowing matrix

Qf =

⎜⎜⎜⎜⎝

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

⎟⎟⎟⎟⎠.

Let us now rearrange the columns to have the cotree’s chords first and the tree’sbranches then.

Page 498: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 485

Qf =

⎜⎜⎜⎜⎜⎜⎝

e5 e7 e8 e9 e1 e2 e3 e4 e6

1 0 0 0 0 1 0 0 00 1 0 0 1 0 0 0 00 0 0 1 0 0 0 0 11 0 1 1 0 0 1 0 00 1 1 1 0 0 0 1 0

⎟⎟⎟⎟⎟⎟⎠

.

If we rearrange the rows of the matrix we obtain

Qf =

⎜⎜⎜⎜⎜⎜⎝

e5 e7 e8 e9 e1 e2 e3 e4 e6

0 1 0 0 1 0 0 0 01 0 0 0 0 1 0 0 01 0 1 1 0 0 1 0 00 1 1 1 0 0 0 1 00 0 0 1 0 0 0 0 1

⎟⎟⎟⎟⎟⎟⎠

=(

Qc I).

This matrix partitioning can be always done over a fundamental cut-set matrix.

Proposition 12.22. Every fundamental cut-set matrix Qf associated with a con-nected graph G can be partitioned as

(Qc I

)where I is the identity matrix of size

(n−1) representing the branches of the spanning tree while Qc is a rectangularmatrix having size (n−1)× (m−n+1) and represents the chords of the associatedcotree.

12.5.5 Relation Among Fundamental Matrices

Let G be a graph having n vertices and m edges. A reduced incidence matrix Afcan be easily constructed. We can identify a spanning tree T . With respect to thisspanning tree we can construct the fundamental cycle matrix Bf and the fundamentalcute-set matrix Qf.

We know that Bf =(

I Bb)

and(

Qc I).

Let us consider the reduced incidence matrix Af. The matrix has size (n−1)×mand can be partitioned as Af =

(Ac Ab

)where Ac contains the incidence cotree’s

chords while Ab contains the incidence of the tree’s branches. Let us now performthe following calculation

AfBTf =

(Ac Ab

)(

IBb

)= Ac +AbBb = O.

Hence, considering that in this binary arithmetic −1 = 1 and that Ab is non-singular for the Theorem 12.4, we can write

Ac =−AbBTb ⇒ A−1

b Ac = BTb .

Page 499: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

486 12 Graph Theory

Now let us arrange the edges in the same way for the matrices Bf and Qf. Weknow that BT

f =(

Ac Ab)

and Qf =(

Qc I). Hence,

QfBTf =

(Qc I

)(

IBT

b

)= Qc +BT

b = O⇒Qc = BTb .

Putting together the equations we see that Qc = A−1b Ac.

This relation has the following consequences.

1. If Aa and then Af are available, immediately Bf and Qf can be calculated

2. If either Bf or Qf is given, the other can be determined

3. Even if Bf and Qf are both given, the matrix Af cannot, in general, be fullydetermined

Example 12.52. In order to understand these findings, let us consider the followinggraph where a spanning tree is marked with solid line and cotree with dashed line.

v1v2

v3

v4 v5

v6

e1

e2

e3e4

e5

e6

e7

The incidence matrix is

Aa =

⎜⎜⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5 e6 e7

v1 1 0 0 1 0 1 0v2 1 1 1 0 0 0 0v3 0 1 0 0 0 0 0v4 0 0 0 1 1 0 1v5 0 0 0 0 1 0 0v6 0 0 1 0 0 1 1

⎟⎟⎟⎟⎟⎟⎟⎟⎠

.

Page 500: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.5 Graph Matrices 487

The reduced incidence matrix can be easily obtained by cancelling one row (e.g.the last one). The resulting matrix can be rearranged as Af =

(Ac Ab

)where

Ac =

⎜⎜⎜⎜⎜⎜⎝

e6 e7

v1 1 0v2 0 0v3 0 0v4 0 1v5 0 0

⎟⎟⎟⎟⎟⎟⎠

and

Ab =

⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5

v1 1 0 0 1 0v2 1 1 1 0 0v3 0 1 0 0 0v4 0 0 0 1 1v5 0 0 0 0 1

⎟⎟⎟⎟⎟⎟⎠

.

The fundamental cycle matrix is

Bf =

⎝e1 e2 e3 e4 e5 e6 e7

z1 1 0 1 0 0 1 0z2 1 0 1 1 0 0 1

⎠ .

Also this matrix can be rearranged as Bf =(

I Bb)

where

I =

⎝e6 e7

z1 1 0z2 0 1

and

Bb =

⎝e1 e2 e3 e4 e5

z1 1 0 1 0 0z2 1 0 1 1 0

⎠ .

The fundamental cut-sets are

Page 501: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

488 12 Graph Theory

• e2

• e5

• e3,e6,e7

• e1,e6,e7

• e4,e7

The fundamental cut-set matrix is

Qf =

⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5 e6 e7

cs1 0 1 0 0 0 0 0cs2 0 0 0 0 1 0 0cs3 0 0 1 0 0 1 1cs4 1 0 0 0 0 1 1cs5 0 0 0 1 0 0 1

⎟⎟⎟⎟⎟⎟⎠

.

Rearranging the rows we obtain

Qf =

⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5 e6 e7

cs4 1 0 0 0 0 1 1cs1 0 1 0 0 0 0 0cs3 0 0 1 0 0 1 1cs5 0 0 0 1 0 0 1cs2 0 0 0 0 1 0 0

⎟⎟⎟⎟⎟⎟⎠

.

The matrix can be re-written as Qf =(

Qc I)

where

Qc =

⎜⎜⎜⎜⎜⎜⎝

e6 e7

cs4 1 1cs1 0 0cs3 1 1cs5 0 1cs2 0 0

⎟⎟⎟⎟⎟⎟⎠

I =

⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5

cs4 1 0 0 0 0cs1 0 1 0 0 0cs3 0 0 1 0 0cs5 0 0 0 1 0cs2 0 0 0 0 1

⎟⎟⎟⎟⎟⎟⎠

.

Page 502: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.6 Graph Isomorphisms and Automorphisms 489

It is clear that Qc = BTb . Moreover it can be easily verified that Ab is non-singular

and the inverse matrix A−1b is

A−1b =

⎜⎜⎜⎜⎜⎜⎝

e1 e2 e3 e4 e5

v1 1 0 0 1 1v2 0 0 1 0 0v3 1 1 1 1 1v4 0 0 0 1 1v5 0 0 0 0 1

⎟⎟⎟⎟⎟⎟⎠

.

If we perform the multiplication

A−1b Ac =

⎜⎜⎜⎜⎝

1 0 0 1 10 0 1 0 01 1 1 1 10 0 0 1 10 0 0 0 1

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

1 00 00 00 10 0

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

1 10 01 10 10 0

⎟⎟⎟⎟⎠

= Qc = BTb .

12.5.5.1 Graph Matrices and Vector Spaces

We have extensively analysed the relation between graphs and matrices and, previ-ously, the relation between matrices and vector spaces. Now we will further showhow graphs are linear algebra objects and how graphs, matrices, and vector spacescan be seen as the same concept represented from different perspectives.

Let G(V,E) be a graph composed of n vertices and m edges. We can considerevery edge as an elementary graph. Hence, the original graph can be seen as thecomposition of m elementary graphs. Looking at this fact from a different perspec-tive, each edge can be seen as the component of a vector space in m dimensions.This vector space can be divided into two subspaces, the first, having dimensionn− 1, corresponding to the branches of the spanning tree and the second, havingdimension n−m+1, to the chords of cotree. These two subspaces are then spannedby the rows of the matrices Bf and Qf, respectively.

12.6 Graph Isomorphisms and Automorphisms

Definition 12.57. Two graphs G = (V,E) and G′ = (V ′,E ′) are said to be isomor-phic, and we write G = G′ if there exists a bijection f : V →V ′ such that ∀ verticesv,w, if (v,w) ∈ E, then ( f (v) , f (w)) ∈ E ′. In other words, two vertices are adjacentin G if and only if their images by f are adjacent in G′.

Page 503: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

490 12 Graph Theory

The isomorphism is then a graph transformation that may change the shape ofthe graph while preserving its structure, that is the adjacency between each pair ofvertices.

Example 12.53. The following two graphs are isomorphic where f (v1) = va,f (v2) = vb, f (v3) = vc, and f (v4) = vd .

v1v2

v3 v4

vavb

vc

vd

Note that two (or more) isomorphic graphs always have the same number ofvertices, the same number of edges. However, these conditions are not enough toensure the isomorphism of the two graphs.

Example 12.54. If we consider the following two graphs, although they have thesame number of vertices and the same number of edges, they are not isomorphic.The reason is that the two graphs have a different structure: the adjacency amongvertices is not the same.

Page 504: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.6 Graph Isomorphisms and Automorphisms 491

v1v2

v3 v4

vavb

vc vd

About isomorphisms between graphs there is a famous conjecture by Ulam.

Ulam’s Conjecture. Let G be a graph with n vertices v1,v2,v3, . . . ,vn and let G′ bea graph with n vertices v′1,v

′2,v

′3, . . . ,v

′n. If ∀i = 1,2, . . . ,n, the subgraphs G−vi and

G′ − v′i are isomorphic, then the graphs G and G′ are isomorphic too.

Definition 12.58. An automorphism of a graph G is an isomorphism of G to itself.Thus, an automorphism is a bijection α : V → V such that ∀ pair of vertices v1,v2,it follows that α (v1) ,α (v2) is an edge if and only if v1,v2 is an edge.

From the definition above, the automorphism is a graph transformation that, likeisomorphism, preserves the adjacency of the vertices but imposes a stronger condi-tion with respect to isomorphisms: the vertices in the transformed graph are the sameas those in the original graph. For all graphs a trivial automorphism, namely iden-tity automorphism can be defined. This transformation makes correspond a graph Gto itself. In general, automorphism can be obtained by “stretching” the edges of agraph and rearranging the graph in the plane.

Example 12.55. An example of two automorphic graphs are given in the following.

Page 505: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

492 12 Graph Theory

v1 v2

v3v4

v1 v2

v4v3

12.7 Some Applications of Graph Theory

In this section we will mention some applications of graph theory, stating and dis-cussing some problems, the most varied nature, which can be set and possibly solvedusing graph theory. Some applications will be simple exercises, others are morecomplex or even unresolved.

12.7.1 The Social Network Problem

Let us consider a meeting involving six individuals and let us pose the followingquestion: “How many people know each other?” The situation can be representedby a graph G with six vertices representing the six people under consideration. Theadjacency of vertices represents whether or not the individuals know each other.

Example 12.56. The graph describing the situation above is the following. Let ussuppose a scenario and represent it in the following graph.

Page 506: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.7 Some Applications of Graph Theory 493

v1 v2 v3

v4 v5 v6

Before tackling the problem, let us introduce the notion of complementary graphof a graph G.

Definition 12.59. Let G be a graph. The complementary graph G of the graph G isgraph containing the same vertices of the graph G, and in which two vertices areadjacent (non-adjacent) in G if and only if they are adjacent (non-adjacent) in G.

Example 12.57. The complementary graph G to the graph above G is given in thefollowing.

v1 v2 v3

v4 v5 v6

It may be observed that regardless of the initial choice of G, either in G or in G atleast one triangle occurs. In other words, in every meeting including six individualswill either have at least a triangle of people that do not each other or a triangle ofpeople that have already met. More formally the following proposition proves whathas been stated at the intuitive level.

Proposition 12.23. For every graph G with six vertices, G or its complement Gcontains a triangle.

Proof. Let v be a vertex of G. Each vertex different from v is either connected toanother vertex or not connected. Hence, v is adjacent either in G or in G to theother 5 vertices. Thus, one can assume, without loss of generality, that there arethree vertices v1, v2, v3 in G adjacent to v. If between these there are two mutuallyadjacent, then these two are the vertices of a triangle in G whose third side is v.Otherwise (i.e. if none of v1, v2, and v3 is adjacent in G), then v1, v2, and v3 form atriangle in G.

Page 507: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

494 12 Graph Theory

12.7.2 The Four Colour Problem

One of the most famous conjectures in mathematics was the following.

Any map on a flat surface (or on a sphere) can be coloured with at most four colors, so thatadjacent regions have different colors.

In 1977, this conjecture has been proved by K. Appel and W. Hagen, see [27].They have proved with the help of the computer that four colors are sufficient. Pre-cisely for this reason (that the proof was done with the help of the computer) somemathematicians do not accept it: despite the accusation of lack of elegance, no errorswere found. Some improvements have been made after the theorem.

The four-color problem can be expressed in the language of graph theory. Eachregion is represented by a vertex of a graph, while each edge is a boundary segmentseparating two regions. In this formulation the problem becomes: given a planargraph, its vertices can be coloured with a maximum of four colors in such a waythat two adjacent vertices never have the same color. This concept can be expressedby saying that every planar graph is 4-colorable.

12.7.3 Travelling Salesman Problem

A problem closely related to the question of Hamiltonian circuits is the traveling-salesman problem, stated as follows: a salesman is required to visit a number ofcities during a trip. Given the distances between the cities, in what order should hetravel so a stop visit every city precisely once and return home, with the minimummileage traveled?

Representing the cities by vertices and the roads between them by edges, we geta graph. In this graph, with every edge ei there is associated a real number (thedistance in miles, say), w(ei). Such a graph is called a weighted graph; w(ei) beingthe weight of edge ei.

In our problem, if each of the cities has a road to every other city, we have acomplete weighted graph. This graph has numerous Hamiltonian circuits, and weare to pick the one that has the smallest sum of distances (or weights). The totalnumber of different (not edge disjoint, of course) Hamiltonian circuits in a completegraph of n vertices can be shown to be (n−1)!

2 . This follows from the fact that startingfrom any vertex we have n−1 edges to choose from the first vertex, n−2 from thesecond, n− 3 from the third, and so on. These being independent choices, we get(n−1)! possible number of choices. This number is, however, divided by 2, becauseeach Hamiltonian circuit has been counted twice.

Theoretically, the problem of the travelling salesman can always be solved byenumerating all (n−1)!

2 Hamiltonian circuits, calculating the distance travelled ineach, and then picking the shortest one. However, for a large value of n, the labourinvolved is too great even for a digital computer.

Page 508: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.7 Some Applications of Graph Theory 495

The problem is to prescribe a manageable algorithm for finding the shortest route.No efficient algorithm for problems of arbitrary size has yet been found, althoughmany attempts have been made. Since this problem has applications in operationsresearch, some specific large-scale examples have been worked out. There are alsoavailable several heuristic methods of solution that give a route very close to theshortest one, but do not guarantee the shortest. It is obvious the importance of thiskind of problems in the theory of transport in electric circuits, etc.

12.7.4 The Chinese Postman Problem

This problem is so called because it has been discussed by the Chinese mathemati-cian Mei-Ko Kwan in 1962 [28]. A postman wants to deliver all the letters in sucha way as to minimize the path and then return to the starting point. It must of coursego through all the streets of the path that was entrusted to him at least once, but hewould avoid covering too many roads more than once.

We observe that the Chinese postman problem differs from the traveling sales-man problem, since the latter only has to visit a number of towns and can choosethe most convenient roads to reach them. Now if one represents a map of the city, inwhich the postman has to make deliveries, by a graph, the problem is equivalent tothe determination of the minimum length of a cycle that passes through each edgeat least once. If the graph is Eulerian, it is clear that a solution to the problem isgiven by an Eulerian cycle (which crosses every edge exactly once). However, it ishighly unlikely that the road network of the mailman meets the conditions requiredby Euler’s theorem for owning a cycle Eulerian. It can be shown that this cycle ofminimum length that the postman look never goes to no arc for more than two times.So for every road network optimal paths exist: you can build by adding to the graphof the road network adequate arc in order to make it Eulerian.

12.7.5 Applications to Sociology or to the Spread of Epidemics

Suppose that by some psychological studies will be able to tell when a person ina group can influence the way of thinking of other members of the group. We canthen construct a graph with a vertex vi for each person in the group and a directededge (vi,v j) every time the person vi will influence the person v j. One may ask whatis the minimum number of people that can spread an idea to the entire group eitherdirectly or by influencing someone who in turn can affect someone else, and so on.

A similar mechanism is typical of epidemics: what is the minimum number ofpatients who can create an epidemic in a population?

Page 509: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

496 12 Graph Theory

Exercises

12.1. Determine whether or not the graph with vertices v1,v2,v3,v4,v5,v6 and edges(v2,v3), (v1,v4), (v3,v1), (v3,v4), (v6,v4) is connected. If not, determine the con-nected components.

12.2. Determine the degree of each the graph below.

v1

v2

v3

v4

v5

v6

v7

v8

v9

v10

Page 510: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

12.7 Some Applications of Graph Theory 497

12.3. Consider the graph below. Does this graph contain an Eulerian cycle? If yes,indicate one.

v1 v2

v3v4

v5

v6

v7

v8

12.4. For the graph below

v1 v2

v3

v4e1

e2e3

e4

e5

1. Determine the reduced incidence matrix where v3 is the reference vertex2. Indicate one spanning tree3. On the basis of the chosen spanning tree determine the corresponding fundamen-

tal cycle matrix

Page 511: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

498 12 Graph Theory

12.5. Assess whether or not the following graph is planar. Verify, if possible, Euler’sformula.

v1

v2

v3

v4v5

Page 512: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Chapter 13Applied Linear Algebra: ElectricalNetworks

13.1 Basic Concepts

This chapter shows how mathematical theory is not an abstract subject which has noconnection with the real world. On the contrary, this entire book is written by statingthat mathematics in general, and algebra in this case, is an integrating part of every-day real life and that the professional life of computational scientists and engineersrequires a solid mathematical background. In order to show how the contents of theprevious chapters have an immediate technical application, the last chapter of thisbook describes a core engineering subject, i.e. electrical networks, as an algebraicexercise. Furthermore, this chapter shows how the combination of the algebraic top-ics give a natural representation of a set of interacting physical phenomena.

Definition 13.1. A bi-pole is a generic electrical device having two connections. Abi-pole is always associated with two physical entities namely voltage v and currenti. Both, voltage and current are time-variant entities and thus functions of the timet with codomain R. The unit for voltage is Volt V while the unit for current isAmpere A.

A bi-pole is graphically represented in the following way

v(t)i(t)

or equivalently by

− +v(t)

if we assume that the current always flows from the negative pole (indicated with“−”) to the positive pole (indicated with “+”).

Obviously electromagnetic phenomena are complex and would require a detaileddissertation which is outside the scopes of this book. From the point of view of

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3_13

499

Page 513: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

500 13 Applied Linear Algebra: Electrical Networks

algebra, current and voltage are two functions of the time and associated with adirection that characterize bi-pole. Furthermore, the electrical power p(t) is heredefined as

p(t) = v(t) i(t)

and is measured in Watt W . The power within a time frame is the electrical energyand is measured in W per hour h, i.e. Wh.

13.2 Bi-poles

The bi-pole itself is a model of electrical phenomena. While electrical phenom-ena occur between the entire extension of physical object, the modelling of thesephenomena assumes that they can be concentrated in a point. Under this hypoth-esis, bi-poles belong to two macro-categories, namely passive and active bi-poles,respectively. The bi-poles belonging to the first category absorb energy while thebi-poles belonging to the second category generate energy. Before analysing thevarious types of bi-poles, it is worth commenting that each bi-pole is an object char-acterised by the relation between voltage and current.

13.2.1 Passive Bi-poles

An electrical conductor is a material whose electrons can freely flow within it andthe current i(t) can (almost rigorously) be interpreted as the flow of electrons withinthe material, see [29]. A current flowing through a conductor is associated with vari-ous concurrent and simultaneous physical phenomena. In physics, these phenomenaare divided into three categories that correspond to the three passive bi-poles takeninto consideration in this book and presented in the forthcoming subsections.

Resistor

The first phenomenon to be analysed is the electro-dynamic effect of the current.When a current flows through a conductor the material contrasts the flowing. As aneffect, the electrical energy is not entirely transferred. On the contrary part of theenergy is dissipated. The property of the material of contrasting the current flowis said resistance. Materials may contrast the current flow with diverse intensitieswhich correspond to diverse resistance values measured in Ohm (Ω ). This propertyis modelled by a bi-pole called resistor and indicated as

v(t)i(t)

Page 514: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.2 Bi-poles 501

The relation between voltage and current of a resistor is given by the Ohm’s law:

v(t) = Ri(t)

where R is the resistance of the resistor.The two extreme conditions R = 0 and R = ∞ correspond to two special resistors,

namely short circuit and open circuit, respectively. A short circuit is indicated as

i(t)

and is characterized by the fact that, regardless of the current value, the voltage isalways null: ∀i(t) : v(t) = 0.

The opposite situation, the open circuit, occurs when regardless of the voltagevalue the current is null: ∀v(t) : i(t) = 0. An open circuit is indicated as

+ −v(t)

Inductor

The second phenomenon to be analysed is the electro-magnetic effect of the cur-rent. When a current flows through a conductor other conductors nearby and theconductor itself, secondary voltages (and secondary currents) are created within theconductors. These secondary voltages are said to be induced by the main current.The physical property of material of inducing secondary voltages is said inductanceand is measured in Henry (H). The corresponding bi-pole is said inductor and indi-cated as

v(t)i(t)

The relation between voltage and current of an inductor is given by:

v(t) = Ldi(t)

dt

where L is the inductance of the inductor anddi(t)

dtis the derivative of the current

with respect to the time t. A dissertation about derivatives can be found in a calculusbook, see e.g. [18].

Capacitor

The third phenomenon to be analysed is the electro-static effect of the current.Voltages and currents are influenced also by static electric charges. The property of

Page 515: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

502 13 Applied Linear Algebra: Electrical Networks

the material to store the charges (electrons) is said capacitance and is measured inFarads (F). The corresponding bi-pole is said capacitor and indicated as

v(t)i(t)

The relation between voltage and current of a resistor is given by:

v(t) =1C

∫ t

0i(τ)dτ

where C is the capacitance of the capacitor and∫ t

0 i(τ)dτ is the integral of the cur-rent. A dissertation about integrals can be found in a calculus book, see e.g. [18].

13.2.2 Active Bi-poles

Electrical energy can be generated by converting energies of a different nature. Forexample a battery is a device that transforms chemical energy into electrical energy.Electrical energy can be also converted by other types of energy such as combustion,i.e. thermal energy, or mechanical energy, like the dynamo of a bicycle. Devices ofthis kind are known as active bi-poles or sources. Electrical sources can be dividedinto voltage sources and current sources, respectively. Sources impose the valuesof voltage (or current) measured at its connectors. Two kind of values are the mostpopular in engineering and are shortly presented in this chapter Direct Current (DC)and Alternating Current (AC) sources, respectively.

DC sources

The most straightforward voltage source is a bi-pole that regardless of the time andthe current value takes a constant voltage value E. In other words, the DC voltagesource is indicated by the symbol

+−

v(t)i(t)

and is characterized by the equation

v(t) = E

where E is a constant.

Page 516: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.2 Bi-poles 503

Analogously, a DC current source is a bi-pole that regardless of the time and thevoltage value takes a constant current value I. The symbol of DC current source is

i(t)

and its equation isi(t) = I

where I is a constant.

AC Sources

While DC currents are mostly used in electronics, the most common electricalsources in power distribution are AC. In AC systems, the current, i.e. the flow ofthe charges periodically reverse its direction. The AC sources are bi-poles charac-terized by a (sometimes complex) periodical function of the time t. In this book,we will focus only on voltages and currents that depend sinusoidally on the time t,which indeed is an example of AC and the most commonly used approximation ofAC in engineering. More specifically, when we refer to AC voltage source we meana bi-pole characterized by the equation

v(t) =VM cos(ωt +θ)

where VM is a constant called amplitude and ω is said angular frequency of thevoltage. An AC voltage source is indicated as

v(t)

Analogously, an AC current source is characterized by the equation

i(t) = IM cos(ωt +φ)

and is represented by

i(t)

The reason why AC is commonly used is fairly complex, related to energy trans-mission and distribution, and out of scope for the present book.

Page 517: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

504 13 Applied Linear Algebra: Electrical Networks

13.3 Electrical Networks and Circuits

Definition 13.2. An electrical network is a set of interconnected bi-poles.

Example 13.1. The following is an electrical network

+−

Definition 13.3. An electrical circuit is a network consisting of a closed loop, thusgiving a return path for the current.

13.3.1 Bi-poles in Series and Parallel

Since a network is composed of interconnected bi-poles, it is fundamental to study,not only each bi-pole but also their connections within the network. Although an indepth explanation of the meaning of current and voltage is not given in this chapter,a current can be seen as a charge flow through a bi-pole while a voltage is a quantitymeasured across a bi-pole.

Definition 13.4. Two bi-poles are said to be in series when the same current flowsthrough both of them. The topological configuration of two bi-poles in series is

i(t) i(t)

Definition 13.5. Two bi-poles are said to be in parallel when they are associatedwith the same voltage. The topological configuration of two bi-poles in parallel is

+ −v(t)

+ −v(t)

Obviously, more than two bi-poles can be in series and parallel.

Page 518: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.3 Electrical Networks and Circuits 505

13.3.2 Kirchoff’s Laws

When multiple bi-poles are connected to compose a network, two energy conserva-tion laws for currents and voltages, respectively are valid. These conservation lawsare fundamental to study a network as they describe the network structure. Beforestating these laws in details the following definitions must be reported.

Definition 13.6. Given an electrical network, a point that connects three of morebi-poles is said electrical node (or simply node) of the network.

Example 13.2. The network

has four nodes that are highlighted in the following by empty circles which simpleconnectors are indicated with full circles.

We know that two or more bi-poles in series when the same current flows throughall of them. Keeping this in mind, we can write the following definition.

Definition 13.7. An electrical edge is a bi-pole or a series of bi-poles such that bothcurrent and voltage are non-null. An electrical edge is indicated as

Example 13.3. The network in Example 13.2 has four electrical nodes and five elec-trical edges. Hence, the network can be depicted as

Page 519: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

506 13 Applied Linear Algebra: Electrical Networks

Let us collapse the nodes connecting short circuits into one single node. We ob-tain a network of interconnected electrical edges. This network is said to be reducedto its minimal topology.

Example 13.4. The network above when reduced to its minimal topology has threeelectrical nodes and five electrical edges and is

e1

e2

e3

e4 e5

where ek marks the corresponding electrical edge.

If we indicate with an edge each electrical edge and with a vertex each node, agraph is univocally associated with any network reduced to its minimal topology. Inother words, there is a bijection between graphs and electrical networks where thegraph fully describes the structure (the topology) of the network.

Example 13.5. The network in Example 13.2 is associated with the following graph

n1 n2

n3

e4e1

e2

e3

e5

Definition 13.8. Given an electrical network, a mesh is a cycle (or circuit) in theassociated graph.

This network characterization allows us to state the following experimental prin-ciples (thus without a mathematical proof) which connect currents and voltages tothe network structures.

Theorem 13.1. Kirchhoff Currents Law (KCL). The sum of the currents incidentinto a node is null:

n

∑k=1

ik (t) = 0.

Theorem 13.2. Kirchhoff Voltages Law (KVL). The sum of the voltages associ-ated with a mesh is null:

m

∑k=1

vk (t) = 0.

Page 520: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.3 Electrical Networks and Circuits 507

13.3.3 Phasorial Representation of Electrical Quantities

Let us observe that a constant function f (x) = k can be interpreted as a specialsinusoidal (or cosinusoidal) function

f (x) = Acos(ωx+θ)

with A, ω , and θ constants when ω = 0.In a similar way, a DC voltage v(t) = E can be considered as a special case of AC

voltage with null angular frequency. Hence, we may theoretically think that all thepossible voltages and currents are AC and can be represented by a certain sinusoidalfunction.

As a further premise, let us remind that a cosinusoidal function is equivalent to asinusoidal with a phase lag of 90◦:

cos(x) = sin(x+90◦) .

Let us focus on a sinusoidal voltage generated by voltage source. It can be easilyverified that the voltages associated with each bi-pole is sinusoidal and has the sameangular frequency ω at that of the voltage source. This can be checked by applyingKLC and KLV and then calculating the equations characterizing the bi-poles. Asimilar consideration can be done about the current. It follows that if a sinusoidalvoltage is generated with angular frequency ω , within a network, all the electricalquantities associated with the bi-poles are characterized by sinusoidal voltages andcurrents with the same angular frequency ω .

Since the value of ω is fixed for the entire network, the voltage value VM cos(ωt +θ) associated with a bi-pole of the network is identified only by the value VM

and the angle θ . Thus, each voltage and each current in the network is univocallyidentified by a couple of numbers of these type. The pair of numbers (VM,θ) canbe interpreted as a complex number in its polar form, i.e. (VM,∠θ). Equivalently,we may state that, if ω is fixed, there is a bijection between the set of sinusoidalvoltages (currents) of an electrical network and the set of complex numbers.

An electrical quantity in the form (VM,∠θ) is said phasor which is the combi-nation of the word “phase”, i.e. the angle θ , and the and word “vector” to highlightthat a voltage (current) can be seen as a vector having modulus VM and directiondetermined by θ .

Obviously, since the phasor is a complex number, it can be expressed into itsrectangular coordinates by using the transformations described in Chap. 5.

Let us now think about a generic current IM cos(ωt +φ)= (IM,∠φ) in a network.If we assume that the current is known let us find the voltage associated with eachpassive bi-pole.

Proposition 13.1. Let IM cos(ωt +φ) = (IM,∠φ) be the current flowing through aresistor R. The associated voltage is

VR = R(IM,∠φ) .

Page 521: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

508 13 Applied Linear Algebra: Electrical Networks

Proof. For the Ohm’s law, obviously

vR (t) = Ri(t) = RIM cos(ωt +φ) = R(IM,∠φ) .�� (13.1)

Theorem 13.3. Let i(t)= IM cos(ωt +φ)= (IM,∠φ) be the current flowing throughan inductor of inductance L. The associated voltage is

VL = jωL(IM,∠φ) .

Proof. The voltage across the inductor can be determined by applying simple dif-ferentiation rules, see [18], and basic trigonometry:

vL (t) = Ldi(t)

dt= L

dIM cos(ωt +φ)dt

=

=−ωLIM sin(ωt +φ) = ωLIM sin(−ωt−φ) == ωLIM cos(90◦ −ωt−φ) = ωLIM cos(90◦+ωt +φ) .

For Proposition 5.3, if ωLIM cos(90◦+ωt +φ) is seen as a complex number(composed of only its real part) it is occurs that

ωLIM cos(90◦+ωt +φ) = jωLIM cos(ωt +φ) .

Hence,

vL (t) = jωLIM cos(ωt +φ) = jωL(IM,∠φ) .��

The same result can be achieved in a trigonometrical easier way by means of thefollowing proof.

Proof. Let us pose α = φ +90◦. Then,

IM cos(ωt +φ) = IM sin(ωt +φ +90◦) .

It follows that

vL (t) = Ldi(t)

dt= L

dIM sin(ωt +α)

dt=

= ωLIM cos(ωt +α) = ωLIM sin(ωt +α +90◦) == jωLIM sin(ωt +α) = jωL(IM,∠α) .��.

The proof regarding the voltage across a capacitor is analogous.

Theorem 13.4. Let i(t)= IM cos(ωt +φ)= (IM,∠φ) be the current flowing througha capacitor of capacitance C. The associated voltage is

VC =1

jωC(IM,∠φ) =

− jωC

(IM,∠φ) .

Page 522: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.3 Electrical Networks and Circuits 509

13.3.4 Impedance

We know that an electrical edge is a series of bi-poles, thus resistors, inductors,and capacitors. Moreover, since these bi-poles are in series, the same current flowsthrough them. Let (IM,∠φ) be this current. Let us name the resistors, inductors, andcapacitors with the corresponding values of resistance inductance, and capacity andlet us indicate as:

R1,R2, . . . ,Rp

L1,L2, . . . ,Lq

C1,C2, . . .Cs.

Since ∀k the voltages vRk across Rk, vLk across Lk and vCk across Ck are given by

vRk = Rk (IM,∠φ)vLk = jωLk (IM,∠φ)vCk =− j

ωCk(IM,∠φ)

it follows, by associativity of the sum for complex numbers that the total voltagesdue to the resistive, inductive and capacitive contributions are, respectively,

vR = R(IM,∠φ)vL = jωL(IM,∠φ)vC =− j

ωC (IM,∠φ)

whereR = ∑p

k=1 Rk

L = ∑qk=1 Lk

1C = ∑s

k=11

Ck.

By applying again associativity of the sum for complex numbers, the voltageacross the entire electrical edge is

v(t) =Vm cos(ωt +θ) = (VM∠θ) ==(R+ j

(ωL− 1

ωC

))(IM,∠φ) = (R+ jX)(IM,∠φ)

where

X =

(ωL− 1

ωC

)

is said conductance, and the complex number indicated as

z =

(R+ j

(ωL− 1

ωC

))

Page 523: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

510 13 Applied Linear Algebra: Electrical Networks

is said electrical impedance or simply impedance. It obviously follows that an elec-trical bi-pole is mathematically a complex number whose real part is the resistivecontribution while its imaginary part is a combination of inductive and capacitivecontributions.

Example 13.6. Let us consider the following electrical edge

15mH 3W 4W120mF

30mH

associated with a current 1∠30◦A and angular frequency ω = 1 rad/s. To find thevoltage at the connectors of the electrical edge the impedance of the electrical edgemust be found:

3+4+ j

(1((15+30)×10−3)− 1

150×10−6

)= 7+ j (0.045−6666.666)≈ 7− j6666Ω .

The voltage is given by

(1∠30◦)(7− j6666) = (1∠30◦)(6666∠−89.9◦) = (6666∠−59.9◦)V

that is6666cos(t−59.9◦)V.

The Ohm’s law in AC is then the product of two complex numbers. The DCcase can be seen as a special case of AS where ω = 0. Under such hypotheses itoccurs that he current IM cos(ωt +φ) is a constant (is time-invariant). The voltageis consequently also time-invariant. Regarding the impedance it occurs that

• its resistive contribution R stays unmodified• its inductive contribution is ωL = 0: the voltage is null regardless of the current

value, i.e. the inductor behaves like a short circuit• its capacitive contribution is 1

ωC = ∞: the current is null regardless of the voltagevalue, i.e. the capacitor behaves like an open circuit

Definition 13.9. The equation expressing the connection between current and volt-age at the connector of an electrical edge is said edge equation.

Obviously the Ohm’s law is the edge equation for passive bi-poles. This fact canbe rephrased in the following proposition.

Proposition 13.2. The electrical impedance z of two passive bi-poles in series withimpedance z1 and z2 is the sum of the impedance:

z = z1 + z2.

Analogously, we may calculate the electrical impedance equivalent to two pas-sive bi-poles in parallel.

Page 524: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.4 Solving Electrical Networks 511

Proposition 13.3. The electrical impedance z of two passive bi-poles in parallelwith impedance z1 and z2 is

z =z1z2

z1 + z2.

Proof. Let us consider two bi-poles in parallel

z2

+ −V

I2

z1

+ −V

I1

I

By applying the KCL and Ohm’s law we know that⎧⎪⎨

⎪⎩

I = I1 + I2

V = z1 I1

V = z2 I2

By combining the equations we may write that

I =Vz1

+Vz2.

We want to find the equivalent impedance, that is that electrical impedance z suchthat

V = zI ⇒ I =Vz.

Hence, by substitutingVz=

Vz1

+Vz2.

We can then determine z:

1z=

1z1

+Vz2

=z1 + z2

z1z2⇒ z =

z1z2

z1 + z2.��

13.4 Solving Electrical Networks

The main task of the study/analysis of an electrical network is its solution, that isthe identification of all the voltages and currents associated with the passive bi-poles when the voltages (or currents) associated with the sources are supposed to beknown.

Page 525: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

512 13 Applied Linear Algebra: Electrical Networks

In general, the solution of an electrical network is a difficult task which requiressophisticated techniques to model the problem and a high computational effort tobe solved. In this book, a simplified case involving only the linear bi-poles listedabove and neglecting the transient phenomena is taken into consideration. Underthese hypotheses, the solution of an electrical network is achieved by applying thefollowing algorithm.

Algorithm 13 Solution of an Electrical Networkreduce the network to its minimal topologyassign a tentative voltage orientation to all the electrical edgeswrite all the edge equationswrite the KCL equation for all the nodeswrite the KVL equation for all the meshessolve the resulting system of linear equations where the variables are all the currents and voltagesof the network

While the edge equations can be straightforwardly written, the writing of KCLand KVL equations requires a comment. Each electrical edge of a network reducedto its minimal topology is univocally associated with one current value and onevoltage value. This concept can be expressed as: there is a bijection between the setof electrical edges and the set of currents as well as between the set of electricaledges and voltages. Furthermore, as shown above, there is a bijection between theelectrical edges of a network and the edges of a graph as well as between the nodesof an electrical network and the vertices of a graph.

In this light, KCL when applied to all the nodes identifies a homogeneous systemof linear equations. The associated incomplete matrix is the incidence matrix of thecorresponding graph where each edge is oriented (it can take 1 or −1 values). Weknow from Corollary 12.2 that the rank of an incidence matrix is n−k with n numberof vertices and k number of components. In this case, k = 1. Hence, out of the n KCLpossible equations of a network only n−1 are linearly independent; one equation issurely redundant. Equivalently, we can interpret the nodes of an electrical networkas vectors whose components are the currents flowing into them. In this case, the nnodes of a network span a vector space having dimension n−1.

Proposition 13.4. Given an electrical network, the number of linearly independentKCL equations is n−1.

Regarding the voltages, KVL applied to all the meshes also identifies a homo-geneous system of linear equations. The associated incomplete matrix is the cyclematrix of the corresponding graph where each edge is oriented (it can take 1 or −1values). From Theorem 12.13, the rank of the cycle matrix is m− n+ 1 where n isthe number of vertices and m is the number of edges. It follows that only m−n+1KVL equations are linearly independent. Analogous to the KCL case, the meshesof an electrical network can be interpreted as vectors whose components are thevoltages. These vectors span a vector space whose dimension m−n+1.

Page 526: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.4 Solving Electrical Networks 513

Proposition 13.5. Given an electrical network, the number of linearly independentKVL equations is m−n+1.

In order to identify m−n+1 meshes leading to linearly independent equations,we can apply Proposition 12.19, i.e. we identify a spanning tree and obtaining themeshes, one by one, when the cotree chords are included. A spanning tree has n−1 branches. Every time a cotree chord is added a mesh is identified. The meshesobtained in this way are a basis spanning a vector space. This explains the adjectivespanning next to this special tree. This tree unequivocally spans a vector space.

Example 13.7. Let us solve the network from the example above with ω = 314 rad/sand the corresponding values of bi-poles indicated in figure

10mF

1W50mF

100mH

4W(220∠45◦)

The corresponding network to minimal topology can represented as

z1

+

V1 E z2

+

V2

where

z1 = 1− j 6ω50 106 ≈ 1− j382Ω

z2 = 4+ j41.4Ω E = (220∠45◦) .

which lead to the edge equations{

V1 = z1 I1

V2 = z2 I2

that is a system of two linear equations in four complex variables, I1, I2, V1, V2.Furthermore,

E = (220∠45◦)∀IE

where IE is the current through the voltage source.

Page 527: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

514 13 Applied Linear Algebra: Electrical Networks

We know that only n−1 = 1 KCL equation is linearly independent, which is forthe upper node

IE − I1− I2 = 0

where the orientation of the current flowing towards a node is taken positive and thecurrent moving out of the node is taken negative. The equation of the lower nodewould have been

−IE + I1 + I2 = 0

which, is obviously redundant.Finally, m− n+ 1 = 3− 2+ 1 = 2 KVL independent equations can be written.

We choose the following ones{

E−V1 = 0

E−V2 = 0.

Putting together all the equations, to solve this electrical network means to solvethe following system of linear equations:

⎧⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎩

V1 = z1I1

V2 = z2I2

IE − I1− I2 = 0

E−V1 = 0

E−V2 = 0.

where E, z1, and z2 are known complex constants and I1, I2, IE , V1, and V2 arecomplex variables. This system of five linear equations in five variables can be easilysimplified by substitution: ⎧

⎪⎨

⎪⎩

IE − I1− I2 = 0

E− z1I1 = 0

E− z2I2 = 0.

The equations are directly solved by calculating

⎧⎪⎨

⎪⎩

I1 =Ez1=−0.4062+ j0.4083A

I2 =Ez2= 4.083− j3.363A

IE = I1 + I2 =−0.4062+ j0.4083+4.083− j3.363 = 3.676− j2.955A

In this case, E = V1 and E = V2 which completes the solution of the network.

The network above was especially easy to solve because the equations were un-coupled and then there was no need to solve the system of linear equations. In thefollowing example this does not happen and a more clear feeling of what is thesolution of an electrical network is given.

Page 528: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.4 Solving Electrical Networks 515

Example 13.8. The following network (ω = 314 rad/s)

5W

300mH 7W 3W

50mH220∠0◦V

50mF

4W

4W

can be represented as

z1

+

−z2

+ −z3

+

E z4

+

wherez1 = 12+ j94.2Ωz2 = 3Ωz3 = j15.7Ωz4 ≈ 8− j63.7ΩE = 220∠0◦V.

We can now write the system of linear equations solving the network:⎧⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎩

−I1 + I2 + IE = 0

−I2 + I3 + I4 = 0

z1 I1 =−E

z2 I2 + z3I3 = E

z3 I3− z4I4 = 0

which can be written as the following matrix equation:⎛

⎜⎜⎜⎜⎝

−1 1 0 0 10 −1 1 1 0z1 0 0 0 00 z2 z3 0 00 0 z3 −z4 0

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

I1

I2

I3

I4

IE

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

00−EE0

⎟⎟⎟⎟⎠.

This system of linear equations requires a certain effort to be solved manually byCramer’s method. Let us solve it by Gaussian elimination. At first, let us write the

Page 529: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

516 13 Applied Linear Algebra: Electrical Networks

complete matrix (and let us multiply the first row by −1):⎛

⎜⎜⎜⎜⎝

1 −1 0 0 −1 00 1 −1 −1 0 0

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 0

⎟⎟⎟⎟⎠.

Since some diagonal elements are null, we need to apply a pivotal strategy. Letus swap the rows to have diagonal elements always non-null:

⎜⎜⎜⎜⎝

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 00 1 −1 −1 0 01 −1 0 0 −1 0

⎟⎟⎟⎟⎠.

We can now apply Gaussian elimination. To eliminate the first column it isenough to apply

r5 = r5−1

(12+ j94.2)r1.

The resulting matrix is⎛

⎜⎜⎜⎜⎝

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 00 1 −1 −1 0 00 −1 0 0 −1 0.29− j2.29

⎟⎟⎟⎟⎠.

In order to eliminate the second column we need to perform the following trans-formation:

r4 = r4− 13 r2

r5 = r5 +13 r2.

The resulting matrix is⎛

⎜⎜⎜⎜⎝

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 00 0 −1− j5.2 −1 0 −73.30 0 − j5.2 0 −1 70− j2.29

⎟⎟⎟⎟⎠.

Page 530: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

13.5 Remark 517

Let us eliminate the third column by performing the following row transforma-tions:

r4 = r4− −1− j5.2j15.7 r3

r5 = r5 +j5.2

j15.7 r3.

The resulting matrix is⎛

⎜⎜⎜⎜⎝

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 00 0 0 0.4+ j21.6 0 −73.30 0 0 −2.6+ j21.2 −1 70− j2.29

⎟⎟⎟⎟⎠.

Finally, the cancellation of the fourth column is obtained by applying

r5 = r5 +−2.6+ j21.20.4+ j21.6 r4.

The final triangular matrix is⎛

⎜⎜⎜⎜⎝

(12+ j94.2) 0 0 0 0 −2200 3 j15.7 0 0 2200 0 j15.7 −(8− j63.7) 0 00 0 0 0.4+ j21.6 0 −73.30 0 0 0 −1 −1.75− j12.44

⎟⎟⎟⎟⎠.

By solving the triangular system we obtain:

I1 ≈−0.2940+ j2.3029AI2 ≈ 1.4698− j10.3802AI3 ≈ 1.9835− j13.7319AI4 ≈−0.06282+ j3.39235AIE ≈ 1.75+ j12.44A

which is essentially the solution of the network.

13.5 Remark

This chapter shows how mathematics (and algebra in this case) has an immedi-ate application in real-world. Conversely, engineering and computational sciencesare built up on mathematics. Therefore a computer scientists or an engineer wouldgreatly benefit of an understanding of basic mathematics every time they are sup-posed to propose a novel technological solution.

This chapter is an example of this fact. The study of electrical network is a majortask in electrical and electronic engineering. Still, to solve a network in a simpli-fied manner almost all topics studied in the previous chapters have been invoked:

Page 531: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

518 13 Applied Linear Algebra: Electrical Networks

matrices, systems of linear equations, vector spaces, linear mappings, graph theory,complex numbers and polynomials etc. Essentially, the solution of an electrical net-work requires the entire algebra as a theoretical foundation. If some simplificationsare removed, for example if we take into account the transient phenomena, alge-bra on its own would not be enough and a substantial portion of calculus would beneeded. A similar conclusion could be achieved by studying a mechanical dynamicsystem (mass, spring, damper) or a static phenomenon in building science.

Exercises

13.1. Solve the following electrical network for ω = 324 rad/s:

220∠0◦

1W 3W 2W

4W

50mF100mH

2W2W

13.2. Solve the following electrical network for ω = 324 rad/s:

220∠0◦

2W 300mH 2W

4W

50mF100mH

2W2W

Page 532: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Appendix AA Non-linear Algebra: An Introductionto Boolean Algebra

A.1 Basic Logical Gates

This chapter is, strictly speaking, not about linear algebra. Nonetheless, the topic ofthis chapter, i.e. Boolean algebra, is related to linear algebra and it has been cruciallyimportant, over the last decades, for the progress of electronics. More specifically,while linear algebra deals with numbers, vectors, and matrices, Boolean algebradeals with binary states 0 and 1. In addition, the basic operators of Boolean algebraare non-linear.

Furthermore, it must be remarked that Boolean algebra is related to linear algebraas it allows its implementation within digital circuits. Thus, Boolean algebra can beseen as the “trait d’union” between abstract algebra and computational science.

In order to introduce Boolean algebra, let us consider an object x and a set A. Amembership function m f (x) scores 0 if x /∈ A and 1 if x ∈ A. At an abstract level,if we consider all the possible objects and sets of the universe, we can associate amembership relationship between each object and set. Each relationship will score0 when the belonging relationship is not verified (the statement is false) and 1 whenthe belonging relationship is verified (the statement is true).

We can think about an image space where only the true and false (or 1 and 0,respectively) are allowed. In this space, the variables, namely binary variables canbe combined to generate a binary algebra, namely Boolean algebra. Since the latterhas to obey to logical rules, the same subject can be seen from a different perspectiveand named Boolean logic. This name is due to George Boole, the English mathe-matician that in 1853 described this logic in his book, “An Investigation of the Lawsof Thought”, see [30].

As mentioned above, in Boolean algebra, a variable x can take either the value 0or 1. Thus, x is a generic variable of a binary set B = {0,1}. Three elementary oper-ators (or basic logical gates), one of them unary (that is applied to only one variable)

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3

519

Page 533: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

520 A A Non-linear Algebra: An Introduction to Boolean Algebra

and two of them binary (that is applied to two variables) are here introduced. Thefirst operator, namely NOT , is defined in the following way:

i f x = 1 then x = NOT (x) = 0

i f x = 0 then x = NOT (x) = 1

The NOT operators is also graphically represented by the following symbol.

x x

The second operator, namely AND or logical multiplication, processes two in-puts, x and y respectively, and returns the values x∧ y according to the followingrules:

x y x∧ y0 0 01 0 00 1 01 1 1

A graphical representation of the AND operator is given in the following way.

x

yx∧ y

The third operator, namely OR or logical sum, processes two inputs, x and yrespectively, and returns the values x∨ y according to the following rules:

x y x∨ y0 0 01 0 10 1 11 1 1

A graphical representation of the OR operator is given in the following way.

x

yx∨ y

Page 534: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

A.2 Properties of Boolean Algebra 521

A.2 Properties of Boolean Algebra

As for numerical linear algebra, the Boolean operators are characterized by basicproperties. These properties are here listed.

• neutral element for AND: ∀x binary number, x∧1 = x• absorbing element for AND: ∀x binary number, x∧0 = 0• neutral element for OR: ∀x binary number, x∨0 = x• absorbing element for OR: ∀x binary number, x∨1 = 1• commutativity with respect to AND: x∧ y = y∧ x• commutativity with respect to OR: x∨ y = y∨ x• distributivity 1: x∧ (y∨ z) = (x∧ y)∨ (x∧ z)• distributivity 2: x∨ (y∧ z) = (x∨ y)∧ (x∨ z)• identity property 1: x∧ x = x• identity property 2: x∨ x = x• negative property 1: x∧ x = 0• negative property 2: x∨ x = 1

These basic properties, when combined, allow us to detect more complex rela-tionships, as shown in the following example.

Theorem A.1. x∧ (x∨ y) = x

Proof. x∧ (x∨ y) = (x∧ x)∨ (x∧ y) = x∨ (x∧ y) = x∧ (1+ y) = x∧1 = x. ��

Important properties of Boolean algebra are the so-called De Morgan’s laws.

Theorem A.2. First De Morgan’s Law. The negation of a disjunction is the con-junction of the negations. (x∨ y) = x∧ y

Proof. In order to prove the first De Morgan’s law, we consider that (x∨ y) = x∧ yis equivalent to write that (x∨ y)∧ (x∧ y) = 0 (for the negative property 1).

The latter equation can be written as (x∨ y)∧ (x∧ y) = ((x∨ y)∧ x)∧ y= (0∨ (x∧ y))∧ y = x∧ y∧ y = x∧0 = 0 ��

Theorem A.3. Second De Morgan’s Law. The negation of a conjunction is thedisjunction of the negations. (x∧ y) = x∨ y

The second De Morgan’s Law can be proved in an analogous way.

Example A.1. Let us consider the following expression (x∨ y)∧(x∨ y). This expres-sion can be simplified. Let us re-write it:

(x∨ y)∧ (x∨ y) = x∨ x∧ y∨ x∧ y∨0 =

= x∧ (1∨ y∨ y) = x∧ (1∨ y) = x.

Page 535: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

522 A A Non-linear Algebra: An Introduction to Boolean Algebra

A.3 Boolean Algebra in Algebraic Structures

The abstract aspects of Boolean Algebra are very complex and deserves possibly aseparate book. However, with the purpose of linking Boolean Algebra to the otherchapters of this book, especially to place it within algebraic structures, this sectionintroduces some other concepts of abstract algebra.

Definition A.1. The algebraic structure composed of a lattice set L endowed withtwo binary operators ∨ and ∧, respectively, is said lattice and indicated with(L,∨,∧). For lattices and x,y,z ∈ L, the following properties hold:

• commutativity 1: x∨ y = y∨ x• commutativity 2: x∧ y = y∧ x• associativity 1: (x∨ y)∨ z = x∨ (y∨ z)• associativity 2: (x∧ y)∧ z = x∧ (y∧ z)• absorption 1: x∨ (x∧ y)• absorption 2: x∧ (x∨ y)• idempotence 1: a∨a = a• idempotence 2: a∧a = a

Definition A.2. A lattice (L,∨, land) is said to be bounded when 0 is the neutralelement for ∨ (x∨0 = x) and 1 is the neutral element for ∧ (x∧1 = x).

It can be observed that a lattice can be seen as the combination of two semi-groups: (L,∨) and (L,∧) respectively. In the cases of bounded lattice, it is the com-bination of two monoids.

Definition A.3. A lattice (L,∨, land) is said to be complemented when it is bounded(with infimum equal to 0 and supremum equal to 1) and for all x ∈ L, there exists anelement y such that

x∧ y = 0

andx∨ y = 1.

Definition A.4. A lattice (L,∨,∧) is said to be distributive when the followingequality holds

x∧ (y∨ z) = (x∧ y)∨ (x∧ z) .

The latter equality can be proved to be equivalent to

x∨ (y∧ z) = (x∨ y)∧ (x∨ z) .

It can be easily seen that Boolean algebra is a complemented distributive lattice.

Page 536: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

A.4 Composed Boolean Gates 523

A.4 Composed Boolean Gates

From the three basic gates several composed gates can be generated. An importantexample is the NAND operator composed of an AND and a NOT and here repre-sented.

x

y (x∧ y)

A more complex example is the XOR operator. This operator processes two in-puts and returns 0 when the inputs are the same and 1 when they are different.

x y x∨ y0 0 01 0 10 1 11 1 0

This operator is composed as x∧ y∨ x∧ y. This expression is graphically repre-sented in the following way,

x

y

y

x

x∧ y∨ x∧ y

or, more compactly as

x

yx∧ y∨ x∧ y

In order to appreciate the practical implications of Boolean logic and it composedgates, let us consider a so-called half adder circuit. The latter is a logic structure,obtained by a straightforward combination of XOR and AND gates, that performs

Page 537: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

524 A A Non-linear Algebra: An Introduction to Boolean Algebra

sum. The scheme is given by:

x

y S

C

If we consider that S stands for sum while C stands for carry, the functioning ofthe half adder can be summarized in the following way. A more complex example isthe XOR operator. This operator processes two inputs and returns 0 when the inputsare the same and 1 when they are different.

x y C S0 0 0 01 0 0 10 1 0 11 1 1 0

As shown the result of the operation 1+ 1 = 10 (where 10 is 2 in binary). Thus,the half adder is an elementary structure that can be used to perform sums. Moregenerally, Boolean logic allows, by means of binary operator, to define a complexlogic. This feature is relevant in computational devices where the physics imposesthe employment of a binary logic at the hardware level. Without entering into thedetails of a computer hardware, it can be easily seen that it is easier to measurewhether or not an amperage flows through a conductor rather than measuring itintensity and associate a semantic value to it. In other words, in order to be reliablea computer hardware must be kept simple at the low level. Then these simple gatescan be logically combined in billions of way in order to build a complex logic.

As a further remark, Boolean logic was not defined to satisfy the necessities ofa computational device since it was defined about one century earlier that the firstcomputers. This statement is to highlight that research in mathematics normallyprecedes applied research of years if not centuries.

A.5 Crisp and Fuzzy sets

As stated above, Boolean logic is derived from the concept that an object x eitherbelongs or does not belong to a set A. The idea of membership of an object to a setis formulated as a membership function mF that can take only two values, i.e. 0 and1. In this case, the set A is said to be crisp.

However, an object x can belong to a set A with a certain degree of membership.For example if person is considered “quite tall”, he/she is not fully a member of

Page 538: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

A.5 Crisp and Fuzzy sets 525

the set of tall people. More mathematically this person is said to belong to the setof tall people with a certain degree or, this person is associated with a membershipfunction value between 0 and 1. In general we can associate to each set A a con-tinuous membership function mF that makes correspond to each object x its degreeof membership to the set. For example, we can say that with respect to the set A,mF = 0.8. In this case, the set A is said to be a fuzzy set, see [31].

Exercises

A.1. Proof of the EquivalenceSelect the expression equivalent to x∧ y∨ x∧ y∧ z

(a) x∧ y(b) y(c) x∧ z(d) x∧ y∧ z

A.2. Determine the values of x, y, z, v such that x∨ y∨ z∨ v = 0

A.3. Derive the Boolean expression from the following logical circuit

x

y

z

v

(a) x∨ y∧ z∨ v(b) z(x∨ y)∨ v(c) (z∨ v)∧ (x∨ y)(d) (x∧ y)∨ z∨ v

Page 539: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

526 A A Non-linear Algebra: An Introduction to Boolean Algebra

A.4. Considering the result of the Boolean expression (truth table)

x y z Out0 0 0 00 0 1 10 1 0 00 1 1 11 0 0 01 0 1 01 1 0 11 1 1 0

extract the corresponding Boolean expression.

(a) x∧ y∧ z∨ x∧ y∧ z∨ x∧ y∧ z(b) x∧ y∧ z∨ x∧ y∧ z∨ x∧ y∧ z(c) x∧ y∧ z∨ x∧ y∧ z∨ x∧ y∧ z(d) x∧ y∧ z∨ x∧ y∧ z∨ x∧ y∧ z

Page 540: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Appendix BProofs of Theorems That RequireFurther Knowledge of Mathematics

Theorem B.1. Rouchè-Capelli Theorem (Kronecker-Capelli Theorem). A sys-tem of m linear equations in n variables Ax = b is compatible if and only if both theincomplete and complete matrices (A and Ac respectively) are characterised by thesame rank ρA = ρAc = ρ named rank of the system.

Proof. The system of linear equations Ax= b can be interpreted as a linear mappingf : Rn → R

m

f (x) = Ax.

This system is determined if one solution exists, i.e. if ∃x0 such that f (x) = b.This means that the system is determined if b ∈ Im( f ).

The basis spanning the image vector space (Im( f ) ,+, ·) is composed of the col-umn vectors of the matrix A:

BIm( f ) = {I1,I2, . . . ,In}A =

(I1 I2 . . . In

).

Thus, the fact that b ∈ Im( f ) is equivalent to the fact that b belongs to the spanof the column vectors of the matrix A:

b = L(I1,I2, . . . ,In) .

This is equivalent to say that the rank of

A =(

I1 I2 . . . In)

andAc =

(I1 I2 . . . In b

)

have the same rank.Thus, the system is compatible if ρA = ρAc = ρ . ��

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3

527

Page 541: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

528 B Proofs of Theorems That Require Further Knowledge of Mathematics

Theorem B.2. Euler’s Formula. For every real number x ∈ R,

e jθ = cosθ + j sinθ ,

where e is the Euler’s number 2.71828, base of natural logarithm.

Proof. Let us consider a complex number z = a+ jb on the unitary circle of thecomplex plane. The number can be re-written, taking into account the polar coordi-nated, as

z = ρ (cosθ + jsinθ) .

where ρ = 1. Hence,z = cosθ + jsinθ .

Let us compute the derivative of z with respect to θ :

dzdθ

=−sinθ + jcosθ = j (cosθ + jsinθ) = jz.

This means that the derivative operator is equivalent to the multiplication by theimaginary unit. Let us rearrange the equation as

dzz= jdθ .

If we integrate this differential equation we obtain:

∫dzz=

∫jdθ ⇒ ln(z) = jθ ⇒ z = e jθ .

Considering that z = cosθ + jsinθ we obtain

e jθ = cosθ + jsinθ .��

Theorem B.3. Fundamental Theorem of Algebra. If p(z) = ∑nk=0 akzk is a com-

plex polynomial having order n≥ 1, then this polynomial has at least one root.

Proof. Let us assume, by contradiction, that a complex polynomial p(z) with noroots exists. More specifically, let p(z) be a complex polynomial such that p(z) �= 0∀z, i.e. p(z) is a polynomial that has no roots.

The function

f (z) =1

p(z).

is defined since it always occurs that p(z) �= 0.Then, let us calculate

lim|z|→+∞

| p(z) |=+∞.

Thus,

lim|z|→+∞

| 1p(z)

|= 0.

Page 542: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

B Proofs of Theorems That Require Further Knowledge of Mathematics 529

This means that the function f (z) is limited. For the Liouville’s Theorem, see[32] and [33], the function f (z) is constant. Hence, also p(z) is constant. In otherwords, the only polynomials that have no roots are the constant polynomials. If theorder of the polynomial is at least one there will be roots. ��

Theorem B.4. If the vectors a1,a2, . . . ,an are linearly independent the Gram deter-minant G(a1,a2, . . . ,an)> 0.

Proof. If the vectors are linearly independent, let us assume that x = λ1a1 +λ2a2 +. . .+λnan with λ1,λ2, . . . ,λn ∈ R. We can thus write that

x2 = (λ1a1 +λ2a2 + . . .+λnan)2 =

n

∑i=1

n

∑j=1

λiλ jaiaj.

This polynomial is a quadratic form, see [34], whose discriminant is equal to theGram determinant. It can be verified that this quadratic form is positive definite.Hence, G(a1,a2, . . . ,an)> 0.

Page 543: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises

Exercises of Chap. 1

1.1

Proof. Let us consider the element x ∈ A∪ (A∩B) that is

x ∈ A OR x ∈ (A∩B) .

All the elements x ∈ (A∩B) are elements of both A AND B. Hence the elements

x ∈ (A∩B)

are elements of a subset of A, that is

(A∩B)⊂ A.

This means that the generic element x belong to either A or to its subset. In otherwords x ∈ A. This can be repeated for all the elements of A∪ (A∩B). Hence,

A∪ (A∩B) = A.��

1.2

Proof. Let us consider the element x ∈ (A∪B)∪C that is

x ∈ (A∪B) OR x ∈C,

that isx ∈ A OR x ∈ B OR x ∈C.

In other words x belongs to at least one of the three sets. Since x belongs to either Bor C (or to both of them) then

x ∈ (B∪C) .

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3

531

Page 544: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

532 Solutions to the Exercises

Since x could also belong to A then

x ∈ A∪ (B∪C) .

Since we can repeat this considerations for all the elements of the set (A∪B)∪Cthen

(A∪B)∪C = A∪ (B∪C) .��

1.3 The roots ofx2−2x−8 = 0

are −2 and 4. Hence,B = {−2,4}.

The Cartesian product A×B is

A×B = {(a,−2) ,(a,4) ,(b,−2) ,(b,4) ,(c,−2) ,(c,4)}

1.4 Let us check the properties of the relations.

• Reflexivity: since (1,1) ,(2,2) ,(3,3) ∈R, the relation is reflexive• Transitivity: we have (1,2) ∈R and (2,3) ∈R. It also happens that (1,3) ∈R.

There are no other elements to consider. The relation is transitive.• Symmetry: since (1,2) ∈R and (2,1) /∈R the relation is not symmetric. Since

there are no symmetric elements, the relations is antisymmetric.

Since the relation is reflexive, transitive and antisymmetric, it is an order relation.

1.5 The set f is a function since ∀x ∈ A there exists only one f (x) ∈ B.This function is not injective because its contains (0,1) and (1,1), i.e. ∃ two

elements x1 �= x2 such that f (x1) = f (x2).

Page 545: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 533

Exercises of Chap. 2

2.1

AB =

(5 0 0 50 −15 19 13

)

2.2xy = 6−9+4−1 = 0

2.3

AB =

(5 0 0 50 −15 19 13

)

2.4

AB =

⎝26 −22 1712 −3 131 4 −3

2.5

det(A) = 1det(B) = 0

2.6

det(A) = 2k+28.

This means that A is singular for k =−7.

det(B) =−2k2− k+10

whose roots are 2 and − 52 . For these two values B is singular.

det(C) = 0

regardless of k since the third row is linear combination of the first and second rows.Hence, C is singular ∀k ∈ R.

2.7

adj(A) =

⎝0 4 −20 −6 41 −8 5

2.8

A−1 =1

30

(2 3−8 3

).

Page 546: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

534 Solutions to the Exercises

B−1 =18

⎝3 2 4−1 2 121 −2 −4

⎠ .

2.9

1. Since det(A) = 21 the matrix A is invertible.2.

A−1 =1

21

⎝7 −1 −40 9 −60 6 3

3.

AA−1 =1

21

⎝3 −1 20 1 20 −2 3

⎝7 −1 −40 9 −60 6 3

⎠=121

⎝21 0 00 21 00 0 21

⎠=

⎝1 0 00 1 00 0 1

⎠ .

2.10 The det(A) = 0. Hence, the rank of the matrix cannot be 3. By cancelling thethird row and the third column we can identify the nonsingular matrix

(2 10 1

).

Hence, the rank of A is 2.

2.11 The determinant of the matrix A is equal to 0, i.e. the matrix A is singular.Thus its rank ρ < 3. It can be noticed that the second row is twice the first one andthe third row is the sum of the first two. There is no 2×2 non-singular sub-matrices.Thus, ρ = 1.

Since the matrix is singular, it cannot be inverted.

Page 547: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 535

Exercises of Chap. 3

3.1 The incomplete matrix is non-singular:

det

⎝1 −2 11 5 00 −3 1

⎠= 4.

Hence, the rank ρA = ρAc = 3 and the system can be solved by the Cramer’sMethod. The solution is

x =

det

⎝2 −2 11 5 01 −3 1

4=

44= 1,

y =

det

⎝1 2 11 1 00 1 1

4=

04= 0

and

z =

det

⎝1 −2 21 5 10 −3 1

4=

44= 1.

3.2 The incomplete and complete matrices associated with the system are, respec-tively:

A =

⎝(k+2) (k−1) −1

k −k 04 −1 0

and

A =

⎝(k+2) (k−1) −1 k−2

k −k 0 24 −1 0 1

⎠.

The det (A) = k− 4k = −3k. Hence, the matrix A is non-singular when k �= 0.Under this condition, ρA = ρAc = 3, i.e. the system is compatible. Since n = 3, thesystem is also determined.

Page 548: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

536 Solutions to the Exercises

If k = 0 the incomplete matrix is singular and its rank is ρA = 2 because at leastone non-singular submatrix of order 2 can be extracted. For example

(−1 −1−1 0

).

is non-singular.The complete matrix would be

Ac =

⎝2 −1 −1 −20 0 0 24 −1 0 1

⎠.

whose rank is 3 because, e.g., the submatrix obtained by cancelling the third column

⎝2 −1 −20 0 24 −1 1

⎠.

is non-singular. Hence, ρA = 2 �= ρAc = 3. If k = 0 the system is incompatible.There is no value of k that makes the system undetermined.

3.3 The incomplete matrix⎛

⎝1 1 −10 1 −11 2 −2

has null determinant as the third row is the sum of the first and second rows.Cramer’s method cannot be applied. It follows that the rank of this matrix is ρA = 2.

The rank of the complete matrix is ρAc is also 2 since the system is homogeneous.Thus, the system has ∞1 solutions.

The general solution can be found posing y = z = α . It then results that x = 0.Hence the general solution is (0,α,α).

3.4 The incomplete matrix⎛

⎝1 2 34 4 83 −1 2

has null determinant as the third column is linear combination of the other twocolumns. It can be seen that there are non-singular order-2 submatrices. Hence, therank of the matrix ρA = 2. Cramer method cannot be applied. On the contrary, the

Page 549: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 537

rank of the complete matrix is ρAc is 3 as at least non-singular sub-matrix havingorder 3 could be extracted. For example the matrix

⎝1 2 14 4 23 −1 1

is non-singular since its determinant is −6. This means that ρA = 2 < ρAc = 3. Thesystem is impossible. Thus it does not allow any solution.

3.5 The incomplete matrix⎛

⎝1 2 32 4 63 6 9

has null determinant as the second row is twice the first row and third row is threetimes the first row. Cramer’s method cannot be applied. It follows that the rank ofthis matrix is ρA = 1.

The rank of the complete matrix is ρAc is also 1 since the known term of thesecond equation is twice the known term of the first equation and the known termof the third equation is three times the known term of the first equation.

This means that ρA = 1ρAc . The system is undetermined and has ∞n−ρ =∞3−1 =∞2 solutions.

In order to find the general solution let us pose y = α and z = β :

x+2α +3β = 1

which leads tox = 1−2α−3β .

Hence, the general solution is

(1−2α−3β ,α,β ) = α(

1α−2,1,0

)+β (−3,0,1) .

3.6 The associated complete matrix is

Ac = (A|b) =

⎝1 −1 1 11 1 0 42 2 2 9

⎠.

Let us at first apply the following row operations:

r2 = r2− r1

r3 = r3−2r1.

Page 550: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

538 Solutions to the Exercises

We obtain

Ac = (A|b) =

⎝1 −1 1 10 2 −1 30 4 0 7

⎠.

Now, let us apply the following row transformation

r3 = r3−2r2.

Thus, we obtain the triangular matrix

Ac = (A|b) =

⎝1 −1 1 10 2 −1 30 0 2 1

⎠.

The matrix corresponds to the system

⎧⎪⎨

⎪⎩

x− y+ z = 1

2y− z = 3

2z = 1

.

3.7 Considering that the generic formulas to fill U and L matrices are for i≤ j

ui, j = ai, j−i−1

∑k=1

li,kuk, j

and for j < i

li, j =1

u j, j

(

ai, j−j−1

∑k=1

li,kuk, j

)

we obtain:

u1,1 = a1,1 = 5u1,2 = a1,2 = 0u1,3 = a1,3 = 5

l2,1 = 1u1,1

(a2,1) = 2

u2,2 = a2,2− l2,1u1,2 = 1u2,3 = a2,3− l2,1u1,3 = 3

l3,1 = 1u1,1

(a3,1) = 3

l3,2 = 1u2,2

(a3,2− l3,1u1,2) = 2

u3,3 = a3,3− l3,1u1,3− l3,2u2,3 = 2.

Hence,

L =

⎝1 0 02 1 03 2 1

Page 551: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 539

and

U =

⎝5 0 50 1 30 0 2

3.8

1. From x(0) = 0,y(0) = 0,z(0) = 0,

x(1) =−2(0) = 0y(1) =−2+2(0)+6(0) =−2z(1) = 8−4(0) = 8.

2. From x(0) = 0,y(0) = 0,z(0) = 0,

x(1) =−2(0) = 0y(1) =−2+2(0)+6(0) =−2z(1) = 8−4(−2) = 16.

Page 552: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

540 Solutions to the Exercises

Exercises of Chap. 4

4.1 The two vectors are parallel if the rank of the associated matrix is less than 2.In this case the associated matrix is

A =

(2 1 −2−8 −4 8

).

The rank of this matrix is 1 because each order 2 sub-matrix is singular. Thus,the vectors are parallel.

4.2

1. The perpendicularity occurs when the scalar product is null. Hence,

2 ·1+0 ·0+1 · (1− k) = 0.

This means2+1− k = 0

that is k = 3.2. These two vectors are parallel if the rank of the matrix

(1 0 1− k2 0 1

)

is < 2This means that the vectors are parallel when 1− 2+ 2k = 0. This means −1+2k = 0 that is k = 1

2 .

4.3 In order to check whether or not the vectors are linearly independent let us pose

#»o = λ #»u +μ #»v +ν #»w .

If the only way to verify the equation is by means of

(λ ,μ ,ν) = (0,0,0)

then the vectors are linearly independent.Thus,

⎝000

⎠= λ

⎝2−32

⎠+μ

⎝30−1

⎠+ν

⎝102

which yields to a homogeneous system of linear equations that is determined onlyif the matrix associated with the system is non-singular. In this case,

det

⎝2 3 1−3 0 02 1 2

⎠= 15.

Page 553: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 541

The vectors are linearly independent.

4.4

1. The associated matrix is

A =

⎝6 2 31 0 10 0 1

is non-singular since det(A) =−2. Hence, the vectors are linearly independent.The only way the null vector can be expressed as a linear combination of #»u , #»v ,#»w is by means of all null scalars.

2. Since the vectors are linearly independent they are basis in V3. Hence, the vector#»t can be expressed in this new basis by imposing:

#»t = λ #»u +μ #»v +ν #»w .

This means(1,1,1) = λ (6,2,3)+μ (1,0,1)+ν (0,0,1) .

From this equation a system of linear equation is identified:⎧⎪⎨

⎪⎩

6λ +μ = 1

2λ = 1

3λ +μ +ν = 1

.

The solution is λ = 12 , μ =−2, and ν = 3

2 . This means

#»t =12

#»u −2 #»v +32

#»w.

4.5

1. The vectors #»u , #»v , #»w are linearly dependent, the determinant of the matrix asso-ciated to them is singular. These vectors are not a basis.

2. Since the vectors #»u , #»v , #»w are not a basis the vector #»t cannot be expressed in thatbasis. The system of equations resulting from these vectors would be impossible.

4.6 For the three vectors, the third component is the second. In other words,

#»o = λ #»u +μ #»v +ν #»w .

is verified for(λ ,μ ,ν) = (0,−2,1)

The vectors are coplanar. Equivalently the vectors are linearly dependent.This statement is equivalent to say that the matrix associated with the vectors is

singular or that the mixed product is zero.

Page 554: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

542 Solutions to the Exercises

4.7 Let us calculate the vector product

#»u ⊗ #»v = det

#»i

#»j

k(3h−5) (2h−1) 3

1 −1 3

⎠=

= 3(2h−1)#»i +3

#»j − (3h−5)+3

#»i −3(3h−5)

#»j − (2h−1)

k =

= 6h#»i +(−9h+18)

#»j +(−5h+6)

k

The two vectors are parallel if the vector product is equal to #»o , i.e.⎧⎪⎨

⎪⎩

6h = 0

−9h+18 = 0

−5h+6 = 0

that is impossible. Hence, there is no value of h that makes #»u and #»v parallel.

4.8 Let us calculate the mixed product

det

⎝2 −1 31 1 −2(h) −1 (h−1)

⎠= 2h−2+2h−3−3h+4+h−1 = 2h−10.

By imposing the determinant to be null, the vectors are coplanar if h = 5.

Page 555: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 543

Exercises of Chap. 5

5.1

1z=

1a+ jb

=a− jb

(a− jb)(a+ jb)=

a− jba2 +b2 .

5.2 The module ρ =√

12 +12 =√

2. The phase arctan(−1) =−45◦ = 315◦

5.3z = 4cos(90◦)+4 j sin(90◦) = 4 j.

5.4 Let us represent the complex number in polar coordinates:

5+ j5 =√

50∠45◦ =√

50(cos(45◦)+ j sin45◦) .

Let us now calculate by De Moivre’s Formula

3√

5+ j5 =3√√

50(cos(45◦)+ j sin45◦) = 6√

50(cos(15◦)+ j sin(15◦))

5.5 By Ruffini’s theorem, since 13− 3× 12− 13× 1+ 15 = 0, it follows that z3−3z2−13z+15 is divisible by (z−1).

5.6 The third row is the sum of the other two rows. Thus, without the need ofperforming any calculation we can conclude that the determinant is null, i.e. thematrix is singular and thus cannot be inverted. The inverse of the matrix A does notexist.

5.7 For the Little Berzout’s Theorem the remainder r is

r = p(2 j)= (2 j)3+2(2 j)2+4(2 j)−8= 8( j)3+8( j)2+8 j−8=−8 j−8+8 j−8=−16.

5.8

−9z+92z2 +7z−4

=1

(2z−1)− 5

(z+4).

5.9 Expand in partial fractions the following rational fraction

3z+1

(z−1)2 (z+2).

Solution

3z+1

(z−1)2 (z+2)=

59(z−1)

+4

3(z−1)2 −5

9(z+2).

Page 556: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

544 Solutions to the Exercises

5.10

5z(z3−3z2−3z−2)

=5z

(z−2)(z2 + z+1)=

107(z−2)

− 10z+57(z2 + z+1)

.

Page 557: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 545

Exercises of Chap. 6

6.1 If we consider the parallel line passing through the origin

4x−3y = 0

and we pose y = α with the parameter α ∈ R, we have

x =34

α.

This line is parallel to the vectors α(

34 ,1

). The direction

(34 ,1

)is the direction

of the line. Equivalently, the direction of the line is (3,4).

6.2 The matrix(

3 −24 1

)

is non-singular. Hence, an intersection point exists.The coordinates of the intersection point are found by means of the Cramer’s

method:

x =det

(−4 −2−1 1

)

det

(3 −24 1

) =− 611

and

y =det

(3 −44 −1

)

det

(3 −24 1

) =1311

.

6.3 The matrix (3 −29 −6

)

is singular and its rank is 1. Hence, the two lines have the same direction.On the other hand, the rank of the complete matrix

(3 −2 −49 −6 −1

)

is 2. The system of linear equations is impossible and thus has no solutions, i.e. thetwo lines do not intersect (the lines are parallel).

Page 558: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

546 Solutions to the Exercises

6.4 The matrix associated to the conic

Ac =

⎝4 1 01 −2 −40 −4 8

is non-singular. Hence, the conic is non-degenerate. Since

det(I3,3) = det

(4 11 −2

)=−9.

Thus, the conic is a hyperbola.

6.5 The matrix associated to the conic

Ac =

⎝4 1 01 2 −40 −4 −6

is non-singular. Hence, the conic is non-degenerate. Since

det(I3,3) = det

(4 11 2

)= 7.

Thus, the conic is an ellipse.

6.6 The matrix associated to the conic

Ac =

⎝1 1 −81 1 0−8 0 −6

is non-singular. Hence, the conic is non-degenerate. Since

det(I3,3) = det

(1 11 1

)= 0.

Thus, the conic is a parabola.

6.7 The matrix associated to the conic

Ac =

⎝1 1 −71 0 −8−7 −8 12

is singular. Hence, the conic is degenerate. Since

det(I3,3) = det

(1 11 0

)=−1.

Thus, the conic is a degenerate hyperbola, that is a pair of intersecting lines.

Page 559: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 547

6.8 The matrix associated to the conic

Ac =

⎝1 3 53 −16 −40−16 −40 24

is non-singular. Hence, the conic is non-degenerate. Since

det(I3,3) = det

(1 33 −16

)=−25.

Thus, the conic is a hyperbola.

Page 560: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

548 Solutions to the Exercises

Exercises of Chap. 7

7.1 (A,+) is not an algebraic structure since the set is not closed with respect to theoperation. For example 6+4 = 10 /∈ A.

7.2 Since the matrix product is an internal composition law, (Rn,n, ·) is an algebraicstructure. Since the matrix product is associative then (Rn,n, ·) is a semigroup. Sincea neutral element exists, that is the identity matrix I then (R3,3, ·) is a monoid. d)Since there is no general inverse element (only non-singular matrices are invertible)then (Rn,n, ·) is not a group.

7.3 (H,+8) is a subgroup because it is a group. The operator +8 is an associativeinternal composition law, every element of H has an inverse, i.e. {0,8,4,2}.

The cosets are H +8 0 = H and H8 +1 = {1,3,5,7}. All the other cosets are likethese two, e.g. H +8 2 = {2,4,6,0}= H +8 0 = H.

All the cosets have the same cardinality that is 4. The cardinality of Z8 is 8.According to the Lagrange Theorem

|Z8||H| = 2

that is an integer number.

7.4 Let us check the associative property. Let us calculate

(a∗b)∗ c = (a+5b)∗ c = a+5b+5c.

Let us calculate now

a∗ (b∗ c) = a∗ (b+5c) = a+5b+25c.

Since the operator is not associative (Q,∗) is not a semigroup. Thus, it cannot be amonoid.

7.5 This mapping is an homomorphism since

f (x+ y) = e(x+y) = e(x)e(y) = f (x) f (y) .

The mapping is an isomorphism because it is injective as if x1 �= x2 then e(x1) �=e(x2). The mapping is surjective since every positive number can be expressed as anexponential of a real number:

∀t ∈ R+∃x ∈ R� ‘ t = ex.

Page 561: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 549

Exercises of Chap. 8

8.1 In order to check whether or not (U,+, ·) and (V,+, ·) are vector spaces, wehave to prove the closure with respect to the two composition laws.

1. Let us consider two arbitrary vectors belonging to U , u1 = (x1,y1,z1) and u2 =(x2,y2,z2). These two vectors are such that

5x1 +5y1 +5z1 = 0

5x2 +5y2 +5z2 = 0.

Let us calculateu1 +u2 = (x1 + x2,y1 + y2,z1 + z2) .

In correspondence to the vector u1 +u2,

5(x1 + x2)+5(y1 + y2)+5(z1 + z2) =

= 5x1 +5y1 +5z1 +5x2 +5y2 +5z2 = 0+0 = 0.

This means that ∀u1,u2 ∈U : u1 +u2 ∈U .2. Let us consider an arbitrary vector u = (x,y,z)∈U and an arbitrary scalar λ ∈R.

We know that 5x+5y+5z = 0. Let us calculate

λu = (λx,λy,λ z) .

In correspondence to the vector λu,

5λx+5λy+5λ z =

= λ (5x+5y+5z) = λ0 = 0.

This means that ∀λ ∈ R and ∀u ∈U : λu ∈U .Thus, (U,+, ·) is a vector space.As for V we have

3. Let us check the closure with respect to the internal composition law:

5(x1 + x2)+5(y1 + y2)+5(z1 + z2)+5 =

= 5x1 +5y1 +5z1 +5x2 +5y2 +5z2 +5 �= 0.

Since there is no closure (V,+, ·) is not a vector space.We can easily check that also (U ∩V,+, ·) is not a vector space since it wouldnot contain the null vector o. In this specific case, the set U ∩V is given by

{5x+5y+5z = 0

5x+5y+5z =−5

Page 562: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

550 Solutions to the Exercises

which is impossible. In other words, the intersection is the empty set . The geo-metrical meaning of this problem is two parallel lines of the space.

8.2

Proof. Let us assume that U ⊂V . It follows that

U ∪V =V.

Since (V,+, ·) is a vector space then (U ∪V,+, ·) is a vector subspace of(E,+, ·). ��

The other case (V ⊂U) is analogous.

8.3 The intersection set U ∩V is given by{

x− y+4z = 0

y− z = 0

which has ∞1 solutions of the type (−3α,α,α) with α ∈ R.The sum set S is obtained by finding, at first, the general vector representation of

each setU = {(β −4γ ,β ,γ) |β ,γ ∈ R}

andV = {(δ ,α,α) |α ∈ R}.

Then, the sum set S is

S =U +V = {(β −4γ +δ ,α +β ,α + γ) |α,β ,γ ,δ ∈ R}

which is R3 since every vector of R

3 can be represented by arbitrarily choosingα,β ,γ ,δ .

The sum set is not direct sum since U ∩V �= o.As shown above dim(U) = dim(V ) = 2, the dim(U ∩V ) = 1 and dim(U +V ) =

3, i.e. 2+2 = 3+1.

8.4 The matrix associated to this system of linear equations⎛

⎝1 2 32 4 63 6 9

is singular as well as all its order 2 submatrices. Hence the rank of the matrix is 1and the system has ∞2 solutions. If we pose y=α and z= β we have x=−2α−3β .Hence, the solutions are proportional to

(−2α−3β ,α,β )

Page 563: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 551

which can written as

(−2α−3β ,α,β ) = (−2α,α,0)+(−3β ,0,β ) = α (−2,1,0)+β (−3,0,1) .

B = {(−2,1,0) ,(−3,0,1)}. The dimension is then dim(E,+, ·) = 2.

8.5 The incomplete matrix associated to the system is singular:

det

⎝1 1 22 1 30 1 1

⎠= 0.

The system is undetermined and has ∞1 solutions. The general solution is(α,α,−α) with α ∈ R. A basis is then B = {(1,1,−1)} and the dimension of thespace is 1.

8.6 The matrix associated to this system of linear equations⎛

⎝1 2 32 4 63 6 9

is singular as well as all its order 2 submatrices. Hence the rank of the matrix is 1and the system has ∞2 solutions. If we pose y=α and z= β we have x=−2α−3β .Hence, the solutions are proportional to

(−2α−3β ,α,β )

which can written as

(−2α−3β ,α,β ) = (−2α,α,0)+(−3β ,0,β ) = α (−2,1,0)+β (−3,0,1) .

These couples of vectors solve the system of linear equations. In order to showthat these two vectors compose a basis we need to verify that they are linearly inde-pendent. By definition, this means that

λ1v1 +λ2v2 = o

only if λ1,λ2 = 0,0.In our case this means that

λ1 (−2,1,0)+λ2 (−3,0,1) = o

only if λ2,λ2 = 0,0. This is equivalent to say that the system of linear equations⎧⎪⎨

⎪⎩

−2λ1−3λ2 = 0

λ1 = 0

λ2 = 0

Page 564: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

552 Solutions to the Exercises

is determined. The only values that satisfy the equations are λ2,λ2 = 0,0. Thismeans that the vectors are linearly independent and hence compose a basis B ={(−2,1,0) ,(−3,0,1)}. The dimension is then dim(E,+, ·) = 2.

8.7 Let us name B the basis we want to find. At first we inspect the vectors.Since u is not the null vector, it can be included in the basis: B = {u}.Let us check whether or not u and v are linearly independent.

o = λ1u+λ2v⎛

⎜⎜⎝

0000

⎟⎟⎠= λ1

⎜⎜⎝

2213

⎟⎟⎠+λ2

⎜⎜⎝

021−1

⎟⎟⎠ .

The associated system of linear equation is determined. Hence, λ1 = λ2 = 0 andthe vectors are linearly independent. We can insert v in the basis B: B = {u,v}.

Let us now attempt to insert w

o = λ1u+λ2v+λ3w

that is ⎛

⎜⎜⎝

0000

⎟⎟⎠= λ1

⎜⎜⎝

2213

⎟⎟⎠+λ2

⎜⎜⎝

021−1

⎟⎟⎠+λ3

⎜⎜⎝

2422

⎟⎟⎠ .

The matrix associated to the system is singular. Thus, the vectors u, v, and w arelinearly dependent. This can be seen also by noticing that w = v+ u. Hence, wecannot include w in the basis B.

We can now attempt to insert a and verify⎛

⎜⎜⎝

0000

⎟⎟⎠= λ1

⎜⎜⎝

2213

⎟⎟⎠+λ2

⎜⎜⎝

021−1

⎟⎟⎠+λ3

⎜⎜⎝

3121

⎟⎟⎠ .

The associated matrix has rank 3 and thus a can be inserted into the basis B.We can now attempt to add b to the basis:

⎜⎜⎝

0000

⎟⎟⎠= λ1

⎜⎜⎝

2213

⎟⎟⎠+λ2

⎜⎜⎝

021−1

⎟⎟⎠+λ3

⎜⎜⎝

3121

⎟⎟⎠+λ4

⎜⎜⎝

0502

⎟⎟⎠ .

The matrix associated to the system is non-singular. Hence we have found byelimination a basis of R4:

B = {u,v,a,b}.

Page 565: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 553

Exercises of Chap. 9

9.1 Let us calculate‖ xy ‖= xy = 76

and the respective modules‖ x ‖= 8.832‖ y ‖= 12.649.

Let us now calculate‖ x ‖‖ y ‖= 111.71.

Since 71 < 111.71, the Cauchy-Schwarz inequality is verified.Let us calculate

‖ x+y ‖=‖ (−2,5,19) ‖= 19.748.

Considering that 19.748 < 8.832+ 12.649 = 21.481, Minkowski’s inequality isverified.

9.2 Let us now apply the Gram-Schmidt method to find an orthonormal basis BU ={e1,e2}. The first vector is

e1 =x1

‖ x1 ‖=

(2,1)√5

=

(2√5,

1√5

)= (0.8940.447) .

For the calculation of the second vector the direction must be detected at first.The direction is that given by

y2 = x2 +λ1e1 = (0,2)+λ1

(2√5,

1√5

).

Let us find the orthogonal direction by imposing that y2e1 = 0. Hence,

y2e1 = 0 = x2e1 +λ1e1e1 = (0,2)

(2√5,

1√5

)+λ1,

which leads to

λ1 =− 2√5.

The vector y2 is

y2 = x2 +λ1e1 = (0,2)+

(− 2√

5

)(2√5,

1√5

)= (0,2)−

(45,

25

)=

(−4

5,

85

).

Finally, we can calculate the versor

e2 =y2

‖ y2 ‖=

(− 4

5 ,85

)

√1625 +

6425

= (−0.447,0.894) .

The vectors e1,e2 are an orthonormal basis of(R

2,+, ·).

Page 566: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

554 Solutions to the Exercises

Exercises of Chap. 10

10.1 The rank is the dimension of the image vector space and the rank of the ma-trix associated to the mapping. Since the image is only the null vector, oF, it hasdimension 0.

The nullity is the dimension of the kernel. Since the mapped vector of all thevectors of the domain are equal to the null vector, then the kernel is the entire R

n.Since the mapping is not injective then it is not invertible.

10.2 The kernel of a linear mapping is the set of vectors such that f (x) = o. Thismeans that the kernel of this mapping is the solution of the system of linear equa-tions: ⎧

⎪⎨

⎪⎩

x+ y+ z = 0

x− y− z = 0

2x+2y+2z = 0

This system has rank ρ = 2 and thus has ∞1 solutions. These solutions are pro-portional to (0,1,−1) and the kernel is

ker( f ) = {α (0,1,−1) ,α ∈ R}.

The nullity is the dimensions of (ker( f ) ,+, ·) which is 1. To find the rank ofthis endomorphism, let us consider that dim

(R

3,+, ·)= 3 and let us apply the rank-

nullity theorem: the rank of the endomorphism is 2.Since the kernel ker( f ) �= o, the mapping is not injective. Since the mapping is

not injective, it is not surjective.The image of the mapping is given by

L

⎝112

⎠ ,

⎝1−12

⎠ ,

⎝112

⎠ .

Only two of them are linearly independent hence the image is

L

⎝112

⎠ ,

⎝1−12

⎠ .

This mapping transforms vectors of space into vectors of a plane (the image) inthe space.

10.3 The kernel of this linear mapping is the set of points (x,y,z) such that⎧⎪⎨

⎪⎩

x+2y+ z = 0

3x+6y+3z = 0

5x+10y+5z = 0.

Page 567: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 555

It can be checked that the rank of this homogeneous system of linear equations isρ = 1. Thus ∞2 solutions exists. If we pose x = α and z = γ with α,γ ∈ R we havethat the solution of the system of linear equations is

(x,y,z) =

(α,−α + γ

2,γ),

that is also the kernel of the mapping:

ker( f ) =

(α,−α + γ

2,γ).

It follows that dim(ker( f ) ,+, ·) = 2. Since dim(R

3,+, ·)= 3, it follows from

the rank-nullity theorem that dim(Im( f )) = 1.Since ker( f ) �= oE, the mapping is not injecting and since it is an endomorphism

it is not surjective.The image is given by

L

⎝135

⎠ .

We can conclude that the mapping f transforms the points of the space (R3) intothe points of a line of the space.

10.4

A =

⎝1 2 00 3 02 −4 2

Let us find the eigenvalues

det(A−λ I) = det

⎝1−λ 2 0

0 3−λ 02 −4 2−λ

⎠= (1−λ )(2−λ )(3−λ ) .

The roots of the characteristic polynomial, i.e. the eigenvalues, are λ1 = 3, λ2 = 2,and λ3 = 1.

In order to find an eigenvector let us take λ1 = 3 and let us solve the system

(A−λ1I)x = o,

⎝−2 2 00 0 02 −4 −1

⎝xyz

⎠=

⎝000

Page 568: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

556 Solutions to the Exercises

whose ∞1 solutions are proportional to the eigenvector⎛

⎝−1−12

Since the eigenvalues are all distinct, the matrix is diagonalizable.

10.5 To find the eigenvalues means to find those values of λ such that{

x+ y = λx

2x = λy⇒

{(1−λ )x+ y = 0

2x−λy = 0.

This means to find those values of λ such that

det

((1−λ ) 1

2 −λ

)= 0.

This means that

(1−λ )(−λ )−2 = 0⇒ λ 2−λ −2 = 0.

The solutions of this polynomial would be the eigenvalues of this endomorphism.The solutions are λ1 =−1 and λ2 = 2, that are the eigenvalues of the endomorphism.

Since the endomorphism has two distinct eigenvalues, it is diagonalizable. Let usfind the eigenvectors. We have to solve

{2x+ y = 0

2x+ y = 0

whose solution is α (1,−2) and{−x+ y = 0

2x−2y = 0

whose solution is α (1,1).The transformation matrix

P =

(1 1−2 1

)

enables the diagonalization of mapping into

D =

(−1 00 2

).

Page 569: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 557

10.6 The eigenvalues associated with the matrix A are

λ1 =−1λ2 = 5λ3 = 1.

The dominant eigenvalue is λ2 = 5.Let us find it by Power method with starting vector xT = (1,1,1):

x = Ax =

⎝−792

⎠ .

At the following iterations we obtain⎛

⎝−47499

⎠ ;

⎝−24724942

⎠ ;

⎝−12471249209

⎠ ;

⎝−624762491042

⎠ ;

⎝−31247312495209

⎠ ;

⎝−15624715624926042

⎠ ;

⎝−781247781249130209

⎠ ;

⎝−39062473906249651042

⎠ .

We can now apply Rayleigh Theorem

λ2 =xTAxxTx

≈ 5.

10.7 Four iterations of Power Method starting from xT = (1,1,1) are⎛

⎝22−2

⎠ ;

⎝88−8

⎠ ;

⎝161616

⎠ ;

⎝3232−32

⎠ ;

⎝646464

⎠ ;

⎝128128−128

⎠ ;

⎝256256256

⎠ ;

⎝512512512

⎠ .

If we apply the Rayleigh Theorem we obtain

λ =xTAxxTx

≈ 23.

However if we calculate the eigenvalues we find

λ1 = 2λ2 =−2λ3 =−2.

Hence, since there is no dominant eigenvalue, the Power method does not con-verge to the dominant eigenvector.

Page 570: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

558 Solutions to the Exercises

Exercises of Chap. 12

12.1 Let us draw the graph

v1 v2

v3

v4 v5

v6

e1

e2

e3e4

e5

The graph is connected.

12.2 The degree of each note isv1 : 2v2 : 3v3 : 2v4 : 3v5 : 2v6 : 3v7 : 2v8 : 3v9 : 2

v10 : 2.

The degree of the graph is

10

∑i=1

degvi = 24.

Page 571: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 559

12.3 The graph is connected. Let us check the degree of the vertices:

v1 : 4v2 : 4v3 : 4v4 : 4v5 : 2v6 : 2v7 : 2v8 : 2.

Since the degree of each vertex is even the graph is Eulerian. An Eulerian cycleis:

(v1,v5,v2,v6,v3,v7,v4,v8,v1,v2,v3,v4,v1) .

12.4 If the vertex v3 is the reference vertex the reduced incidence matrix is

Af =

⎝1 0 0 1 11 1 0 0 00 0 1 1 0

⎠ .

A spanning tree must be a tree (no cycles and connected) containing all the ver-tices. For example

v1 v2

v3

v4e1

e3

e4

For the spanning tree above the corresponding fundamental cycle matrix is

Bf =

(0 0 1 1 11 1 0 0 1

).

12.5 The graph is planar since it can be drawn without crossing edges:

Page 572: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

560 Solutions to the Exercises

v1

v2

v3

v4

v5

We have n = 5, m = 8, f = 5The Euler’s formula

n−m+ f = 5−8+5 = 2

is then verified.

Page 573: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 561

Exercises of Chap. 13

13.1 Let us represent the network in its minimal topology:

E

z1

+ −

z2

+

z3

+ −

z4

+

z5

+

where

E = (220∠0◦)z1 = 4Ωz2 = 4Ωz3 = 2+ j

(314×0.1− 1

314×50×10−6

)Ω = 2+ j (31.4−63.38)Ω = 2− j31.98

z4 = 2Ωz5 = 2Ω

We can now write the equations⎧⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎩

I1 = I2 + I3

I3 = I4 + I5

E = z1I1 + z2I2

z2I2 = z3 I3 + z4I4

z4I4 = z5 I5

which can be rearranged as⎛

⎜⎜⎜⎜⎝

−1 1 1 0 00 0 −1 1 1z1 z2 0 0 00 −z2 z3 z4 00 0 0 −z4 z5

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

00E00

⎟⎟⎟⎟⎠.

By substituting the numbers⎛

⎜⎜⎜⎜⎝

−1 1 1 0 00 0 −1 1 14 4 0 0 00 −4 (2− j31.98) 2 00 0 0 −2 2

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

00

22000

⎟⎟⎟⎟⎠.

Page 574: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

562 Solutions to the Exercises

The solution of the system of linear equations is⎛

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

27.7625+ j1.678827.2375− j1.67880.5249+ j3.35760.2625+ j1.67880.2625+ j1.6788

⎟⎟⎟⎟⎠.

13.2 Let us represent the network in its minimal topology:

E

z1

+ −

z2

+

z3

+ −

z4

+

z5

+

where

E = (220∠0◦)z1 = 2+ j(314∗300∗10−3)Ω = 2+ j94.2Ωz2 = 4Ωz3 = 2+ j

(314×0.1− 1

314×50×10−6

)Ω = 2+ j (31.4−63.38)Ω = 2− j31.980

z4 = 2Ωz5 = 2Ω

We can now write the equations⎧⎪⎪⎪⎪⎪⎪⎨

⎪⎪⎪⎪⎪⎪⎩

I1 = I2 + I3

I3 = I4 + I5

E = z1I1 + z2I2

z2I2 = z3 I3 + z4I4

z4I4 = z5 I5

which can be rearranged as⎛

⎜⎜⎜⎜⎝

−1 1 1 0 00 0 −1 1 1z1 z2 0 0 00 −z2 z3 z4 00 0 0 −z4 z5

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

00E00

⎟⎟⎟⎟⎠.

Page 575: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Solutions to the Exercises 563

By substituting the numbers⎛

⎜⎜⎜⎜⎝

−1 1 1 0 00 0 −1 1 1

(2+ j94.2) 4 0 0 00 −4 (2− j31.98) 2 00 0 0 −2 2

⎟⎟⎟⎟⎠

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

00

22000

⎟⎟⎟⎟⎠.

The solution of the system of linear equations is⎛

⎜⎜⎜⎜⎝

I1

I2

I3

I4

I5

⎟⎟⎟⎟⎠

=

⎜⎜⎜⎜⎝

0.14708− j2.33810−0.13584− j2.294570.28292− j0.043530.14146− j0.021770.14146− j0.02177

⎟⎟⎟⎟⎠.

Page 576: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

564 Solutions to the Exercises

Exercises of Appendix A

A.1 (a) x∧ y

A.2

x = 1y = 0z = 1v = 0

A.3 (b) z(x∨ y)∨ v

A.4 (c) x∧ y∧ z∨ x∧ y∧ z∨ x∧ y∧ z

Page 577: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

References

[1] J. Hefferon, Linear Algebra. Saint Michael’s College, 2012.[2] G. Cramer, “Introduction a l’analyse des lignes courbes algebriques,” Geneva:

Europeana, pp. 656–659, 1750.[3] K. Hoffman and R. Kunze, Linear Algebra. Englewood Cliffs, New Jersey,

Prentice - Hall, 1971.[4] A. Schönhage, A. Grotefeld, and E. Vetter, Fast Algorithms. A Multitape Tur-

ing Machine Implementation. 1994.[5] J. B. Fraleigh and R. A. Beauregard, Linear Algebra. Addison-Wesley Pub-

lishing Company, 1987.[6] J. Grcar, “Mathematicians of Gaussian elimination,” Notices of the American

Mathematical Society, vol. 58, no. 6, pp. 782–792, 2011.[7] N. Higham, Accuracy and Stability of Numerical Algorithms. SIAM, 2002.[8] D. M. Young, Iterative methods for solving partial difference equations of el-

liptical type. PhD thesis, Harvard University, 1950.[9] H. Coxeter, Introduction to Geometry. Wiley, 1961.

[10] T. Blyth and E. Robertson, Basic Linear Algebra. Springer UndergraduateMathematics Series, Springer, 2002.

[11] D. M. Burton, The History of Mathematics. McGraw-Hill, 1995.[12] M. A. Moskowitz, A Course in Complex Analysis in One Variable. World Sci-

entific Publishing Co, 2002.[13] M. R. Spiegel, Mathematical Handbook of Formulas and Tables. Schaum,

1968.[14] A. Kaw and E. Kalu, Numerical Methods with Applications. 2008.[15] J. P. Ballantine and A. R. Jerbert, “Distance from a line, or plane, to a point,”

The American Mathematical Monthly, vol. 59, no. 4, pp. 242–243, 1952.[16] D. Riddle, Analytic geometry. Wadsworth Pub. Co., 1982.[17] H. S. M. Coxeter, Projective Geometry. Springer.[18] K. G. Binmore, Mathematical Analysis: A Straightforward Approach. New

York, NY, USA: Cambridge University Press, 2nd ed., 1982.

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3

565

Page 578: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

566 References

[19] D. V. Widder, The Laplace Transform, vol. 6 of Princeton Mathematical Se-ries. Princeton University Press, 1941.

[20] R. Larson and D. C. Falvo, Elementary Linear Algebra. Houghton Mifflin,2008.

[21] A. Cobham, “The intrinsic computational difficulty of functions,” Proc. Logic,Methodology, and Philosophy of Science II, North Holland, 1965.

[22] D. Kozen, Theory of computation. Birkhäuser, 2006.[23] S. Arora and B. Barak, Computational Complexity: A Modern Approach. New

York, NY, USA: Cambridge University Press, 1st ed., 2009.[24] D. Huffman, “A method for the construction of minimum-redundancy codes,”

Proceedings of the IRE, vol. 40, pp. 1098–1101, 1952.[25] J. Łukasiewicz, Aristotle’s Syllogistic from the Standpoint of Modern Formal

Logic. Oxford University Press, 1957.[26] L. Euler, “Solutio problematis ad geometriam situs pertinensis,” Comm. Acad.

Sc. Imperialis Petropolitanae, vol. 8, 1736.[27] K. Appel and W. Haken, “Solution of the four color map problem,” Scientific

American, vol. 237, no. 4, pp. 108–121, 1977.[28] K. Mei-Ko, “Graphic programming using odd or even points,” Chinese Math.,

vol. 1, pp. 273–277, 1962.[29] C. A. Desoer and E. S. Kuh, Basic Circuit Theory. McGraw-Hill Education,

2009.[30] G. Boole, An Investigation of the Laws of Thought. Prometheus Books, 1853.[31] L. A. Zadeh, “Fuzzy sets,” Information and Control, vol. 8, no. 3, pp. 338–353,

1965.[32] J. Liouville, “Lecons sur les fonctions doublement periodiques,” Journal f"ur

die Reine und Angewandte Mathematik, vol. 88, pp. 277–310, 1879.[33] V. Vladimirov, Methods of the theory of functions of several complex variables.

1966.[34] O. T. O’Meara, Introduction to Quadratic Forms. Springer-Verlag, 2000.

Page 579: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Index

AAbelian, 258, 261Additivity, 341, 343Adjugate matrix, 43, 47–50, 52Affine mapping, 342, 379, 380Algebraic multiplicity, 191, 193, 387, 394,

399, 402, 408Algebraic structures

basic concepts, 253equivalence and congruence relation,

262–266Lagrange’s theorem, 266–269monoids, 254–258semigroups, 254–258

Associative, 46, 254, 257, 258, 548

BBasis extension theorem, 315–316Basis reduction theorem, 314Big-O notation, 419–423Bijective, 13–15, 135, 156, 268, 278, 369–371Bipartite graph, 449–450, 452, 458Bi-poles

activeAC sources, 503DC sources, 502–503

passivecapacitor, 501–502inductor, 501resistor, 500–501

in series and parallel, 504

Boolean algebrain algebraic structures, 522composed gates, 523–524crisp and fuzzy sets, 524–525properties, 521

Branch, 459–461, 477–479, 484, 513

CCanonic form

ellipse, 246–247hyperbola, 246–247parabola, 247–248

Capacitor, 501–502, 508–510Cartesian product, 6–10, 12, 13, 21, 170, 304,

467, 532Cauchy-Schwarz inequality, 331–333, 335,

553Chinese postman problem, 495Chord

conic, 236cotree, 460definition of diameter, 238diameters, 241edges, 459spanning tree, 484

Column vectorGram-Schmidt orthonormalization, 409linear dependence, 33–36, 321product of matrices, 26row, 23

© Springer Nature Switzerland AG 2019F. Neri, Linear Algebra for Computational Sciences and Engineering,https://doi.org/10.1007/978-3-030-21321-3

567

Page 580: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

568 Index

Commutativeabelian, 258cancellation law, 273field, 18internal composition law, 254intersection, 263ring properties, 18, 271, 272zero divisors, 276

Compatible matrices, 27, 65, 67–69Complement minor, 42Complete graph, 437, 444, 447, 451, 466Complex matrix, 178–180Complex number

arithmetic operations, 171–172De Moivre’s formula, 175Euler’s formula, 175–177intersection, 170matrices, 177–182null imaginary part, 326Ohm’s law, 510operations, 21in polar coordinates, 174, 543real

and imaginary axes, 170numbers, 281

rectangular coordinates, 173resistive, inductive and capacitive

contributions, 509square roots, 169systems of linear equation, 177–182vectors, 177–182

Complex vector, 177–182, 405Computational complexity

algorithms, 419–423big-O notation, 419–423Huffman coding, 426–430P, NP, NP-Hard, NP-complete problems,

423–426polish and reverse polish notation, 430–432

Congruence relation, 262–266Conics

analytical representation, 212–213canonic form (see Canonic form)intuitive introduction, 211–212matrix representation

asymptotes, 236–246axes, 236–246centres, 236–246classification, 230–235degenerate and non-degenerate, 228–229diameters, 236–246intersection with line, 225–226line tangent, 227–228

simplified representation

degenerate, 213–214non-degenerate, 214–224

Conjugate number, 171Connected component, 439, 440, 442, 450, 457Convergence, 111, 117, 121, 122, 125–131,

415Coordinate

analytical representation, 214foci, 222geometrical interpretation, 311linear equations, 243polar, 173, 174, 195rectangular, 173reference system, 137transformations, 507

Coplanardefinition, 135linear equations, 159vectors, 146, 153, 154

Cosets, 260–261, 266–269Cotree

chords, 478spanning tree, 477subspaces, 489and trees, 457–461

Cramer’s theorem, 76–81, 88, 537Cut-point, 442, 443Cycle matrices, 474–481, 485, 487, 512, 559

DDecision problem, 419, 420, 425Degenerate conic

generic conic, 228simplified representation, 213–214twice degenerate, 235

De Moivre’s formula, 175, 176Determinants

adjugate matrices, 41–43cofactors, 41–43conic, 231, 240, 242Cramer’s method, 88definitions, 30–33geometric characterization, 203Gram-Schmidt (see Gram-Schmidt

orthonormalization)incomplete matrix, 85, 180Laplace theorems, 44–46linear dependence, 33–36non-singular, 113null, 536polynomial, 386properties, 37–41row and column vectors, 33–36submatrices, 41–43

Page 581: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Index 569

Diagonalizationmatrix, 395–403symmetric mapping, 403–412

Dimensionimage, 355kernel, 360, 386mapping, 367vector space, 304–319

Dirac’s theorem, 448Direct methods

definition, 88–91equivalence, 108–110Gaussian elimination (see Gaussian

elimination)LU factorization, 102–108mathematical operation, 88pivoting strategies and computational cost,

99–101Direct sum, 289–291Distributivity, 17, 22, 25, 26, 137, 161, 163,

270, 281, 326, 521Divisible, 186–192, 387Domain

algebraic structure, 278codomain, 7function, 13integral, 275mapping, 340null vector, 554zero divisor, 274

Dominant eigenvalue, 412–415, 557

EEigenspace

definition, 382–384eigenvalues and eigenvectors,

384–395linear mapping, 381

Eigenvaluecalculation procedure, 111eigenvectors and eigenspaces, 381–395endomorphisms, 413

Eigenvector, 381–384dominant, 415mapping, 398method for determining, 384–395system of linear equations, 402

Electrical networksbasic concepts, 499–500bi-pole (see Bi-poles)impedance, 509–511Kirchoff’s laws, 505–506phasorial representation, 507–508solution, 511–517

Ellipsecanonic form, 246–247conic, 232, 546equation, 222–224intersection, 212perpendicular directions, 242simplified equation, 223, 224

Endomorphismalgebraic multiplicity, 387cases, 360characteristic polynomial, 386dimensional vector space, 382eigenvalues, 383, 556inverse mapping, 370and kernel, 347–354loss of generality, 364rank-nullity theorem, 554spectrum, 395symmetric, 406

Equation of line, 204, 205, 225Equivalence class

congruence relation, 262–267sets, 11transitivity, 12

Equivalence relation, 10–12, 16, 18, 143,262–264, 266, 267, 376, 377

Equivalent matrices, 89, 91Euclidean division, 184–187Euclidean spaces, 326–329

Gram determinant/Gramian, 333orthonormal basis, 335scalar product of vectors, 337in two dimensions, 329–330

Eulerian graph, 444–446Eulerian trail, 446Euler’s formula, 175–177, 461–463, 528, 560Euler’s graph, 444External composition law, 253, 281, 282, 327,

345

FFundamental theorem of algebra, 188–189,

192, 254, 528–529

GGaussian elimination

application, 100equivalence, 108–110linear equations, 92–96, 515LU factorization, 102–108row vector notation, 96–99steps, 92transformation, 100

Gaussian plane, 176

Page 582: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

570 Index

Gauss-Seidel method, 117–120, 123, 126–130Geodesic, 439, 450Geometric dual, 455, 456Geometric mapping, 377–381Geometric multiplicity

dimension of kernel, 386eigenvalue, 383, 386, 392, 401, 402

Geometric vectorsbases, 154–160basic concepts, 133–138linear

dependence, 138–149independence, 138–149

matrices, 150–154products, 160–166

Gerschgorin’s theorem, 395Girth, 439Gramian, 333–335Gram-Schmidt orthonormalization

algorithm, 335–338column vectors, 409definition, 333–335

Graph theoryapplications

Chinese postman problem, 495epidemics, 495four colour problem, 493social network problem, 492–493travelling salesman problem, 494–495

bipartite, 449–450Eulerian and Hamiltonian, 444–449isomorphisms and automorphisms, 489–492matrices (see Matrices)motivation and basic concepts, 433–443planar, 450–463

Grassmann’s formula, 316–319Groups

abelian, 261algebraic structure, 260combination, 270cosets, 260–261definition, 258–260degenerate, 235homomorphism, 276inverse element, 259, 266psychological studies, 495semigroups, 254–258sorting, 9subgroup, 265

HHamiltonian graph, Eulerian, 444–449Hamiltonian path, 447, 448

Homogeneous systemeigenvectors, 386endomorphism, 384KCL, 512linear equations, 85–87, 139, 159, 285, 349,

353, 366Homomorphisms, 276–279Huffman coding

algorithm, 426edge incident, 428letters, 429massive memory saving, 430operation, 427–428sorting, 427substantial saving, 426

Hyperbolaanalytical equation of ellipse, 222asymptotic directions, 233, 234canonic form, 246–247cases, 211–212conic, 546equation, 216–220, 239perpendicular directions, 242simplified equations, 232

IIdempotent, 522Identity matrix, 24, 54, 270, 335, 396, 478,

481, 485Identity principle, 183, 190, 192Imaginary field, 172, 173Imaginary number, 169, 170, 172Incidence matrices, 468–474Inductor, 501, 508–510Inner product space

basic concepts, 325–326Hermitian product, 326

Internal composition law, 253, 254, 281, 283,284, 345, 548, 549

Intersectionhyperbola, 211line, 225–226point, 208reference axis, 215set, 5symmetric difference, 6two sets, 170vertex of conic, 244–246

Interval, 15, 216, 325Inverse element

definition of group, 266existence, 270monoid, 255, 256

Page 583: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Index 571

neutral, 258non-singular matrices, 548opposite, 17

Inverse matrix, 46, 50, 52, 77, 78, 120, 369,373, 489

Isomorphisms, 276–279, 489–491, 548Iterative methods

definition, 111Gauss-Siedel’s method, 117–120Jacobi’s method, 112–117method of successive over relaxation,

121–125numerical comparison, 125–131

JJacobi’s method, 112–117, 126–130

KKernel

definition, 347–350dimension, 360, 440mapping, 361, 555theorem, 350–354

Kirchoff’s lawsdefinition, 505–506KCL, 506KVL, 506

Kronecker’s theorem, 59–60Kuratowski’s theorem, 453–454

LLagrange’s theorem, 266–269Laplace theorem

on determinants, 44–46vector of solutions, 79–80

Linear combinationcomplete matrix, 82express, 141null vector, 144n vectors, 138row vector, 35, 109s vectors, 298–299

Linear dependence/dependentcolumn, 36, 37coplanar, 152first lemma, 302–303linear combination, 141and linear independence, 138–149in n dimensions, 292–296row and column vectors, 33–36second lemma, 303–304vectors, 138, 145, 147, 294

Linear dependence lemma, 302–304

Linear equationsassociated system, 552complex vectors, matrices and systems,

177–182coordinates, 243direct methods (see Direct methods)eigenvalues and eigenvectors, 384endomorphisms, 360homogeneous systems, 85–87, 159, 160,

285, 337, 350iterative methods (see Iterative methods)linear combination, 159null vector, 369solution, 75–85, 206, 207variables, 198, 311

Linearly independentassociated matrix, 313eigenvectors, 388, 399, 412electrical network, 512, 513hypothesis, 298linear combination, 294, 320rows and columns, 57–58vectors, 146, 167, 307, 308, 309, 315, 316

Linear mappingsconcepts, 339–346eigenspaces, 381–395eigenvalues, 381–395eigenvectors, 381–395endomorphisms, 347–354kernel, 347–354as matrix, 368–369matrix diagonalization, 395–412power method, 412–416rank and nullity (see Nullity)set of vectors, 554

Linear span, 296–304Lines in plane

equations, 203–206family of straight, 208–211intersecting, 206–208

LU factorization, 102–110, 132

MMathematics, 527–529

algebraic structures, 17–18axiomatic system, 4functions, 12–14number sets, 14–17

Matricesadjacency, 464–468cut-set matrices, 482–485cycle, 474–481

Page 584: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

572 Index

Matrices (cont.)definitions, 22–24determinant (see Determinants)graph matrices and vector spaces, 489incidence, 468–474invertible, 46–53numeric vectors, 21–22operations, 24–30orthogonal, 54–56product, 29, 63, 85, 102, 178, 243, 260, 422,

476, 548rank, 56–72relation, 485–489sum, 24

Method of successive over relaxation, 121–125Minkowski’s inequality, 332–333Mixed product, 164, 165, 541, 542Monoids

definition, 254–256elements, 258homomorphism, 276inverse element, 258neutral element, 256non-singular matrices, 259non-standard operator, 257operator, 548

NNeutral element

commutative ring, 275internal composition law, 281inverse, 258monoid, 255product of matrices, 46properties, 17semigroup, 255sum and product, 269sum operation, 25

Newton’s binomial, 272–273, 436Non-degenerate conics

ellipse, 222–224hyperbola, 216–220parabola, 220–221

Non-linear algebra, 519–520NP-complete, 423–426NP-hard, 423–426Nullity

geometric mappings, 377–381invertible mappings, 369–371linear mappings (see Linear mappings)matrix representation, 362–367

rank-nullity theorem (see Rank-nullitytheorem)

similar matrices, 371–377Sylvester’s law, 61–70

Null matrix, 23, 56, 67, 274

OOperations

arithmetic, 101, 426elementary row, 89, 92elements, 17incidence matrices, 469matrix (see Matrices)polynomials (see Polynomials)real field, 18scalar product, 177, 327square root, 169sum and product, 17, 269

Opposite element, 17, 25, 136, 270, 281, 290Order and equivalence, 8–12Order relation, 8–12, 18, 532Ore’s theorem, 448Orthogonal

arbitrary pair, 335definition, 156diagonalizable, 409, 412directions, 330, 331, 338, 553eigenspaces, 408Euclidean space, 327matrices, 54–56maximum length, 331property, 54–56set, 328

Orthonormalcolumn vectors, 409Euclidean space, 335Gram-Schmidt method, 335vectors, 157versors, 156, 159

PParabola

asymptotic directions, 230canonic form, 247–248cases, 239conic, 235, 244, 546equation, 220–221intersection, 211linear equations, 240simplified equation, 232

Page 585: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

Index 573

Parallelbi-poles, 504conic equation, 235determined, 145null vector, 143parallelism, 154two vectors, 143, 144, 148vector space, 390

Partial fractions, 196–201, 543Partitioning of matrix, 63, 64Permutation

even and odd number, 30–31fundamental, 31, 32grouping, 30

Phase, 173, 174, 507, 543Phasor, 507Pivot element, 88Planar graph

4-colorable, 494definition, 451–457Euler’s formula, 461–463graphs and vector spaces, 461graph theory, 450trees and cotrees, 457–461

Polar coordinates, 173, 174, 195Polish notation, 430–432Polynomials

complexity, 423operations, 183–186partial fractions, 196–201quotient, 185–186, 188reminder, 185–187roots (see Roots of polynomials)

Power methoddefinition, 412–414endomorphism, 412Rayleigh’s quotient, 414–416

Product of scalarby matrix, 25by vector, 137, 253, 327, 328

Product polynomial, 184Pythagorean formula, 333

RRank

associated matrix, 286cycle matrix, 512matrix, 56–72, 207and nullity of linear mappings (see Nullity)Rouchè-Capelli theorem, 85vector space, 461

Rank-nullity theorem, 355, 358–362, 368, 416,440, 461, 555

general case, 357–362

special cases, 356well-posedness of equality, 355–356

Rank of graph, 440, 461Rank of mapping, 355Rank of matrix

definition, 56–59Kronecker’s theorem, 59–61Sylvester’s law of nullity, 61–70Weak Sylvester’s law of nullity, 70–72

Real field, 18, 21, 172Resistor, 500–502, 507, 509Rings

algebraic structures, 270cancellation law, 273–275fields, 275–276

Roots of polynomialsdefinition, 186, 191–193determination, 193–196distinct roots of polynomial, 190–191fundamental theorem of algebra, 188–189Ruffini’s theorem, 186–188

Rouché-Capellicases, 207homogeneous system, 286Kronecker-Capelli theorem, 80–85linear systems, 131

Row vectorcofactors, 45and column, 26Gaussian elimination, 96–99incidence matrix, 470linear combination, 36scalar product, 55vectors of vectors, 26

Ruffini’s theorem, 186–188, 195, 196

SScalar

arbitrary, 285cofactors, 46definition, 21dot product, 161geometric vector, 282homogeneity, 342linear combination, 34, 142non-null scalar, 91product, 137, 177, 205, 241, 333product of matrices, 26vector of cofactors, 44vectors, 22

Scalar productalgorithm, 422calculation, 406–407cofactors, 46

Page 586: Linear Algebra for Computational Sciences and Engineering, 2nd … · physics is principally supported by three ideas: Superposition Principle, Decoupling Principle and Symmetry Principle

574 Index

Scalar product (cont.)complex vectors, 177–179dot product, 161–162Euclidean space, 327Hermitian product, 326Laplace theorem, 45orthogonal matrices, 55perpendicularity, 540product matrix, 476real number, 22row vector, 26vector of cofactors, 44

Set theory, 4–11Semigroup

cancellation law, 259and monoids, 254–258neutral element, 548

Shearing, 378Similar matrices, 371–377, 396Spectral radius, 395Spectrum, 395Square matrix, 23, 24, 31, 129, 397, 403Staircase system, 90, 91Subgroups

cosets, 260–261definition, 258–260finite group, 267–268Lagrange’s theorem, 279

Subsetalgebraic structure, 260cardinality, 5domain and codomain, 7infinite, 262interval, 15kernel, 355NP-hard, 425poset, 10vector space, 283

Sum of vectors, 81, 136, 138, 161, 163, 258,322

Sum polynomial, 183, 184Surjective

endomorphism, 369and injective, 14, 341mapping, 13, 156, 340

Sylvester’s law of nullity, 61–62, 70–73, 483Symmetric mapping, diagonalization, 403–412Systems of linear equations

complex numbers, 180eigenvectors, 387, 400vector equations, 339See also Linear equations

TTransformation matrix, 373, 375, 397, 400,

403, 408–412, 556

Transpose matrix, 23, 24, 27, 37, 43, 48, 54,55, 78, 409, 483

Travelling salesman problemalgorithm, 495digital computer, 494Hamiltonian circuits, 494

Treesarbitrary chord, 477and cotrees, 457–461non-singular, 470n vertices, 470spanning, 471

Turing machine, 420, 423, 424

UUndetermined, 80, 81, 159–161, 239, 240,

367, 384, 536, 537Union, 262–265, 285, 441, 449, 450, 467, 519Uniqueness, 10, 185

VVector product

calculation, 542cross product, 162–164definition, 162–164mixed product, 165

Vector spacesanalogy, 461basic concepts, 281–282basis and dimension, 304–319Euclidean space, 327finite-dimensional, 325, 371graph matrices, 489linear

dependence, 292–296mapping, 343, 362span, 296–304

mapping, 355row and column, 319–321subspaces, 282–292

Vector subspace, 282–292, 308, 311, 345, 346,550

Versor, 156, 157, 335, 336, 338, 553Voltage

AC, 503bi-pole, 502, 507capacitor, 508conductor, 501connectors, 510and current, 499–501, 506KVL, 506, 512null angular frequency, 507resistor, 502time, 500