Dfference Equatons c Jan Vrbk 1 Bascs Suppose a sequence of numbers, say a 0,a 1,a,a 3,... s defned by a certan general relatonshp between, say, three consecutve values of the sequence, e.g. a + +3a +1 5a =7 (1) true for each nonnegatve nteger. An equaton of ths type s called a dfference equaton, and our man am of ths artcle s to explan how to solve t (.e. fnd a formula for computng the ndvdual terms of the sequence). We wll deal only wth the smplest case of such equatons, namely those lnear n all the a s; furthermore, we allow the a s to have only constant coeffcents (such as our above example - note that the a -terms are usually collected on the left hand sde of the equaton). If the rght hand sde of the equaton s zero, t s called homogeneous, otherwse (as n our example) the equaton s non-homogeneous. We wll be able to solve a non-homogeneous equaton only when the rght hand sde s a polynomal n, further multpled by a constant rased to the power of, e.g. ( 4). Note that (1) s of ths type - the constant s smply equal to 1. Homogeneous case - Introducton Havng an equaton of the a + +5a +1 3a =0 () type, we attempt to solve t by assumng that the soluton has the followng form (hopng that our guess wll prove correct): a tral = λ where λ s a constant whose exact value remans to be establshed. Substtutng ths tral soluton nto () yelds λ + +5λ +1 3λ =0 1
or, equvalently (dvdng the prevous equaton by λ ), the followng so called characterstc equaton (ts LHS s the correspondng characterstc polynomal): λ +5λ 3=0 The last equaton has clearly only two roots, namely λ 1 = 1 and λ = 3. Ths mples that each a =( 1 ) and a =( 3) consttutes a dfferent soluton to () - we wll call them (stretchng the usual termnology a bt) basc solutons. One can show that the fully general soluton of () can be bult by takng a lnear combnaton of the two basc solutons, thus: a general = A ( 1 ) + B ( 3) where A and B are two arbtrary numbers. To fx the values of A and B and construct a specfc soluton to (), we need to be gven numercal values of exactly two members of the a -sequence. In the case of an equaton wth two basc solutons, there are two common possbltes:.1 Intal condtons s the name by whch we refer to the stuaton when the frst two members of the sequence (usually a 0 and a 1 ) are gven, e.g. a 0 = 1 and a 1 =. Ths clearly leads to two ordnary lnear equatons for A and B, namely (n the case of the prevous example): A + B = 1 A 3B = whch can be easly solved to yeld: A = 7 and B = 5 7. The specfc soluton whch meets not only () but also the two ntal condtons s then: a specfc = 7 µ 1 5 7 ( 3) basedonwhchwecaneaslyfnd the value of any a, e.g. a 10 = 7 1 10 5 7 ( 3)10 1 595 063 = 51. Note that n ths case (of gven ntal condtons), we can also fnd a 10 (or any other specfc a ) by the usual recursve procedure,.e. a = 5 a 1 + 3 a 0 = 13 a 3 = 5 a + 3 a 1 = 77 4.
(no formula necessary). As a second, more nterestng example, let us try to fnd a formula for the determnant of the followng tr-dagonal matrx: α β 0 0... 0 β α β 0... 0 0 β α β... 0 a det. 0 0 β α............ β 0 0 0... β α where s the number of rows (and columns). By expandng t along the frst row, one gets: a = α a 1 β a wth a 1 = α and a = α β. Clearly, a + α a +1 + β a =0 s an equvalent way of presentng the same set of equatons. The roots of the correspondng characterstc poynomal are λ 1 = α + p α 4β and λ = α p α 4β The general soluton to (??) sthus a = A λ 1 + B λ The ntal condtons mply A λ 1 + B λ = α A λ 1 + B λ = α β whch yelds A = λ 1 and B = λ λ 1 λ λ 1 λ The fnal, specfc solutonsthus a = λ+1 1 λ +1 λ 1 λ whch can be wrtten n a more explct form of a = 1 [/] X +1 j+1 α j (α 4β ) j (3) j=0 where [/] mples the nteger part of /. 3
. Boundary condtons We wll now return to solvng (), but ths tme the frst and the last value of the sequence are gven, e.g. a 0 = 97 3 and a 69 857 10 = 3. Smlarly to dealng wth ntal condtons, ths leads to two ordnary lnear equatons for A and B, namely A + B = 97 A 10 + B ( 3)10 = whch yeld A =3and B = 1 3. The correspondng specfc soluton then reads a specfc =3 µ 1 + 1 3 ( 3) = 3 69 857 3 µ 5 1 ( 3) 1 Note that n ths case the recursve procedure would not work, and the formula soluton s thus the only way to solve the problem. 3 Homogeneous case - Complcatons A natural extenson of our prevous examples s to relate more than three consecutve values of the a sequence, e.g. a +3 3a + a +1 +3a =0 (4) It s not to dffcult to fgure out that the correspondng characterstc equaton s λ 3 3λ λ +3=0 ths tme havng three roots, namely λ 1 =3,λ =1and λ 3 = 1. The general soluton to (4) s thus a = A 3 + B + C ( 1) To fnd a specfc soluton, three dstnct values of the a sequence must be gven; f these are a 0,a 1 and a, we can stll call t an ntal-value problem (and have the opton of solvng t recursvely), but there s no clear-cut verson of boundary condtons. In general, t s mportant to realze that there are several equvalent ways of presentng (4), such as a 3a 1 a +3a 3 =0 (the only dfference beng that now one would say: true for 3). 4
In ths context, one should watch out for skpped ndces, e.g. a 3a 1 +a 3 =0 (5) whose characterstc polynomal s λ 3 3λ + (no λ term!) wth roots of 1, 1+ 3 and 1 3. The general soluton to (5) s thus a = A + B (1 + 3) + C (1 3) (6) 3.1 Double and multple roots An obvous complcaton arses when two (or more) roots of the characterstc polynomal are equal to each other, e.g. a +3 4a + 3a +1 +18a =0 (7) whose characterstc polynomal has the followng roots:, 3 and 3. Clearly, ( ) and 3 are stll two basc solutons of ths dfference equaton, but where s the thrd? One can easly verfy that, n a case lke ths, multplyng 3 by creates yet another possble soluton to (7) - check t out! The fully general soluton s then constructed as a lnear combnaton of these: a = A ( ) + B 3 + C 3 (8) Convertng t to a specfc soluton for a gven set of ntal values, e.g. a 0 =, a 1 =0and a = 1 s done n the usual way: A + B = A +3B +3C = 0 4A +9B +18C = 1 The correspondng soluton s: A = 17 33 13 5,B= 5 and C = 15, whch leads to a spec. = 17 5 ( ) + 11 5 3+1 13 5 3 1 Smlarly, n a case of a trple root (say, equal to 3), we would construct the correspondng three basc solutons by frst takng ( 3), then multplyng ths by, and fnally multplyng t by. The general pattern should now be obvous. Thus, for example, f the characterstc polynomal has the followng set of roots:, 3, 3, 4, 4 and 4, the general soluton s: a = A + B 3 + C 3 + D ( 4) + E ( 4) + F ( 4) Note that some textbooks, nstead of multplyng a multple root by,, 3, etc. use the followng alternate selecton:, ( 1), ( 1)( ),... The latter approach has some conceptual and perhaps even computatonal advantages, but here we prefer usng the former. The two schemes are fully equvalent. 5
3. Complex roots Snce ths secton deals wth complex numbers, we need the symbol to denote the purely magnary unt. We wll thus have to swtch from the old a to usng a n. Later on, we wll return to our regular notaton. As we all know, roots of a polynomal can easly turn out to be complex (comng n complex-conjugate pars). Formally, our prevous soluton remans correct, for example: a n+ 4a n+1 +13a n =0 (9) has a characterstc polynomal wth roots of +3 and +3. We can stll wrte a n = A ( + 3) n + A ( 3) n where A and A are complex conjugates of each other (to yeld a real answer), but t s often more convenent to avod complex numbers and use, nstead of (+3) n and ( 3) n, ther real and purely magnary parts (qute legtmately, as we can always replace any two basc solutons by ther lnear combnatons). Ths s acheved more easly by convertng +3 to ts polar representaton, thus: +3 13 cos(arctan 3 )+sn(arctan 3 ) The real and purely magnary parts of ( + 3) n are then, respectvely: 13 n/ cos(n arctan 3 ) and 13 n/ sn(n arctan 3 ) The general soluton to (9) can then be wrtten (avodng complex numbers) thus: a n =13 n/ A sn(n arctan 3 )+B cos(n arctan 3 ) Luckly, many practcal stuatons usually manage to steer clear of the complex case. Double and multple complex roots are dealt wth n the standard manner (multplyng the usual basc soluton by powers of n). So s the constructon of a specfc soluton. 4 Non-homogeneous case We now consder dfference equatons wth a non-zero rght hand sde (.e. havng at least one term not multpled by an a ; such terms can appear on ether sde of the equaton, but we wll always transfer them to the RHS). In general, the RHS can be any expresson nvolvng and a handful of constant parameters, but we wll explctly treat only the case of the RHS havng the form of P () θ (10) 6
where P () s a polynomal n, and θ s a specfc number. One can show that a general soluton to a dfference equaton wth a RHS (10) can be bult as follows: Take the general soluton to the correspondng homogeneous equaton, and add to t a so called partcular soluton to the complete (non-homogeneous) equaton. Note that the partcular soluton wll have no arbtrary constants (the old A, B, C, etc.) - the frst part of the soluton takes care of these. To fnd a partcular soluton s, for our partcular RHS (10), rather easy (at least n prncple); all we need to know s that t wll have the followng form: Q() θ m (11) where Q() s a polynomal of the same degree as P (), but wth undetermned (meanng: yet-to-be-determned) coeffcents, and m s the multplcty of θ as a root of the (homogeneous) characterstc polynomal. Typcally, θ s not a root of the characterstc polynomal, whch means that m =0and the last factor of (11) dsappears. But then, f θ happens to be a smple root, m =1;f t s a double root, m =, etc. 4.1 Specal case of θ =1 In ths case, the RHS s smply a polynomal n. One has to realze that, mplctly, t s stll multpled by 1. Thus, to establsh the value of m, one has to check whether 1 s a root of the characterstc polynomal (and ts multplcty). As an example, let us solve Eq. 1. Its characterstc polynomal has the followng roots: 5 and 1. The RHS of (1) s a lnear polynomal, whch means that θ = 1, whose multplcty as a root of the characterstc polynomal s m =1. The form of the partcular soluton s then a part. =(q 0 + q 1 ) (1) Note that we need a complete lnear polynomal (.e. a polynomal wth both lnear and constant coeffcents), even though P () had only a lnear term. Also,weneedtorealzethatq 0 and q 1 (unlke A and B) arenot arbtrary numbers; to fnd the actual partcular soluton, we must frst substtute (1) nto (1) - ths can be done effcently by Maple - and then solve for the correct values of q 0 and q 1 by matchng the coeffcents of all powers of. Substtutng (1) nto the LHS of (1) yelds: 7q 0 +11q 1 +14q 1 To match ths to the RHS of (1), namely to 7, we need (matchng lnear terms): 14q 1 =7 whch mmedately yelds q 1 = 1, and (matchng absolute terms): 7q 0 +11q 1 =0 7
whch mples that q 0 = 11 14. The partcular soluton s thus a part. = 11 14 + whch leads to the followng fully general soluton of (1): a gen. = A ( 5 ) + B 11 14 + Note that only at ths pont we would be n a poston to deal wth ether ntal or boundary condtons (a common mstake s to omt the partcular soluton when fndng A and B). For example, gven that a 0 =3and a 1 =6, we get whch yelds A = 46 49 4. More examples A + B = 3 5 A + B 11 14 + 1 = 6 193 and B = 49, and the followng specfc soluton: a spec. = 46 49 ( 5 ) + 193 49 11 14 + In ths secton we concentrate on buldng partcular solutons only (extendng them to general soluton s qute trval). Another frequent specal case of (10) arses when the polynomal P () s just a constant (of zero degree), e.g. a +5 3a +4 4a +3 +13a + +84a +1 +36a =5 3 (13) To fnd the correct form of a partcular soluton, we only need to know the multplcty of θ =3as a root of the characterstc polynomal λ 5 3λ 4 4λ 3 +13λ +84λ +36 (14) Ths can be fgured out wthout solvng the correspondng equaton! Frst, we substtute 3 for λ n (14). Snce we get zero, 3 s clearly a root. To fnd ts multplcty, we repeatedly dfferentate (14) wth respect to λ, then make the same substtuton, tll we reach a non-zero value. The order of the frst non-zero dervatve yelds the multplcty of the root. In the case of our example, the frst dervatve stll evaluates to zero, but the second one s equal to 350. Ths mples that the correspondng multplcty m s equal to. The partcular soluton wll thus have the followng form: a = q 3 (15) 8
where the correct value of q s yet to be found. Substtutng (15) nto the LHS of (13), best done wth the help of Maple, yelds 3150q 3 To make ths equal to the RHS of (9), q = 5 The partcular soluton s then a part. = 630 3 3150 = 1 630. For our fnal example, we just replace the RHS of (13) by 3+ ( ) (16).e. a quadratc polynomal, multpled by θ, where θ = 1. Frst we need to know the multplcty of 1 as a root of (14) - the characterstc polynomal has not changed! The correspondng substtuton yelds 0 for the polynomal tself, and 441 8 for ts frst dervatve. The correspondng m s thus equal to 1. The partcular soluton wll have a form of q 0 + q 1 + q ( ) When substtuted nto the LFS of (13), ths yelds (the amount of algebra s formdable - Maple now becomes ndspensable): µ 441q0 1105q 1 + 73q 16 88q 1 + 315q 16 133q 16 1 ( ) We can make the last expresson equal to (16) by makng q = 16 q 1 = 315 88 16 133 = 40 961 and q 0 = 48+1105q 1 73q 441 = 8408 6487. The partcular soluton thus reads: a part. = (wehavecancelledoutthefactorof 8). 4.3 Superposton prncple 1051 6487 5 961 + 133 3 ( ) 3 133, Fnally, when the RHS of a non-homegeneous equaton s a sum of two or more terms of type (10), t s easy to show that the correspondng partcular soluton wll be the correspondng sum (superposton) of the(two or more)ndvdual partcular solutons, constructed separately for each term (gnorng the rest). Thus, replacng the RHS of our prevous example (yet one more tme) by 3+ 5 (17) 9
we fst have to realze that ths does not have the form of (10), but can be wrttenasassumof 3+ (18) and 5 (19) whch, ndvdually, we do know how to deal wth. The frst of these s just a quadratc polynomal (mplctly, θ =1), and we can also readly verfy that 1 s not a root of (14), mplyng that m =0. The frst partcular soluton wll thus have the form of q 0 + q 1 + q Ths, substtuted nto the LHS of (13), yelds: 108q + (108q 1 +7q ) + (108q 0 +36q 1 78q ) mplyng that q = 1 108,q 1 = 7 108 = 1 16 and q 0 = 3 36q 1+78q The correspondng partcular soluton s a part(1) = 71 1944 16 + 108 108 = 71 1944. Smlarly, to fnd a partcular soluton to match (19), we frst have to fnd the multplcty of θ =as a root of (14). Substtutng for λ agan results n a non-zero value, agan mplyng that m =0. The form of the second partcular soluton s thus smply q Ths, substtuted nto the LHS of (13), results n yeldng q = 1 16. Thus, a part() 80q = 4 The partcular soluton whch solves the whole equaton s thus a superposton (sum) of the two, namely: a part. = 71 1944 16 + 108 4 To buld the fully general soluton, we frst need to fnd all roots of (14). We already know that 3 s a double root and 1 a smple root; t s not dffcult to verfy that s also a double root - note that replacng n (17) by ( ) would have made the prevous example a lot more dffcult! 10
Ths mples that a general = A 3 +B 3 +C ( 1 ) +D ( ) +E ( ) + 71 1944 16 + 108 4 Only at ths pont one could start constructng a specfc soluton, based on fve gven values of a. Ths would lead to a lnear set of ordnary equatons for A, B, C, D and E (farly routne). Hopefully, no explct example s necessary. 11