Differential Equations INTEGRATING FACTOR METHOD Graham S McDonald A Tutorial Module for learning to solve 1st order linear differential equations ● Table of contents ● Begin Tutorial c 2004 g.s.mcdonald@salford.ac.uk Table of contents 1. 2. 3. 4. 5. 6. Theory Exercises Answers Standard integrals Tips on using solutions Alternative notation Full worked solutions Section 1: Theory 3 1. Theory Consider an ordinary differential equation (o.d.e.) that we wish to solve to find out how the variable y depends on the variable x. If the equation is first order then the highest derivative involved is a first derivative. If it is also a linear equation then this means that each term can dy involve y either as the derivative dx OR through a single factor of y . Any such linear first order o.d.e. can be re-arranged to give the following standard form: dy + P (x)y = Q(x) dx where P (x) and Q(x) are functions of x, and in some cases may be constants. Toc JJ II J I Back Section 1: Theory 4 A linear first order o.d.e. can be solved using the integrating factor method. After writing the equation in standard form, P (x) can be identified. One then multiplies the equation by the following “integrating factor”: R IF= e P (x)dx This factor is defined so that the equation becomes equivalent to: d dx (IF y) = IF Q(x), whereby integrating both sides with respect to x, gives: IF y = R IF Q(x) dx Finally, division by the integrating factor (IF) gives y explicitly in terms of x, i.e. gives the solution to the equation. Toc JJ II J I Back Section 2: Exercises 5 2. Exercises In each case, derive the general solution. When a boundary condition is also given, derive the particular solution. Click on Exercise links for full worked solutions (there are 10 exercises in total) Exercise 1. dy + y = x ; y(0) = 2 dx Exercise 2. dy + y = e−x ; y(0) = 1 dx Exercise 3. dy x + 2y = 10x2 ; y(1) = 3 dx ● Theory ● Answers ● Integrals ● Tips ● Notation Toc JJ II J I Back Section 2: Exercises Exercise 4. dy x − y = x2 ; y(1) = 3 dx Exercise 5. dy x − 2y = x4 sin x dx Exercise 6. dy x − 2y = x2 dx Exercise 7. dy + y cot x = cosec x dx ● Theory ● Answers ● Integrals ● Tips ● Notation Toc JJ II J I Back 6 Section 2: Exercises 7 Exercise 8. dy + y · cot x = cos x dx Exercise 9. dy (x2 − 1) + 2xy = x dx Exercise 10. dy = y tan x − sec x ; y(0) = 1 dx ● Theory ● Answers ● Integrals ● Tips ● Notation Toc JJ II J I Back Section 3: Answers 8 3. Answers 1. General solution is y = (x − 1) + Ce−x , and particular solution is y = (x − 1) + 3e−x , 2. General solution is y = e−x (x + C) , and particular solution is y = e−x (x + 1) , 3. General solution is y = 25 x2 + y = 21 (5x2 + x12 ) , C x2 , and particular solution is 4. General solution is y = x2 + Cx , and particular solution is y = x2 + 2x , 5. General solution is y = −x3 cos x + x2 sin x + Cx2 , 6. General solution is y = x2 ln x + C x2 , Toc JJ II J I Back Section 3: Answers 9 7. General solution is y sin x = x + C , 8. General solution is 4y sin x + cos 2x = C , 9. General solution is (x2 − 1)y = x2 2 +C , 10. General solution is y cos x = C − x , and particular solution is y cos x = 1 − x . Toc JJ II J I Back Section 4: Standard integrals 10 4. Standard integrals f (x) n x 1 x x e sin x cos x tan x cosec x sec x sec2 x cot x sin2 x cos2 x R f (x)dx xn+1 n+1 (n 6= −1) ln |x| ex − cos x sin x − ln |cos x| ln tan x2 ln |sec x + tan x| tan x ln |sin x| x sin 2x 2 − 4 x sin 2x 2 + 4 Toc JJ R f (x) n 0 [g (x)] g (x) g 0 (x) g(x) x a sinh x cosh x tanh x cosech x sech x sech2 x coth x sinh2 x cosh2 x II J f (x)dx [g(x)]n+1 n+1 (n 6= −1) ln |g (x)| ax (a > 0) ln a cosh x sinh x ln cosh x ln tanh x2 2 tan−1 ex tanh x ln |sinh x| sinh 2x − x2 4 sinh 2x + x2 4 I Back Section 4: Standard integrals f (x) 1 a2 +x2 √ 1 a2 −x2 √ a2 − x2 11 R f (x) dx f (x) 1 a tan−1 1 a2 −x2 R (a > 0) 1 x2 −a2 f (x) dx a+x 1 2a ln a−x (0 < |x| < a) x−a 1 ln 2a x+a (|x| > a > 0) sin−1 x a √ 1 a2 +x2 √ 2 2 ln x+ aa +x (a > 0) (−a < x < a) √ 1 x2 −a2 √ 2 2 ln x+ xa −a (x > a > 0) a2 2 −1 sin √ +x Toc x a x a a2 −x2 a2 JJ √ i √ a2 +x2 a2 2 x2 −a2 II a2 2 J h h sinh−1 − cosh−1 I x a i √ x a2 +x2 2 a i √ 2 2 + x xa2−a + x a Back Section 5: Tips on using solutions 12 5. Tips on using solutions ● When looking at the THEORY, ANSWERS, INTEGRALS, TIPS or NOTATION pages, use the Back button (at the bottom of the page) to return to the exercises. ● Use the solutions intelligently. For example, they can help you get started on an exercise, or they can allow you to check whether your intermediate results are correct. ● Try to make less use of the full solutions as you work your way through the Tutorial. Toc JJ II J I Back Section 6: Alternative notation 13 6. Alternative notation The linear first order differential equation: dy + P (x) y = Q(x) dx R has the integrating factor IF=e P (x) dx . The integrating factor method is sometimes explained in terms of simpler forms of differential equation. For example, when constant coefficients a and b are involved, the equation may be written as: dy + b y = Q(x) a dx In our standard form this is: dy b Q(x) + y= dx a a with an integrating factor of: R IF = e Toc JJ II b a dx bx =ea J I Back Solutions to exercises 14 Full worked solutions Exercise 1. Compare with form: dy + P (x)y = Q(x) (P, Q are functions of x) dx Integrating factor: P (x) = 1. Integrating factor, R IF = e P (x)dx R = e dx = ex Multiply equation by IF: dy + ex y = ex x dx d x i.e. [e y] = ex x dx ex Toc JJ II J I Back Solutions to exercises 15 Integrate both sides with respect to x: ex y Z { Note: dv u dx dx u i.e. y = ex (x − 1) + C Z = uv − v du dx i.e. integration by parts with dx dv ≡ ex dxZ → xex − ex dx ≡ x, → xex − ex = ex (x − 1) } = (x − 1) + Ce−x . Particular solution with y(0) = 2: 2 = (0 − 1) + Ce0 = −1 + C i.e. C = 3 and y = (x − 1) + 3e−x . Return to Exercise 1 Toc JJ II J I Back Solutions to exercises 16 Exercise 2. Integrating Factor: P (x) = 1 , R IF = e P dx R =e dx = ex Multiply equation: ex i.e. dy + ex y = ex e−x dx d x [e y] = 1 dx Integrate: ex y y i.e. = x+C = e−x (x + C) . Particular solution: y=1 x=0 gives 1 and y = e0 (0 + C) = 1.C i.e. C = 1 −x = e (x + 1) . Return to Exercise 2 Toc JJ II J I Back Solutions to exercises 17 Exercise 3. Equation is linear, 1st order i.e. dy dx + x2 y = 10x, Integrating factor : IF = dy + P (x)y = Q(x) dx P (x) = x2 , Q(x) = 10x i.e. where R e P (x)dx = e2 2 = e2 ln x = eln x = x2 . dy + 2xy = dx d 2 x ·y = dx i.e. Integrate: i.e. JJ dx x x2 Multiply equation: Toc R II J x2 y = y = I 10x3 10x3 5 4 x +C 2 C 5 2 x + 2 2 x Back Solutions to exercises 18 Particular solution i.e. 3 = 5 2 ·1+ i.e. 6 2 = 5 2 +C i.e. C= 1 2 ∴ y = 52 x2 + y(1) = 3 i.e. y(x) = 3 when x = 1. C 1 1 2x2 = 1 2 5x2 + 1 x2 . Return to Exercise 3 Toc JJ II J I Back Solutions to exercises 19 Exercise 4. dy − dx Standard form: Compare with 1 y=x x dy + P (x)y = Q(x) , giving dx R Integrating Factor: IF = e P (x)dx = e− R dx x P (x) = − 1 x −1 = e− ln x = eln(x Multiply equation: 1 1 dy − 2 y = x dx x d 1 i.e. y = dx x 1 1 Integrate: i.e. Toc JJ 1 y x y II = x+C = x2 + Cx . J I Back ) = 1 . x Solutions to exercises 20 Particular solution with y(1) = 3: i.e. Particular solution is 3 = 1+C C = 2 y = x2 + 2x . Return to Exercise 4 Toc JJ II J I Back Solutions to exercises Exercise 5. Linear in y : 21 dy dx − x2 y = x3 sin x Integrating factor: IF = e−2 R dx x −2 = e−2 ln x = eln x = 1 x2 1 dy 2 − y = x sin x x2 dx x3 d 1 y = x sin x dx x2 Z y = −x cos x− 1 · (− cos x)dx+C 0 x2 Multiply equation: i.e. Integrate: [Note: integration by parts, R dv R u dx dx = uv − v du dx dx, u = x, i.e. i.e. y x2 y dv dx = sin x] = −x cos x + sin x + C = −x3 cos x + x2 sin x + Cx2 . Return to Exercise 5 Toc JJ II J I Back Solutions to exercises 22 Exercise 6. 2 y=x x Standard form: dy − dx Integrating Factor: P (x) = − R IF = e P dx Multiply equation: Toc = e−2 R dx x 2 x −2 = e−2 ln x = eln x = 1 x2 1 dy 2 1 − y= x2 dx x3 x d 1 1 i.e. y = dx x2 x JJ II J I Back Solutions to exercises 23 1 y= x2 Integrate: Z dx x i.e. 1 y x2 = ln x + C i.e. y = x2 ln x + Cx2 . Return to Exercise 6 Toc JJ II J I Back Solutions to exercises 24 Exercise 7. Of the form: where dy + P (x)y = Q(x) (i.e. linear, 1st order o.d.e.) dx P (x) = cot x. R Integrating factor : IF = e P (x)dx cos x sin x dx R =e R ≡e f 0 (x) dx f (x) = eln(sin x) = sin x sin x · dy dx + sin x i.e. sin x · dy dx + cos x · y = 1 i.e. d dx Multiply equation : Integrate: cos x sin x y= [sin x · y] = 1 (sin x)y = x + C . Toc JJ sin x sin x II Return to Exercise 7 J I Back Solutions to exercises 25 Exercise 8. Integrating factor: P (x) = cot x = R IF = e Note: P dx cos x f 0 (x) ≡ sin x f (x) R =e cos x sin x dx cos x sin x = eln(sin x) = sin x Multiply equation: sin x · Integrate: Toc cos x dy + sin x · y · = sin x · cos x dx sin x d i.e. [sin x · y] = sin x · cos x dx Z y sin x = sin x · cos x dx JJ II J I Back Solutions to exercises 26 Z { Note: Z sin x cos x dx ≡ f (x)f (x)dx ≡ Z ≡ i.e. i.e. Z 0 f df = y sin x = 1 2 sin2 x + C = 1 2 · 12 (1 − cos 2x) + C f df · dx dx 1 2 f +C } 2 4y sin x + cos 2x = C 0 where C 0 = 4C + 1 = constant . Return to Exercise 8 Toc JJ II J I Back Solutions to exercises 27 Exercise 9. dy + dx Standard form: 2x x2 − 1 P (x) = Integrating factor: R IF = e Multiply equation: P dx y= x x2 − 1 2x x2 − 1 R =e (x2 − 1) 2x dx x2 −1 2 = eln(x −1) = x2 − 1 dy + 2x y = x dx (the original form of the equation was half-way there!) d 2 i.e. (x − 1)y = x dx Integrate: (x2 − 1)y = Toc JJ 1 2 x +C . 2 II Return to Exercise 9 J I Back Solutions to exercises 28 Exercise 10. P (x) = − tan x Q(x) = − sec x IF = e− R tan x dx = e− R sin x cos x dx = e+ R − sin x cos x dx = eln(cos x) = cos x Multiply by IF: i.e. y(0) = 1 d dx dy cos x dx − cos x · [cos x · y] = −1 sin x cos x y = − cos x · sec x i.e. y cos x = −x + C . i.e. y = 1 when x = 0 gives cos(0) = 0 + C ∴ C = 1 i.e. y cos x = −x + 1 . Return to Exercise 10 Toc JJ II J I Back