1Q2 Course Notes 2001

Similar documents
Consider an ideal pendulum as shown below. l θ is the angular acceleration θ is the angular velocity

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.

Higher-order ordinary differential equations

Advanced Mathematics Support Programme Edexcel Year 2 Core Pure Suggested Scheme of Work ( )

Further Mathematics SAMPLE. Marking Scheme

Material for review. By Lei. May, 2011

4 Differential Equations

Engg. Math. I. Unit-I. Differential Calculus

dx n a 1(x) dy

PURE MATHEMATICS AM 27

In Z: x + 3 = 2 3x = 2 x = 1 No solution In Q: 3x = 2 x 2 = 2. x = 2 No solution. In R: x 2 = 2 x = 0 x = ± 2 No solution Z Q.

Ordinary Differential Equations (ODEs)

UNIVERSITY OF CAMBRIDGE Faculty of Mathematics MATHEMATICS WORKBOOK

With this expanded version of what we mean by a solution to an equation we can solve equations that previously had no solution.

Complex Numbers. The set of complex numbers can be defined as the set of pairs of real numbers, {(x, y)}, with two operations: (i) addition,

Complex Numbers and the Complex Exponential

THE NATIONAL UNIVERSITY OF IRELAND, CORK COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2009.

MAS153/MAS159. MAS153/MAS159 1 Turn Over SCHOOL OF MATHEMATICS AND STATISTICS hours. Mathematics (Materials) Mathematics For Chemists

z = x + iy ; x, y R rectangular or Cartesian form z = re iθ ; r, θ R polar form. (1)

CALCULUS PROBLEMS Courtesy of Prof. Julia Yeomans. Michaelmas Term

10.1 Complex Arithmetic Argand Diagrams and the Polar Form The Exponential Form of a Complex Number De Moivre s Theorem 29

Chapter 3. Reading assignment: In this chapter we will cover Sections dx 1 + a 0(x)y(x) = g(x). (1)

Merton College Maths for Physics Prelims October 3, 2010 MT I. Calculus. { y(x + δx) y(x) dx 2 + x dy

ENGI 9420 Lecture Notes 1 - ODEs Page 1.01

d 1 µ 2 Θ = 0. (4.1) consider first the case of m = 0 where there is no azimuthal dependence on the angle φ.

Monday, 6 th October 2008

Some suggested repetition for the course MAA508

Overview of Complex Numbers

UNIVERSITY OF SOUTHAMPTON. A foreign language dictionary (paper version) is permitted provided it contains no notes, additions or annotations.

C. Complex Numbers. 1. Complex arithmetic.

1 (2n)! (-1)n (θ) 2n

ISE I Brief Lecture Notes

Here are brief notes about topics covered in class on complex numbers, focusing on what is not covered in the textbook.

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

3 + 4i 2 + 3i. 3 4i Fig 1b

10.3. The Exponential Form of a Complex Number. Introduction. Prerequisites. Learning Outcomes

2005 Mathematics. Advanced Higher. Finalised Marking Instructions

z = a + ib (4.1) i 2 = 1. (4.2) <(z) = a, (4.3) =(z) = b. (4.4)

Linear DifferentiaL Equation

Topic 4 Notes Jeremy Orloff

MSM120 1M1 First year mathematics for civil engineers Revision notes 3

Math Final Exam Review

Partial differential equations (ACM30220)

Formulas to remember

MATH1231 CALCULUS. Session II Dr John Roberts (based on notes of A./Prof. Bruce Henry) Red Center Room 3065

OR MSc Maths Revision Course

Extra FP3 past paper - A

MTH4101 Calculus II. Carl Murray School of Mathematical Sciences Queen Mary University of London Spring Lecture Notes

REVIEW OF DIFFERENTIAL CALCULUS

Second-Order Linear ODEs

ECM Calculus and Geometry. Revision Notes

In this chapter we study several functions that are useful in calculus and other areas of mathematics.

Math review. Math review

Mathematics 104 Fall Term 2006 Solutions to Final Exam. sin(ln t) dt = e x sin(x) dx.

JUST THE MATHS UNIT NUMBER DIFFERENTIATION 3 (Elementary techniques of differentiation) A.J.Hobson

Friday 09/15/2017 Midterm I 50 minutes

Partial Fractions. June 27, In this section, we will learn to integrate another class of functions: the rational functions.

Quick Overview: Complex Numbers

Chapter 3: Complex Numbers

P1 Calculus II. Partial Differentiation & Multiple Integration. Prof David Murray. dwm/courses/1pd

Foundations of quantum mechanics

3.4.1 Distinct Real Roots

Chapter 2: Complex numbers

MATH1012 Mathematics for Civil and Environmental Engineering Prof. Janne Ruostekoski School of Mathematics University of Southampton

6 Second Order Linear Differential Equations

(λ, µ, ν are not zero). Show that the condition for the points with position vectors

STEP Support Programme. STEP 2 Matrices Topic Notes

Math 4B Notes. Written by Victoria Kala SH 6432u Office Hours: T 12:45 1:45pm Last updated 7/24/2016

1MA1 Introduction to the Maths Course

Introduction to Complex Analysis

B Ordinary Differential Equations Review

Background ODEs (2A) Young Won Lim 3/7/15

MS 3011 Exercises. December 11, 2013

MATH 135: COMPLEX NUMBERS

Mathematics Notes for Class 12 chapter 7. Integrals

Examples and MatLab. Vector and Matrix Material. Matrix Addition R = A + B. Matrix Equality A = B. Matrix Multiplication R = A * B.

Calculus I Review Solutions

Introduction and preliminaries

Partial Differential Equations Summary

Mathematical Review for Signal and Systems

Systems of Linear ODEs

Section 3.4. Second Order Nonhomogeneous. The corresponding homogeneous equation. is called the reduced equation of (N).

Partial Differential Equations for Engineering Math 312, Fall 2012

Complex Numbers Introduction. Number Systems. Natural Numbers ℵ Integer Z Rational Q Real Complex C

Contents. 2 Partial Derivatives. 2.1 Limits and Continuity. Calculus III (part 2): Partial Derivatives (by Evan Dummit, 2017, v. 2.

Advanced Mathematics Support Programme OCR Year 2 Pure Core Suggested Scheme of Work ( )

1.4 Techniques of Integration

PURE MATHEMATICS AM 27

Examples: Solving nth Order Equations

1 Distributions (due January 22, 2009)

Power series solutions for 2nd order linear ODE s (not necessarily with constant coefficients) a n z n. n=0

Complex Numbers and Exponentials

Mathematics of Imaging: Lecture 3

Some functions and their derivatives

JUST THE MATHS UNIT NUMBER DIFFERENTIATION APPLICATIONS 5 (Maclaurin s and Taylor s series) A.J.Hobson

Differential Equations 2280 Sample Midterm Exam 3 with Solutions Exam Date: 24 April 2015 at 12:50pm

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

TEST CODE: MMA (Objective type) 2015 SYLLABUS

7.3 Singular points and the method of Frobenius

Linear Algebra Primer

Transcription:

1Q2 Course Notes 2001 D.A.Howe 1 Complex Numbers 1.1 Introduction Revision: roots of quadratic x 2 2x 3 = 0 x = (2 ± 16)/2, i.e. 2 real roots: x = 3, x = 1. However, for: x 2 2x + 5 = 0 x = (2 ± 16)/2. No real roots, i.e. no roots on the real number line. Assume numbers can exist outside the real number line. Define i where i 2 = 1 and see what happens. This means 16 = 16 1 = 4 1 = 4i, and the two complex roots of the example are 1 ± 2i. Sometimes j is used for 1 instead of i. Either is OK for 1Q2, but be consistent! In general a complex number z can be written z = a + ib where a and b are real numbers; a = real part of z = Re(z); b = imaginary part of z = Im(z); z 1 = z 2 if real parts are the same and imaginary parts are the same. 1.2 Complex conjugate pairs Complex conjugate of z = a + ib is z = a ib. Real parts are the same, imaginary parts have the same magnitude but opposite sign. NB: (z) = (a ib) = a + ib = z 1.3 Graphical form - Argand Diagram A complex number can be depicted as a point on a cartesian plane, with the real part as the x-coordinate, and the imaginary part as the y-coordinate. The x-axis is the same as the real number line, so real numbers are included in complex numbers, but form a special case with zero imaginary part. 1.4 Basic results bi = ib; a + ib = ib + a; ( i)(+i) = 1; i 2 = 1; ( i) 2 = 1; i 3 = (i 2 )i = i; 1/i = i/i 2 = i/( 1) = i 1

1.5 Algebra with complex numbers 1.5.1 Addition (a + ib) + (c + id) = a + c + i(b + d) i.e. Re(z 1 + z 2 ) = Re(z 1 ) + Re(z 2 ) and Im(z 1 + z 2 ) = Im(z 1 ) + Im(z 2 ) Addition of complex numbers obeys the same rules of algebra as with real numbers. 1.5.2 Multiplication (a + ib)(c + id) = ac + ibc + iad + i 2 bd = ac bd + i(bc + ad) using the result i 2 = 1 and grouping real and imaginary parts. Multiplication of complex numbers obeys the same rules of algebra as with real numbers. 1.5.3 Division This is also possible, as with real numbers, but not so abvious how to do: z 1 z 2 = a + ib c + id =??? Here we use the fact that z z is real, in this case z 2 z 2 = c 2 + d 2, giving: 1.6 Polar form = z 1 = z 1 z 2 (a + ib)(c id) = z 2 z 2 z 2 (c + id)(c id) 1 c 2 (ac + bd + i(bc ad)) + d2 Using polar coordinates instead of cartesian, leads to the following way of writing a complex number x + iy: z = x + iy = r(cos θ + i sin θ) where: r = modulus = z = x 2 + y 2 ; θ = argument = Arg(z). In this course, the argument θ is usually expressed in the principal value range π +π. To find θ in this range, use one of the following results, as appropriate: θ = + cos 1 (x/r) if y 0 θ = cos 1 (x/r) if y < 0. For a complex conjugate in polar form, θ simply changes to θ, meaning that: r(cos θ + i sin θ) = r (cos( θ) + i sin( θ)) = r(cos θ i sin θ) 2

1.7 DeMoivre theorem; multiplication in polar form DeMoivre theorem: (cos θ + i sin θ) n = cos(nθ) + i sin(nθ) where n is an integer. Also, in general, when complex numbers are multiplied in polar form, moduli are multiplied, arguments are added. 1.8 Division in polar form Divide moduli, subtract arguments. 1.9 Exponential form To begin with, a bit of background: r 1 (cos θ 1 + i sin θ 1 ) r 2 (cos θ 2 + i sin θ 2 ) = r 1 r 2 (cos(θ 1 θ 2 ) + i sin(θ 1 θ 2 )) Many functions can be expressed in polynomial form, using a power series. These series have an infinite number of terms. Sometimes the first few terms are used as approximations. Using more terms makes the approximation better, but is also more complicated (see block 5 later on). For example: cos x = 1 x2 2! + x4 4! x6 6! +...etc. sin x = x x3 3! + x5 5! x7 7! +...etc. e x = 1 + x + x2 2! + x3 3! + x4 4! +...etc. The above results can be used to express complex numbers in a new way, which is much easier to use in many applications: First, we expand e iθ in the same way as e x, to get: e iθ = 1 + iθ + (iθ)2 2! = 1 + iθ + i2 θ 2 2! + (iθ)3 3! + i3 θ 3 3! Using i 2 = 1, i 3 = i, i 4 = +1, i 5 = +i etc., we get: + (iθ)4 4! + i4 θ 4 4! +...etc. +...etc. e iθ = 1 + iθ + θ2 2! + iθ3 3! + θ4 4! + iθ5 +...etc. 5! = 1 + iθ θ2 2! iθ3 + θ4 3! 4! + iθ5...etc. 5! Group real terms (with no i) and imaginary terms (with i): ( ) ( ) e iθ = 1 θ2 2! + θ4 4!...etc. + i θ θ3 3! + θ5 5!...etc. 3

Comparing brackets with series for sine and cosine above, we see that: e iθ = cos θ + i sin θ Therefore: re iθ = r(cos θ + i sin θ) z = re iθ is another way of writing a complex number of modulus r and argument θ. This is called the exponential or Euler form of a complex number. 1.10 Algebra and calculus with exponential form Rules relating moduli and arguments in polar from follow naturally in exponential form: z 1 z 2 = r 1 e iθ 1 r 2 e iθ 2 = r 1 r 2 e i(θ 1+θ 2 ) and so on. Differentiation is done in the normal way: and so on. Also note the following: where k is any integer. d dθ reiθ = rie iθ z = re iθ = re i(θ+2πk) 1.11 Using complex numbers Problems involving trig. functions can often be solved more easily by converting temporarily into complex form. Here are some illustrations of this: 1.11.1 Trig. Identities Example: find cos(4x) and sin(4x) in terms of cos x and/or sin x. From sect. 1.7 we know: cos(4x) + i sin(4x) = (cos x + i sin x) 4 Expand RHS: cos(4x) + i sin(4x) = cos 4 x + 4 cos 3 x(i sin x) + 6 cos 2 x(i sin x) 2 + 4 cos x(i sin x) 3 + (i sin x) 4 (Binomial expansion). By using i 2 = 1, i 3 = i, i 4 = +1 and grouping real terms and imaginary terms, we get a complex number of the form a + ib, where a and b are in terms of cos x and/or sin x and a = cos(4x), b = sin(4x). This is much easier than doing it geometrically. 4

1.11.2 Integration Some integrals can be made simpler using the Euler form of complex numbers. For example, the following integrals can be done by integrating by parts twice (see 1Q1): I 1 = e x cos xdx = (1/2)e x cos x + (1/2)e x sin x + C 1 I 2 = e x sin xdx = (1/2)e x cos x + (1/2)e x sin x + C 2 Another way, to do both together (even if you didn t want both!) is as follows: Define I = I 1 + ii 2 = e x cos xdx + i e x sin xdx = e x (cos x + i sin x)dx = e x e ix dx = e (1+i)x dx = 1 1 + i e(1+i)x + C From sect 1.5.3 1/(1 + i) = (1 i)/2 = 1/2 i(1/2). Also, as we are using complex numbers, constant of integration C may be complex itself. Let C = C 1 + ic 2. This gives: I = (1/2 i(1/2))e (1+i)x + C = (1/2 i(1/2))e x e ix + C = (1/2 i(1/2))e x (cos x + i sin x) + C 1 + ic 2 Multiply out, use i 2 = 1 and separate real and imaginary terms: This gives us the results quoted above. I = I 1 + ii 2 = (1/2)e x cos x + (1/2)e x sin x + C 1 +i( (1/2)e x cos x + (1/2)e x sin x + C 2 ) 1.11.3 Phasors Sinusoidal functions in the form f = A cos(ωt + φ) occur in many applications. Here A is the amplitude (NB A is positive, f varying sinusoidally between +A and A), ω is the angular speed (radians/sec) and φ is the phase (in radians, defined in the principal value range π +π). In complex form, define complex number X such that: f = Re(X) = Re(A(cos(ωt + φ) + i sin(ωt + φ))) Using the exponential form (sect. 1.9) and rearranging: X = Ae i(ωt+φ) = Ae iφ e iωt = Ze iωt 5

where Z = Ae iφ. The complex constant Z carries information about the amplitude and phase, and is known as the phasor of function f. When adding two sinusoidal functions in the form A cos(ωt + φ) with the same angular speed, but different amplitude and phase, the phasor of the sum is equal to the sum of the phasors. Example: Find the phasor for 2 cos(ωt π/4). A = 2, φ = π/4, so the phasor is 2e iπ/4. Example: Find the phasor for 2 sin(ωt π/4). 2 sin(ωt π/4) = 2 cos(ωt π/4 π/2) = 2 cos(ωt 3π/4), so the phasor is 2e i3π/4. Example: Find the phasor for 2 cos(ωt π/4). 2 cos(ωt π/4) = 2 cos(ωt π/4 + π) = 2 cos(ωt + 3π/4), so the phasor is 2e i3π/4. 6

2 Hyperbolic functions 2.1 Introduction Hyperbolic functions are defined as follows, starting with the more common: (i) Hyperbolic sine: (ii) Hyperbolic cosine: (iii) Hyperbolic tangent: sinh x = ex e x 2 cosh x = ex + e x tanh x = ex e x e x + e x N.B. tanh x = sinh x/ cosh x just as, in trig. functions: tan x = sin x/ cos x. Other hyperbolic functions are defined analogously to trig. functions, being distinguished by the letter h added to the corresponding trig. symbol: coth x = 1/tanh x; sech x = 1/cosh x; cosech x = 1/sinh x. Here are some general properties of hyperbolic functions: (a) (i) sinh x is an odd function: sinh ( x) = sinh x (like sin x) (ii) sinh 0 = 0 (like sin 0) (b) (i) cosh x is an even function: cosh ( x) = cosh x (like cos x) (ii) cosh x 1 for all x (unlike cos x) (iii) cosh 0 = 1 (like cos 0) (c) (i) tanh x is an odd function: tanh ( x) = tanh x (like tan x) (ii) -1 < tanh x < +1 for all x (unlike tan x) (iii) tanh 0 = 1 (like tan 0) 2 2.2 Inverse Hyperbolic Functions Written sinh 1, cosh 1, tanh 1 etc. 2.2.1 Example y = sinh x = 1.475; what is x? By definition x = sinh 1 (1.475) e x e x = 1.475 2 Rearranging: (e x ) 2 2.950e x 1 = 0 (quadratic in e x ). Solution of the quadratic gives e x = 3.257 or e x = -0.3070. As e x must be positive for all real x, only the positive root is allowed, giving: e x = 3.257; x = ln(3.257) = 1.181 (4 sig. fig.). The same procedure for inverse cosine gives 2 possible values (cosh 1 is not single valued). You should check this yourself. 7

2.2.2 General forms Application of the same procedure as above for arbitrary y gives: sinh 1 y = ln(y + y 2 + 1) cosh 1 y = ± ln(y + y 2 1) = ln(y ± y 2 1) tanh 1 y = 1 [ ] 1 + y 2 ln 1 y 2.3 Hyperbolic Identities 2.3.1 Introduction Hyperbolic functions have identities similar but not always the same as the corresponding trig. identities. For example: cosh 2 x sinh 2 x = 1 instead of cos 2 x + sin 2 x = 1 instead of 1 + tan 2 x = sec 2 x like sin(2x) = 2 sin x cos x. 1 tanh 2 x = sech 2 x sinh(2x) = 2 sinh x cosh x cosh(2x) = cosh 2 x + sinh 2 x instead of cos(2x) = cos 2 x sin 2 x. 2.3.2 Osborn s Rule To get a hyperbolic identity from a trig. identity: 1. Change trig. functions to corresponding hyperbolic functions 2. Reverse the sign (+/-) of terms containing a product of 2 sinh, tanh, coth or cosech (e.g. sinh 2 x, sinhxtanhx, sinh 3 x etc.). See the previous subsection for examples. 2.4 Derivatives of hyperbolic functions and their inverses 2.4.1 Hyperbolic functions Similarly: d dx sinh x = d dx ( e x e x ) 2 = ex + e x 2 d cosh x = sinh x dx d dx tanh x = sech2 x = cosh x 8

2.4.2 Inverse Hyperbolic Functions For example: x = sinh 1 y; what is dx/dy? From y = sinh x, dy/dx = cosh x (from sect. 2.4.1). (dy/dx) (dx/dy) = 1, so cosh x(dx/dy) = 1; dx/dy = 1/ cosh x. d dy (sinh 1 y) = 1 cosh x We now want cosh x in terms of y. Using cosh 2 x sinh 2 x = 1, cosh x = 1 + sinh 2 x = 1 + y 2. This gives us: d dy (sinh 1 y) = 1 1 + y 2 Using similar methods, we find that the derivative of inverse cosine depends on whether it is positive or negative, and is undefined for cosh 1 y = 0: d dy (cosh 1 y) = d dy (cosh 1 y) = 1 y 2 1 1 y 2 1 (cosh 1 y > 0) (cosh 1 y < 0) 9

3 Matrices 3.1 Introduction A matrix is an array of elements in m rows and n columns. The rows are counted from the top down, and the columns from left to right. The order of a matrix is written: m n and pronounced m by n. A line matrix has just 1 row. A column matrix has just 1 column. A square matrix has m = n. The identity matrix is a square matrix with elements = 1 along the diagonal from top left, elements = 0 everywhere else; for example: ( ) 1 0 0 1 A null matrix has all elements = 0. and 1 0 0 0 1 0 0 0 1 Symbols to represent matrices are usually upper case letters, maybe in bold type or underlined. The identity matrix is represented as I. The null matrix is represented as 0. Elements are referred to using lower case letter with 2 subscripts for row number and column number; e.g. a 23 is the element of matrix A in the second row and the third column. Equal matrices must have the same order and same corresponding elements. The transpose of a matrix has rows and columns transposed. It is written with a superscript T or. For example: If A has order m n and B = A T : (i) B has order n m (ii) b ij = a ji for all elements. (iii) B T = (A T ) T = A. 1 4 ( ) 1 5 2 A = 5 2 A T = 4 2 1 2 1 To save space, a column matrix may be written as the transpose of a row matrix. For example: 1 1 2 3 5 = ( 1 1 2 3 5 ) T 10

3.2 Algebra with Matrices 3.2.1 Addition and Subtraction Matrices to be added must be of the same order. Add corresponding elements: If C = A + B, then c ij = a ij + b ij for all rows i and columns j. Similarly, if C = A B, then c ij = a ij b ij. Note the following properties: (A + B) + C = A + (B + C) A + B = B + A A + 0 = A (A + B) T = A T + B T (A B) T = A T B T 3.2.2 Multiplication by a Number k Multiply each element by k: If C = ka = Ak, then c ij = ka ij for all elements. 3.2.3 Multiplication of Matrices Product AB of two matrices A and B is possible only if the number of columns in A = the number of rows in B Rows act upon columns as follows: If C = AB, then c ij = a i1 b 1j + a i2 b 2j + a i3 b 3j + a i4 b 4j +...etc. for all rows i and columns j. The following properties are valid if the products are possible: A(B + C) = AB + AC A(BC) = (AB)C (AB) T = B T A T AI = IA = A A0 = 0A = 0 However!! AB BA in most cases. 3.3 Determinants The determinant of matrix A is written deta or A The determinant of a fully written out matrix is written by replacing the brackets with vertical lines. A determinant is a number associated with a square matrix. For small matrices, their determinants can be found as 11

follows. For a 2 2 matrix: For a 3 3 matrix: a b = ad bc c d a 11 a 12 a 13 a 21 a 22 a 23 a 31 a 32 a 33 = a 11 a 22 a 23 a 32 a 33 a 12 a 21 a 23 a 31 a 33 + a 13 a 21 a 22 a 31 a 32 Take each element of the top row, multiply by the determinant of the elements not in the same row or column, alternate + + signs before each, then add up. If any row or column is all zeros, the determinant is zero. If any 2 rows or 2 columns are the same, the determinant is zero. If any row or column is all multiplied by a number, the determinant is multiplied by that number. 3.4 Minors and Cofactors The smaller determinant formed by ignoring the row and column occupied by an element is known as the minor of that element. For example, given: 1 2 4 A = 1 3 2 0 3 5 3 2 the minor of a 11 is 3 5 = 3 5 ( 2) ( 3) = 9 1 2 the minor of a 23 is 0 3 = 1 ( 3) (2) 0 = 3 The cofactor of an element a ij is defined as follows: If i + j is even: cofactor = minor. If i + j is odd: cofactor = minor. So in the example, the cofactor of a 11 is 9, while the cofactor of a 23 is +3. NB. For a 2 2 matrix the minor of a term is simply the diagonally opposite term: ( ) 2 4 If A = 1 2 the minor of a 11 is 2 the minor of a 21 is 4 12

the cofactor of a 11 is 2 the cofactor of a 21 is +4 3.5 Inverse Matrices Given matrices A and B; if AB = I (identity matrix: see 3.1; matrix multiplication: see 3.2.3), then the matrices are inverses of each other. The inverse of A is written A 1. N.B: (i) Only square matrices have an inverse, but not all square matrices have one. (ii) AA 1 = A 1 A = I In this course, I ll describe just one method of finding inverse matrices. This is suitable for small matrices. Given a square matrix A: 1. Find the determinant A (see 3.3) 2. Find the cofactors of all elements in A and form a new matrix C of cofactors, where each element is replaced by its cofactor (see 3.4). 3. Transpose C to get C T (see 3.1). C T is called the adjoint of A, written adja. 4. The inverse is found as follows: (see 3.2.2, multiplying by a number) If you have time: 5. Check that AA 1 = I (see 3.1 and 3.2.3). A 1 = adja A Note that if A = 0 the matrix has no inverse (we will use this in section 3.6.2) I will illustrate the above procedure with the 2 2 matrix from the previous subsection. ( ) 2 4 A = 1 2 Step 1: A = 2 ( 2) ( 1) ( 4) = 8 Step 2: The minor of a 11 is 2, its cofactor c 11 is thus 2. The minor of a 12 is 1, its cofactor c 12 is thus +1. The minor of a 21 is 4, its cofactor c 21 is thus +4. The minor of a 22 is +2, its cofactor c 12 is thus +2. Therefore: Step 3: Step 4: A 1 = adja A C = adja = C T = ( ) 2 1 4 2 ( ) 2 4 1 2 = 1 ( ) ( ) 2 4 1/4 1/2 = 8 1 2 1/8 1/4 13

Step 5: You should check this yourself. 3.6 Some uses of Matrices 3.6.1 Solving Equations Problems involving systems of equations can often be solved as one equation in matrix form. I will illustrate this with a system of 3 simultaneous equations: 2x + 5y 3z = 5 x 4y + z = 5 4x + 3y z = 10 This can be expressed in matrix form: Therefore: Ab = d 2 5 3 x 5 1 4 1 y = 5 4 3 1 z 10 2 5 3 Let A = 1 4 1 4 3 1 x 5 b = y d = 5 z A 1 Ab = A 1 d (NB in matrix algebra you must multiply both sides in the same sequence, unlike real and complex numbers) Ib = A 1 d (using A 1 A = I) b = A 1 d (using Ib = b) The right hand side will be a column matrix whose components are the solutions x, y, z. 10 3.6.2 Eigenvalues and Eigenvectors The following type of equation occurs very often in Science and Engineering problems: Ax = λx where A is a square matrix, x is a column matrix (x 1 x 2 x 3...) T, known as an eigenvector (see 3.1), λ is a number, known as an eigenvalue. We want to find λ and x. The method is as follows: Ax = λx Ax λx = 0 (null matrix, see 3.1) Ax λix = 0 (where I has the same order as A) 14

(A λi)x = 0 If matrix (A λi) has an inverse (A λi) 1, then: (A λi) 1 (A λi)x = (A λi) 1 0 Ix = 0 x = 0 This would mean x 1 = x 2 = x 3 =... = 0. This is not a useful answer. However if the determinant A λi = 0, then (A λi) 1 does not exist, as the inverse involves the reciprocal of the determinant, and 1/0 is undefined (see 3.5). Therefore: Step 1: we solve: A λi = 0 to get eigenvalues λ, and then: Step 2: use these in the original equation to get corresponding eigenvectors x. Example: Step 1: A λi = 0 Therefore: ( 1 λ)(4 λ) 3 2 = 0 λ 2 3λ 10 = 0 This gives 2 eigenvalues: λ = 5, λ = 2 Step 2: Substitute into Ax = λx Ax = λx ( ) 1 3 where A = and x = 2 4 ( ) x1 ( ) ( ) 1 3 1 0 A λi = λ 2 4 0 1 ( ) ( ) 1 3 λ 0 = 2 4 0 λ = 1 λ 3 2 4 λ (i) λ = 5: ( ) ( ) 1 3 x1 = 5 2 4 x 2 ( ) x1 x 1 + 3x 2 = 5x 1 and 2x 1 + 4x 2 = 5x 2. These both mean that x 2 = 2x 1. Any x where x 2 = 2x 1 will satisfy the equation, so for λ = 5: ( ) 1 x = α 2 where α = any number. (ii) λ = 2: ( ) ( ) 1 3 x1 = 2 2 4 x 2 x 2 ( ) x1 x 2 x 2 15

x 1 + 3x 2 = 2x 1 and 2x 1 + 4x 2 = 2x 2. These both mean that 3x 2 = x 1. Any x where 3x 2 = x 1 will satisfy the equation, so for λ = 2: ( ) 3 x = β 1 where β = any number. 16

4 Second Order Ordinary Differential Equations (ODEs) 4.1 Introduction An ODE links a function, e.g. y(x) to x and one or more derivatives. To solve, one finds an algebraic relationship between y and x. The order of an ODE is the highest derivative occurring. The degree of an ODE is the power to which the highest derivative is raised, once fractional powers (e.g. dy/dx) are removed. An ODE is linear if y and its derivatives are linear, e.g.: P d2 y dx 2 + Q dy dx + Ry = S where P, Q, R and S are functions of x or constants. 4.2 2nd Order Linear ODEs Simple example: motion due to constant acceleration: d 2 y dt 2 = a or ÿ = a where a is acceleration, t is time and y is position. This can simply be integrated twice to give: y = 1 2 at2 + ut + y(0) where u is initial velocity, y(0) is initial position. Note that for a second order equation there are two constants of integration. To determine these you will need two pieces of information; e.g. initial position and velocity (initial conditions) or: position at two points (boundary conditions). Boundary conditions are not always enough to give a unique solution. Unlike constant acceleration, most 2nd order ODEs cannot be solved by integrating twice. Here is the general form for a linear 2nd order ODE: If f(x) = 0 the equation is homogeneous p(x) d2 y dy + q(x) + r(x)y = f(x) dx2 dx If f(x) 0 the equation is inhomogeneous or non-homogeneous If p(x), q(x) and r(x) are all constants, the equation is constant coefficient We will deal only with constant coefficient equations. N.B. q(x) and/or r(x) can be zero, but p(x) 0 otherwise the equation would not be 2nd order! 17

4.3 Homogeneous 2nd Order ODEs with Constant Coefficients 4.3.1 Introduction a d2 y dx 2 + b dy dx + cy = 0 The method of solution is as follows: (i) Form an auxiliary equation aλ 2 + bλ + c = 0 (ii) Solve to get two roots: λ 1 and λ 2 (iii) (1) If λ 1 = λ 2 and both are real: y = Ae λ 1x + Be λ 2x (2) If λ 1 = λ 2 = λ: y = (Ax + B)e λx (3) If λ 1 and λ 2 are a complex conjugate pair α ± iβ (see 1.2): y = e αx (A cos βx + B sin βx) (iv) If known, substitute initial conditions (or boundary conditions) to find A and B. 4.3.2 Derivation Given: where a 0, a, b and c are constants; Use the differential operator a d2 y dx 2 + b dy dx + cy = 0 D = d dx such that Dy = dy/dx, D 2 y = d 2 y/dx 2. This means: ad 2 y + bdy + cy = 0 It turns out that this is still valid when factorised (prove this for yourself in tutorial question 5 on sheet 1 for this block): where: λ 1 = b + b 2 4ac 2a (D λ 1 )(D λ 2 )y = 0 and λ 2 = b b 2 4ac 2a (Obviously it doesn t really matter how the roots are labelled. All that happens if you swap them round is that the answer comes out written in a different order). There are 3 cases: 18

(1) λ 1 = λ 2 and b 2 > 4ac (two real roots) (2) λ 1 = λ 2 i.e. b 2 = 4ac (two identical roots) (3) λ 1 = λ 2 and b 2 < 4ac (two complex conjugate roots) (1) 2 real roots: (D λ 1 )(D λ 2 )y = 0 Either (D λ 1 )y = 0 or (D λ 2 )y = 0 (D λ 1 )y = Dy λ 1 y = dy/dx λ 1 y = 0, or: (D λ 2 )y = Dy λ 2 y = dy/dx λ 2 y = 0 These are 1st order ODEs with separable variables (revision 1Q1): dy/dx = λ 1 y or dy/dx = λ 2 y, giving: y = Ae λ 1x or y = Be λ 2x where A and B are constants. Any linear combination of solutions to an homogeneous equation is also a solution, giving the following general solution (the solution with constants A and B not known): y = Ae λ 1x + Be λ 2x If suitable initial or boundary conditions are known, the constants can be determined. An example of a real system showing the above behaviour is an overdamped oscillator. (2) 2 identical roots λ 1 = λ 2 = λ: as in (1). However, we need 2 constants. Let u = (D λ)y (D λ)(d λ)y = 0 (D λ)y = 0 gives y = Be λx (D λ)(d λ)y = (D λ)u = du/dx λu = 0 giving: u = (D λ)y = dy λy = Aeλx dx This first order ODE can be solved using an integrating factor (revision 1Q1). Adding the two solutions gives the following general solution: y = Axe λx + Be λx = (Ax + B)e λx An example of a real system showing the above behaviour is a critically damped oscillator. (3) Complex conjugate roots λ 1 = α + iβ λ 2 = α iβ Solve as (1) but with complex constants Z 1 and Z 2 : y = Z 1 e (α+iβ)x + Z 2 e (α iβ)x = e αx [ Z 1 e iβx + Z 2 e iβx] 19

Converting to polar form (see sect. 1.9) gives: y = e αx [Z 1 (cos βx + i sin βx) + Z 2 (cos βx i sin βx)] = e αx [(Z 1 + Z 2 ) cos βx + i(z 1 Z 2 ) sin βx] The solution y must be real, so (Z 1 + Z 2 ) is real = A i(z 1 Z 2 ) is real = B (the i must cancel out in each case, as we are looking only for real solutions). The general solution therefore becomes: y = e αx [A cos βx + B sin βx] An example of this behaviour is an underdamped oscillator. Here examples of each case are given: (1) d 2 y dx 2 + dy dx 2y = 0 λ 2 + λ 2 = 0 λ = 1, or λ = 2 y = Ae x + Be 2x (2) d 2 y dx 2 2 dy dx + y = 0 λ 2 2λ + 1 = 0 λ 1 = λ 2 = 1 y = (Ax + B)e x (3) d 2 y dx 2 + 2 dy dx + 2y = 0 λ 2 + 2λ + 2 = 0 λ = 1 ± i y = e x (A cos x + B sin x) Also, in cases where b = 0, the answer can be expressed as hyperbolic functions, for example: (4) d 2 y dt 2 4y = 0 λ 2 4 = 0 20

λ = ±2 y = Ae 2t + Be 2t Using the fact that cosh x + sinh x = e x and cosh x sinh x = e x we can express our answer: y = A(cosh 2t + sinh 2t) + B(cosh 2t sinh 2t) = (A + B) cosh 2t + (A B) sinh 2t y = C cosh 2t + D sinh 2t where C and D are constants. 4.3.3 Finding Constants of Integration Examples: (1) y = Ae x + Be 2x (general solution) and y(0) = 0 dy dx = Aex 2Be 2x Therefore: y(0) = Ae 0 + Be 0 = A + B = 0 dy dx (0) = Ae0 2Be 0 = 1 A = 1/3, B = 1/3, giving: for these initial conditions. dy dx (0) = 1 y = 1 3 ex 1 3 e 2x (initial conditions) (2) y = e x (A cos x + B sin x) (general solution) and y(0) = 1 dy dx (0) = 0 dy dx = e x (A cos x + B sin x) + e x ( A sin x + B cos x) Therefore: y(0) = e 0 (A cos 0 + B sin 0) = A = 1 (initial conditions) dy dx (0) = e 0 (A cos 0 + B sin 0) + e 0 ( A sin 0 + B cos 0) Using A = 1 obtained already, we get 1 + B = 0, so B = 1 giving: y = e x (cos x + sin x) for these initial conditions. Thus, the procedure for using initial conditions to find constants is as follows: (i) Differentiate the general solution (ii) Put x = 0 into the general solution and its derivative (iii) Equate these with the known values at x = 0 to find the constants (iv) Replace the constants in the general solution 21

4.4 Inhomogeneous ODEs with Constant Coefficients These have the following form: where a, b and c are constants. a d2 y dx 2 + b dy + cy = f(x) dx 4.4.1 Method (1) Find the general solution u c to the corresponding homogeneous equation: u c is the complementary function a d2 u c dx 2 + bdu c dx + cu c = 0 (2) Find any solution u p to the inhomogeneous equation (see 4.4.2): a d2 u p dx 2 + bdu p dx + cu p = f(x) u p is the particular integral or particular solution (3) Add u c and u p : y = u c + u p y is the general solution of the inhomogeneous equation we started with. (4) Now (and only now!) substitute initial conditions or boundary conditions if known. 4.4.2 Finding u p (i) Write a function of the same form as f(x) but with unknown constants, for example: If f(x) = a constant, try u p = m If f(x) = x 2 + 1 try u p = mx 2 + nx + k If f(x) = polynomial of order n try u p = polynomial of order n If f(x) = ge hx try u p = me hx If f(x) = g cos ωx + h sin ωx try u p = m cos ωx + n sin ωx (NB: g or h may be zero, m, n, k and h are constants) (ii) Check that the trial u p is not a possible solution to the corresponding homogeneous equation. If it is multiply by x and repeat stage (ii). (iii) Find the first and second derivatives of u p and substitute these and u p into the original equation to find constants m, n and k as applicable. 4.4.3 Examples I. d2 y dx + 2 dy dy 2 dx + 2y = sin 2x where y(0) = 0 and dx (0) = 1 (1) Find u c : 22

λ 2 + 2λ + 2 = 0, λ = 1 ± i u c = e x (A cos x + B sin x) (2) Find u p : (i) Try u p = m cos 2x + n sin 2x (ii) This is not a possible solution to the homogeneous equation so we can proceed. (iii) dup d 2 u p dx 2 dx = 2m sin 2x + 2n cos 2x = 4m cos 2x 4n sin 2x Now substitute u p and its derivatives into the original ODE: ( 4m cos 2x 4n sin 2x) + 2( 2m sin 2x + 2n cos 2x) + 2(m cos 2x + n sin 2x) = sin 2x (4n 2m) cos 2x + ( 2n 4m) sin 2x = sin 2x 4n 2m = 0, 2n 4m = 1 This gives m = 1/5, n = 1/10 so: (3) The general solution is: u p = 1 5 1 cos 2x sin 2x 10 y = u c + u p = e x (A cos x + B sin x) 1 5 cos 2x 1 sin 2x 10 (4) As we are given initial conditions, we can now find A and B. dy dx = e x [(B A) cos x (A + B) sin x)] + 2 5 sin 2x 1 5 cos 2x A 1/5 = 0, A = 1/5 y(0) = e 0 (A cos 0 + B sin 0) 1 5 cos 0 1 10 sin 0 = 0 dy dx (0) = e 0 [(B A) cos 0 (A + B) sin 0)] + 2 5 sin 0 1 5 cos 0 = 1 B A 1/5 = 1, B 1/5 1/5 = 1, B = 7/5, giving the final answer: for the initial conditions given. e x ( 1 5 cos x + 7 5 sin x) 1 5 II. 1 cos 2x sin 2x 10 d 2 y dx 2 + 3 dy + 2y = e x dx (general solution) (1) Find u c : λ 2 + 3λ + 2 = 0, λ = 2, or λ = 1 (2) Find u p : (i) Try u p = me x u c = Ae 2x + Be x (ii) This is a possible solution to the homogeneous equation (with A = 0 and B = m) and will not work. Try u p = mxe x. This is suitable. (iii) du p dx = e x (m mx) d2 u p = e dx x (mx 2m) 2 e x (mx 2m) + 3e x (m mx) + 2e x mx = e x 23

e x [mx 2m + 3m 3mx + 2mx] = e x mx 2m + 3m 3mx + 2mx = 1, giving m = 1, so: u p = xe x (3) The general solution is: y = u c + u p = Ae 2x + Be x + xe x 24

5 Series and Limits 5.1 Introduction A series is a sum of terms in a particular order. It may be written using summation notation: n u 1 + u 2 + u 3 +... + u n = u r r=1 If n is finite the series has a fixed sum. If n is infinity ( ) the series may in some cases still have a fixed sum. If an infinite series has a fixed sum it is convergent (it converges), if not it is divergent (it diverges). For example: 1 + 2 + 3 +... = r r=1 diverges 1 + 1 2 + 1 4 + 1 8... = r=0 1 2 r converges to 2 Adding or removing a finite number of terms to the beginning of an infinite series, or multiplying all terms by a finite number, does not affect whether it converges or diverges, though it will, of course, change the sum of a convergent series. 5.2 Some types of series (1) Arithmetic progression: u r+1 = u r + d where d is the common difference. Arithmetic progressions always diverge. (2) Geometric progression: u r+1 = ku r where k is the common ratio. Geometric progressions converge if 1 < k < 1, otherwise they diverge. (3) Power series: c 0 + c 1 x + c 2 x 2 + c 3 x 3... = c r x r r=0 where c r is the r th coefficient. These sometimes converge for all x, sometimes only for a limited range of x, it depends on the coefficients. 25

5.3 Tests for convergence Below are a few tests for convergence. Others exist but are not covered in this course. 5.3.1 Terms must tend towards zero if lim r u r = 0 the series is divergent But if lim r u r = 0 the series could still diverge (other tests are needed) An important example of a series whose terms tend to zero but which still diverges, is the harmonic series : 5.3.2 Ratio test 1 + 1 2 + 1 3 + 1 4 + 1 5 +... = Perform this test on series with positive terms. This is often the best test to apply first. For example in power series, where convergence or divergence may depend on x, by applying this test you may find that convergence or divergence over most values of x can be determined, perhaps leaving some particular values of x where other tests are needed. r=0 1 r if u r+1 lim < 1 the series is convergent r u r For example: if if u r+1 lim > 1 the series is divergent r u r u r+1 lim = 1 you need other tests r u r 2/3 + 5/9 + 8/27 + 11/81 +... = u r+1 u r = (3r + 2) 3 r+1 3 r (3r 1) = 1 3 r=1 ( 3r + 2 3r 1 3r 1 3 r As r (3r + 2)/(3r 1) 1, so u r+1 /u r 1/3. This is less than 1, so the series is convergent. ) 5.3.3 Comparison test This test is for positive terms. If each term is less than the corresponding term of another series you know converges, the series will converge. Similarly, if each term is greater than that of a series which you know diverges, the series will diverge. Often you compare with the following series: r=1 1 r p = 1 1 p + 1 2 p + 1 3 p +... 26

which converges if p > 1 and diverges if p 1. For example: 1/6 + 1/24 + 1/60 +... = 1/(1 2 3) + 1/(2 3 4) + 1/(3 4 5) +... We note that: = r=1 1 r(r + 1)(r + 2) 1 r(r + 1)(r + 2) < 1 r 3. We know 1 r 3 converges, so our new series converges too. 5.3.4 Alternating series If the terms have alternate + + + signs, the series converges if the terms decrease in magnitude and tend to zero. 5.3.5 Absolute convergence For series including negative and positive terms, form a new series u r. If u r converges then u r also converges, and is known as absolutely convergent. If u r diverges, u r may possibly converge ( conditional convergence ) or may possibly diverge, for example, the harmonic series 1 + 1/2 + 1/3 + 1/4 +... diverges, but the series 1 1/2 + 1/3 1/4 +... is conditionally convergent. When you use the ratio test on the series u r, the following results apply: if if u r+1 lim < 1 the series u r is convergent r u r u r+1 lim > 1 the series u r is divergent r u r if u r+1 lim = 1 you need other tests r u r 5.4 Taylor series 5.4.1 What are Taylor Series? Taylor series express a function e.g. f(x) as a power series: f(x) = A + Bx + Cx 2 + Dx 3 +... = c r x r r=0 where A, B, C, D are coefficients c r. As stated in the introduction, these series sometimes converge (and are therefore valid) for all x, sometimes for a limited range of x. 27

If, for the range of values of x we are interested in for a particular application, the terms in the power series quickly tend toward zero, the first few terms may often be used as an approximation. To find the power series for a given function f(x), take a power series g(x) with unknown coefficients. We want to find coefficients A, B, C, D... etc. such that g(x) = f(x), at least for some range of x. If this is the case, then at some value of x in that range, say x = a, the following must be true: g(a) = f(a), dg df dx (a) = dx (a), d2 g (a) = d2 f (a), d3 g (a) = d3 f (a) and so on. When using a finite dx 2 dx 2 dx 3 dx 3 number of terms as an approximation you choose point a to be in the range of x you are investigating. 5.4.2 MacLaurin series I will show how to find coefficients for a MacLaurin series. This is a special case of a Taylor series with the function and derivatives determined at x = a = 0. First, take a power series g(x) and its derivatives: g(x) = A + Bx + Cx 2 + Dx 3 +... + γx r +... dg dx (x) = B + 2Cx + 3Dx2 +... + rγx r 1 +... d 2 g dx 2 (x) = 2C + 3 2Dx +... + r(r 1)γxr 2 +... d 3 g dx 3 (x) = 3 2D +... + r(r 1)(r 2)γxr 3 +... and so on. Therefore, equating g(x) and its derivatives to f(x) and its derivatives at x = a = 0, we find the coefficients: g(0) = A so A = f(0) dg df (0) = B so B = dx dx (0) d 2 g dx 2 (0) = 2C so C = 1 d 2 f 2 dx 2 (0) d 3 g dx 2 (0) = 3 2D so D = 1 d 3 f (3 2) dx 3 (0) For general r th derivative, define d r f/dx r as f (r), d r g/dx r as g (r) : g (r) (0) = [r(r 1)(r 2)(r 3)...]γ = r!γ so γ = f (r) (0) r! We can now put the coefficients into the power series and equate with f(x): f(x) = f(0) + xf (0) + x2 f (0) 2! 28 + x3f (0) +... 3!

This can be written in summation form: f(x) = r=0 x r f (r) (0) r! where f (0) = f, and we use the fact that, by definition, 0! = 1. 5.4.3 General Taylor series For a = 0 we get the following: or: f(x) = f(a) + (x a)f (a) + (x a)2 f (a) + 2! (x a) 3 f (a) 3! f(x) = r=0 +... (x a) r f (r) (a) r! One would use this if investigating a region x a or if f(x) is not defined at x = 0. 5.4.4 Examples of Taylor series (1) Find the MacLaurin series for y = sin x y (x) = cos x, y (x) = sin x, y (x) = cos x, y iv (x) = sin x, y v (x) = cos x... etc. Evaluating y and its derivatives at x = 0 we get: y(0) = 0, y (0) = 1, y (0) = 0, y (0) = 1, y iv (0) = 0, y v (0) = 1... etc. This gives: sin x = 0 + x (+1) + x2 (0) 2! + x5 (+1) 5! Simplifying, and including only non-zero terms: + x6 (0) 6! + x3 ( 1) 3! +... sin x = x x3 3! + x5 5! x7 7! +... = (2) Find the Taylor series for f(x) = ln x about x = 1 (i.e. a = 1) r=0 + x4 (0) 4! ( 1) r x 2r+1 (2r + 1)! f (x) = 1/x, f (x) = 1/x 2, f (x) = 2/x 3, f iv (x) = (3 2)/x 4... etc. f(1) = 0, f (1) = 1 = 0!, f (1) = 1 = (1!), f (1) = 2 = 2!, f iv (1) = (3 2) = (3!)... etc. ln x = 0 + (x 1) (x 1)2 2! + 2!(x 1)3 3! 3!(x 1)4 4!(x 1)5 +... 4! 5! 29

Simplifying: (x 1)2 (x 1)3 ln x = (x 1) + 2 3 (x 1)4 (x 1)5 ( 1) r+1 (x 1) r +... = 4 5 r Let s test this for convergence. Clearly, for some x the series has a mixture of positive and negative terms, so we test for absolute convergence (see 5.3.5). Taking a typical r th term u r The most likely test to try first is the ratio test (5.3.2). First form a new series where each term is replaced by its modulus, making it a series with positive terms: r=1 u r = (x 1) r r Now take the ratio of an arbitrary term number r + 1 and its preceding term: u r+1 u r = (x 1) r+1 r + 1 r (x 1) r = (x 1) r r + 1 As r, r/(r + 1) 1, so the limit as r of u r+1 / u r is x 1. From the ratio test we now know that the series is convergent if x 1 < 1, i.e. 1 < x 1 < +1, i.e. 0 < x < 2. We also know that the series is divergent if x 1 > 1, i.e. 1 > x 1 > +1, i.e. x > 2 or x < 0. We still have two values of x to consider: If x = 0: The series with x = 0 is thus u r = ( 1)r+1 ( 1) r r = ( 1)2r+1 r 1 1/2 1/3 1/4... = This is the harmonic series multiplied by 1 (see 5.3.1). divergent, so multiplying it by 1 will not change this (see the introduction). If x = 2: The series with x = 2 is thus u r = ( 1)r+1 (1) r r 1 1/2 + 1/3 1/4 +... r=1 1 r We that the harmonic series is This is an alternating series whose terms tend to zero, and is thus (conditionally) convergent. Now we can say that the Taylor series for ln x about x = 1 is convergent over the range 0 < x 2 and divergent for all other x. 30

5.4.5 Taylor approximations If you use a finite number of terms you get a polynomial approximation to the original function. The approximation is more accurate (i) the higher the order of the approximation (the more terms used - though also more complicated) (ii) the closer x is to a (where a = 0 for MacLaurin series). 5.5 L Hospital s Rule Given two functions f(x) and g(x) where for some value a, f(a) and g(a) are both zero: f(a) g(a) is undefined However: f(x) lim x a g(x) Take Taylor series about a for both functions: may exist f(x) g(x) We know that f(a) = g(a) = 0, so f(a) + (x a)f (a) + (x a)2 f (a) 2! +... = g(a) + (x a)g (a) + (x a)2 g (a) 2! +... f(x) g(x) Divide top and bottom by x a: (x a)f (a) + (x a)2 f (a) 2! +... = (x a)g (a) + (x a)2 g (a) 2! +... f(x) g(x) = f (a) + (x a)f (a) 2! +... g (a) + (x a)g (a) 2! +... As x a, terms with x a tend to zero, so, if g (a) 0: f(x) lim x a g(x) = f (a) g (a) If f (x) = g (x) = 0 we simply apply the rule again, and find f (a) g (a) 5.6 Taylor series from differential equations and so on. Even if you don t know a function one may be able to find its Taylor series. For example, given a differential equation and initial conditions (at x = 0 or t = 0 etc.), a MacLaurin series can be found. This is easiest to show using examples: (1) Find the MacLaurin series for y(t) obeying dy dt = y 31

given intial condition y(0) = 1. The actual answer (separation of variables) is y = e t, so we should in this example get a power series for e t. Differentiate the equation repeatedly and find the values of successive derivatives at t = 0 using the initial given value of y: dy dt d 2 y dt 2 = dy dt dy = y so (0) = y(0) = 1 dt so d2 y dy (0) = dt2 dt (0) = 1 d 3 y dt 3 = d2 y dt 2 so d3 y dt 3 (0) = d2 y dt 2 (0) = 1 and so on. The expression for the MacLaurin series for y (see 5.4.2) is: y = y(0) + t dy t2 (0) + dt 2! d 2 y t3 (0) + dt2 3! d 3 y (0) +... dt3 Using values at t = 0: As expected! y = 1 + t + t2 2! + t3 3! +... (2) Find the MacLaurin series for y(x) such that: y y + y 2 = 0 where y(0) = 1 and y (0) = 1. We know the initial values of the function and its first derivative, so we ll rearrange to get unknowns on the right, then differentiate successively and use previous information to find the initial value of each derivative: y = y y 2 so y (0) = 1 ( 1) 2 = 2 y = y 2yy so y (0) = 2 2 1 1 = 0 so y iv (0) = 0 2(( 1) 2 + 1 2) = 2 y iv = y 2y y 2yy = y 2((y ) 2 + yy ) y v = y iv 2(2y y + y y + y y ) = y iv 2(3y y + yy ) so y v (0) = 2 2(3 ( 1) 2 + 1 0) = 10 etc. y = y(0) + xy (0) + x2 2! y (0) + t3 y (0) +... 3! In practice, as long as x is small (much smaller than 1), a few terms will give a good approximation. Putting in the initial values of y and its derivatives which we calculated gives: y 1 x 2x2 2! + 2x4 4! 10x5 5! 32

(NB as this is an approximation the series is no longer infinite). Simplifying we get: y 1 x x 2 + x4 12 x5 12 33

6 Partial Differentiation 6.1 Introduction A function of 1 variable e.g. f(x) = x 2 can be represented as a line of distance f above the x axis. A function of 2 variables e.g. f(x, y) = x 2 + y 2 can be represented as a surface of distance f above the x, y plane. Functions of more than 2 variables exist, but cannot so easily be visualised. For example, the temperature on a flat metal plate can be represented as function T (x, y) where x, y coordinates are used to define a position on the plate. However, if you were studying the cooling or heating of the plate, you would need T (x, y, t) where t is time. Back to 2 variables, represented by a surface. If you cut a cross-section through the surface at fixed x or fixed y, you get a line, a function of 1 variable (the one not fixed). This can be differentiated in the normal way. When a function of more than 1 variable is differentiated with respect to only one variable, the others being treated as constants, the resulting expression is known as a partial derivative. The notation uses a different d from that used for functions of 1 variable (ordinary derivative). Take a function of 1 variable f(x) = x 2 : ordinary derivative d f(x) = 2x dx Take a function of 2 variables g(x, y) = 2xy 2 : It has 2 partial derivatives: g(x, y) = 2y2 x g(x, y) = 4xy y A short notation is often used: g/ x = g x etc. 6.2 Higher Derivatives There are more possible derivatives for more variables and for higher derivatives. For example, given g(x, y) = 2xy 2 : g x = g x = 2y 2 2 g y 2 = y 2 g x 2 = x 2 g x y = x 2 g y x = y g y = g y = 4xy ( ) g = g yy = 4x y ( ) g = g xx = 0 x ( ) g = g xy = 4y y ( ) g = g yx = 4y x 34

If any function f(x, y) is continuous where you take the derivatives, it turns out that: as in the example above. f xy = f yx 6.3 Total Differential Take g(x, y) = 2xy 2. Changes δx and δy will produce change δg. If these changes are small enough, δg can be approximated in two steps: (i) Keep y constant and change x. This produces an approximate change: δg 1 g x δx = 2y2 δx (ii) Then keep x constant and change y. This produces a further approximate change: δg 2 g δy = 4xyδy y The approximate combined effect δg of both these changes is simply their sum: This is known as a total differential. δg(x, y) g x δx + g y δy For more than 2 variables, just add extra terms, e.g.: δj(x, y, z) j x δx + j y δy + j z δz 6.4 Errors e.g. Perfect gas law: pv = RT (where R is constant, p is pressure, v is volume per mole, T is temperature in Kelvin) p(v, T ) = RT v The estimated value of p may differ from the true value due to errors (uncertainties) δt and δv in measured values of T and v respectively. P/ T = R/v, p/ v = RT/v 2 Error in p due to δt = ±( p/ T )δt = ±(R/v)δT. Error in p due to δv = ±( P/ v)δv = ±( RT/v 2 )δv. The maximum error in p is when the two errors have the same sign: p = RT ( ) R v ± RT δt + v v 2 δv 6.5 Function of a Function (chain rules) 6.5.1 Given f(u) where u = u(x, y) f x = df u du x f y = df u du y 35

6.5.2 Total Derivative The total derivative is not a partial derivative, but is derived using partial derivatives. It occurs when the variables are expressible each as functions of a single variable. Example: A box has sides x, y, z changing in length over time t. Find the rate of change in volume. Let the volume be f(x, y, z) = xyz. x, y and z are all changing as functions of time t: x = x(t) y = y(t) z = z(t) In a short time interval δt, x changes by δx, y changes by δy and z changes by δz, resulting in a change in volume f of δf. From the total differential (see section 6.3): δf f x δx + f y δy + f z δz δx dx dt δt dy δy dt δt dz δz dt δt Therefore: δf ( ) dx f x dt + f dy y dt + f dz z δt dt δf δt f dx x dt + f dy y dt + f dz z dt In the limit as δt 0 we obtain the rate of change of f with time: df dt = f dx x dt + f dy y dt + f dz z dt In this example f x = yz, f y = xz and f z = xy. dx/dt, dy/dt and dz/dt are either given as functions of t or simply as values (e.g. x is decreasing at 0.2 metres per second means dx/dt = 0.2 if units are metres.) In general, given f(x, y, z,...) where the variables x, y, z,... are each functions of another variable t, then the total derivative is given by: df dt = f dx x dt + f dy y dt + f dz z dt +... 6.5.3 Total Derivative - where variables are related I will cover cases of a function f(x, y) with 2 variables: (1) If y is a known function of x (i.e. y = y(x)). In this case we can adapt the expression for total derivative from section 6.5.2, by defining t = x. This means dx/dt = dx/dx = 1, dy/dt = dy/dx and df/dt = df/dx; giving the total derivative: df dx = f dy x + f y dx (2) If y and x are related in a known way, but you don t know y(x) (or it is difficult to determine). 36

If you arrange the relationship between the variables into the form g(x, y) = 0, it is possible to find dy/dx and use this in the equation in case (1) above. g(x, y) = 0 means that any change in x involves a change in y such that g remains zero. This means that the total derivative of g is dg/dx = 0. We now use the formula from case (1) above: 0 = g x + g y dy dx giving dy dx = g x g y Now we use the same formula to find the total derivative of f: 6.6 Exact Differential Equations Given a first order ODE of the form: df dx = f x f y g x g y (assuming g y 0) P (x, y) + Q(x, y) dy dx = 0 (1) It can often be solved quickly if there is a function f(x, y) such that If so: f x = P and f y = Q f x + f dy y dx = 0 (2) The LHS of (2) is a total derivative df/dx for the case where y is a function of x (see 6.5.3 case (1)). Therefore we know that: To solve we need to find f(x, y). df = 0 hence f(x, y) = const. dx if f x = P then 2 f y x = P y f if y = Q then 2 f x y = Q x As long as P and Q are continuous: (see section 6.2). Therefore: 2 f y x = 2 f x y if P y = Q x the equation is exact Here s how to check for and solve exact ODEs: Assume the equation is arranged in the following form: P (x, y) + Q(x, y) dy dx = 0 37

(i) Check if P/ y = Q/ x If so, the equation is exact and we know that P = f/ x and Q = f/ y where f = f(x, y) = const. (ii) If the equation is exact: Integrate P over x, temporarily treating y as constant. f = P dx + φ(y) (3) N.B. as y is treated as constant, the constant of integration in equation (3) may contain y, so we use function φ of y to allow for this. φ(y) will be found later. (iii) We know Q = f y from the derivation above. We also now have an expression for f (equation (3)), so we take its partial derivative with respect to y, and equate this with Q in the original ODE: Q = f y = ( y As we know Q and P dx, we can find dφ/dy ) P dx + dφ dy (iv) Integrate dφ/dy to find φ(y), then substitute into equation (3) to get f(x, y). (v) The solution is f(x, y) = const. Here s an example: Rearrange: xy 2 = x + (8y x 2 y) dy dx (x xy 2 ) + (8y x 2 y) dy dx = 0 (i) P = (x xy 2 ), P y = 2xy. Q = (8y x 2 y), Q x = 2xy = P y so the equation is exact. (ii) f = P dx + φ(y) = (x xy 2 )dx + φ(y) = (x 2 /2)(1 y 2 ) + φ. (iii) Q = 8y x 2 y = ( ) (x xy 2 )dx + dφ y dy = x2 y + dφ dy Therefore: 8y x 2 y = x 2 y + dφ/dy giving dφ/dy = 8y. (iv) φ(y) = 4y 2 + const., so (v) f(x, y) = const., so: (after grouping constants on RHS) f = (x 2 /2)(1 y 2 ) + 4y 2 + const. x 2 2 (1 y2 ) + 4y 2 = const. 38

6.6.1 Integrating Factors Often the equation you wish to solve is not exact as first derived. However, in many cases equations can be made exact by multiplying the whole equation by some function, known as an integrating factor. The integrating factor method you covered in 1Q1 is an example of this technique. 6.7 Coordinate Systems 6.7.1 Introduction Say a function is expressed in one coordinate system but you want derivatives with respect to a different system. Though you could perhaps substitute the new variables then take derivatives, it may be easier to do it differently. First I will describe some common coordinate systems in 2 and 3 dimensions and their relationship to Cartesian. (a) Cartesian: (x, y) (2 dimensions) or (x, y, z) (3 dimensions). You should be familiar with the convention for the direction of the 3 Cartesian axes. (b) Plane Polar: (r, θ) (2 dimensions) where x = r cos θ, y = r sin θ. (c) Cylindrical Polar: (r, θ, z) (3 dimensions) where x = r cos θ, y = r sin θ, z = z. (d) Spherical Polar: (r, θ, φ) (3 dimensions) where x = r sin θ cos φ, y = r sin θ sin φ, z = r cos θ. N.B. (1) Other labelling conventions exist (2) In the convention used here the r and θ in spherical polar coordinates are not the same as the r and θ in cylindrical polar coordinates! 6.7.2 Partial Derivatives with Change of Variable If you know the relationship between 2 sets of variables, you can express a function in terms of either system. It is best to use a different symbol for each function so that the variables do not have to be written in each time: e.g. function f(x, y) in Cartesian coordinates may be called F (r, θ) in plane polar. F would be written out by converting x and y as described above (6.7.1). If you do not wish to convert a function to new variables, but need to know its partial derivatives with respect to different variables, this is how it is done: (i) Given two different coordinate systems; x, y, z,... (not necessarily Cartesian) and α, β, γ,... where x, y, z,... are each functions of α, β, γ,...: Let f(x, y, z,...) = G(α, β, γ,...) where x = x(α, β, γ,...), y = y(α, β, γ,...) z = z(α, β, γ,...) etc... Then: G α = f x x α + f y y α + f z z α +... 39

G β = f x x β + f y y β + f z z β +... etc... Here s an example of change from Cartesian to Cylindrical Polar: x = r cos θ, y = r sin θ, z = z. Let G(r, θ, z) = f(x, y, z) = x 2 + 3xy + y 2 + z 2. G r = f x x r + f y y r + f z z r G θ = f x x θ + f y y θ + f z z θ G z = f x x z + f y y z + f z z z f x = 2x + 3y = 2r cos θ + 3r sin θ = r(2 cos θ + 3 sin θ) f y = 3x + 2y = r(3 cos θ + 2 sin θ) f z = 2z (unchanged in new coordinates) x r = cos θ, y r = sin θ, z r = 0 x θ = r sin θ, y θ = r cos θ, z θ = 0 x z = 0, y z = 0, z z = 1. Substituting these into the formulae above and simplifying we get: G r = 2r(1 + 3 sin θ cos θ) G θ = 3r 2 (cos 2 θ sin 2 θ) G z = 2z 40