MATH 215/255 Fall 2014 Assignment 3 solutions

advertisement
MATH 215/255
Fall 2014
Assignment 3 solutions
§1.6, §1.7, §2.1, §2.2
Solutions to selected exercises can be found in [Lebl], starting from page 303.
• 1.6.6: Start with the logistic equation dx
dt = kx(M − x). Suppose that we modify our
harvesting. That is we will only harvest an amount proportional to current population.
In other words we harvest hx per unit of time for some h > 0 (Similar to earlier
example with h replaced with hx). a) Construct the differential equation. b) Show
that if kM > h, then the equation is still logistic. c) What happens when kM < h?
Answer.
is
a) The logistic equation with harvesting that is proportional to population
dx
= kx(M − x) − hx.
dt
(1)
dx
h
= kx M − − x .
dt
k
(2)
It can be further simplified to
b) If kM > h, then we can introduce M̃ = M − h/k > 0, so that
dx
= kx M̃ − x .
dt
(3)
This equation is logistic because M̃ > 0.
c) If kM< h, then
M̃ < 0. There are two critical points x = 0 and x = M̃ < 0.
Since kx M̃ − x < 0 for x > 0, then the population will tend to zero for all initial
conditions.
• 1.6.101: Let x0 = (x − 1)(x − 2)x2 . a) Sketch the phase diagram and find critical
points. b) Classify the critical points. c) If x(0) = 0.5, then find limt→∞ x(t).
Answer.
a) To find critical points, we need to solve f (x) = 0, or (x−1)(x−2)x2 = 0.
This gives three critical points, x = 0, x = 1, and x = 2. b) To classify critical points,
note that f (x) > 0 for x < 0, f (x) > 0 for 0 < x < 1, f (x) < 0 for 1 < x < 2, and
f (x) > 0 for x > 2. This makes x = 0 and x = 2 unstable, while x = 1 is stable.
x=2
x=1
x=0
Figure 1: Phase diagram for problem 1.6.101:.
c) Since the initial condition x(0) = 0.5 falls between two critical points x = 0 and
x = 1, and f (x) > 0 in the interval 0 < x < 1, then the solution will approach a
critical point x = 1 with time. In this case, limt→∞ x(t) = 1.
• 1.7.5: Approximate the value of e by looking at the initial value problem y 0 = y with
y(0) = 1 and approximating y(1) using Euler’s method with a step size of 0.2.
Answer.
Euler’s method applied to y 0 = y with y(0) = 1 is
yk+1 = yk + hyk = (1 + h)yk ,
(4)
where k = 0...4, h=0.2 and yk approximates solution y(hk). This equation can be
simplified to
y5 = (1 + h)5 y0 ,
(5)
or
y5 = (1.2)5 ≈ 2.4883,
(6)
where y0 = y(0) = 1 and y5 approximates y(5h) = y(1). The exact solution of the
equation y 0 = y with y(0) = 1 is y(1) = e ≈ 2.7183.
• 1.7.6: Example of numerical instability: Take y 0 = −5y, y(0) = 1. We know that the
solution should decay to zero as x grows. Using Euler’s method, start with h = 1 and
compute y1 , y2 , y3 and y4 to try to approximate y(4). What happened? Now halve
the interval. Keep halving the interval and approximating y(4) until the numbers you
are getting start to stabilize (that is, until they start going towards zero). Note: You
might want to use a calculator.
Answer.
Euler’s method, applied to y 0 = −5y, y(0) = 1 can be written as
yk+1 = yk − 5hyk = (1 − 5h)yk ,
(7)
where yk is an approximation for y(kh), and k = 0...3. This equation can further be
simplified to
yk = (1 − 5h)k y0 ,
k = 1...4,
(8)
and since y0 = y(0) = 1 to
yk = (1 − 5h)k .
(9)
If h = 1, then yk = (−4)k , or
y1 = −4,
y2 = 16,
y3 = −64,
y4 = 256.
(10)
The numerical solution oscillates from positive to negative and grows in amplitude,
which indicates that it is unstable. If h = 1/2, then
y(4) = y(8h) ≈ y8 = (1 − 5/2)8 ≈ 25.6289.
(11)
y(4) = y(16h) ≈ y16 = (1 − 5/4)16 ≈ 2.3283 × 10−10 .
(12)
If h = 1/4, then
Euler’s method is unstable for h = 1 and h = 1/2, since at each step the solution
is multiplied by a number whose absolute value is bigger than 1, in which case the
numerical solution tends to infinity. When h = 1/4, |1 − 5h| = 1/4 < 1, in which case
at each step the solution is multiplied by a factor whose absolute value is smaller than
1 and the solution tends to zero with each step.
2
• 2.1.6: Suppose that (b − a)2 − 4ac > 0. a) Find a formula for the general solution of
ax2 y 00 + bxy 0 + cy = 0. Hint: Try y = xr and find a formula for r. b) What happens
when (b − a)2 − 4ac = 0 or (b − a)2 − 4ac < 0?
Answer.
a) Substitute y = xr into the equation to get
ax2 r(r − 1)xr−2 + bxrxr−1 + cxr = 0,
(13)
which can be further simplified to
ar2 + (b − a)r + c = 0.
(14)
The latter equation allows to find r as
r1,2 =
−(b − a) ±
p
(b − a)2 − 4ac
.
2a
(15)
Both r1 and r2 are real since (b − a)2 − 4ac > 0. The general solution is
y = C1 xr1 + C2 xr2 ,
(16)
where r1 and r2 are given above.
b) When the discriminant is zero, i.e. (b − a)2 − 4ac = 0 there is only one root. The
second linearly independent solution is xr ln x, as shown in next exercise. The general
solution is
y = C1 xr + C2 xr ln x,
(17)
where r = (a − b)/(2a). When (b − a)2 − 4ac < 0 there are no real roots for r1,2 ,
however, formulas (15) and (16) apply even for complex values of r1 and r2 .
• 2.1.7: Same equation as in Exercise 2.1.6. Suppose (b − a)2 − 4ac = 0. Find a
formula for the general solution of ax2 y 00 + bxy 0 + cy = 0. Hint: Try xr ln x for the
second solution.
Answer.
As for the previous exercise, substitute xr into the equation to find
ar2 + (b − a)r + c = 0,
(18)
which can be solved using (b − a)2 − 4ac = 0 as
r=
a−b
.
2a
(19)
Thus, there is only one solution in the form xr . To find the second linearly independent
solution, let’s substitute y = xr ln x into the equation to find
ax2 (r(r−1)xr−2 ln x+2rxr−1 x−1 −xr x−2 )+bx(rxr−1 ln x+xr x−1 )+cxr ln x = 0. (20)
Combining the terms, we have
ar(r − 1)xr ln x + 2arxr − axr + brxr ln x + bxr + cxr ln x = 0,
3
(21)
and
ar2 + (b − a)r + c ln x + 2ar − a + b = 0.
(22)
Substituting r = (a − b)/(2a), we have
a(a − b)2 /(4a2 ) − (b − a)2 /(2a) + c ln x + (a − b) − a + b = 0,
(23)
or
1
4ac − (b − a)2 ln x + (a − b) − a + b = 0.
(24)
4a
Since (b − a)2 − 4ac = 0, then the last equation is valid, and so xr ln x is a solution,
Finally, the general solution is
y = C1 xr + C2 xr ln x,
(25)
where r is given in (19).
Alternative solution by reduction of order. We already have one solution y1 (x) = xr .
For a second solution we try y2 (r) = xr v(x):
y2 = xr v,
y20 = rxr−1 v + xr v 0 ,
y200 = r(r − 1)xr−2 v + 2rxr−1 v 0 + xr v 00 ,
(26)
and
0 = ax2 y200 + bxy20 + cy2 = [ar(r − 1) + br + c]xr v + ax2 (2rxr−1 v 0 + xr v 00 ) + bxxr v 0 (27)
Using (18) and (19), it equals 0 + axr+1 (xv 00 + v 0 ). Thus xv 00 + v 0 = 0.
Let w = v 0 . Then xw0 + w = 0, which is separable. One solution is w =
R
r
v = dx
x = ln x, and y2 (x) = x ln x is a second solution.
1
x.
Then
• 2.1.8: (Reduction of order) Suppose that y1 (x) is a solution of y 00 +p(x)y 0 +q(x)y = 0.
Find a second linearly independent solution y2 (x). Hint: Take y2 (x) = y1 (x)v(x), plug
it into equation and use the fact that y1 (x) is a solution to find v(x). It might be
useful to introduce w(x) = v 0 (x), and don’t forget about integration constants.
Answer. Suppose y1 (x) is a non-zero solution of y 00 + p(x)y 0 + q(x)y = 0. First note
that if y2 (x) = y1 (x)v(x), then
y20 (x) = y10 (x)v(x) + y1 (x)v 0 (x),
y200 (x) = y100 (x)v(x) + 2y10 (x)v 0 (x) + y1 (x)v 00 (x).
(28)
By substituting y2 (x) = y1 (x)v(x) into the differential equation, we have
y100 (x)v(x)+2y10 (x)v 0 (x)+y1 (x)v 00 (x)+p(x) y10 (x)v(x)+y1 (x)v 0 (x) +q(x)y1 (x)v(x) = 0.
(29)
Arranging the terms, we get
00
y1 (x)+p(x)y10 (x)+q(x)y1 (x) v(x)+y1 (x)v 00 (x)+ 2y10 (x)+p(x)y1 (x) v 0 (x) = 0. (30)
Since y1 (x) is a solution, then the term in the parenthesis multiplying v(x) is zero.
By introducing w(x) = v 0 (x), the result can be simplified to
y1 (x)w0 (x) + 2y10 (x) + p(x)y1 (x) w(x) = 0.
(31)
4
The solution to this first order differential equation is
w(x) = C1 e
or
R
−2y10 (x)/y1 (x)−p(x) dx
,
(32)
R
e− p(x) dx
,
w(x) = C1
y1 (x)2
(33)
where C1 is an integration constant. Since v 0 (x) = w(x), the last equation needs to
be integrated to find
Z − R p(x) dx
e
v(x) = C1
dx + C2 ,
(34)
y1 (x)2
where C2 is another integration constant. By choosing C1 = 1, C2 = 0, we see that
Z
y2 (x) = y1 (x)v(x) = y1 (x)
R
e− p(x) dx
dx
y1 (x)2
(35)
is also a solution of the original equation. It can be verified that y1 (x) and y2 (x) are
linearly independent: If y2 (x) is a constant multiple of y1 (x), then
Z
R
e− p(x) dx
dx
y1 (x)2
(36)
is a constant and the integrand
R
e− p(x) dx
y1 (x)2
is zero, which is impossible. Therefore, the general solution is
R
hZ e− p(x) dx i
y(x) = D1 y1 (x) + D2 y1 (x)
dx ,
y1 (x)2
(37)
where D1 , D2 are constants.
• 2.1.10: Take y 00 − 2xy 0 + 4y = 0. a) Show that y = 1 − 2x2 is a solution. b) Use
reduction of order to find a second linearly independent
R x 2 solution. Express your answer
in terms of imaginary error function erfi(x) = √2π 0 et dt. c) Write down the general
solution.
Answer.
a) To show that y = 1 − 2x2 is a solution, one can substitute it into the
differential equation to find
−4 − 2x(−4x) + 4(1 − 2x2 ) = 0,
(38)
which is correct.
b) Using the result of the previous problem and noting that y1 (x) = 1 − 2x2 and
p(x) = −2x, the second linearly independent solution can be written as
Z
y2 (x) = y1 (x)
R
e− p(x) dx
dx = (1 − 2x2 )
y1 (x)2
5
Z
R
e 2x dx
dx,
(1 − 2x2 )2
(39)
which can be reduced to
2
y2 (x) = (1 − 2x )
Z
2
ex
dx.
(1 − 2x2 )2
(40)
To calculate the integral, note that
1
1
1
1
1
1
√
√
√ +
√
=
+
+
.
(1 − 2x2 )2
4 (1 − 2x)2 (1 + 2x)2 1 − 2x 1 + 2x
The first two terms can be integrated by parts, so that
Z √
Z
2
2
2
1
ex
2xex
ex
√
√ −
√ dx,
dx = √
(1 − 2x)2
2 1 − 2x
1 − 2x
and
Z
2
2
1
ex
ex
√
√ +
dx = − √
(1 + 2x)2
2 1 + 2x
Z √
(41)
(42)
2
2xex
√ dx.
1 + 2x
Combining the results, it is clear that
Z
Z
2
2
ex
1 2xex
x2
dx =
+ 2 e dx ,
(1 − 2x2 )2
4 1 − 2x2
(43)
(44)
whereby the solution is
y2 (x) =
i
1h
2
(1 − 2x2 )π 1/2 erfi(x) + 2xex ,
4
where erfi(x) is the imaginary error function, that is defined as
Z x
2
2
erfi(x) = √
et dt.
π 0
(45)
(46)
Here the integration constant is omitted in (45) since its contribution is proportional
to (1 − 2x2 ), i.e. not linearly independent from y1 (x).
c) The general solution is
i
C2 h
2
y(x) = C1 (1 − 2x2 ) +
(1 − 2x2 )π 1/2 erfi(x) + 2xex ,
(47)
4
where C1 and C2 are two constants.
• 2.2.7: Find the general solution of y 00 + 9y 0 − 10y = 0.
Answer.
To find the general solution, we need to substitute y = erx into the
differential equation to find
r2 erx + 9rerx − 10erx = 0,
(48)
r2 + 9r − 10 = 0.
(49)
or
The solution to this quadratic equation is
√
−9 ± 81 + 4 × 10
.
r1,2 =
2
6
(50)
So, r1 = 1 and r2 = −10. The general solution is
y(x) = C1 ex + C2 e−10x ,
(51)
where C1 and C2 are two constants.
• 2.2.103: Find the solution to 2y 00 + y 0 + y = 0, y(0) = 1, y 0 (0) = −2.
Answer.
To find the general solution, we need to substitute y = erx into the
differential equation to find
2r2 erx + rerx + erx = 0,
(52)
2r2 + r + 1 = 0,
(53)
or
This quadratic equation can be solved as
√
√
−1 ± 1 − 4 × 2
1
r1,2 =
= − (1 ∓ i 7).
4
4
(54)
Option 1:
The general solution is
1
y(x) = C1 e− 4 x ei
√
7
x
4
1
+ C2 e− 4 x e−i
√
7
x
4
,
(55)
where C1 and C2 are constants. We find C1 and C2 from the initial conditions as
y(0) = 1
⇒
C1 + C2 = 1,
√
√
1
1
y 0 (0) = −2 ⇒
− (1 − i 7)C1 − (1 + i 7)C2 = −2,
4
4
√
√
so that C1 = (1 + i 7)/2 and C2 = (1 − i 7)/2. The solution is then
√
√
√
√
7
7
1
1
1
1
y(x) = (1 + i 7)e− 4 x ei 4 x + (1 − i 7)e− 4 x e−i 4 x .
2
2
It can be simplified to
h √ √
√ i
1
y(x) = e− 4 x cos 47 x − 7 sin 47 x .
(56)
(57)
(58)
(59)
Option 2:
The general solution is
√7 √7 − 14 x
y(x) = C1 e
sin
x + C2 e
cos
x ,
(60)
4
4
where C1 and C2 are constants. We find C1 and C2 from the initial conditions as
− 14 x
y(0) = 1
⇒
√
C2 = 1,
7
1
C1 − C2 = −2,
4
4
√
so that C1 = − 7 and C2 = 1. Finally, the solution is
h √ √
√ i
1
y(x) = e− 4 x cos 47 x − 7 sin 47 x .
y 0 (0) = −2
⇒
7
(61)
(62)
(63)
Download