5
MAT2007 ODEs (2008/9) ES1 Solutions to revision exercises, week 1 The M-file exercise revision.m gives some Matlab commands. 1. All ODEs in this question are separable. Note that dfield gives a nice overview of the shape of the solutions. (a) Note that dx dt = t can be rewritten as R dx = R t dt . Hence the solutions are x(t)= t 2 2 + C , see Figure 1(a). (b) The ODE dx dt = x can be rewritten as R dx x = R dt . This gives ln x = t + C , thus the solutions are x(t)= Ae t , see Figure 1(b). (c) The ODE dx dt = 3t 2 +1 2x can be rewritten as R 2x dx = R (3t 2 + 1) dt . This gives x 2 = t 3 + t + C , thus the solutions are x(t)= ± t 3 + t + C , see Figure 1(c). (d) The ODE sin t cos x = sin x cos t dx dt can be rewritten as R tan x dx = R tan t dt . This gives ln sec x = ln sec t + C , hence solutions are of the form sec x = A sec t or cos x = B cos t , see Figure 1(d). (a) Solutions of 1(a), note the similarity of the solutions (shift in x -direction). (b) Solutions of 1(b), note the similarity of the solutions (shift in t direction and reflection). (c) Solutions of 1(c), note the vertical derivative near x = 0 and the fact that the solutions can’t be continued here. (d) Solutions of 1(d), note the periodicity in both x and t . The solutions have vertical derivatives near x = , k Z and can’t be continued at those points. Figure 1: Exercise 1, solutions with dfield.

Solutions to revision exercises, week 1

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Solutions to revision exercises, week 1

MAT2007 ODEs (2008/9) ES1

Solutions to revision exercises, week 1

The M-file exercise revision.m gives some Matlab commands.

1. All ODEs in this question are separable. Note that dfield gives a nice overview of theshape of the solutions.

(a) Note that dxdt = t can be rewritten as

∫dx =

∫t dt . Hence the solutions are

x(t) = t2

2 + C , see Figure 1(a).

(b) The ODE dxdt = x can be rewritten as

∫dxx =

∫dt . This gives lnx = t + C , thus

the solutions are x(t) = Aet , see Figure 1(b).

(c) The ODE dxdt = 3t2+1

2x can be rewritten as∫

2x dx =∫

(3t2 + 1) dt . This givesx2 = t3 + t + C , thus the solutions are x(t) = ±√t3 + t + C , see Figure 1(c).

(d) The ODE sin t cosx = sin x cos t dxdt can be rewritten as

∫tanx dx =

∫tan t dt .

This gives ln secx = ln sec t + C , hence solutions are of the form secx = A sec t orcosx = B cos t , see Figure 1(d).

(a) Solutions of 1(a), note the similarity of the

solutions (shift in x -direction).

(b) Solutions of 1(b), note the similarity of the

solutions (shift in t direction and reflection).

(c) Solutions of 1(c), note the vertical derivative

near x = 0 and the fact that the solutions can’t

be continued here.

(d) Solutions of 1(d), note the periodicity in both

x and t . The solutions have vertical derivatives

near x = kπ , k ∈ Z and can’t be continued at

those points.

Figure 1: Exercise 1, solutions with dfield.

Page 2: Solutions to revision exercises, week 1

MAT2007 ODEs (2008/9) ES2

2. Again, both ODEs are separable. Checks with Matlab are in the M -file.

(a) The ODE (2t + 1) dxdt = x2 can be written as

∫dxx2 =

∫dt

2t+1 . This gives− 1

x = 12 ln(2t + 1) + C . Using the initial condition x(0) = 1, we get that C

satisfies −1 = 12 ln(1) + C , hence C = −1. Thus the solution of the IVP is

x(t) =(1− 1

2 ln(2t + 1))−1 = 2

2−ln(2t+1) .

(b) The ODE t2 dxdt = e2x can be rewritten as

∫e−2x dx = dt

t2. This gives −1

2 e−2x =−1

t + C . Using the initial condition x(1) = 0, we get that C satisfies −12 =

−1 + C , hence C = 12 . Thus the solution of the IVP is e−2x(t) = 2

t − 1 or x(t) =−1

2 ln(

2t − 1

).

3. These ODEs are of first order and linear and can be solved with the integrating factormethod. Again dfield gives nice pictures of the solutions.

(a) The ODE can be written as dxdt + p(t) x = q(t) with p(t) = 2

t and q(t) = 3t2

. Thusthe integrating factor is

IF = exp(∫

2tdt

)= exp

(ln t2

)= t2.

Multiplying the ODE with the integrating factor gives

d

dx

(t2 x

)= 3, hence t2 x =

∫3 dt = 3t + C, thus x(t) =

3t

+C

t2,

see Figure 2(a).

(b) The ODE can be written as dxdt + x = 2t e−t . Thus the integrating factor is

IF = exp(∫

dt

)= et.

Multiplying the ODE with the integrating factor gives

d

dx

(et x

)= 2t, hence et x =

∫2t dt = t2 + C, thus x(t) = (t2 + C) e−t,

see Figure 2(b)

(c) The integrating factor for the ODE dxdt + 2x = et is

IF = exp(∫

2 dt

)= e2t.

Multiplying the ODE with the integrating factor gives

d

dx

(e2t x

)= e3t, hence e2t x =

13

e3t + C, thus x(t) =13

et + Ce−2t,

see Figure 2(c)

Page 3: Solutions to revision exercises, week 1

MAT2007 ODEs (2008/9) ES3

(d) The integrating factor for the ODE dxdt − 2xt = t is

IF = exp(−2

∫t dt

)= e−t2 .

Multiplying the ODE with the integrating factor gives

d

dx

(e−t2 x

)= te−t2 , hence e−t2 x = −1

2e−t2 +C, thus x(t) = −1

2+Cet2 ,

see Figure 2(d)

(a) Solutions of 3(a). (b) Solutions of 3(b).

(c) Solutions of 3(c). (d) Solutions of 3(d).

Figure 2: Exercise 3, solutions with dfield.

4. All ODEs are linear, second order ones. To solve them we use the methods of LinearAlgebra, chapter 5. The plots are in figure 4, the Matlab code is in exercise revision.m .

(a) The auxiliary quadratic for the homogeneous ODE d2xdt2

+ dxdt − 30x = 0 is m2 +

m − 30 = 0, or (m − 5)(m + 6) = 0. Thus the general solution of this ODE isx(t) = A e5t + B e−6t , see Figure 3(a).

Page 4: Solutions to revision exercises, week 1

MAT2007 ODEs (2008/9) ES4

(b) The auxiliary quadratic for the inhomogeneous ODE 2 d2xdt2

+ 3 dxdt + x = e2t is

2m2 +3m+1 = 0 or (2m+1)(m+1) = 0. Thus the complementary function (CF)is xC(t) = Ae−t + B e−t/2 . For the particular integral (PI), we try xP (t) = C e2t .Substitution into the ODE gives (8C + 6C + C)e2t = e2t . Hence C = 1

15 and thegeneral solution for the ODE is x(t) = Ae−t + B e−t/2 + 1

15e2t , see Figure 3(a).

(c) The auxiliary quadratic for the inhomogeneous ODE d2xdt2

+ 2 dxdt + 5x = 5t − 3 is

m2 + 2m + 5 = 0 or (m + 1)2 + 4 = 0. Thus m = −1± 2i and the complementaryfunction is xC(t) = e−t(A cos 2t + B sin 2t). For the particular integral, we tryxP (t) = C t + D . Substitution into the ODE gives 0 + 2C + 5(Ct + D) = 5t − 3.Hence C = 1 and D = −1, thus the general solution for the ODE is x(t) =e−t(A cos 2t + B sin 2t) + t− 1, see Figure 3(a).

(a) Solutions of 4(a). (b) Solutions of 4(b).

(c) Solutions of 4(c).

Figure 3: Exercise 4, solutions with dfield.

5. The ODEs are again second order linear ones and can solved in the same way as in theprevious question.

Page 5: Solutions to revision exercises, week 1

MAT2007 ODEs (2008/9) ES5

(a) The auxiliary quadratic for the inhomogeneous ODE d2xdt2

− 2 dxdt + 5x = 10 cos t is

m2 − 2m + 5 = 0 or (m − 1)2 + 4 = 0. Thus m = 1 ± 2i and the complementaryfunction is xC(t) = et(A cos 2t + B sin 2t). For the particular integral, we tryxP (t) = C cos t + D sin t . Substitution into the ODE gives (−C − 2D + 5C) cos t +(−D + 2C + 5D) sin t = 10 cos t . Hence C = 2 and D = −1, thus the generalsolution for the ODE is x(t) = et(A cos 2t+B sin 2t)+2 cos t−sin t . Using the initialcondition x(0) = 2, we get A + 2 = 2, thus A = 0 and x′(0) = 1 gives 2B− 1 = 1,hence B = 1. Thus the solution of the IVP is x(t) = et sin 2t + 2 cos t− sin t .

(b) The auxiliary quadratic for the inhomogeneous ODE 2 d2xdt2

+2 dxdt−x = 11e2t is 2m2+

2m− 1 = 0 or 2(m + 1

2

)2− 32 = 0. Thus m = 1

2(−1±√3) and the complementaryfunction is xC(t) = Ae(−1+

√3)t/2+B e(−1−√3)t/2 . For the particular integral, we try

xP (t) = C e2t . Substitution into the ODE gives (8C+4C−C)e2t = 11e2t , thus C =1 and the general solution for the ODE is x(t) = Ae(−1+

√3)t/2 +B e(−1−√3)t/2 +e2t .

With the initial conditions x(0) = 1 and x′(0) = 2, we get

1 = A + B + 1

2 = −1+√

32 A + −1−√3

2 B + 2

Thus A = 0 = B and the solutions of the IVP is x(t) = e2t .

6. We start pplane by typing pplane7 into Matlab and introduce the ODE. In Figure 4(a),the input window from pplane is shown. By using the keyboard and/or clicking on pointsnear (0, 0), (1, 0), (1, 1), (−1/2, 0) and (1/2, 0), the plot is Figure 4(b) is obtained.The solutions divide the plane in 3 regions, one with periodic solutions and two withunbounded solutions.

(a) Input of pplane (b) Some typical solutions of the system

Figure 4: Exercise 6, using pplane.