First Orer Differential Equations 19.2 Introuction Separation of variables is a technique commonly use to solve first orer orinary ifferential equations. It is so-calle because we rearrange the equation to be solve such that all terms involving the epenent variable appear on one sie of the equation, an all terms involving the inepenent variable appear on the other. Integration completes the solution. Not all first orer equations can be rearrange in this way so this technique is not always appropriate. Further, it is not always possible to perform the integration even if the variables are separable. In this Section you will learn how to ecie whether the metho is appropriate, an how to apply it in such cases. An exact first orer ifferential equation is one which can be solve by simply integrating both sies. Only very few first orer ifferential equations are exact. You will learn how to recognise these an solve them. Some others may be converte simply to exact equations an that is also consiere Whilst exact ifferential equations are few an far between an important class of ifferential equations can be converte into exact equations by multiplying through by a function known as the integrating factor for the equation. In the last part of this Section you will learn how to ecie whether an equation is capable of being transforme into an exact equation, how to etermine the integrating factor, an how to obtain the solution of the original equation. Prerequisites Before starting this Section you shoul... Learning Outcomes On completion you shoul be able to... Section 19.2: First Orer Differential Equations unerstan what is meant by a ifferential equation; (Section 19.1) explain what is meant by separating the variables of a first orer ifferential equation etermine whether a first orer ifferential equation is separable solve a variety of equations using the separation of variables technique 11
1. Separating the variables in first orer ODEs In this Section we consier ifferential equations which can be written in the form = f(x)g(y) Note that the right-han sie is a prouct of a function of x, an a function of y. Examples of such equations are = x2 y 3, = y2 sin x an = y ln x Not all first orer equations can be written in this form. For example, it is not possible to rewrite the equation = x2 + y 3 in the form = f(x)g(y) Task Determine which of the following ifferential equations can be written in the form = f(x)g(y) If possible, rewrite each equation in this form. (a) = x2 y 2, (b) = 4x2 + 2y 2, (c) y + 3x = 7 (a) ( ) 1 = x2, (b) cannot be written in the state form, y 2 (c) Reformulating gives = (7 3x) 1 y which is in the require form. 12 Workbook 19: Differential Equations
The variables involve in ifferential equations nee not be x an y. Any symbols for variables may be use. Other first orer ifferential equations are ( ) z t = θ tez t = θ an v 1 r = v r 2 Given a ifferential equation in the form = f(x)g(y) we can ivie through by g(y) to obtain 1 g(y) = f(x) If we now integrate both sies of this equation with respect to x we obtain 1 g(y) = f(x) that is 1 g(y) = f(x) We have separate the variables because the left-han sie contains only the variable y, an the right-han sie contains only the variable x. We can now try to integrate each sie separately. If we can actually perform the require integrations we will obtain a relationship between y an x. Examples of this process are given in the next subsection. Key Point 1 Metho of Separation of Variables The solution of the equation = f(x)g(y) may be foun from separating the variables an integrating: 1 g(y) = f(x) Section 19.2: First Orer Differential Equations 13
2. Applying the metho of separation of variables to ODEs Example 3 Use the metho of separation of variables to solve the ifferential equation = 3x2 y Solution The equation alrea has the form = f(x)g(y) where f(x) = 3x 2 an g(y) = 1/y. Diviing both sies by g(y) we fin y = 3x2 Integrating both sies with respect to x gives y = 3x 2 that is y = 3x 2 Note that the left-han sie is an integral involving just y; the right-han sie is an integral involving just x. After integrating both sies with respect to the state variables we fin 1 2 y2 = x 3 + c where c is a constant of integration. (You might think that there woul be a constant on the left-han sie too. You are quite right but the two constants can be combine into a single constant an so we nee only write one.) We now have a relationship between y an x as require. Often it is sufficient to leave your answer in this form but you may also be require to obtain an explicit relation for y in terms of x. In this particular case so that y 2 = 2x 3 + 2c y = ± 2x 3 + 2c 14 Workbook 19: Differential Equations
Task Use the metho of separation of variables to solve the ifferential equation = cos x sin 2y First separate the variables so that terms involving y an x appear on the right: appear on the left, an terms involving You shoul have obtaine sin 2y = cos x Now reformulate both sies as integrals: sin 2y = cos x that is sin 2y = cos x Now integrate both sies: 1 2 cos 2y = sin x + c Finally, rearrange to obtain an expression for y in terms of x: y = 1 2 cos 1 (D 2 sin x) where D = 2c Section 19.2: First Orer Differential Equations 15
1. Solve the equation = e x y. Exercises 2. Solve the following equation subject to the conition y(0) = 1: = 3x2 e y 3. Fin the general solution of the following equations: (a) = 3, (b) = 6 sin x y 4. (a) Fin the general solution of the equation = t(x 2). t (b) Fin the particular solution which satisfies the conition x(0) = 5. 5. Some equations which o not appear to be separable can be mae so by means of a suitable substitution. By means of the substitution z = y/x solve the equation = y2 x + y 2 x + 1 6. The equation ir + L i t = E where R, L an E are constants arises in electrical circuit theory. This equation can be solve by separation of variables. Fin the solution which satisfies the conition i(0) = 0. s 1. y = ± D 2e x. 2. y = ln(x 3 + e). 3 (a) y = 3x + C, (b) 1 2 y2 = C 6 cos x. 4. (a) x = 2 + Ae t2 /2, (b) x = 2 + 3e t2 /2. 5. z = tan(ln Dx) so that y = x tan(ln Dx). 6. i = E R (1 e t/τ ) where τ = L/R. 16 Workbook 19: Differential Equations
3. Exact equations Consier the ifferential equation = 3x2 By irect integration we fin that the general solution of this equation is y = x 3 + C where C is, as usual, an arbitrary constant of integration. Next, consier the ifferential equation (yx) = 3x2. Again, by irect integration we fin that the general solution is yx = x 3 + C. We now ivie this equation by x to obtain y = x 2 + C x. The ifferential equation (yx) = 3x2 is calle an exact equation. It can effectively be solve by integrating both sies. Task Solve the equations (a) = 5x4 (b) (x3 y) = 5x 4 (a) y = (b) y = (a) y = x 5 + C (b) x 3 y = x 5 + C so that y = x 2 + C x 3. If we consier examples of this kin in a more general setting we obtain the following Key Point: Section 19.2: First Orer Differential Equations 17
The solution of the equation is f(x) y = Key Point 2 (f(x) y) = g(x) g(x) or y = 1 f(x) g(x) 4. Solving exact equations As we have seen, the ifferential equation (yx) = 3x2 has solution y = x 2 + C/x. In the solution, x 2 is calle the efinite part an C/x is calle the inefinite part (containing the arbitrary constant of integration). If we take the efinite part of this solution, i.e. y = x 2, then (y x) = (x2 x) = (x3 ) = 3x 2. Hence y = x 2 is a solution of the ifferential equation. Now if we take the inefinite part of the solution i.e. y i = C/x then (y i x) = ( ) C x x = (C) = 0. It is always the case that the general solution of an exact equation is in two parts: a efinite part y (x) which is a solution of the ifferential equation an an inefinite part y i (x) which satisfies a simpler version of the ifferential equation in which the right-han sie is zero. Task (a) Solve the equation (y cos x) = cos x (b) Verify that the inefinite part of the solution satisfies the equation (y cos x) = 0. (a) Integrate both sies of the first ifferential equation: 18 Workbook 19: Differential Equations
y cos x = cos x = sin x + C leaing to y = tan x + C sec x (b) Substitute for y in the inefinite part (i.e. the part which contains the arbitrary constant) in the secon ifferential equation: The inefinite part of the solution is y i = C sec x an so y i cos x = C an (y i cos x) = (C) = 0 5. Recognising an exact equation The equation (yx) = 3x2 is exact, as we have seen. equation (i.e. ifferentiate the prouct) we obtain x + y. Hence the equation If we expan the left-han sie of this x + y = 3x2 must be exact, but it is not so obvious that it is exact as in the original form. This leas to the following Key Point: The equation is exact. It can be re-written as Key Point 3 f(x) + y f (x) = g(x) (y f(x)) = g(x) so that y f(x) = g(x) Section 19.2: First Orer Differential Equations 19
Example 4 Solve the equation x 3 + 3x2 y = x Solution Comparing this equation with the form in Key Point 3 we see that f(x) = x 3 an g(x) = x. Hence the equation can be written (yx3 ) = x which has solution yx 3 = x = 1 2 x2 + C. Therefore y = 1 2x + C x 3. Task Solve the equation sin x + y cos x = cos x. You shoul obtain y = 1 + Ccosec x since, here f(x) = sin x an g(x) = cos x. Then (y sin x) = cos x an y sin x = cos x = sin x + C Finally y = 1 + C cosec x. 20 Workbook 19: Differential Equations
1. Solve the equation (yx2 ) = x 3. Exercises 2. Solve the equation (yex ) = e 2x given the conition y(0) = 2. 3. Solve the equation e + 2e2x y = x 2. 4. Show that the equation x 2 + 2xy = x3 is exact an obtain its solution. 5. Show that the equation x 2 + 3xy = x3 is not exact. Multiply the equation by x an show that the resulting equation is exact an obtain its solution. s 2x 1. y = x2 4 + C x 2. 2. y = 1 2 ex + 3 2 e x. 3. y = ( 1 3 x3 + C ) e 2x. 4. y = 1 4 x2 + C x 2. 5. y = 1 5 x2 + C x 3. 6. The integrating factor The equation x 2 + 3x y = x3 is not exact. However, if we multiply it by x we obtain the equation x 3 + 3x2 y = x 4. This can be re-written as (x3 y) = x 4 which is an exact equation with solution x 3 y = x 4 so x 3 y = 1 5 x5 + C an hence y = 1 5 x2 + C x 3. The function by which we multiplie the given ifferential equation in orer to make it exact is calle an integrating factor. In this example the integrating factor is simply x. Section 19.2: First Orer Differential Equations 21
Task Which of the following ifferential equations can be mae exact by multiplying by x 2? (a) + 2 x y = 4 (b) x + 3y = x2 (c) 1 x 1 x y = x 2 () 1 x + 1 x y = 3. 2 Where possible, write the exact equation in the form (f(x) y) = g(x). (a) Yes. x 2 + 2xy = 4x2 becomes (x2 y) = 4x 2. (b) Yes. x 3 + 3x2 y = x 4 becomes (x3 y) = x 4. (c) No. This equation is alrea exact as it can be written in the form () Yes. x + y = 3x2 becomes (xy) = 3x2. ( ) 1 x y = x. 7. Fining the integrating factor for linear ODEs The ifferential equation governing the current i in a circuit with inuctance L an resistance R in series subject to a constant applie electromotive force E cos ωt, where E an ω are constants, is L i + Ri = E cos ωt t (1) This is an example of a linear ifferential equation in which i is the epenent variable an t is the inepenent variable. The general stanar form of a linear first orer ifferential equation is normally written with y as the epenent variable an with x as the inepenent variable an arrange so that the coefficient of is 1. That is, it takes the form: + f(x) y = g(x) (2) in which f(x) an g(x) are functions of x. 22 Workbook 19: Differential Equations
Comparing (1) an (2), x is replace by t an y by i to prouce i + f(t) i = g(t). The function t f(t) is the coefficient of the epenent variable in the ifferential equation. We shall escribe the metho of fining the integrating factor for (1) an then generalise it to a linear ifferential equation written in stanar form. Step 1 Write the ifferential equation in stanar form i.e. with the coefficient of the erivative equal to 1. Here we nee to ivie through by L: i t + R L i = E cos ωt. L Step 2 Integrate the coefficient of the epenent variable (that is, f(t) = R/L) with respect to the inepenent variable (that is, t), an ignoring the constant of integration R L t = R L t. Step 3 Take the exponential of the function obtaine in Step 2. This is the integrating factor (I.F.) I.F. = e Rt/L. This leas to the following Key Point on integrating factors: Key Point 4 The linear ifferential equation (written in stanar form): [ + f(x)y = g(x) has an integrating factor I.F. = exp ] f(x) Task Fin the integrating factors for the equations (a) x + 2x y = xe 2x (b) t i + 2t i = te 2t (c) t (tan x)y = 1. Section 19.2: First Orer Differential Equations 23
(a) Step 1 Step 2 Divie by x to obtain + 2y = e 2x The coefficient of the inepenent variable is 2 hence 2 = 2x Step 3 I.F. = e 2x (b) The only ifference from (a) is that i replaces y an t replaces x. Hence I.F. = e 2t. (c) Step 1 Step 2 Step 3 This is alrea in the stanar form. sin x tan x = = ln cos x. cos x I.F. = e ln cos x = cos x 8. Solving equations via the integrating factor Having foun the integrating factor for a linear equation we now procee to solve the equation. Returning to the ifferential equation, written in stanar form: i t + R L i = E cos ωt L for which the integrating factor is e Rt/L we multiply the equation by the integrating factor to obtain Rt/L i e t + R L ert/l i = E L ert/l cos ωt At this stage the left-han sie of this equation can always be simplifie as follows: t (ert/l i) = E L ert/l cos ωt. Now this is in the form of an exact ifferential equation an so we can integrate both sies to obtain the solution: e Rt/L i = E e Rt/L cos ωt t. L All that remains is to complete the integral on the right-han sie. Using the metho of integration by parts we fin e Rt/L L cos ωt t = [ωl sin ωt + R cos ωt] L 2 ω 2 ert/l + R2 Hence Finally e Rt/L i = i = E L 2 ω 2 + R 2 [ωl sin ωt + R cos ωt] ert/l + C. E L 2 ω 2 + R 2 [ωl sin ωt + R cos ωt] + C e Rt/L. 24 Workbook 19: Differential Equations
is the solution to the original ifferential equation (1). Note that, as we shoul expect for the solution to a first orer ifferential equation, it contains a single arbitrary constant C. Task Using the integrating factors foun earlier in the Task on pages 22-23, fin the general solutions to the ifferential equations (a) x 2 + 2x2 y = x 2 e 2x (b) t 2 i t + 2t2 i = t 2 e 2t (c) (tan x)y = 1. (a) The stanar form is + 2y = e 2x for which the integrating factor is e 2x. 2x e + 2e2x y = 1 i.e. (e2x y) = 1 so that e 2x y = x + C leaing to y = (x + C)e 2x (b) The general solution is i = (t+c)e 2t as this problem is the same as (a) with ifferent variables. (c) The equation is in stanar form an the integrating factor is cos x. then (cos x y) = cos x so that cos x y = cos x = sin x + C giving y = tan x + C sec x Section 19.2: First Orer Differential Equations 25
Engineering Example 1 An RC circuit with a single frequency input Introuction The components in RC circuits containing resistance, inuctance an capacitance can be chosen so that the circuit filters out certain frequencies from the input. A particular kin of filter circuit consists of a resistor an capacitor in series an acts as a high cut (or low pass) filter. The high cut frequency is efine to be the frequency at which the magnitue of the voltage across the capacitor (the output voltage) is 1/ 2 of the magnitue of the input voltage. Problem in wors Calculate the high cut frequency for an RC circuit is subjecte to a single frequency input of angular frequency ω an magnitue v i. (a) Fin the stea state solution of the equation R q t + q C = v ie jωt an hence fin the magnitue of (i) the voltage across the capacitor v c = q C (ii) the voltage across the resistor v R = R q t (b) Using the impeance metho of (i) the voltage across the capacitor v c 12.6 confirm your results to part (a) by calculating (ii) the voltage across the resistor v R in response to a single frequency of angular frequency ω an magnitue v i. (c) For the case where R = 1 kω an C = 1 µf, fin the ratio v c v i ω 10 10 2 10 3 10 4 10 5 10 6 v c v i an complete the table below () Explain why the table results show that a RC circuit acts as a high-cut filter an fin the value of the high-cut frequency, efine as f hc = ω hc /2π, such that v c v i = 1. 2 26 Workbook 19: Differential Equations
Mathematical statement of the problem We nee to fin a particular solution to the ifferential equation R q t + q C = v ie jωt. This will give us the stea state solution for the charge q. Using this we can fin v c = q C an v R = R q. These shoul give the same result as the values calculate by consiering the impeances t in the circuit. Finally we can calculate v c v i high-cut frequency from v c v i = 1 2 an f hc = ω hc /2π. Mathematical solution an fill in the table of values as require an fin the (a) To fin a particular solution, we try a function of the form q = c 0 e jωt which means that q t = jωc 0e jωt. Substituting into R q t + q C = v ie jωt we get Rjωc 0 e jωt + c 0e jωt C = v ie jωt Rjωc 0 + c 0 c 0 = Thus v i Rjω + 1 C (i) v c = q C = = Cv i RCjω + 1 q = C = v i Cv i RCjω + 1 ejωt v i RCjω + 1 ejωt an (ii) v R = q t = RCv ijω RCjω + 1 ejωt (b) We use the impeance to etermine the voltage across each of the elements. The applie voltage is a single frequency of angular frequency ω an magnitue v i such that V = v i e jωt. For an RC circuit, the impeance of the circuit is Z = Z R + Z c where Z R is the impeance of the resistor R an Z c is the impeance of the capacitor Z c = j ωc. Therefore Z = R j ωc. The current ( can be foun using v = Zi giving v i e jωt = R j ) i i = v ie jωt ωc R j ωc We can now use v c = z c i an v R = z R i giving (i) v c = q C = j ωc v i R j ωc e jωt = v i RCjω + 1 ejωt (ii) v R = Rv i R j ωc e jωt = RCv ijω RCjω + 1 ejωt which confirms the result in part (a) foun by solving the ifferential equation. (c) When R = 1000 Ω an C = 10 6 F v i v i v c = RCjω + 1 ejωt = 10 3 jω + 1 ejωt Section 19.2: First Orer Differential Equations 27
So v c v i = 1 10 3 jω + 1 ejωt = 1 10 3 jω + 1 = 1 10 6 ω 2 + 1 Table 1: Values of v c v i for a range of values of ω ω 10 10 2 10 3 10 4 10 5 10 6 v c v i 0.99995 0.995 0.707 0.00995 0.0099995 0.001 () Table 1 shows that a RC circuit can be use as a high-cut filter because for low values of ω, v c v i is approximately 1 an for high values of ω, v c is approximately 0. So the circuit will filter out high v i frequency values. v c v i = 1 2 when 1 10 6 ω 2 + 1 = 1 10 6 ω 2 + 1 = 2 10 6 ω 2 = 1 ω 2 = 10 6 2 As we are consiering ω to be a positive frequency, ω = 1000. So f hc = ω hc 2π = 1000 2π Interpretation 159 Hz. We have shown that for an RC circuit fining the stea state solution of the ifferential equation with a single frequency input voltage yiels the same result for v c v i an v R as foun by working v i with the complex impeances for the circuit. An RC circuit can be use as a high-cut filter an in the case where R = 1 kω, C = 1 µf we foun the high-cut frequency to be at approximately 159 Hz. This means that the circuit will pass frequencies less than this value an remove frequencies greater than this value. 28 Workbook 19: Differential Equations
1. Solve the equation x 2 + x y = 1. Exercises 2. Fin the solution of the equation x y = x subject to the conition y(1) = 2. 3. Fin the general solution of the equation + (tan t) y = cos t. t 4. Solve the equation + (cot t) y = sin t. t 5. The temperature θ (measure in egrees) of a bo immerse in an atmosphere of varying temperature is given by θ t + 0.1θ = 5 2.5t. Fin the temperature at time t if θ = 60 C when t = 0. 6. In an LR circuit with applie voltage E = 10(1 e 0.1t ) the current i is given by L i t + Ri = 10(1 e 0.1t ). If the initial current is i 0 fin i subsequently. s 1. y = 1 x ln x + C x 2. y = x ln x + 2x 3. y = (t + C) cos t 4. y = ( 1 2 t 1 4 sin 2t + C) cosec t 5. θ = 300 25t 240e 0.1t 6. i = 10 ( 100 R 10R L ) e 0.1t + [ i 0 + 10L R(10R L) ] e Rt/L Section 19.2: First Orer Differential Equations 29