CALCULUS II ASSIGNMENT 4 SOLUTIONS. Evaluate the integrals e arctan(y) (i) + y dy, (ii) (iii) (iv) t cos(t)dt, ( + x ) 8 dx, ue u du, (v) (vi) (vii) (viii) sec(θ) tan(θ) 6 dθ, φtan(φ) dφ, x arctan(x) dx, sin(ψ) cos(ψ) sin(ψ) 4 + cos(ψ) 4 dψ. Solutions. To compute (i), one might recognize that the derivative of arctan(y) is /( + y ), immediately suggesting a substitution u = arctan(y). Doing so, the first integral simplifies to e arctan(y) + y dy = e u du = e u = e arctan(y). For (ii), observe that t cos(t) is a product, suggesting that we should use integration by parts; upon differentiating t, the integral simplifies. Thus t cos(t)dt = t sin(t) t= t t= sin(t)dt = + cos(t) t= =. t= For (iii), one could expand the binomial. Alternatively, in trying to be lazy and also to prevent arithmetic mistakes, one might try to do a substitution u = + x. Taking the differential, we see that du = dx x = dx (u ) so dx = (u )du. Upon making this substitution, the bounds of integration change as: For the upper bound, x = implies u = + = ; and For the lower bound, x = implies u = + =. Putting everything together, we see that ( ) 8 + x dx = u 8 (u )du = u 9 u9 u= ( 4 = u= 5 4 ) ( 9 5 ) = 4 4 + = 497 9 45 45. For (iv), perhaps a first instinct is to try to integrate by parts to get rid of the u factor in front of the exponential. But one is left integrating e u, which does not look so easy. So another thing that comes to mind might be to do the substitution x = u in hopes that it will make things easier. The differential of this substitution is dx = du u = du x so du = xdx.
CALCULUS II ASSIGNMENT 4 SOLUTIONS Putting this into the integrand then puts it that yells, integration by parts!!!! : ue u du = x e x dx = x e x 4 xe x dx = x e x 4xe x + 4e x = (u u + )e u. For (v), one might notice that the derivative of tan(θ) is sec(θ), so this calls for a substitution u = tan(θ). Doing so, one is reduced to an integral of a rational function: sec(θ) tan(θ) 6 dθ = du u 6 = du (u 4)(u + 4). To integrate the rational function, we use the method of partial fractions; that is, we aim to find numbers A and B so that (u 4)(u + 4) = A u 4 + B u + 4. Clearing denominators and then collecting like terms, we get equations imposed by = A(u + 4) + B(u 4) = (A + B)u + (4A 4B). Comparing coefficients of u implies A = B; comparing constant terms then implies that 8A =, so A = /8, B = /8. Therefore sec(θ) tan(θ) 6 dθ = du 8 u 4 du 8 u + 4 = ( ) ( tan(θ) 4 ) log(u 4) log(u + 4) = 8 8 log. tan(θ) + 4 For (vi), I stare at it, and draw some blanks since I don t seem to know how to directly integrate tan(φ), nor does there look like any good substitutions. This suggests that I now need to use some trigonometric identities, the first of which comes to mind being the Pythagorean identity tan(φ) = sec(φ). Now I know how to integrate φ; what about φsec(φ)? Well, since this is a product, I again think about integration by parts. This time, I know how to integrate sec(φ) directly: it is the derivative of tan(φ)! Thus φtan(φ) dφ = φsec(φ) dφ ( φdφ = φtan(φ) To do the remaining integral, recall the definition of tan(φ): sin(φ) du tan(φ)dφ = cos(φ) dφ = u = log(cos(φ)), where I performed the substitution u = cos(φ). Putting everything together, φtan(φ) dφ = φtan(φ) + log(cos(φ)) φ. ) tan(φ) dφ φ. For (vii), I see a product of functions, and I immediately yearn to integrate by parts; I know how to differentiate arctan(x) but not integrate it, so there is a clear choice of what to try: x arctan(x)dx = x arctan(x) x + x dx = x + x arctan(x) + x + x dx = x arctan(x) x + arctan(x) where I added and subtracted in the numerator of the rational function to simplify it a bit.
CALCULUS II ASSIGNMENT 4 SOLUTIONS 3 Finally, for (viii), there are a lot of trigonometric functions, and in particular, some in the numerator touching the differential: this calls for a substitution! Set u = sin(ψ), then the integral simplifies to sin(ψ) cos(ψ) sin(ψ) 4 + cos(ψ) 4 dψ = u u 4 + ( u ) du = u u 4 u + du. The denominator of this rational function secretly looks like a quadratic polynomial; indeed, this can be made a reality upon performing the substitution v = u. Then dv = u du so u u 4 u + du = dv v v +. We might try to factor the denominator by, say, using the quadratic formula to find the roots of the polynomial there; however, doing so, we find that the roots ought to be ± 4 8 = ± 8 4 and the square root is not something we can do right now. This means that the denominator is an irreducible quadratic polynomial and so we should compute this integral using a trigonometric substitution. We can do this upon completing the square in the denominator; that is, write ( v v + = v v + ) (( = v ) ) +. 4 Putting this into the denominator of our rational function, this suggests that we then need to make the trigonometric substitution Putting these together, we get that sin(ψ) cos(ψ) v = tan(θ). dv sin(ψ) 4 + cos(ψ) 4 dψ = v v + = dv ((v /) + /4) = sec(θ) 4 4 (tan(θ) + ) dθ = dθ = θ = arctan(v ) = arctan(sin(ψ) ). We can simplify the argument of arctan a bit more: using the half-angle identity for squares for sin, sin(ψ) cos(ψ) sin(ψ) 4 + cos(ψ) 4 dψarctan(sin(ψ) ) = arctan( cos(ψ)) = arctan(cos(ψ)). And that s a wrap!
4 CALCULUS II ASSIGNMENT 4 SOLUTIONS. Compute / sin(x) n dx for n =,,,3. Can you guess what the value of the integral might be for arbitrary n? Solution. It is good for your soul to compute by hand the initial values of this integral. But now, once you have computed a few values, to try to find a pattern you might try to relate the integral of sin(x) n to, say, sin(x) n ; after all, since you have done some work at this point, might as well try to use it! Thinking about this a bit, you might realize that one way to do this would be integration by parts: / sin(x) n dx = / sin(x)sin(x) n dx = cos(x)sin(x) n x=/ + (n ) x= / cos(x) sin(x) n dx. Now the first term on the extreme right is rather special: since cos(/) = and sin() =, both evaluations of cos(x)sin(x) n must vanish. Thus the integration by parts formula simplifies to / sin(x) n dx = (n ) / cos(x) sin(x) n dx. Now the right hand side can be expressed purely in terms of sine functions upon invoking Pythagoreas: Therefore / / cos(x) sin(x) n dx = sin(x) n dx = (n ) / / sin(x) n dx / sin(x) n dx (n ) sin(x) n dx. / sin(x) n dx. Now we see that we should combine the integrals of sin(x) n on both sides; upon rearranging and dividing by n, we obtain the reduction formula Therefore, in general, / / sin(x) n dx = n n sin(x) n dx = n n n 3 n 3 4 In particular, the first few integrals are / / / sin(x) n dx. (n )(n 3) 3 dx = n(n ) 4 sin(x) dx = /, sin(x) dx = / 4, sin(x) 4 dx = 3 6, And now you can go on, and on, and on... /. sin(x) 6 dx = 5 3.
CALCULUS II ASSIGNMENT 4 SOLUTIONS 5 3. Evaluate the integral x + (x x + ) dx by completing the square in the denominator and doing a trigonometric substitution. Solution. One can directly complete the square and perform a trigonometric substitution to compute this integral. Instead, let me split this integral up to simpler ones to compute, the point being that the numerator almost looks like the polynomial in the denominator: x + (x x + ) dx = (x x + ) + (x ) + (x x + ) dx dx x x + + = x (x x + ) dx + dx (x x + ) To compute the first and third integral, we will need to complete the square in the denominator and proceed with a trigonometric substitution. But first, let s do the second integral. The numerator was carefully chosen so that I can perform the substitution u = x x +, since then du = (x )dx. Therefore x du (x x + ) dx = u = u = x x +. Okay, now for the first and third integrals. Complete the square: x x + = (x ) +. Thus we perform the trigonometric substitution x = tan(θ). Then the first integral amounts to dx x x + = sec(θ) tan(θ) dθ = θ = arctan(x ). + As for the third integral, we simplify, use the definition of sec(θ) and then a half-angle identity to get: dx (x x + ) = sec(θ) (tan(θ) + ) dθ dθ = = sec(θ) cos(θ) dθ = θ + 4 sin(θ) = arctan(x ) + sin(arctan(x )). 4 Now it s fairly good practice to try to simplify expressions like sin(arctan(x )). Perusing a list of trigonometric identities, one might stumble upon the double angle formulae, which then gives Putting everything together, we get x + Phew! tan(arctan(x )) (x ) sin(arctan(x )) = = + tan(arctan(x )) x x +. (x x + ) dx = 3 arctan(x ) + ( 3arctan(x ) + = x x x + x 3 x x + ). x x +
6 CALCULUS II ASSIGNMENT 4 SOLUTIONS 4. Let s think about the calculations that we performed in Assignment, Question. A function of the form f (x) = a sin(x) + a sin(x) + + a N sin(n x) is called a finite Fourier series. Show that Moreover, verify that a m = f (x)sin(mx)dx. f (x)cos(mx)dx = for all positive integers m. This gives a way of extracting the coefficients a i in a function of this form! Solution. Okay, well, let s evaluate the integral at hand by plugging in the definition of the function f (x) and split the integral up using linearity: f (x)sin(mx)dx = = a Now by Assignment, Question, whenever n m, ( a sin(x) + a sin(x) + + a N sin(n x) ) sin(mx)dx sin(x)sin(mx)dx + a a sin(x)sin(mx)dx + + a N sin(n x) sin(mx) dx. sin(nx) sin(mx) =. Therefore, the only term that contributes to the integral of f (x)sin(mx) is the term corresponding to a m sin(mx). In other words, as claimed. The vanishing f (x)sin(mx)dx = a m sin(mx)sin(mx)dx = a m = a m f (x)cos(mx)dx = now comes from the exact same calculation, but now using the fact that sin(nx)cos(mx) always pairs to when integrated between and.
CALCULUS II ASSIGNMENT 4 SOLUTIONS 7 5. The calculation in 3. suggests a way to approximate certain functions. Consider the function { if x <, f (x) = if x. (i) Calculate a m = f (x)sin(mx)dx for m =,,3,4,5,6,7,8. (ii) Let f i (x) = a sin(x) + a sin(x) + + a i sin((i )x) + a i sin(i x). With the help of a computer, graph the functions f, f, f 3, and f 4 in the interval [,]. Also draw the graph of f. Solution. In fact, we can compute the coefficients a m in general; their behaviour only depends on the parity of m. To compute the integral, split it at so that we can substitute the piecewise definition of f : f (x)sin(mx)dx = f (x)sin(mx)dx + f (x)sin(mx)dx = sin(mx)dx + sin(mx) dx = m cos(mx) x= + x= m cos(mx) x= x= = ( ) cos() cos( m) cos(m). m Now cos(m) = if m is even and cos(m) = if m is even. Putting this into the final line, we see that In particular, the first few values of a m are if m is even, f (x)sin(mx)dx = 4 m if m is odd. 4,, 4 3,, 4 5,, 4 7,. With the computations from (i), we see that the functions f i defined above take the form f (x) = 4 sin(x), f (x) = 4 sin(x) + 4 3 sin(3x), f 3 (x) = 4 sin(x) + 4 3 sin(3x) + 4 5 sin(5x), f 4 (x) = 4 sin(x) + 4 3 sin(3x) + 4 5 sin(5x) + 4 7 sin(7x). Plotting these functions, we have the following:
8 CALCULUS II ASSIGNMENT 4 SOLUTIONS In this picture, f is pictured in red, f in green, f 3 in blue, and f 4 in violet. Notice how the more terms we add to f i, the more it wiggles around the function f, pictured in thicker black. One might imagine that as we add more terms to the f i, the closer f i hugs f. Indeed, this is what happens: consider, for example, the following plot of f 5 :.5.5 Perhaps in the limit, f i, in some sense, becomes f! This is a subject that you might encounter in more depth in courses on Fourier analysis, signal processing, etc.