Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 1. (a) Find the derivative of the function f (x) = x 2 Z x t sin 3 πt 6 dt at the point x = 3. (10 points) Solution. Define G(x) to be just the integral from above, i.e., Z x πt t sin G(x) = dt. 6 3 We recognize G(x) as the area function of x sin( πx ) with left endpoint 3. By the 6 Fundamental Theorem of Calculus (Part I), we therefore have πx G0 (x) = x sin . 6 Then we can write f (x) more easily as f (x) = x2 G(x). By the Product Rule, f 0 (x) = 2x · G(x) + x2 · G0 (x), which expands to Z x πx πt 0 3 f (x) = 2x · t sin dt + x sin . 6 6 3 This gives a general formula for f 0 (x). The question asks for the value of f 0 (x) at x = 3, which is Z 3 πt 3π 0 3 dt + 3 sin . f (3) = 6 t sin 6 6 3 But the definite integral of any function from 3 to 3 is automatically 0, so the first term vanishes, leaving just 3π 0 3 f (3) = 3 sin = 27 sin(π/2) = 27. 6 1 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (b) Use Simpson’s rule to approximate 2 Z ln x dx 1 with n = 4 subintervals. Find a bound on the error. No need to simplify your answers! (5 + 5 = 10 points) Rb Solution. We are using Simpson’s Rule to approximate a f (x) dx with a = 1, b = 2, n = 4, and f (x) = ln x. Starting from ∆x = (b − a)/n = 1/4, we see that x0 = 1, x2 = 32 , x1 = 54 , x3 = 74 , x4 = 2. Then applying the Simpson’s Rule formula gives ∆x f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + f (x4 ) 3 1 = ln 1 + 4 ln 45 + 2 ln 32 + 4 ln 74 + ln 2 . 12 S4 = (There’s no need to simplify, but if you really felt like it, the ln 1 simplifies to 0, and we could combine some of the ln’s together). To get a bound on the error of this approximation, we will use the error bound eS ≤ K(b − a) (∆x)4 , 180 where the constant K is chosen so that |f (4) (x)| ≤ K for all x in the interval [a, b]. Since f (x) = ln x, we take derivatives to find f 0 (x) = x−1 f 00 (x) = −x−2 f 000 (x) = 2x−3 f (4) (x) = −6x−4 . So we need K to be larger than |f (4) (x)| = |−6/x4 | = 6/|x|4 = 6/x4 for all x in [1, 2]. It’s easy to see that 6/x4 is largest when its denominator is smallest, which occurs at x = 1. So we may safely take K = 6 (but any larger value of K also works). Then eS ≤ K(b − a) 6(2 − 1) 1 4 1 1 (∆x)4 = (4) = = . 4 180 180 30 · 4 7680 The error of the approximation S4 is at most 1/7680 ≈ 0.00013. 2 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (c) Find the definite integral Z 1 −2 2 dx. (x + 1)4 (10 points) Solution. The most important thing to note is that the integrand 2/(x + 1)4 is undefined when x = −1, and since this undefined value of x lies between −2 and 1, the integral is improper. To deal with the discontinuity at x = −1, we split the definite integral there, and then replace each improper endpoint with a limit: Z 1 Z −1 Z 1 2 2 2 dx = dx + dx. 4 4 4 −2 (x + 1) −2 (x + 1) −1 (x + 1) Z 1 Z b 2 2 dx + lim + dx. = lim− 4 4 a→−1 b→−1 a (x + 1) −2 (x + 1) Let’s start with the first of these two integrals inside a limit. The antiderivative of 2(x + 1)−4 is − 32 (x + 1)−3 (use the substitution u = x + 1 if you don’t see it right away). That gives Z b −2 b 2 −3 2 dx = − (x + 1) 3 (x + 1)4 −2 −3 2 = − 3 (b + 1) + 23 (−2 + 1)−3 2 2 =− − , 3(b + 1)3 3 so the first of the two improper integrals is Z −1 2 2 2 dx = lim− − − . 4 3 b→−1 3(b + 1) 3 −2 (x + 1) As b approaches −1, the denominator 3(b + 1)3 goes to 0, causing the limit to diverge. R −1 Since the improper integral −2 2(x + 1)−4 dx diverges, the original improper integral is also divergent. 3 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (d) We have a pair of fair coins. The faces of the first coin are marked with the numbers 0 and 1, the faces of the second coin are marked with the numbers +2 and -2. We toss both coins simultaneously. Let X denote the random variable given by the product of values that appear face up. Find the probability density function of X. (10 points) Solution. There are four equally likely has probability 41 ): First coin shows 0, second coin shows First coin shows 1, second coin shows First coin shows 0, second coin shows First coin shows 1, second coin shows outcomes for the coin flips (so each outcome −2 −2 +2 +2 =⇒ =⇒ =⇒ =⇒ X X X X = 0. = −2. = 0. = 2. So we see that X only has three possible values 0, 2 or −2, meaning it is a discrete random variable. To fully describe the PDF of X we just provide a table of probabilities for Pr(X = x) (note that X = 0 occurred in 2 of the 4 cases): x Pr(X = x) 0 2/4 2 1/4 −2 1/4 4 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (e) Obtain the partial fraction decomposition of the function x2 x−7 . − x − 12 (10 points) Solution. The numerator has lower degree than the denominator, so there’s no need to perform any long division. The denominator factors as x2 − x − 12 = (x − 4)(x + 3), so we are looking for a decomposition of the form A B x−7 = + . (x − 4)(x + 3) x−4 x+3 Multiplying both sides by the common denominator (x − 4)(x + 3) reduces this to x − 7 = A(x + 3) + B(x − 4), (1) which must hold for all values of x. When x = 4, this means 4 − 7 = 7A + 0B =⇒ 7A = −3, so that A = −3/7. When x = −3, a similar calculation gives −3 − 7 = 0A − 7B =⇒ 7B = 10, which reveals B = 10/7. The partial fraction decomposition is x2 −3/7 10/7 3 10 x−7 = + =− + . − x − 12 x−4 x+3 7(x − 4) 7(x + 3) Alternative: We could also solve for A and B by comparing the coefficients of the corresponding powers of x in equation (1). This leads to the system of equations 1=A+B −7 = 3A − 4B. The first equation implies A = 1−B. Substituting this result into the second equation, we find that −7 = 3(1 − B) − 4B = 3 − 7B. Rearranging and solving gives B = 10 . 7 Since A+B = 1, we get A = 1− 10 = −3/7. 7 5 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (f) Solve the initial value problem 0 4 3y + y cos t = 0, y π 2 1 = . 2 (10 points) Solution. We start off by separating variables y and t: 3y 0 + y 4 cos t = 0 3y 0 = −y 4 cos t dy 3 = −y 4 cos t dt −3y −4 dy = cos t dt. Z Z −4 −3y dy = cos t dt. Both sides are straightforward to integrate, yielding the relation y −3 = sin t + C (2) for some constant C. We have an initial condition stating that y( π2 ) = 12 . Since ( 12 )−3 = 8 and sin( π2 ) = 1, the equation (2) shows that C = 8 − 1 = 7. Taking the reciprocal of (2) now gives that s 1 1 y3 = , so that y = 3 . sin(t) + 7 sin(t) + 7 6 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 2. Evaluate the definite integral: Z π 2 esin x (sin x + 1) cos x dx. 0 (20 points) Solution. We proceed in two steps. We first make a substitution. Let u = sin x, so that du = cos x dx. Under this substitution, the endpoints 0 and π/2 of the original integral get replaced with sin(0) = 0 and sin(π/2) = 1. This permits us to write Z π Z 1 2 sin x e (sin x + 1) cos x dx = eu (u + 1) du 0 Z0 1 Z 1 u = e u du + eu du. 0 0 Next, we method of integration by parts to evaluate the first of the integrals on the righthand side. Let U = u and dV R= eu du. (We R use capital U and V since the lowercase letter u is already taken.) Then eu u du = U dV . Also, we have dU = 1 du and we can take V = eu . Hence, 1 Z 1 Z 1 u e u du = (U V ) − V dU 0 0 0 1 Z 1 u = (ue ) − eu du. 0 0 Combining this result with the result we found by substitution, we see that ! Z 1 Z 1 Z π 1 2 esin x (sin x + 1) cos x dx = (ueu ) − eu du + eu du 0 0 0 0 1 u = (ue ) = 1 · e1 − 0 · e0 = e. 0 So the value of the definite integral is e. Alternative: One could also compute the indefinite integral first and then substitute in the original endpoints 0 and π2 at the very end. This approach involves the same two methods as before: substitution, and then integration by parts. By much the same reasoning as above, we find that with u = sin x, an antiderivative of esin x (sin x + 1) cos x is ueu = (sin x)esin x . Thus, the original definite integral is π π 2 π sin x (sin x)e = sin esin( 2 ) − sin(0)e0 = 1 · e − 0 · 1 = e. 2 0 7 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 3. Let X be a continuous random variable that measures the lifetime (in years) of a light bulb. It can be shown that the probability density function of X is given by ( 1 − x2 e if x ≥ 0, f (x) = 2 0 otherwise. (10+10 = 20 points) (a) Compute the cumulative distribution function of X. Solution. We begin by recalling that the CDF can be expressed as an area function of the PDF; specifically, if F (x) denotes the CDF, we have Z x F (x) = f (t) dt. −∞ Since f (t) = 0 for t < 0, we see immediately that F (x) = 0 for x < 0. We also deduce that for x ≥ 0, Z x F (x) = f (t) dt 0 Z x 1 −t/2 e dt. = 0 2 An antiderivative of 12 e−t/2 is −e−t/2 . (Make the substitution u = −t/2 if you don’t see this immediately.) By the fundamental theorem of calculus, x Z x 1 −t/2 e dt = −e−t/2 0 2 0 = −e−x/2 − (−e−0/2 ) = 1 − e−x/2 . Putting everything together, we deduce that ( 1 − e−x/2 F (x) = 0 8 if x ≥ 0, otherwise. Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 (b) Find the expected value of X. R∞ Solution. We use the formula E[X] = −∞ xf (x) dx. Substituting in the given expression for f (x), noting in particular that f (x) = 0 for x < 0, we see that Z ∞ 1 −x/2 E[X] = xe dx. 2 0 The integral on the right-hand side is improper, and so we rewrite it as a limit: Z ∞ Z b 1 −x/2 1 −x/2 xe dx = lim xe dx. b→∞ 0 2 2 0 To evaluate the right-hand side integral, of integration by parts. R we use the method R Let u = x and dv = 12 e−x/2 dx. Then 12 xe−x/2 dx = u dv. Moreover, du = dx, and we can take v = −e−x/2 . Thus, b Z b Z b 1 −x/2 xe dx = (uv) − v du 0 2 0 0 b Z b −x/2 = (−xe ) − (−e−x/2 ) dx. (3) 0 0 Now −x/2 (−xe b ) = (−be−b/2 ) − (−0 · e−0/2 ) 0 = −be−b/2 . By the fundamental theorem of calculus — using that 2e−x/2 is an antiderivative of −e−x/2 — we also have b Z b −x/2 −x/2 −e dx = 2e 0 0 −b/2 = 2e − 2e−0/2 = 2e−b/2 − 2. Substituting these results back into (3) shows that Z b 1 −x/2 xe dx = −be−b/2 − (2e−b/2 − 2) 0 2 = 2 − e−b/2 (b + 2). Hence, Z E[X] = lim b→∞ 0 b 1 −x/2 b+2 xe dx = lim (2 − e−b/2 (b + 2)) = 2 − lim b/2 = 2 − 0 = 2. b→∞ b→∞ e 2 (To evaluate the final limit, we used that eb/2 is growing exponentially, and so tends to infinity faster than b + 2.) 9 Midterm 2 Solutions (204, 205, 206, 211) Math 105 Spring 2012 4. (Extra credit) A bank account earns 10% annual interest with continuous compounding. This means that at any given time, the account earns interest at a rate that is 10% of the account balance at that time. In addition, money is deposited into the account at the rate of $1200 per year, spread evenly throughout the year. If the initial balance is $0, write down an initial value problem that models the account balance as a function of time. Do not solve this problem! (5 points) Solution. Let A(t) denote the balance of the account after t years. We seek to model A(t) as the solution to a differential equation. Let ∆A denote the change in the balance in a small period of time, which we denote by ∆t. Since the interest rate is 10%, the amount of interest accrued in a period of time of length ∆t is approximately 0.1A · ∆t. Moreover, since $1200 is deposited per year (spread evenly), the amount of money deposited in the account in the same period of time is approximately 1200 · ∆t. Thus, ∆A ≈ 0.1A · ∆t + 1200 · ∆t. Dividing by ∆t shows that (for small values of ∆t) ∆A ≈ 0.1A + 1200. ∆t Letting ∆t → 0, we obtain a differential equation modeling the account balance, namely dA = 0.1A + 1200. dt To finish specifying the initial value problem, we need to give not only a differential equation but an initial value. This is given to us in the problem; the initial account balance is $0. So the initial value is A(0) = 0. In summary: The initial value problem modeling the account balance is dA = 0.1A + 1200, dt with the initial condition A(0) = 0. 10