Simple second order ordinary differential equations Many differential equations we find in nature are second order equations. In this help sheet we will demonstrate how the simplest form of the second order differential can be solved, before outlining the standard procedure for solving such an equation. It is easy to see why second order differential equations appear in engineering and physics as the questions are often about how objects move when forces act. As force directly relates to acceleration and acceleration is the second derivative of displacement, a second order differential equation is needed to relate force and position. It is surprising to find that these equations have properties which make them useful in a far wider range of disciplines. As integration is the opposite of differentiation, it would seem reasonable that we would have to integrate twice to solve this sort of equation. Every time we integrate we must add in a constant of integration. Therefore we expect there to be two arbitrary constants in our general solution to the equation. Indeed, in many physical systems we find that once we have described how the object moves under the action of the forces we are still free to choose a starting position and velocity for the object. However, as we shall see, we manage to form a solution without ever seeming to perform an integration. Despite this, it is still necessary to maintain two arbitrary constants in the general solution to allow us to solve for the initial or boundary conditions given1. Solving a second order differential equation The simplest second order differential equation we come across is of the form: d2y dy a 2 b cy 0 dx dx where a, b and c are numbers. To solve this we start by assuming that the solution is y e mx . At this point this is just a guess but it will turn out to be a good one. Assuming the solution is of this form, we can substitute it into the above equation and find: am 2e mx bmemx ce mx 0 where the m 2 and m have appeared because every time we take a derivative of e mx we drop down a multiple of m . As every term is multiplied by e mx we can divide everywhere by e mx , leaving us with: 1 The distinction between initial conditions and boundary conditions is one of semantics; initial conditions are given when the problem is given in terms of time (t) and boundary conditions are given when the problem is given in terms of space (x). am 2 bm c 0 which is known as the auxiliary equation. In a question we would be given the values of a, b and c and we could attempt to solve this quadratic by factoring it. If we can’t find a simple factorisation it is always possible to use the quadratic formula to solve for values of m : m1, 2 b b 2 4ac 2a where m1 is given by calculating the formula with a plus and m2 is given by calculating with a minus. Once we have solved this quadratic we will find ourselves in one of three possible positions: 1) Distinct real roots As long as b 2 4ac is a positive number the auxiliary equation will yield two real numbers m1 and m2 . We can multiply both of these solutions by an arbitrary constant and add them together, leading to a general solution: y Aem1x Be m2 x . If we have been supplied with boundary conditions we can solve for A and B to give a particular solution. 2) Repeated real roots If b 2 4ac is zero then m1 will be the same as m2 , i.e. m1 m2 , so we may as well drop the subscript and call the single solution to the auxiliary equation simply m . However, as this is a second order problem we will have two boundary conditions, so we still require two constants in our solution. To make the two general solutions different we multiply one by x and form a solution of the form: y A Bx emx 3) Imaginary roots If b 2 4ac is negative then the only way to solve the quadratic is with imaginary numbers. The two roots will be complex conjugates of each other, that is, both solutions have the same numbers in their real and imaginary parts but one will have a positive imaginary part and the other a minus: m1 i , m2 i . Here and are just numbers once again; we have used Greek letters to avoid confusion with the a and b used in the differential equation. This allows us to form the solution as: y ex A cosx B sin x It is very important to notice that the real part is used only in the exponential and the imaginary part is used only in the sin and cos parts. Also notice that we have dropped the plus and minus. Steps for solving We summarize the steps to solving a simple second order equation below: d2y dy a 2 b cy 0 Starting from: dx dx 2 am bm c 0 Form the auxiliary equation: b b 2 4ac 2a Then form the solution according to the following possibilities: Solve the auxiliary equation: m1, 2 Solutions to the auxiliary equation Two real distinct roots m1, m2 Real repeated roots m Complex roots i Form of general solution y C1em1x C2em2 x y C1 C2 x emx y ex C1 cosx C2 sin x Finally, solve for constants if you have been given initial conditions. Worked examples: Example 1 Find the general solution to the differential equation: d2y dy 2 3y 0 2 dx dx and also the particular solution given initial conditions y0 0 and y' 0 1 . Solution First we form the auxiliary equation: m 2 2m 3 0. In this instance it is simple to see that this can be factorised with ease giving: m 3m 1 0, so we can read off the solutions m1 3 and m2 1 . As we have two distinct real roots we can say that the general solution is simply: yx Ae3 x Be x . As we have been given initial conditions we can also find the particular values of A and B. The first initial condition tells us that y 0 when x 0 ; substituting these values into our general solution we get: 0 Ae30 Be 0 A B 0 (as e 0 1 ) The second initial condition tell us that the differential of y is 1 when x is 0. The differential of the general solution is: y' x 3 Ae3 x Be x , substituting in the initial conditions we get: 1 3A B. We can now solve these two equations simultaneously (see the simultaneous equation help sheet and videos) to find: A 1 1 ,B 4 4 Thus the particular solution is: yx 1 3x 1 x e e 4 4 Example 2 Find the general solution to the equation: 4 y ' '4 y ' y 0 and then find the particular solution that solves the boundary conditions y0 0, y2 e . Solution First notice that the question has been given to us using dash notation; this question is the same as: d2y dy 4 4 y 0 dx dx Therefore we have the auxiliary equation: 4m 2 4m 1 0 which isn’t obviously factorisable so we can use the quadratic formula: m1, 2 4 42 4 4 1 24 we can see that 4 4 4 1 0 , therefore we only get one value for m which is m 1 2 . As we have a repeated root we can form the general solution: 2 x 2 yx A Bx e . Using the first boundary condition we find that: 0 2 y0 A B 0e A 0 i.e. we have found that A 0 . From the second boundary condition we find: 2 y 2 2 Be 2 e Dividing both sides by e we find: 2 B 1 B 1 2 Leaving us with the particular solution: x y 1 2 xe 2 Example 3 Find the general solution to the equation: 2 y ' '6 y '5 y 0 and then find the particular solution for the initial conditions y0 1 and 1 y ' 0 . 2 Solution 3 We find the auxiliary equation to be: 2m 2 6m 5 0 and once again a simple factorisation does not seem possible, so we use the quadratic formula: 6 62 4 2 5 . 22 The first thing to notice is that 6 2 4 2 5 4 , so if we type this into a calculator we will get an error. This means that the solutions are complex numbers: m1, 2 3 1 m1, 2 i . 2 2 This time we have complex roots with real part 3 and the imaginary part 2 1 . Notice that we ignore the sign when reading off the second part. Looking 2 back at the table we can form the general solution: yx e 3 x 2 x x A cos B sin . 2 2 To use the initial conditions to solve for the particular solution we will also need the differential of the general solution: 3 x x x x A x B x y ' x e 2 A cos B sin e 2 sin cos 2 2 2 2 2 2 2 3 3 Note that we had to use the product rule. From the first initial condition, y0 1 , we find: y0 e0 A cos0 B sin 0 A 1 1 i.e. A 1 . From the second initial condition, y ' 0 , we find: 2 3 B 3 B 1 1 y ' 0 e 0 1 cos0 B sin 0 e 0 sin 0 cos0 . 2 2 2 2 2 2 We can now solve this giving B 2 , therefore the particular solution is: yx e 3 x 2 x x cos 2 sin . 2 2 Example 4 Find the general solution to the equation: d2y dy 3 0 2 dx dx Solution 4 This equation looks a little different as it is missing a y term, but we can solve it in the same way. First we form the auxiliary equation: m2 3m 0, which factorises to: mm 3 0 thus the solutions are m1 0 and m2 3 . It is common for people to ignore or forget to include the m1 0 in the general solution. The correct general solution is: yx Ae0x Be 3 x or simply: yx A Be 3x . Example 5 Find the general solution to the equation: d 2 y dy 2y 0 dx 2 dx with the boundary conditions y0 1 and y 0 . Solution 5 Solving the differential equation should be fairly easy in this case. The auxiliary equation is: m2 m 2 0 which is factorised into: m 1m 2 0 and therefore the general solution is: yx Ae x Be 2 x . Now we have to think about the boundary conditions we have been given. The second condition imposes that as x gets very large y must approach zero. Looking at the two terms in the general solution it is clear that the first one, Ae x , simply gets larger and larger as x increases so we cannot include this in the particular solution. Therefore we are forced to take A 0 . The second term, Be 2 x , does indeed get smaller as x increases, therefore we can use the first boundary term to find B : y0 Be 0 B 1, Giving the particular solution: yx e 2 x .