Study Advice Service Mathematics Worksheet Differential Equations 1 This is one of a series of worksheets designed to help you increase your confidence in handling Mathematics. This worksheet contains both theory and exercises which cover 1st Order Differential Equations. It deals with 4 types:1. Exact 2. Variables Separable 3. Homogeneous 4. Linear There are often different ways of doing things in Mathematics and the methods suggested in the worksheets may not be the ones you were taught. If you are successful and happy with the methods you use it may not be necessary for you to change them. If you have problems or need help in any part of the work then there are a number of ways you can get help. For students at the University of Hull Ask your lecturers Contact the Study Advice Service in the Brynmor Jones Library where you can access the Mathematics Tutor, or contact us by email. Come to a Drop-In session organised for your department Look at one of the many textbooks in the library. For others Ask your lecturers Access your Study Advice or Maths Help Service Use any other facilities that may be available. If you do find anything you may think is incorrect (in the text or answers) or want further help please contact us by email. Web: www.hull.ac.uk/studyadvice Email: studyadvice@hull.ac.uk Tel: 01482 466199 What Are Differential Equations? Any equation containing terms of the form dny is a differential equation. dx n The following are all differential equations of varying order and degree dy x y 2 0, dx Sometimes dy , dx d2y dx 2 2 y sin x 0, dx 2 d3y are written as y ' , dx3 xy , d2y Order: If the highest derivative appearing is If the highest is 2 d3y dy 3. dx dx y' ', y ' ' ' to save space! dy then the equation is of order 1. dx d2y then it is of order 2 etc. Not all such equations can be solved in dx 2 terms of the unknown, some have to be solved by numerical methods giving approximate results. Type 1 Exact If you are asked to solve the Differential Equation dy cos x 3x 2 you can integrate dx immediately giving y sin x x 3 A . In the same way the following second order Differential Equation can be solved directly by integration: d2y 2 integrating integrate again 3e 3x 4 x sin x dx dy e 3x 2 x 2 cos x A dx e 3x 2 x 3 y sin x Ax B 3 3 Note that integrating twice has introduced the 2 arbitrary constants A and B. dny f x then you can, in theory, integrate n times to dx n find the solution. This assumes that you can integrate at each step (remember that you cannot integrate every function algebraically). Your solution will contain n arbitrary constants. If you have a DE of the form Type 2 Variables Separable dy Equations of the form f x g y 0 can be solved by ‘separating the variables’ dx which means all the x -terms along with dx can be put on one side of the equation and all the y -terms along with dy can be put on the other side. page 1 Examples dydx xy 0 1 : Find the general solution of the equation x 2 1 This gives dy xy 2 dx x 1 Integrating dy x dx 2 y x 1 dy x dx y x2 1 ln y 1 ln x 2 1 A 2 and simplify, putting ln B A ln y ln x 2 1 ln B ln B x 2 1 y B x 2 1 is the general solution hence 2 : Solve the equation 4 x2 1 dy xy given y(1) 0 (ie y 0 when x 1) y 1 dx This can be written as Simplify and Integrate 4 x2 1 dx y y 1 dy x 1 2 4 x x dx y y dy y3 y2 2 x ln x A 3 2 2 ln1 0 0 A A 2 2 When x 1, y 0 y3 y2 2 x ln x 2 3 2 2 Solution Exercise 1 Solve the following dy 1. x y 2 dx dy 2. x x 2 1 dx 2 3. 2 xy 2 dy dx x 1 dy 6. e x y 1 dx dy x x dy 5. cos 2 x cos 2 y 2 dx y y dx dy y 1 dy 7. x y 8. ( x 1) y x , where y(1) 1 dx y 1 dx dy dy 9. tan x cot y where y(0) 10. sin x cos x cos x sin x dx dx 2 4. 11. Find the equation of the curve which has gradient function dy y 2 dx x 1 and passes through the point (2, -1). page 2 Type 3 Homogeneous Equations A homogeneous equation of the first order is one that can be written in the form dy y f . To test whether a function can be written in that form substitute y vx dx x and the function should reduce to one containing only v . For instance dy x3 y x 2 y 2 dx 4 xy3 x3 y becomes dy vx4 v 2 x 4 v v2 x4 v v2 . dx 4v3 x 4 vx4 4v3 v x 4 4v3 v The substitution y vx simplifies the function from two variables to one so it seems dy logical to try the same substitution for . This is another technique which may have dx come about by ‘trial and error’, but helps us in this case, to solve equations. Differentiating y vx (using product rule) gives dy d vx dv dx dv xv x v. dx dx dx dx dx So by substituting y vx the differential equation dv dy y f becomes x v f v dx dx x which can be solved by separating the variables. dy 4 y dx x dv 4vx dv x v 4v x 3v dx x dx dv 3dx v x Example 1 Solve the differential equation Putting y = vx this becomes Separating the variables gives Integrate ln v 3ln x c ln Ax3 where c ln A giving v Ax3 y Ax3 y Ax4 x 4 dy 4y 3 4 Ax Check y Ax which is where we started! 4 Ax dx x x 4 page 3 Example 2 : Solve the equation Substitute y vx dy y x y given y(1) 1 (ie y 1 when x 1). dx x y x dv vxx vx v1 v x 2 x v dx xvx x v 1x 2 dv v1 v v v 1 dx dv v1 v vv 1 2v x dx v 1 v 1 x separate variables 2 dx v 1 dv x v 1 v dv x 2 x 1 integrate 2 dx dx v ln v 2 ln x c put c ln A But y vx , hence or v 2 ln x ln v ln A ln Ax 2 v y y ln Ax 2 x x ln Axy y x ln Axy But y(1) 1; substituting in gives 1 ln A A e The solution can be written as y x ln exy or y x ln exy x ln e ln xy x(1 ln xy ) It is important to realise that there are often many different ways of writing the final solution. It depends on how it is to be used as to which is the most useful form. page 4 Example 3 : Solve the equation x dy y dx x2 y 2 dy dx this can be written as substitute y vx x dv v dx x2 y2 y x x 2 v 2 x 2 vx x x 1 v 2 vx x x simplify separate the variables 1 v2 v 1 v2 dx x x dx sin 1 v ln x c integrate put v dv v dx dv x dx dv 1 v2 dv 2 1 v sin 1 y and c ln A x y ln x c ln Ax x y x sinln Ax dy x y dx dy x y dx x dv x vx x v 1 v dx x dv x 1 dx dx dv x 1 v dx ln x A x v ln x ln B ln Bx Example 4: Solve the equation x Rearrange equation putting y vx gives simplify separate the variables integrate & put A ln B y put v x giving answer y ln Bx x y x ln Bx page 5 Exercise 2 Solve the following dy x 2 y 1. dx x 2. 3. 2 x 2 dy x2 y 2 dx dy dy 6. y x 2 y y x2 y 2 dx dx dy dy 7. x x 2 y 2 y y 2 x 2 8. x 3 xy 2 x2 y y3 dx dx 4. xy2 dy x3 y 3 dx dy x 2 y 2 dx xy 5. x Type 4 - Linear Equations dy P x y Q x . The method used to solve dx such equations depends, again, on noticing a particular pattern. A linear equation is one of the form If z ye f x then differentiating (using the product rule and the chain rule dz dy f x dy e yf ' x e f x e f x f ' x y dx dx dx When compared to the linear equation above, this suggests that if we can find an e f x to multiply both sides of the linear equation by then we’ll be able to integrate the left hand side immediately. Multiplying the linear equation dy P x y Q x by e f x gives dx dy e f x Px y e f x Qx dx dy comparing left hand side with e f x f ' x y (which can be integrated dx immediately) shows that we want to find f ( x ) where f ' x Px f x Px dx i.e. multiply the equation by e f x e Example 1 Solve the equation P x dx dy 3 y e2 x dx From above the Integrating Factor is e Multiplying through gives which is called the Integrating Factor. e 3 x 3dx e3x dy 3e 3 x y e 3 x e 2 x dx The left hand side is the differential of ye 3 x Check, using product rule, d ye 3 x dy 3 x e y 3e 3 x dx dx dy e 3 x 3e 3 x y dx page 6 From the original equation dy 3 y e2 x dx multiply through by e 3 x e 3 x dy 3e 3 x y e 3 x e 2 x dx d ye 3 x e x dx this can be written as ye 3 x e x dx integrating e x A y e 2 x Ae3 x or, multiplying through by e3 x dy 4 y sin x sin 2 x find y( x ) (ie y as a function of x ), dx (ie y 0 when x ). Example 2 Given 2 cos x given that y(0) 3 3 dy Px y Qx dx dy 2 sin x sin 2 x 2 sin x cos x y dx cos x 2 cos x 2 cos x dy 2 tan x y sin x dx 2 tan x dx The equation is linear, integrating factor e Divide through by 2cos x to write it in the form 2 tan xdx 2 ln sec x ln sec 2 x ln sec 2 x 2 tan x dx sec 2 x e hence integrating factor is e multiply by I. F. sec 2 x dy 2 sec 2 x tan x y sec 2 x sin x dx d y sec 2 x sin x sec 2 x sin x dx cos2 x y sec 2 x Integrate Multiply by cos2 x sin x cos 2 x dx 1 A cos x y cos x A cos 2 x But y 0 when x hence 0 cos A cos2 3 3 0 1 1 2 4 2 3 A A 2 Solution y( x) cos x 2 cos x page 7 Example 3 Solve the equation dy yx dx 1dx The I. F. is e e x giving e x dy ye x xe x dx d ye x xe x dx hence giving ye x xe x dx xe x e x dx Integrating the right side by parts xe x e x A giving y Ae x x 1 Exercise 3 Solve the following dy dy 1. y e x 2. xy 0 dx dx dy dy 4. x y x2 5. y x dx dx dy dy 8. x 2 y 7. y cot x cos x dx dx dy y tan x cos 2 x dx dy 11. 1 x 2 xy 1 dx 9. dy y 1 dx x x dy 6. 2y x dx 3. x3 dydx 2 xy x 10. x 2 1 12. dy 3 y e2 x dx Exercise 4 Miscellaneous Differential Equations Solve the following dx dy 1. tan t x 2. x y x 2 ln x dt dx dy dy 4 4. 3 x x 2 2 5. 2 x 8y dx dx x2 3. cos sin 6. 3 d2y dx 2 d dr 12 x 2 2 sin x dy xy ln x which satisfies dx the conditions x 1, y 1. Give ln y in terms of x . dy 8. Solve the differential equation x 2 y e x x 0 given that dx y 1 when x 1. dy 9. Find the solution of the differential equation y cot x sin x dx for which y 1 when x . 7. Find the solution of the differential equation page 8 dy x which satisfies the dx boundary condition y 2 when x 0 . Give y in terms of x . 10. Find the solution of the differential equation ye 2 x ANSWERS (note many of the answers can be put in slightly different forms, depending whether the constant is put as A or ln B or ln C etc.) Exercise 1 1. 3x 2 2 y 2 A 2. x 4 2 x 2 4 y A 4. 2 y 3 3 y 2 2 x 3 3x 2 A 5. tan y tan x A 6. e y e x A 7. ln x y 2 1 tan 1 y A 10. y lnsin x cos x A 9. sin x cos y 1 Exercise 2 1. x3 3x 2 y A 2. y 2 2 x 2 ln Ax 3. ln x 2 1 ln y A or y A x2 1 8. x ln x 1 ln y 11. y 2 x 1 3x 1 3. 2 x y xln Ax 1 x3 2 y3 4. ln x ln A or Bx 3 x 3 2 y 3 1 3 6 x y y 5. sin1 ln x A or sin1 ln Ax x x yx x x 6. ln ln Ax or ln y x A x yx yx 7. 2 x 2 ln Axy y 2 0 8. 2 y 2 ln xy x 2 Cy 2 page 9 Exercise 3 x2 1. ye x x A or y x Ae x 2. y Ae 2 3. xy x A or y 1 Ax1 4. y x 2 Ax 6. 4 y 2 x 1 Ae2 x 7. y 1 sin x A or 4 y sin x cos 2 x A 8. y x3 Ax2 9. 3 y cos x 3 sin x sin3 x A 1 sin x 2 5. y x 1 Ae x 10. 2 y x 2 1 x 2 A 11. y 1 x 2 sin1 x A 12. 5 ye 3x e 5x A Exercise 4 1. x B sin t 2. y x 2 ln x x 2 Ax 4. y 1 x 2 2 ln Ax 6 3 2 5. y 4 7. ln y 1 x 2 ln x 1 1 x 2 9. y sin x 1 x 1 sin 2 x 2 4 2 3. r ln sec c x2 A x 4 2 sin x 6. y Ax B 3 x4 8. y xe x e x 1 x2 10. y 2 1 9 e 2 x 2 xe 2 x 2 We would appreciate your comments on this worksheet, especially if you’ve found any errors, so that we can improve it for future use. Please contact the Maths tutor by email at studyadvice@hull.ac.uk updated 29th November 2004 The information in this leaflet can be made available in an alternative format on request. Telephone 01482 466199 © 2009 page 10