Lecture 10. Integration (continued) Integration by substitution – definite integrals Integration by parts Integration of trigonometric functions Applications of integrations CE1MAT 1 Definite integral by substitution Evaluate ò t 4 3t +1 2 1 dt Solution du du = 6t, which gives tdt = dt 6 We have to substitute values for the limits t = 1 and t = 4, because we are integrating with respect to the new variable u = 3t2 + 1 Let u = 3t 2 +1. Hence, When t = 1, u = 3 x 12 + 1 = 4 When t = 4, u = 3 x 42 +1 = 49 ò 4 1 t 3t +1 2 dt = ò u=49 u=4 1 du 1 = u 6 6 ò 1/2 ù é 1 u 1 1/2 1/2 5 u-1/2 du = ê = (49 - 4 ) = ú 6 ë1/ 2 û4 3 3 49 49 4 CE1MAT 2 Example Evaluate ò p /2 0 cos x sin x dx Solution Let u = sin x. Hence, du = cos x Þ cos xdx = du dx We have to change the limits of integration: ò p /2 0 cos x sin x dx = ò u=1 u=0 u du = ò x = 0, u = sin(0) = 0; x = π/2, u = sin(π/2) = 1 é u3/2 ù 2 3/2 3/2 2 u du = ê ú = (1 - 0 ) = 3 ë 3 / 2 û0 3 1 1 0 CE1MAT 3 Integration by parts The product rule for differentiation of two functions u(x) and v(x) is given by d (uv) = u¢v + uv¢ dx Integrating both sides gives Rearranging yields uv = ò u¢vdx + ò uv¢ dx ò uv¢ dx = uv - ò u¢vdx it is called the integration by parts formula CE1MAT 4 ò uv¢ dx = uv - ò u¢vdx Example Find x xe ò dx Solution Let u = x, v′ = ex. Then v = ò ex dx = ex; u¢ = 1 Substitute everything into the formula x x x x x x xe dx = xe 1×e dx = xe e + C = e (x -1) + C ò ò Why have we chosen u = x, v′ = ex and not other way round? If we had selected v′ = x, u = ex , then 1 2 v = x ; u¢ = ex 2 1 2 x x2 x ò xe dx = 2 x e - ò 2 e dx even more complicated than the original one x CE1MAT 5 ò uv¢ dx = uv - ò u¢vdx Example Find ò xln xdx Solution Let u = ln x 1 u¢ = x v¢ = x x2 v = ò xdx = 2 x2 1 x2 x2 1 x2 1 x2 òxln xdx = ln x 2 - òx 2 dx = 2 ln x - 2 òxdx = 2 ln x - 2 ò 2 x2 ò 1ò = òln x - ò + C 2ò 2ò CE1MAT 6 ò uv¢ dx = uv - ò u¢vdx Example Find ò t cost dt Solution Let u= t v¢ = cost u¢ = 1 v = ò cost dt = sin t ò t cost dt = t sint - ò sint dt = t sint + cost + C CE1MAT 7 Integration by parts formula for definite integrals ò b a uv¢ dx = [uv]a - ò u¢vdx b b a Example 1 1 1 1 1 1 1 2 t 2 t 2 0 2t te dt te ( e ) dt (1 e 0 e ) e dt 2 0 2 2 0 0 0 2 1 2t 1 1 2 1 1 2t 1 2 1 2 0 3 2 1 1 e e e (e e ) e 1 3e2 2 2 2 2 4 4 4 4 0 u= t v¢ = e-2t u¢ = 1 1 v = ò e-2tCE1MAT dt = - e-2t 2 8 Example (mechanics) x of a particle is given by x = te-t Find the velocity, v = x for the initial condition t = 0, v = 0. The acceleration, Solution v = x = ò te-t dt tet (et )dt tet et dt tet et C u= t v¢ = e-t u¢ = 1 v = ò e-t dt = -e-t Substituting the given conditions t = 0, v = 0, we have Hence, 0 0e0 e0 C C 1 v = -te-t - e-t +1 = 1- e-t (1+ t) CE1MAT 9 Displacement, velocity and acceleration relation The displacement, s, velocity, v, and acceleration a, are related by ò vdt v = ò adt s= Moreover, if we are given initial conditions, we can find the value of the integration constant C. CE1MAT 10 Example The pressure, P at a distance x of a fluid flowing around a sphere of radius r is given by x ò1+ r 3 / x3 ò P = ò kò -ò ò x 4 dx ò ò where k is a constant. Evaluate P. Solution ò1+ r 3 / x3 ò P = ò kò òdx = 4 -ò ò x ò x x ò 1 r 3 / x3 ò x 1 x 1 3 k + dx = k dx + kr ò-ò òòx4 x4 òò ò-ò x4 ò-ò x7 dx x x òx ò k ò1 ò kr 3 ò 1 ò k kr 3 3 òx ò = k ò ò + kr ò ò = - ò 3 ò =- 3 - 6 6ò ò 3 òx ò-ò 6 òx ò-ò 3x 6x ò-3 ò-ò ò-6 ò-ò -3 -6 x CE1MAT x 11 More examples ò ln p 0 ex sin(ex )dx du = ex Þ exdx = du dx x = 0, u = e0 = 1 Let u = ex Þ x = ln p , u = eln p = p - new limits = ò p 1 sin(u) du = ò p 1 p é ù sin(u)du = -ëcosuû = -(cos p - cos1) =1.54 1 CE1MAT 12 Example of using integration by parts twice Find ò 1 -1 1 2 x x e dx 2 x 1 x e dx x e 1 1 2 x u= x v¢ = e u¢ = 1 v = ex 1 1 1 v¢ = ex u¢ = 2x v = ex 2 xe dx (e e ) 2 x 1 x 1 xe dx xe 1 1 x 1 u = x2 x 1 1 1 1 xe x dx e x dx 1 (e (1)e ) e x (e1 e 1 ) (e1 e 1 ) 2e 1 1 1 ò 1 -1 1 x2 ex dx = e- e-1 - 2 × 2e-1 = e- 5e-1 CE1MAT 13 Integration of trigonometric functions 1 sin x (1 cos 2 x) 2 2 cos xdx sin x C 1 sin 2 xdx cos 2 x C 2 sin 2 xdx 1 1 1 1 (1 cos 2 x)dx dx cos 2 xdx x sin 2 x C 2 2 2 2 1 1 x sin 2 x K , where K C / 2 2 4 CE1MAT 14 Example Find sin2x = 2sin xcos x cos2x ò cos2 xsin2 x dx Solution cos2x 4cos2x dx = ò cos2 xsin2 x ò sin2 2x dx du du Let u = sin 2x Þ = 2cos2x Þ cos2xdx = dx 2 ò 4cos2x dx = 2 sin 2x ò 4 du du 2 -2 -1 = 2 = 2 u du = -2u + C = +C ò ò 2 2 u 2 u sin 2x CE1MAT 15 1 sin x cos x sin 2 x 2 Example Find the area under the curve sin(x)cos(x) for x between 0 and 2π 2 0 sin x cos xdx 2 0 1 1 1 2 sin 2 xdx cos 2 x 0 cos 4 cos0 2 4 4 1 (1 1) 0 4 The correct value of the definite integral is 0, But the correct value of the total area enclosed is + + 4 - - /2 0 sin x cos xdx 4 (cos cos0) 2 CE1MAT 1 cos 2 x0 /2 4 16 Engineering applications Area = b ò ydx, where y = f (x) a We can compare exact and approximate evaluations of the integral by determining the percentage error: æ exact - approximate ö % error = ç ÷ ´100 è ø exact CE1MAT 17 Example Area = 1 ò 0 é1 ù 1 x2 dx = ê x3 ú = ë 3 û0 3 Number of intervals 1 òx 2 dx (trapezium rule) 0 Percentage error 1 4 8 16 32 64 0.34375 0.33594 0.33398 0.33349 0.33337 -3.125 -0.782 -0.194 -0.047 -0.011 CE1MAT 18 Simpson’s rule To calculate area under the curve with the Simpson’s rule, one has to divide it into an even number of blocks with the uniform width h. Each of the segments is approximated by a parabola (instead of straight line as for trapezium rule). CE1MAT 19 Example p /2 ò cos(x) dx 0 Number of intervals Trapezium rule Simpson’s rule 10 1.183 1.1895 20 1.1932 1.1953 50 1.19695 1.19746 100 1.19772 1.19790 200 1.19799 1.19806 500 1.19810 1.19812 CE1MAT 20