. D Matrix Calculus D 1

Similar documents
1 Matrices and matrix algebra

2. Linear algebra. matrices and vectors. linear equations. range and nullspace of matrices. function of vectors, gradient and Hessian

Elementary maths for GMT

LS.1 Review of Linear Algebra

MATH 2030: MATRICES ,, a m1 a m2 a mn If the columns of A are the vectors a 1, a 2,...,a n ; A is represented as A 1. .

Phys 201. Matrices and Determinants

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

We could express the left side as a sum of vectors and obtain the Vector Form of a Linear System: a 12 a x n. a m2

11 a 12 a 21 a 11 a 22 a 12 a 21. (C.11) A = The determinant of a product of two matrices is given by AB = A B 1 1 = (C.13) and similarly.

MAT 1332: CALCULUS FOR LIFE SCIENCES. Contents. 1. Review: Linear Algebra II Vectors and matrices Definition. 1.2.

7.6 The Inverse of a Square Matrix

Dr. Allen Back. Sep. 8, 2014

Chapter 3. Determinants and Eigenvalues

Matrix Differentiation

MATH 431: FIRST MIDTERM. Thursday, October 3, 2013.

REVIEW OF DIFFERENTIAL CALCULUS

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

Matrix Algebra: Definitions and Basic Operations

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Bastian Steder

Matrix Algebra, Class Notes (part 2) by Hrishikesh D. Vinod Copyright 1998 by Prof. H. D. Vinod, Fordham University, New York. All rights reserved.

Introduction to Determinants

Math 302 Outcome Statements Winter 2013

1 Determinants. 1.1 Determinant

2 Constructions of manifolds. (Solutions)

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Section 4.2. Types of Differentiation

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Basic Concepts in Linear Algebra

Tangent Planes, Linear Approximations and Differentiability

Brief Review of Vector Algebra

Review of Basic Concepts in Linear Algebra

Matrices: 2.1 Operations with Matrices

Matrices A brief introduction

(1) Recap of Differential Calculus and Integral Calculus (2) Preview of Calculus in three dimensional space (3) Tools for Calculus 3

Stat 206: Linear algebra

Math 240 Calculus III

Contravariant and Covariant as Transforms

Introduction Eigen Values and Eigen Vectors An Application Matrix Calculus Optimal Portfolio. Portfolios. Christopher Ting.

CP3 REVISION LECTURES VECTORS AND MATRICES Lecture 1. Prof. N. Harnew University of Oxford TT 2013

Matrix Algebra. Matrix Algebra. Chapter 8 - S&B

MATH 423/ Note that the algebraic operations on the right hand side are vector subtraction and scalar multiplication.

ENGI 9420 Lecture Notes 2 - Matrix Algebra Page Matrix operations can render the solution of a linear system much more efficient.

Exercise Set Suppose that A, B, C, D, and E are matrices with the following sizes: A B C D E

Linear Algebra (Review) Volker Tresp 2018

Matrix Algebra, part 2

a11 a A = : a 21 a 22

Econ Slides from Lecture 8

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

MULTIVARIABLE CALCULUS, LINEAR ALGEBRA, AND DIFFERENTIAL EQUATIONS

Mathematics. EC / EE / IN / ME / CE. for

Graduate Mathematical Economics Lecture 1

Undergraduate Mathematical Economics Lecture 1

g(t) = f(x 1 (t),..., x n (t)).

MATRICES The numbers or letters in any given matrix are called its entries or elements

Matrix Multiplication

k is a product of elementary matrices.

Hands-on Matrix Algebra Using R

ECON 186 Class Notes: Linear Algebra

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

MATH 240 Spring, Chapter 1: Linear Equations and Matrices

Matrices and Determinants

CSL361 Problem set 4: Basic linear algebra

Matrices A brief introduction

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Diego Tipaldi, Luciano Spinello

Sometimes the domains X and Z will be the same, so this might be written:

Lesson U2.1 Study Guide

MATRICES. a m,1 a m,n A =

MATRICES AND MATRIX OPERATIONS

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Chapter 9: Systems of Equations and Inequalities

Mathematical foundations - linear algebra

Chapter 4. Determinants

Math Camp Lecture 4: Linear Algebra. Xiao Yu Wang. Aug 2010 MIT. Xiao Yu Wang (MIT) Math Camp /10 1 / 88

Vectors. January 13, 2013

Contents. Appendix D (Inner Product Spaces) W-51. Index W-63

Figure 25:Differentials of surface.

Exercise Sheet 1.

Lecture 2j Inner Product Spaces (pages )

Math 360 Linear Algebra Fall Class Notes. a a a a a a. a a a

M. Matrices and Linear Algebra

Chapter 1: Systems of Linear Equations and Matrices

MA 106 Linear Algebra

ELEMENTARY MATRIX ALGEBRA

Matrix representation of a linear map

ME751 Advanced Computational Multibody Dynamics

Calculus for the Life Sciences II Assignment 6 solutions. f(x, y) = 3π 3 cos 2x + 2 sin 3y

The matrix will only be consistent if the last entry of row three is 0, meaning 2b 3 + b 2 b 1 = 0.

Electromagnetism HW 1 math review

MTH4101 CALCULUS II REVISION NOTES. 1. COMPLEX NUMBERS (Thomas Appendix 7 + lecture notes) ax 2 + bx + c = 0. x = b ± b 2 4ac 2a. i = 1.

Multiple Integrals and Vector Calculus (Oxford Physics) Synopsis and Problem Sets; Hilary 2015

Matrices and Vectors

Vector Calculus. A primer

EE364a Review Session 7

ICS 6N Computational Linear Algebra Matrix Algebra

Math 1060 Linear Algebra Homework Exercises 1 1. Find the complete solutions (if any!) to each of the following systems of simultaneous equations:

POLI270 - Linear Algebra

System of Linear Equations

Transcription:

D Matrix Calculus D 1

Appendix D: MATRIX CALCULUS D 2 In this Appendix we collect some useful formulas of matrix calculus that often appear in finite element derivations D1 THE DERIVATIVES OF VECTOR FUNCTIONS Let x and y be vectors of orders n and m respectively: x x 1 x 2 x n, y y 1 y 2 y m, (D1) where each component y i may be a function of all the x j, a fact represented by saying that y is a function of x,or y y(x) (D2) If n 1, x reduces to a scalar, which we call x Ifm 1, y reduces to a scalar, which we call y Various applications are studied in the following subsections D11 Derivative of Vector with Respect to Vector The derivative of the vector y with respect to vector x is the n m matrix def 1 2 1 m 1 1 1 2 2 m 2 2 1 2 n m n n (D3) D12 Derivative of a Scalar with Respect to Vector If y is a scalar, def 1 2 n (D4) D13 Derivative of Vector with Respect to Scalar If x is a scalar, def [ 1 2 m ] (D5) D 2

D 3 D1 THE DERIVATIVES OF VECTOR FUNCTIONS REMARK D1 Many authors, notably in statistics and economics, define the derivatives as the transposes of those given above 1 This has the advantage of better agreement of matrix products with composition schemes such as the chain rule Evidently the notation is not yet stable EXAMPLE D1 Given and y [ y1 ], x y 2 y 1 x 2 1 x 2 y 2 x 2 3 + 3x 2 [ x1 x 2 x 3 ] (D6) (D7) the partial derivative matrix / is computed as follows: 1 2 1 1 1 2 2 2 1 2 3 3 [ 2x1 0 ] 1 3 0 2x 3 (D8) D14 Jacobian of a Variable Transformation In multivariate analysis, if x and y are of the same order, the determinant of the square matrix /, that is J (D9) is called the Jacobian of the transformation determined by y y(x) The inverse determinant is J 1 (D10) 1 One author puts it this way: When one does matrix calculus, one quickly finds that there are two kinds of people in this world: those who think the gradient is a row vector, and those who think it is a column vector D 3

Appendix D: MATRIX CALCULUS D 4 EXAMPLE D2 The transformation from spherical to Cartesian coordinates is defined by x r sin θ cos ψ, y r sin θ sin ψ, z r cos θ (D11) where r > 0, 0 < θ < π and 0 ψ < 2π To obtain the Jacobian of the transformation, let x x 1, y x 2, z x 3 r y 1, θ y 2, ψ y 3 (D12) Then J sin y 2 cos y 3 sin y 2 sin y 3 cos y 2 y 1 cos y 2 cos y 3 y 1 cos y 2 sin y 3 y 1 sin y 2 y 1 sin y 2 sin y 3 y 1 sin y 2 cos y 3 0 y 2 1 sin y 2 r 2 sin θ (D13) The foregoing definitions can be used to obtain derivatives to many frequently used expressions, including quadratic and bilinear forms EXAMPLE D3 Consider the quadratic form y x T Ax where A is a square matrix of order n Using the definition (D3) one obtains (D14) Ax + AT x (D15) and if A is symmetric, 2Ax (D16) We can of course continue the differentiation process: 2 y ( ) A + A T, (D17) 2 and if A is symmetric, 2 y 2 2A (D18) The following table collects several useful vector derivative formulas y Ax x T A x T x x T Ax A T A 2x Ax + A T x D 4

D 5 D2 THE CHAIN RULE FOR VECTOR FUNCTIONS D2 Let THE CHAIN RULE FOR VECTOR FUNCTIONS x x 1 x 2 x n, y y 1 y 2 y r and z z 1 z 2 z m (D19) where z is a function of y, which is in turn a function of x Using the definition (D2), we can write ( ) z T Each entry of this matrix may be expanded as z 1 z 1 1 2 z 2 1 z 2 2 1 2 z 1 n z 2 n n (D20) z i j r q1 z i q q j { i 1, 2,,m j 1, 2,,n (D21) Then ( ) z T z1 y q q 1 z2 q q 1 zm q z 1 z 1 1 z 2 z 2 1 1 q 1 2 2 2 ( ) z T ( On transposing both sides, we finally obtain z1 q q 2 z2 q q 2 zm q q z2 q q n z2 q q n zm q q n 2 z 1 1 1 r 1 2 1 n z 2 r 2 2 1 2 2 n r r r 1 2 r n ) T ( ) z T (D22) z z, (D23) which is the chain rule for vectors If all vectors reduce to scalars, z z z, (D24) D 5

Appendix D: MATRIX CALCULUS D 6 which is the conventional chain rule of calculus Note, however, that when we are dealing with vectors, the chain of matrices builds toward the left For example, if w is a function of z, which is a function of y, which is a function of x, w z w z (D25) On the other hand, in the ordinary chain rule one can indistictly build the product to the right or to the left because scalar multiplication is commutative D3 THE DERIVATIVE OF SCALAR FUNCTIONS OF A MATRIX Let X (x ij ) be a matrix of order (m n) and let y f (X), (D26) be a scalar function of X The derivative of y with respect to X, denoted by X, (D27) is defined as the following matrix of order (m n): G X 11 21 m1 12 22 m2 1n 2n mn [ ] ij i, j E ij ij, (D28) where E ij denotes the elementary matrix* of order (m n) This matrix G is also known as a gradient matrix EXAMPLE D4 Find the gradient matrix if y is the trace of a square matrix X of order n, that is y tr(x) n x ii i1 (D29) Obviously all non-diagonal partials vanish whereas the diagonal partials equal one, thus G X I, (D30) where I denotes the identity matrix of order n * The elementary matrix E ij of order m n has all zero entries except for the (i, j) entry, which is one D 6

D 7 D4 THE MATRIX DIFFERENTIAL D31 Functions of a Matrix Determinant An important family of derivatives with respect to a matrix involves functions of the determinant of a matrix, for example y X or y AX Suppose that we have a matrix Y [y ij ] whose components are functions of a matrix X [x rs ], that is y ij f ij (x rs ), and set out to build the matrix X (D31) Using the chain rule we can write rs i j Y ij ij ij rs (D32) But Y j y ij Y ij, (D33) where Y ij is the cofactor of the element y ij in Y Since the cofactors Y i1, Y i2, are independent of the element y ij,wehave ij Y ij (D34) It follows that rs i j Y ij ij rs (D35) There is an alternative form of this result which is ocassionally useful Define a ij Y ij, A [a ij ], b ij ij rs, B [b ij ] (D36) Then it can be shown that rs tr(ab T ) tr(b T A) (D37) EXAMPLE D5 If X is a nonsingular square matrix and Z X X 1 its cofactor matrix, If X is also symmetric, G X X ZT G X X 2ZT diag(z T ) (D38) (D39) D 7

Appendix D: MATRIX CALCULUS D 8 D4 THE MATRIX DIFFERENTIAL For a scalar function f (x), where x is an n-vector, the ordinary differential of multivariate calculus is defined as n f df dx i (D40) i In harmony with this formula, we define the differential of an m n matrix X [x ij ]tobe dx def i1 dx 11 dx 12 dx 1n dx 21 dx 22 dx 2n dx m1 dx m2 dx mn This definition complies with the multiplicative and associative rules (D41) d(αx) α dx, d(x + Y) dx + dy (D42) If X and Y are product-conforming matrices, it can be verified that the differential of their product is d(xy) (dx)y + X(dY) (D43) which is an extension of the well known rule d(xy) ydx+ xdyfor scalar functions EXAMPLE D6 If X [x ij ] is a square nonsingular matrix of order n, and denote Z X X 1 Find the differential of the determinant of X: d X i, j X ij dx ij where X ij denotes the cofactor of x ij in X X ij dx ij tr( X X 1 ) T dx) tr(z T dx), i, j (D44) EXAMPLE D7 With the same assumptions as above, find d(x 1 ) The quickest derivation follows by differentiating both sides of the identity X 1 X I: d(x 1 )X + X 1 dx 0, (D45) from which If X reduces to the scalar x we have d(x 1 ) X 1 dxx 1 d ( ) 1 dx x x 2 (D46) (D47) D 8