Introduction To Differential Equations - Math 286 X1 Fall 2009 Homework 2 Solutions
Introduction To Differential Equations - Math 286 X1 Fall 2009 Homework 2 Solutions
Fall 2009
Homework 2 Solutions
1. Solve each of the following differential equations:
(a) y ′ + 3xy = 0
(b) y ′ + 3y = 3x
dy
(c) = cos(t)y
dt
dy
(d) x2 −y =3
dx
Solution:
(a) This is a first-order linear equation, so we use an integrating factor. The integrating factor is
2
ρ(x) = e3x /2 , so we have
2 2
e3x /2 ′
y (x) + 3xe3x /2 y(x) = 0,
d 3x2 /2
(e y(x)) = 0,
dx
2
e3x /2 y(x) = C,
2
y(x) = Ce−3x /2
.
1
Integrating gives
e1/x y(x) = −3e1/x + C,
or
y(x) = −3 + Ce1/x .
Solution:
(a) This one we can solve many ways, but we see that the solution is y(x) = Ce2x . Plugging in the
initial condition gives C = 0, so the solution is y(x) ≡ 0.
(b) We solve by separation to get
dy
= x2 dx,
y
x3
ln |y| = + C,
3
3
y(x) = Cex /3 .
Plugging in the initial condition gives y(1) = Ce1/3 = 2, so C = 2e−1/3 , and thus the solution is
3
y(x) = 2e(x −1)/3
.
(c) We see that the left-hand side is already in the form of a product rule, so we can write
d
((1 + x)y(x)) = 3
dx
(1 + x)y(x) = 3x + C
3x C
y(x) = + .
1+x 1+x
(If we didn’t make this observation, then, first divide by the front coefficient to get
1 3
y′ + y= .
1+x 1+x
The integrating factor will be
1
R
ρ(x) = e 1+x = eln |1+x| = 1 + x
and multiplying through gives the original equation.) In any case, plugging in x = 0 gives
y(x) = C = −1,
so the solution is
3x − 1
y(x) = .
1+x
2
(d) Divide through by the front coefficient to get
1 5
y ′ + (3 + )y = .
x x
The integrating factor is
1
R
3+ x dx
e = e3x+ln x = e3x eln x = xe3x .
Multiplying through gives
3. (Problem 1.5.36 from book.) A tank initially contains 60 gal of pure water. Salt water containing 1 lb
of salt per gallon enters the tank at 2 gal/min, and the perfectly mixed solution leaves the tank at 3
gal/min. Thus the tank is empty after 1 hour. Find the amount of salt in the tank after t minutes.
Determine the maximum amount of salt ever in the tank.
Solution: First note that the tank is losing a net of 1 gal/min of liquid, which means that it will be
empty in 60 minutes. More specifically, the number of gallons in the tank at time t is V (t) = 60 − t.
Second, we want to write down a differential equation for the salt at time t, which we will denote by
S(t). Clearly, the rate of change of salt will be the rate coming in minus the rate going out. The
amount coming in is 1 lb/ gal * 2 gal/min = 2 lb/min. The rate going out is more complicated, since
it depends on the concentration of the salt in the tank at the time. But notice that if there is S(t)
pounds of salt at time t, and there are 60 − t gallons in the tank at time t, then the concentration
is thus S(t)/(60 − t) lb/gallon in the tank. The rate of liquid leaving is 3 gal/min, so the rate out is
3S(t)/(60 − t). Thus we have
dS 3S(t)
=2− ,
dt 60 − t
or
3
S′ + S = 2.
60 − t
We will use the integrating factor
3
R
dt
= e−3 ln(60−t) = eln((60−t) )
= (60 − t)−3 .
−3
e 60−t
3
Then we have
Now, we also need an initial condition, but notice that there is no salt in the tank at the start, so that
S(0) = 0. Plugging in gives
S(0) = C ∗ 603 + 60 = 0,
or
1 1
C =− =− .
602 3600
Thus the solution for all t between 0 and 60 minutes is given by
(60 − t)3
S(t) = − + (60 − t).
3600
(We can check that S(60) = 0, as it should.) Now we want to know the maximum value of S(t) for t
between 0 and 60. We first compute its derivative
−(60 − t)2
S ′ (t) = + 1.
1200
Setting this equal to zero gives
(60 − t)2 = 1200
or √
t = 60 ± 1200.
Since we only care about t less than 60, we want
√ to take the
√ solution
√ with the minus and not the plus.
Thus the value we are looking for is S(60 − 1200) = 20( 3 − 1/ 3) ≈ 23.094.
is a solution to
y ′ + y = 4 sin x, y(0) = 4.
So
y ′ + y = (A + B) cos x + (A − B) sin x,
4
so we have
A + B = 0,
A − B = 1.
We get
y ′ + y = (A + B) cos x + (A − B) sin x + (C − C)e−x ,
and the C’s cancel, thus we get the same solution for A, B as before. Our solution is then
1
y(x) = (sin x − cos x) + Ce−x .
2
Plugging in x = 0 gives
1
y(0) = C − = 4,
2
so C = 9/2, and the full solution is
1 9
y(x) = (sin x − cos x) + e−x
2 2