ENGI 344 - Second Order Linear ODEs age -01. Second Order Linear Ordinary Differential Equations The general second order linear ordinary differential equation is of the form d y dy x Q x y Rx dx dx Of the second (and higher) order ordinary differential equations, the linear equations with constant coefficients will command most of our attention in this chapter: d y dx dy Q y R x dx Contents:.1 Complementary Function. articular Solution (Variation of arameters).3 articular Solution (Undetermined Coefficients).4 Higher Order Linear Ordinary Differential Equations.5. Numerical Methods
ENGI 344.1 Complementary Function age -0.1 Complementary Function The homogeneous equation associated with the ODE d y dx dy dx Q y d y dx 0 dy Q y Rx is dx The principle of superposition of solutions of the homogeneous equation is valid because it is linear. That is, if y = u(x) and y = v(x) are both solutions of the homogeneous ODE, then so also is any linear combination of these functions: y = c 1 u(x) + c v(x), where c 1 and c are any constants. Adding any solution of the homogeneous ODE to a particular solution of the original ODE generates another solution of the original ODE. Thus the general solution (abbreviated as G.S.) of d y dy dx dx Q y Rx can be partitioned into two parts: the complementary function (C.F., which is the general solution of the associated homogeneous ODE) and a particular solution (.S.). If y e x then Substituting y e x into the homogeneous ODE: from which the auxiliary equation (A.E.) follows: + + Q = 0 [The choice of y e x as a trial solution to the homogeneous ODE is justified later, on page -09, when a more general method for finding the complementary function is introduced.]
ENGI 344.1 Complementary Function age -03 The solution of the auxiliary equation + + Q = 0 is Distinct roots ( 1 ) the complementary function is [The case of equal roots will be dealt with later, on page.08.] Example.1.1 Solve the differential equation The auxiliary equation is y" + 3y' 4y = 0 The complementary function (which is also the general solution) is Checking the solution:
ENGI 344.1 Complementary Function age -04 Example.1. Solve y" y' + y = 0 In general, when the roots of the auxiliary equation are a complex conjugate pair of values, = a ± bj, then the complementary function is C ax jbx jbx ax cos sin y x e c e c e e c bx c bx 1 3 4 (where the arbitrary constants are related by c3 c1 c and c j c c ) 4 1 or y C (x) = A e ax cos(bx ) c c where A c c, cos and sin or y C (x) = A e ax sin(bx ) c3 c4 where A c3 c4, sin and cos c c c c 3 4 3 4 c3 c4 c3 c4 3 4 3 4 Note that, for an auxiliary equation of this type, with real coefficients, where the solution is constrained to be real, the arbitrary constants c 3 and c 4 are both real, but c 1 and c often are not. For this reason, the forms involving the trigonometric functions are usually preferred to the complex exponential form.
ENGI 344.1 Complementary Function age -05 Example.1.3 A spring, that is not at its natural length, experiences a restoring force R that is proportional to the extension s beyond the natural length and is directed towards the equilibrium position. In the absence of friction, this would lead to undamped simple harmonic motion. Let us suppose that there is also a friction force D that is proportional to the speed and acts in the opposite direction to the velocity. Restoring force proportional to displacement Friction (drag) proportional to speed Newton s second law of motion: Therefore the ODE governing the motion of the spring is
ENGI 344.1 Complementary Function age -06 Example.1.3 (continued) Suppose that m = 1 kg, b = 6 kg s 1, c = 5 kg s and that the spring begins at its equilibrium position, but moving at m s 1 to the right, so that s(0) = 0 and v(0) =, then the ODE becomes Note that if b = 0 (no friction at all), then the system is totally undamped and exhibits simple harmonic motion: s(t) = A sin (kt ) where k c m.
ENGI 344.1 Complementary Function age -07 The General Spring roblem Case 1: b c 4 m m d s b ds c s 0 dt m dt m λ = Case : λ = b c 4 m m or or Case 3: b c 4 m m λ =
ENGI 344.1 Complementary Function age -08 Complementary Function when the Auxiliary Equation has Equal Roots 1 the ODE becomes y" λ y' + λ y = 0 One solution to this equation is y C1 e x We require another solution that is independent of this one (so that there will be two distinct arbitrary constants of integration in the complementary function). Try f x C xe x [This second form arises naturally from the operator method, on page.09.] Then f '(x) = and f "(x) = Example.1.4 Solve y" 6y' + 9y = 0
ENGI 344.1 Complementary Function age -09 The Operator Method The homogeneous ordinary differential equation with constant coefficients, d y dy Q y 0 dx dx can also be written, using differential operators, in the form d d k1 k y 0 dx dx Justification: The second order ODE can therefore be re-written as a linked pair of first order linear ordinary differential equations [the method of reduction of order, section 1.4]: d k1 dx 0, (A) where dy k y. dx (B) Solution:
ENGI 344.1 Complementary Function age -10 Operator Method (continued)
ENGI 344.1 Complementary Function age -11 Operator Method (continued) Summary for the Complementary Function: ODE: y" + y' + Q y = 0 A.E.: λ + λ + Q = 0 λ real and distinct y A e B e C 1x x λ real and equal y Ax B e x C λ complex conjugate pair ax yc e C cos bx D sin bx, where a Re, b Im
ENGI 344. Variation of arameters age -1. articular Solution (Variation of arameters) The method of variation of parameters is a general method for finding the particular solution of a linear ODE. If the complementary function for the ODE d y dy dx dx y x C y x C y x Q y Rx is, (so that, C 1 1 1 solutions to the homogeneous ODE), then the particular solution is y x y x is a basis for the space of all y x u x y x v x y x, 1 where the functions u(x) and v(x) need to be determined. We need two constraints in order to pin down the functional forms of u(x) and v(x). u x y x v x y x be a particular solution of the An obvious constraint is that 1 ODE. We have considerable freedom as to what the other constraint will be. y u y v y 1 Impose our free constraint,
ENGI 344. Variation of arameters age -13 Define the Wronskian function W(x) to be W y, x det y1 y y 1 y 1 y together with the associated determinants 0 y y1 0 W1 det yr and W det y1r R y y 1 R then Cramer s rule yields solutions for u' and v' : W1 W u and v. W W Therefore a particular solution is y u y1 v y, where W x W x y x R x y x R x 1 u x dx, v x dx, W x y y y 1 y 1 Note that we can ignore the arbitrary constants of integration in both integrals, because Ay 1 and By are both solutions of the homogeneous ODE and can therefore be absorbed into the complementary function. Example..1 Find the general solution of the ODE x y y 3y x e.
ENGI 344. Variation of arameters age -14 Example..1 (continued) articular Solution by Variation of arameters:
ENGI 344. Variation of arameters age -15 Example..1 (continued)
ENGI 344. Variation of arameters age -16 Example.. Find the general solution of: y" + y = tan x
ENGI 344. Variation of arameters age -17 Example.. (continued)
ENGI 344. Variation of arameters age -18 Example..3 Use the variation of parameters method to find the particular solution, then find the complete solution of the initial value problem y" y' + y = e x, y(0) = 0, y'(0) = 1
ENGI 344. Variation of arameters age -19 Example..3 (continued) Note that a complete solution requires additional information (often in the form of initial conditions). Two pieces of information are needed in order to evaluate both arbitrary constants of integration. However, do not substitute these conditions into the complementary function; wait until the general solution has been obtained.
ENGI 344. Variation of arameters age -0 The method of variation of parameters may also be used to find the particular solution of a linear second order ODE whose coefficients are not constant. However, general methods for finding the complementary functions in these cases are beyond the scope of this course. Example..4 Verify that the complementary function for the ODE d y dy x 5x 8 y 3x dx dx 4 is yc Ax B x and hence find the general solution of the ODE. 4 yc Ax B x y C The particular solution is y x u x y x v x y x where y x and y x 4 1 1
ENGI 344. Variation of arameters age -1 Example..4 (continued) [This example appeared in the journal note A seldom used formula for ODEs, George, G.H., Mathematical Gazette, vol. 9, #54, pp. 344-348]
ENGI 344.3 Undetermined Coefficients age -.3 articular Solution (Undetermined Coefficients) The general solution to d y dy Q y Rx dx dx is the sum of the complementary function and any one solution (the particular solution) that we can find to the original inhomogeneous ODE. The method of variation of parameters to find the particular solution is powerful, but it can involve an unnecessary level of effort. In some cases, an alternative method (undetermined coefficients) is available that is often faster to use. If the function R(x) does not contain any part of the complementary function, then assume that the particular solution y (x) is of the same form as R(x). Example.3.1 (same as Example..1) Find the general solution of the ODE x y y 3y x e. A.E.: C.F.:.S.: R(x) contains neither 3x e nor x e. R x is the sum of a quadratic function and x e. Therefore try the sum of a quadratic function and a multiple of where all four coefficients are to be determined. x e,
ENGI 344.3 Undetermined Coefficients age -3 Example.3.1 (continued) x y ax bx c d e Matching coefficients: G.S.: yx y x y x Therefore C
ENGI 344.3 Undetermined Coefficients age -4 General Method: d y dx dy dx Q y Rx If the function R x does not contain any part of the complementary function, then y x is of the same form as R x. assume that the particular solution kx If Rx e If then try, y ce kx, with c to be determined. R x = (a polynomial of degree n), then try y = (a polynomial of degree n), with all (n + 1) coefficients to be determined. If R(x) = (a multiple of cos kx and/or sin kx), then try y ccos k x d sin k x, with c and d to be determined. This method can be extended to cases where R x = (a sum and/or product of the functions above). But: if part (or all) of y is included in the complementary function y C, then multiply y by x and try again. As seen above in Example.3.1, the method of undetermined coefficients can be used in Example..1 x. It can also be used in Example..3 Rx R x x e However, in Example.., Rx tan x e. x, which does not fall into any of these categories. The method of undetermined coefficients cannot be used in this case to find y cos x ln sec x tan x ). the particular solution (which was
ENGI 344.3 Undetermined Coefficients age -5 Example.3. Consider a model of the simple series RLC circuit, where the constants R, L, C are the resistance, inductance and capacitance respectively, E(t) is the applied electromotive force, t is the time and it is the resulting current. Examine the voltage drops around the circuit: R : L : dq C : and note that i. dt
ENGI 344.3 Undetermined Coefficients age -6 Example.3. (continued) articular solution If E(t) = E o (constant), then Suppose that the e.m.f. is sinusoidal, so that E(t) = E o sin ωt, then 1 de Eocos t L dt L.S.: Try i asint bcost i b sint a cost i a sint b cost R 1 i i i L LC br a ar b L LC L LC Eo 0 sint cost L a sint b cost b R a a L LC RC a b 1 LC ar a 1 Eo 1 LC L RC LC L ar RC C a1 LC Eo RC LC RC LC L a Eo RC LC EoC RC L RC 1 LC RC 1 LC LC EoC RC EoC 1 LC 1 1 1 b RC RC LC RC LC
ENGI 344.3 Undetermined Coefficients age -7 Example.3. (continued) Therefore the particular solution is i o RC 1 LC E C RC sint 1 LC cost which is a steady-state sinusoidal response to the sinusoidal electromotive force, but with RC a phase difference of arccos RC 1 LC. The total current is then Rt sin 1 cos L D D E C RC t LC t it e A sin t B cos t L L RC 1 LC transient steady state As a specific example, if E(t) = 17 sin t, R = 10 Ω, C = 1 mf and L = 10 H, then it can be shown that t sin 8 cos8 sin 4cos 6 1 i t e A t B t t t 10 6t The transient current, i t e A sin 8t B cos8t C, dies away very quickly. Its magnitude falls to under 1% of the total current permanently in less than a second. The values of the two arbitrary constants can be found from the initial conditions, but, given that the complementary function becomes negligible in a very short time, one often does not try to evaluate them. Example.3.3 Find the complete solution of the initial value problem x y y y e, y 0 y 0 1
ENGI 344.3 Undetermined Coefficients age -8 Example.3.3 (continued)
ENGI 344.4 - Higher Order ODEs age -9.4 Higher Order Linear Ordinary Differential Equations The n th order ordinary differential equation n n1 n d y d y d y d y dy a a an an an y n 1 n 1 n 1 dx dx dx dx dx (where the coefficients a are all constant) can be solved as follows. i Form the auxiliary equation n n 1 n a a a a 1 a Find all n values for. 1 n n1 n 0 Rx Form the complementary function e, e,, e 1x x nx y C, which will be a linear combination of (except for repeated roots). Complex conjugate pairs can be re-written in terms of sine and cosine functions. Find a particular solution y (by inspection, undetermined coefficients, or variation of parameters, as extended to this higher order equation). Write down the general solution y yc y. n initial and/or boundary conditions will be needed at this stage to evaluate all of the n arbitrary constants of integration. Example.4.1 Find the general solution of 5 4 3 d y d y d y d y dy 3 4 4 5 4 3 dx dx dx dx dx 8x Auxiliary equation: 5 4 3 3 4 4 0
ENGI 344.4 - Higher Order ODEs age -30 Example.4.1 (continued)
ENGI 344.4 - Higher Order ODEs age -31 Example.4. A thin uniform beam of length L experiences a transverse deflection y(x) at location x (0 < x < L) due to a transverse force per unit length W(x). From the elementary theory of beams, the governing differential equation is EI 4 d y dx 4 W x where EI is the flexural rigidity of the beam, E is Young s modulus and I is the moment of inertia of the beam about its central axis. If the beam has uniform elastic properties and a uniform cross section along its length, then its flexural rigidity EI is constant. The initial conditions are: y 0 a the deflection at x = 0, 0 b 0 0 y the slope at x = 0, EI y c the bending moment at x = 0 and EI y d the shear at x = 0. Find the deflection for a cantilever beam with uniform load W(x) = W (constant). For a cantilever beam, the deflection and slope are zero at the fixed end (x = 0), while the bending moment and the shear are zero at the free end (x = L ).
ENGI 344.4 - Higher Order ODEs age -3 Example.4. (continued)
ENGI 344.5 - Numerical Methods age -33.5. Numerical Methods [not examinable] An initial value problem with an nth order ordinary differential equation can be re-written as a linked set of n first order initial value problems. Where analytical solutions are difficult or impossible, extensions of numerical methods, such as the Euler and RK4 methods, can be applied to obtain approximate solutions to these initial value problems at particular values of the independent variable. A more general case for initial value problems involving second order ODEs, d y dy x, y Qx, y y Rx, y0 a, y0 b, dx dx transforms into the linked pair of first order initial value problems dy z, y 0 a dx and dz R x Q x, y y x, y z, z 0 b dx This pair of problems can be solved sequentially (as in the operator method on pages.09, 0 x, y f x. Otherwise analytical to.11) if the coefficients Qx y and solutions are mostly beyond the scope of this course. Symbolic algebra software, such as Maple, may be able to provide exact solutions or numerical approximations. Example.5.1 Use software to estimate the value of y(0.5) given that d y dy y y sin x, y 0 0, y0 1. dx dx Using Maple software, the commands > with(detools): > DEplot(diff(y(x),x$)+y(x)*y(x)*diff(y(x),x)+y(x)-sin(x),y(x), x=-3..1, [[y(0)=0,d(y)(0)=1]], y=-6..3, stepsize=.05, linecolour=[blue]); produce the plot
ENGI 344.5 - Numerical Methods age -34 Example.5.1 (continued) which does not resemble any standard function. Zooming in (to x=0..0.5, y=0..0.5 and enhancing slightly), we can see that our estimate is y 0.5 0.495 The Maple worksheet is on the course web site, at "www.engr.mun.ca/~ggeorge/344/ demos/ex51.mws" The further sequence of Maple commands > ode1 := diff(y(x),x$)+y(x)*y(x)*diff(y(x),x)+y(x)-sin(x); > ic1 := y(0) = 0, D(y)(0) = 1; > dsol1 := dsolve({ode1, ic1}, numeric, range=0..1); > dsol1(0.5); produces y(0.5) =.494 671...
ENGI 344.5 - Numerical Methods age -35 Example.5. Find the general solution of the ordinary differential equation d y dy x 6x 1y 4 dx dx and find the complete solution given the additional information y y 1, 1 1. This is an example of a dimensionally homogeneous ODE (also known as a Cauchyt Euler ODE). A change of variables x e will convert the ODE into a form with constant coefficients, which can be solved exactly using the methods in the earlier sections of this chapter. The sequence of Maple commands > with(detools): > ode1 := x^*diff(y(x),x$) - 6*x*diff(y(x),x) + 1*y(x) - 4; > ic1 := y(1) =, D(y)(1) = 1; > dsolve(ode1); produces the general solution y(x) = x^3 _C + x^4 _C1 + The additional command > dsolve({ode1, ic1}); produces the complete solution y(x) = x^3 + x^4 + The Maple worksheet is available at "www.engr.mun.ca/~ggeorge/344/demos/ex5.mws" One can easily verify that this complete solution is correct:
ENGI 344.5 - Numerical Methods age -36 Example.5. (continued) The exact solution (not examinable except possibly as a bonus question) is obtained as follows: t dx t Let x e e x dt dy dy dt dy dx t dy 1 dy dy dy By the chain rule, e x dx dt dx dt dt dt x dt dx dt d y d dy d dy dx 1 d t dy 1 t d y t dy e e e dx dx dx dt dx dt x dt dt x dt dt 1 d y dy d y d y dy x x dt dt dx dt dt d y dy Any Cauchy-Euler ODE of the type x bx cy r x, dx dx (where b and c are constants) therefore transforms into the ODE d y dy dy d y dy b cy r x b 1 cy r x dt dt dt dt dt In this case, b = 6, c = 1 and r(x) = 4. d y dy The equivalent ODE is 7 1y 4 dt dt 7 1 0 3 4 0 3, 4 A.E.: 3t 4t t t C.F.:.S.: C 3 4 C 3 4 y t Ae Be A e B e y x Ax Bx r x is a constant. Therefore try y x c y x y x 0 0 1c 4 c y x Substituting into the ODE: 3 4 Therefore the general solution is yx Ax Bx Applying the conditions y1, y1 1 4 3 The complete solution is therefore yx x x 0 0 quickly leads to A 1, B 1..
ENGI 344.5 - Numerical Methods age -37 Example.5.3 (same as Example 5.11.) Find the general solution (as a power series about x = 0) to the ordinary differential equation d y xy 0 dx The sequence of Maple commands > with(detools): > ode := diff(y(x),x$) + x*x*y(x); > dsolve(ode); produces the exact general solution 1 x 1 x yx _ C1 x BesselJ, _ C x BesselY, 4 4 where the Bessel functions J x and Y x are beyond the scope of this course. Converting the exact solution into a power series, > Order := 15; > dsolve(ode, y(x), series); produces 1 1 1 1 yx y0 D y0 x y0 x D y0 x y0 x D y0 x 1 0 67 1440 1 1 1 y 0 x D y0 x 13 Ox 15 88704 4640 Letting A y 0 B y 0 this solution can be re-written as and 1 4 1 8 1 1 yx A1 x x x 1 67 88704 1 5 1 9 1 13 Bx x x x 0 1440 4640 4 5 8 9
ENGI 344.5 - Numerical Methods age -38 [Space for Additional Notes] END OF CHATER