Chapter 7 Nonconstant Coefficients We return to second-order linear ODEs, but with nonconstant coefficients. That is, we consider (7.1) y + p(t)y + q(t)y = 0, with not both p(t) and q(t) constant. The theory developed in Chapter 3 still holds, and in particular Theorem 3.4 is still valid. Specifically, the general solution is still y(t) = c 1 y 1 + c 2 y 2 with y 1, y 2 independent solutions to (7.1) and c 1, c 2 arbitrary constants. Unfortunately, there is no method to find explicit formulas for y 1 and y 2. There are however some special cases. 7.1. Reduction of Order If somehow we are lucky enough to fine one solution to (7.1), then a method exists to find the other. The method is similar to the technique we employed in the repeated root section of Chapter 3.1.3, and in deriving the variation of parameters in Chapter 3.3. Suppose somehow we find y 1 solving (7.1). We try to find a second independent solution by modifying it; y 2 = u(t)y 1 (t). Substituting this back into (7.1), we find u y 1 + (2y 1 + py 1 )u = 0. Since u does not appear in the ODE, we may immediately integrate. Indeed, set z = u. Then z satisfies the first-order ODE (7.2) z + p(t) + 2 y 1 z = 0. y 1 In principle this can be solved explicitly using methods in Chapter 1.2. 73
74 7. Nonconstant Coefficients Example 7.1. Consider the second-order, linear, nonconstant coefficient ODE y 1 + x x y + 1 x y = 0 Note that y 1 = e x is a solution. To find another independent solution, we reduce the order. Here p(x) = (1 + x)/x. Equation (7.2) is The integrating factor is (Chapter 1.2) z + x 1 x z = 0. µ = e x 1 x dx = ex x. Thus (e x z/x) = 0. That is, u = z = cxe x or u = c(xe x + e x ), and y 2 = u(x)y 1 (x) = u(x)e x = 1 + x. The general solution is therefore y = c 1 e x + c 2 (1 + x). Homework 7.1 (Reduction of Order) Find the general solution. 1. t 2 y 4ty + 6y = 0, y 1 (t) = t 2 2. t 2 y + 3ty + y = 0, y 1 (t) = t 1 3. xy y + 4x 3 y = 0, y 1 (t) = sin t 2 4. xy (x + 1)y + y = 0, y 1 (t) = e x 5. x 2 y 2xy 4y = 0, y 1 (t) = 1/x Answers 1. y 2 = t 3 2. y 2 = t 1 ln t 3. y 2 = cos t 2 4. y 2 = x + 1 5. y 2 = x 4 7.2. Cauchy-Euler Equations The Cauchy-Euler equation is a special form of Equation (7.1). It is given by (7.3) x 2 y + axy + by = 0, where aand b are real numbers. Note that the powers of x match the number of derivatives. The may seem fortuitous, but the ODE arises in many physical settings including heat conduction and electrostatics. The form of the equation suggests y = x α may be a solution. Indeed, y = αx α 1 and y = α(α 1)x α 2. Putting these in (7.3), we find α(α 1) + aα + b = 0.
7.3. Series Solutions 75 Using the quadratic formula we can solve for α. If the roots, r 1, r 2 are real, the general solution is y = c 1 x r1 + c 2 x r2. If the roots are complex, λ ± iµ, then y = c 1 x λ x iµ + c 2 x λ x iµ = x λ c 1 e iµ ln x iµ ln + c 2 e x where C 1 = c 1 + c 2 and C 2 = i(c 1 c 2 ). = C 1 x λ cos(µ ln x) + C 2 x λ sin(µ ln x), Suppose the roots are repeated, r 1 = r 2 = r. Then we know one solution, y 1 = x r. To find the other solution we employ the method of the previous section. We find in this case y = c 1 x r + c 2 ln(x) x r. Homework 7.2 (Cauchy-Euler Equations) Find the (general) solution. 1. 2x 2 y + xy 3y = 0, y(1) = 1, y (1) = 4 2. 4x 2 y + 8xy + 17y = 0 3. x 2 y 3xy + 4y = 0, y( 1) = 2, y ( 1) = 3 4. By making the substitution x = e t show that (7.3) can be written y + (a 1)y + by = 0, where differentiation is now with respect to t. Note the coefficients are now constant. 1. y = 2x 3/2 x 1 Answers 2. y = c 1 x 1/2 cos(2 ln x) + c 2 x 1/2 sin(2 ln x) 3. y = 2x 2 7x 2 ln x 7.3. Series Solutions There is a general method of finding solutions to (7.1). Let us suppose that the solution to (7.1) is analytic. That is, we suppose the solution y has a Taylor series which converges on an interval. Specifically, we suppose (7.4) y(x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + + a n x n + = a n x n, on some interval containing the origin, or more generally y(x) = a 0 + a 1 (x x 0 ) + a 2 (x x 0 ) 2 + a 3 (x x 0 ) 3 + + a n (x x 0 ) n + = a n (x x 0 ) n,
76 7. Nonconstant Coefficients on some interval containing x 0. We suppose p(x) and q(x) are analytic as well. Familiar examples might include e x = 1 + x + x2 2! + x3 3! + = X sin x = x x3 3! + x5 5! + = X cos x = 1 x2 2! + x4 4! + = X x n n! ( 1) n (2n + 1)! n x 2n+1 ( 1) n 1 n x 2n. (2n)! The idea is to put (7.4) into the ODE and find the coefficients. To do so we will need some shifting formulas. One can easily verify the following. y(x) = a n x n, (7.5) y (x) = y (x) = = na n x n 1 = (n + 1)a n+1 x n, n=2 n(n 1)a n x n 2 = (n + 1)na n+1 x n 1, (n + 2)(n + 1)a n+2 x n. Example 7.2. Find the general solution to y + y = 0. Solution. We just have to compute the a n in (7.4). Using the formula (7.5), we get (n)(n 1)a n x n 2 + a n x n = (n + 2)(n + 1)a n+2 + a n x n = 0. n=2 The polynomials on either side of the equation must balance. So, (n + 2)(n + 1)a n+2 + a n = 0 for n = 0, 1, 2,.... This last equation is called an Recurrence Relation. We may write it as a n a n+2 = (n + 2)(n + 1). We can use it to find the coefficients in (7.4). It would also be easy to use in computations. If we know a 0, then the recurrence relation provides us with a 0, a 2, a 4... and knowledge of a 1 gives us a 1, a 3, a 5,.... In particular, if we set a 0 = c 1, then a 0 = c 1 a 2 = a 0 (0 + 2)(0 + 1) = c 1 2 a 4 = a 2 (2 + 2)(2 + 1) = 1 4 3 a 2 = c 1 4!.
7.3. Series Solutions 77 In general, we have Similarly, if we set a 1 = c 2, we find In general, we find a 2n = ( 1) n c 1 (2n)!. a 1 = c 2 a 3 = a 1 (1 + 2)(1 + 1) = c 1 3 2 a 5 = a 3 (3 + 2)(3 + 1) = 1 5 4 a 3 = c 1 5!. a 2n+1 = ( 1) n c 1 (2n + 1)!. Thus the general solution is y(x) = c 1 1 x2 2! + x4 4! + + c 2 x x3 3! + x5 5! + = c 1 cos x + c 2 sin x as expected. Example 7.3. Find the series solution to Airy s equation y xy = 0, y(0) = 1, y (0) = 1. Solution. Again we put (7.4) into the ode. We find n(n 1)a n x n 2 x a n x n = 0 or That is, n=2 (n + 2)(n + 1)a n+2 x n a n 1 x n = 0. 2a 2 + We see a 2 = 0, and the recurrence relation is (n + 2)(n + 1)a n+2 a n 1 x n = 0. (n + 2)(n + 1)a n+2 a n 1 = 0 n 1. Knowledge of a 0, provides a 3, a 6, a 9..., and knowledge of a 1 gives us a 4, a 7, a 10.... Thus, a 0 = a 0 a 0 a 3 = (1 + 2)(1 + 1) = a 0 3 2 a 6 = a 9 = a 3 (4 + 2)(4 + 1) = a 0 2 3 5 6 a 6 (7 + 2)(7 + 1) = a 0 2 3 5 6 8 9
78 7. Nonconstant Coefficients and a 1 = a 1 a 1 a 4 = (2 + 2)(2 + 1) = a 0 4 3 a 7 = a 10 = a 4 (5 + 2)(5 + 1) = a 0 3 4 6 7 a 7 (8 + 2)(8 + 1) = a 0 3 4 6 7 9 10 and the general solution is y = a 0 y 1 + a 1 y 2. That is, y(x) = a 0 1 + x3 2 3 + x 6 2 3 5 6 + x 9 2 3 5 6 8 9 + +a 1 x + x4 3 4 + x 7 3 4 6 7 + x 10 3 4 6 7 9 10 + 2 1 Y 0-1 5 n=30 n=45 n=60 n=75 n=90-2 -10-8 -6-4 -2 0 2 X Figure 1. Polynomial approximations of the solution y 1 in Airy s Equation. Example 7.4. Find the solution to n=2 y + xy + y = 0, y(0) = 1, y (0) = 0. We put (7.4) back into the ode and find n(n 1)a n x n 2 + x na n x n 1 + a n x n = 0 or That is, (n + 2)(n + 1)a n+2 x n + na n x n + a n x n = 0. (n + 2)(n + 1)a n+2 + na n + a n x n = 0,
7.3. Series Solutions 79 and the recurrence relation is (n + 2)(n + 1)a n+2 + (n + 1)a n = 0 or a n+2 = a n n + 2. Knowledge of a 0 reveals a 2, a 4,..., and knowledge of a 1 gives us a 3, a 5,.... and a 0 = a 0 a 2 = a 0 (0 + 2) = a 0 2 a 4 = a 2 2 + 2 = a 0 2 4 a 6 = a 4 4 + 2 = a 0 2 4 6 a 1 = a 1 a 3 = a 1 1 + 2 = a 1 3 a 5 = a 3 3 + 2 = a 1 3 5 a 7 = a 5 5 + 2 = a 1 3 5 7. The general solution is y(x) = a 0 1 x2 2 + x4 2 4 x6 2 4 6 + +a 1 x x3 3 + x5 3 5 x7 3 5 7 + X ( 1) n = a 0 2 n n! x2n + a 1 ( 1) n 2 n n! (2n + 1)! x2n+1.
80 7. Nonconstant Coefficients Homework 7.3 (Power Series) Find the recurrence relation on the first four terms in each of two solutions y 1 and y 2 (unless the series truncates sooner). 1. y y = 0 2. y xy y = 0 3. (1 x)y + y = 0 4. (1 + x 2 )y 4xy + 6y = 0 Partial Answers 1. a n+2 = a n /(n + 2)(n + 1) 2. a n+2 = a n /(n + 2) 3. (n + 2)(n + 1)a n+2 n(n + 1)a n+1 + a n = 0 for n 1; a 2 = 1 2 a 0 4. y 1 = 1 3x 2, y 2 = x x 3 /3.
Index asymptotically stable, 76 backward Euler, 12 Center, 59 Characteristic Polynomial, 20 Complex roots, 21 Convolution, 50 critical point, 75 Critically Damped, 32 second order linear ODE, 17 stable critical point, 76 trajectory, 75 unstable critical point, 76 Wronskian, 30 Delta function, 47 Eigenvalues, 55 Eigenvectors, 55 Euler Formula, 21 exponential order, 37 exponentially bounded, 37 Focus, 59 forward Euler, 10 Heaviside function, 42 improved Euler, 14 integrating factor, 4 Jacobian, 76 Laplace transform, 37 linear, 17 ODE, 1 Over Damped, 31 Partial Differential Equation, 1 Phase Portrait, 56 piecewise continuous, 37 piecewise smooth, 37 Real distinct roots, 20 Recurrence Relation, 84 Repeated roots, 23 Saddle, 56 81