Review sheet for midterm 2 solutions

Review sheet for midterm 2 solutions
1) Solve the following differential equations:
(a)
dy
y
= − 5 with y(1) = 1
dx
x
Identify the equation as linear.
y
dy
− m = −5m
dx
x
dm
m
To use the product rule:
=−
dx
x
dm
dx
=−
m
x
ln |m| = − ln |x| + C
1
m=
x
d[my]
By the product rule:
= −5m
dx
d[y/x]
5
=−
dx
x
y
= −5 ln |x| + C
x
y = −5x ln |x| + Cx
Using the initial condition: 1 = y(1) = −5 ln |1| + C = C
C=1
Therefore y = −5x ln |x| + x
m
take C=0
(b)
dy
= y − x2 with y(0) = 0
dx
Identify the equation as linear.
dy
− my = −x2 m
dx
dm
To use the product rule:
= −m
dx
dm
= −dx
m
ln |m| = −x + C
m = e−x
d[my]
By the product rule:
= −x2 m
dx
d[e−x y]
= −x2 e−x
dx
Z
m
e−x y = − x2 e−x dx
Z
2 −x
−x
= − − x e + 2 xe dx
Z
2 −x
−x
= x e − 2 − xe + e−x dx
= x2 e−x + 2xe−x + 2e−x + C
y = x2 + 2x + 2 + Cex
Using the initial condition: 0 = y(0) = 2 + C
C = −2
Therefore y = x2 + 2x + 2 − 2ex
2
take C=0
dy
(c) (x + 1)
= y − x with y(0) = 0
dx
Identify the equation as linear.
y
x
dy
−m
= −m
dx
x+1
x+1
dm
m
To use the product rule:
=−
dx
x+1
dm
dx
=−
m
x+1
ln |m| = − ln |x + 1| + C
1
m=
x+1
d[my]
x
By the product rule:
=−
m
dx
x+1
x
d[y/(x + 1)]
=−
dx
(x + 1)2
Z
x
y
=−
dx
x+1
(x + 1)2
Z
x+1−1
=−
dx
(x + 1)2
Z
1
1
=−
−
dx
x + 1 (x + 1)2
1
+C
= − ln |x + 1| −
x+1
y = −(x + 1) ln |x + 1| − 1 + C(x + 1)
Using the initial condition: 0 = y(0) = − ln |1| − 1 + C = −1 + C
C=1
Therefore y = −(x + 1) ln |x + 1| − 1 + (x + 1)
= −(x + 1) ln |x + 1| + x
m
3
take C=0
dy
(d) csc(x)
= y + 1 with y(0) = 0
dx
Identify as separable
dy
= sin(x)dx
y+1
ln |y + 1| = − cos(x) + C
y = −1 + e−cos(x)+C
Check for the missed solution: y = −1
Using the intial condition: 0 = y(0) = −1 + e−1+C
C = ln(1) + 1 = 1
Therefore: y = −1 + e1−cos(x)
2) Estimate y(3) for the following functions using step sizes h = 1, 2
(a)
dy
= x2 − xy − y 2 where y(1) = 1
dx
For h = 1
n xn = xn−1 + h
yn = yn−1 + f (xn−1 , yn−1 )h
2
n xn = xn−1 + 1 yn = yn−1 + x2n−1 − xn−1 yn−1 − yn−1
0
1
1
2
2
1
2
1+1 −1·1−1 =0
2
3
0 + 22 − 2 · 0 − 02 = 4
We find y(3) ≈ 4
Now, for h = 2
n xn = xn−1 + h
yn = yn−1 + f (xn−1 , yn−1 )h
2
n xn = xn−1 + 2 yn = yn−1 + 2(x2n−1 − xn−1 yn−1 − yn−1
)
0
1
1
2
2
1
3
1 + 2(1 − 1 · 1 − 1 ) = −1
We find y(3) ≈ −1
4
(b)
dy
= sin(πy) where y(−1) = 12
dx
For h = 1
n xn = xn−1 + h yn = yn−1 + f (xn−1 , yn−1 )h
n xn = xn−1 + 1
yn = yn−1 + sin(πyn−1 )
1
0
−1
2
1
π
3
1
0
+
sin(
)
=
2
2
2
3
2
1
+ sin( 3π
) = 12
2
2
1
3
2
+ sin( π2 ) = 32
2
3
+ sin( 3π
) = 12
4
3
2
2
We find y(3) ≈ 21
Now, for h = 2
n xn = xn−1 + h yn = yn−1 + f (xn−1 , yn−1 )h
n xn = xn−1 + 1
yn = yn−1 + 2 sin(πyn−1 )
1
0
−1
2
1
π
5
1
1
+
2
sin(
)
=
2
2
2
5π
9
5
+
2
sin(
)
=
2
3
2
2
2
9
We find y(3) ≈ 2
5
3) (a) A colony of ants reproduces at a rate proportional to its size. Suppose you start an ant farm with only one male ant and one female
ant. One year later you count your ants and find that you have 100
of them. If ants are immortal, how many ants will you have in 5
years?
Now, you realize ants are, in fact, not immortal. You do some
research and keep track of your ants and find that on your farm
ants die at a rate of ekt where K is the same proportianality constant from the reproduction rate. With this added information,
how many ants will there actually be in 5 years?
Make the following variable declarations:
P = population of ants, units in ants
t = time, units in years
Because of the phrase “reproduces at a rate proportional to its size”
dP
= kP for some constant k. In addition, we have two
we know
dt
initial conditions: P (0) = 2 and P (1) = 100. This is separable, and
solved as follows:
dP
= kdt
P
ln |P | = kt + C
P = ekt+C
2 = P (0) = e0+C
P =e
kt+ln(2)
100 = P (1) = 2e
so C = ln(2)
kt
= 2e
k
so k = ln(50)
P = 2eln(50)t = 2(50)t
So it follows after 5 years P (5) = 2(50)5 is a lot of ants. (Technically, we missed the solution P = 0, but this does not satisfy our
initial conditions)
BUT as the second part of the question points out we forgot to
account for ants dying. We lose 10 ants every year, so our differential equation changes:
6
dP
= In − Out = kP − ekt
dt
The inital condtions stay the same, so we must solve this new differential equation. This is a linear differential equation.
dP
− kmP = −ekt m
dt
dm
To use the product rule:
= −km
dt
dm
= −kdt
m
ln |m| = −kt + C
m
choose C=0
m = e−kt
d[mP ]
= −ekt m
Using the product rule
dt
d[e−kt P ]
= −1
dt
e−kt P = −t + C
P = ekt (C − t)
Using initial conditions: 2 = P (0) = e0 (C − 0)
C=2
100 = P (1) = ek (2 − 1) = ek
k = ln(100)
P = eln(100)t (2 − t)
= (100)t (2 − t)
So we then have after five years P (5) = (100)5 (2 − 5) = −3(100)5 .
Stop. This should raise a lot of red flags, because now we have
a negative number of ants. Clearly this doesn’t make sense, so we
need to check to see if all the ants die off. The equation we got is
only valid if there are actually ants to reproduce, i.e. only when it
is positive. Checking our solution:
P = (100)t (2 − t) ≥ 0
2−t≥0
t≤2
7
by (100)t ≥ 0 always
And in fact, at t = 2 we find P = 0. This means all the ants died
off, so there is no more room for the population to grow or shrink.
So we need to adjust our solution to the following:
P =
100t (2 − t)
0
when 0 ≤ t ≤ 2
when t ≥ 2
So we actually find there are no ants after 5 years i.e. P (5) = 0.
8
(b) You are making lemonade, but you first make a few pitchers of
lemonade that is 50% lemon juice. You decide this is too much.
So, you take a 2000mL bucket and fill it with water. You then
pour your original lemonade into the bucket at a rate of 10mL/s
and drain the well mixed lemonade at the same rate. Find the concentration of lemon juice in the bucket as a function of time. You
decide you want lemonade that is 10% lemon juice, how long do
you have to wait?
First we must declare our variables. Note this is a mixing problem:
Q = concetration of lemon juice, units juice/mL
L = amount of lemon juice, units juice = 2000Q
t = time, units seconds
We start with a bucket of just water, so L(0) = 0. Our rate in is the
same as our rate out at 10mL/s. We get the following differential
equation:
dL
= In − Out = (0.50juice/mL)(10mL/s) − (Qjuice/mL)(10mL/s)
dt
L
= 5 − 10Q = 5 −
200
Noting our units match up. This is both separable and linear, I will
present the separable solution method:
dL
dt
=
1000 − L
200
t
− ln |1000 − L| =
+C
200
|1000 − L| = eC−t/200
1000 − L = ±eC−t/200
L = ±eC−t/200 + 1000
Using the inital condition 0 = L(0) = ±eC + 1000
−1000 = ±eC
must use -, so C = ln(1000)
Therefore L = 1000 − eln(1000)−t/200 = 1000 − 1000e−t/200
9
So we then have Q =
1
.
Q(t) = 0.10 = 10
L
2000
=
1
2
− 12 e−t/200 . We need to solve for
1
1 1
= − e−t/200
10
2 2
−4
1
= − e−t/200
10
2
4
= e−t/200
5
4
−t/200 = ln
5
4
t = −200 ln
5
10
(c) You buy a house for $10,000. You cannot afford this because you
are a college student, so you take out a loan for the money. The
loan has a yearly interest rate of 10%. You decide to pay $2000 a
year to pay off the loan. Write the amount of money you still owe,
M , as a function of time. Are your payments large enough that you
will eventually completely pay off the loan, and if so when will you
finish paying off the loan? Answer the same questions if you had
paid $1000 per year, or $5000 per year.
dM
= In − Out. The money
We know we can apply the following:
dt
“IN” is the money being added to your debt by the interest. The
money “Out” is the money being taken out of the debt by your payments. We then have the separable and linear differentiale equation:
dM
dt
1
dM
−m M
m
dt
10
dm
To use the product rule:
dt
dm
m
=
1
M − 2000
10
= −2000m
1
10
dt
=−
10
t
ln |m| = − + C
10
m = e−t/10
d[mM ]
= −2000m
Using the product rule
dt
d[e−t/10 M ]
= −2000e−t/10
dt
e−t/10 M = 20000e−t/10 + C
= −m
choose C=0
M = 20000 + Cet/10
Using the inital debt 10000 = M (0) = 20000 + Ce0
−10000 = C
Therefore M = 20000 − 10000et/10
Will we eventually pay off the debt? and if so when? Both questions
11
can be answered by setting M = 0 and solving for t:
0 = M = 20000 − 10000et/10
2 = et/10
t = 10 ln(2)
So the answer is yes. For payments of $5000, you will similarlyfind
the answer is yes where M = 50000 − 40000et/10 and t = 10 ln 54 .
For payments of $1000 you find M = 10000 remains constant, so
you end up never repaying your debt.
12
(d) Recall Newton’s cooling law: dT
= k(T − Tr ) where Tr is the temdt
perature of the container and T is the temperature of the object in
question. Suppose you put a 200◦ C cup of soup in the refrigerator,
which is set to 0◦ C. You want to know when the soup will reach
20◦ C so you can eat it. Suppose you check the soup 1 minute after you put it in the refrigerator and find the temperature is now
150◦ C. How long do you have to wait from the moment you put
the soup in the refrigerator before you can eat the soup?
dT
= k(T − 0)
dt
dT
= kdt
T
ln |T | = kt + C
T = ekt+C
Using initial conditions: 200 = T (0) = eC
C = ln(200)
150 = T (1) = ek+ln(200) = 200ek
3
= ek
4
3
k = ln
4 3
4
3 t
= 200
4
3 t
20 = T = 200
4
3 t
1
=
10
4
1
3
ln
= ln
t
10
4
1
ln 10
− ln 10
=
t=
ln 3 − ln 4
ln 3
ln
therefore T = 200e
4
13
t
4) Find the following Taylor polynomials and Taylor Series using the apx
−x
)
propriate method. (Recall cosh(x) = e +e
2
(a) T31 2x = 2 + (ln 2)2(x − 1) +
(ln 2)2 2
(x
2
− 1)2 +
(ln 2)3 2
(x
6
− 1)3
(b)
T∞
sin(x)
1
= T∞
sin(x)
1−x
1−x
= (1 + x + x2 + · · · + xn + o(xn ))(x −
(−1)n x2n+1
x3
+ ··· +
+ o(x2n+1 ))
3!
(2n + 1)!
x3
(−1)n x2n+1
+ ··· +
+ o(x2n+1 )
3!
(2n + 1)!
x4
(−1)n x2n+2
+ x2 −
+ ··· +
+ o(x2n+2 )
3!
(2n + 1)!
(−1)n x2n+3
x5
3
+ ··· +
+ o(x2n+3 )
+x −
3!
(2n + 1)!
n 2n+1+n
(−1) x
+ ··· +
+ o(x2n+1+n )
(2n + 1)!
= c0 + c1 x + c2 x2 + · · · + cn xn + o(xn )
=x−
Where cn = 1 −
1
3!
+ ··· +
(−1)k
(2k+1)!
for n = 2k + 1 and n = 2k + 2
(c)
√
T9 1 − 3x = T9 (1 + u)1/2 for u=-3x
1/2
1/2
1/2 2
1/2 9
=
+
u+
u + ··· +
u
0
1
2
9
1/2
1/2
1/2 2
9 1/2
=
−3
x+9
x + · · · + (−3)
x9
0
1
2
9
(d)
T∞
1 + t2
= (1 + t2 )(1 + t2 + t4 + t6 + · · · + t2n + o(t2n ))
1 − t2
= 1 + t2 + t4 + t6 + · · · + t2n + o(t2n )
+ 0 + t2 + t4 + t6 + t8 + · · · + t2n + t2n+2 + o(t2n+2 )
= 1 + 2t2 + 2t4 + · · · + 2t2n + o(t2n )
14
(e)
T∞ e9−2t = e9 T∞ e− 2t
4e9 2
(−2)n e9 n
= e − 2e t +
t + ··· +
t + o(tn )
2
n!
9
(f) T4 cosh(x) = 1 +
x2
2
9
+
x4
4!
5) (a) Find T3 {x5 − ln(1 + x)}. What is the maximum possible error,
|(x5 − ln(1 + x)) − T3 {x5 − ln(1 + x)}|, over the interval |x| < 12 ?
T3 {x5 − ln(1 + x)} = −T3 ln(1 + x) = x −
only affects the fifth term.
x
2
+
x
3
because the x5
f (4) (ξ)x4 |(x5 − ln(1 + x)) − T3 {x5 − ln(1 + x)}| = |R3 {x5 − ln(1 + x)}| = 4!
|120ξ + 6(1 + ξ)−4 ||x|4
=
24
1
|120ξ + 6(1 + ξ)−4 |
by |x| <
<
4
2 24
2
We now have to maximize 120ξ + 6(1 + ξ)−4 over |ξ| < 21 . Critical
points are solutions to 120−24(1+ξ)−5 = 0, but the solution to this
equation is nasty and difficult to work with by hand. So, we bound
this function another way. We know it is always positive, and that
120ξ ≤ 120 · 12 = 60. Now, (1 + ξ)−4 has derivative −4(1 + ξ)−5 ,
which has no zeroes. This function then has no critical points, so
after checking the end points we find (1 + ξ)−4 ≤ (1 − 1/2)−4 = 16.
So it follows that:
5
|R3 {x − ln(1 + x)}| <
<
=
=
15
|120ξ + 6(1 + ξ)−4 |
24 24
60 + 6 · 16
60
6
=
+
4
2 24
16 · 24 24
5
1
+
16 · 2 4
13
32
R1 3
(b) Estimate 0 ex dx Using the first order Taylor Polynomial of ex ,
and find the maximum error in this estimation.
T1 et = 1 + t
T1 et = 1 + x3
1
Z
1 + x3 dx = 1 +
The integral is approximately
0
Now to find the error, noting R1 et =
1
1
5
=
4
4
eξ t2
.
2
Z 1
x3
3
e dx −
1 + x dx = e − 1 + x dx
0
0
0
Z 1
t
=
R1 e dx for t = x3
0
Z 1 eξ x 6 dx
=
2
Z 1 6
Z 10 6
3x
ex
dx ≤
dx
≤
2
2
0
0
by eξ increasing and the Comparison Theorem
3
=
14
Z
x3
16
Z
1
3