- Practice
- About 22 min
- 5 practice questions
Homogeneous differential equations and first-order linear equations
Recognise homogeneous functions and equations and solve them with y = vx, and solve first-order linear equations dy/dx + Py = Q using the integrating factor.
If something looks wrong, please tell us.
By the end of this lesson you can
- Test whether f(x, y) is a homogeneous function and find its degree.
- Solve a homogeneous equation dy/dx = g(y/x) with the substitution y = vx (or x = vy).
- Find the integrating factor of a linear equation and use it to solve the equation.
- Solve linear equations in which x is the dependent variable.
Not every first-order equation separates. Two large families can still be solved by a standard trick: homogeneous equations, which become separable after a substitution, and linear equations, which become an exact derivative after multiplying by an integrating factor.
Homogeneous functions
A function f(x, y) is homogeneous of degree n if f(tx, ty) = tⁿ f(x, y) for all suitable x, y and t (Euler's homogeneity). For example, f = x² − 3xy + 5y² gives f(tx, ty) = t²x² − 3t²xy + 5t²y² = t²f, so it is homogeneous of degree 2. But x³ + y sin x is not homogeneous, because sin(tx) cannot be written as a power of t times sin x. A homogeneous function of degree 0, such as (x² + y²)/(xy), can always be written as a function of y/x alone: (x² + y²)/(xy) = (1 + (y/x)²)/(y/x).
Homogeneous differential equations
An ODE is in homogeneous form if it can be written dy/dx = g(y/x). In differential form, M(x, y) dx + N(x, y) dy = 0 is homogeneous when M and N are homogeneous functions of the same degree, because then dy/dx = −M/N is homogeneous of degree 0. Take care: this use of the word is different from the "homogeneous linear equation" (g(x) = 0) of lesson 1.
Method. Put y = vx. Then dy/dx = v + x dv/dx, and the equation becomes v + x dv/dx = g(v), that is x dv/dx = g(v) − v, which separates: dv/[g(v) − v] = dx/x. Integrate, then replace v by y/x. When the equation is naturally dx/dy = g(x/y), put x = vy instead, so dx/dy = v + y dv/dy.
Worked example 1: (x² + y²) dx − 2xy dy = 0
Both M = x² + y² and N = −2xy have degree 2, so the equation is homogeneous. dy/dx = (x² + y²)/(2xy). Put y = vx: v + x dv/dx = (1 + v²)/(2v), so x dv/dx = (1 + v² − 2v²)/(2v) = (1 − v²)/(2v). Separate: 2v dv/(1 − v²) = dx/x. Integrate: −log|1 − v²| = log|x| − log C, so 1 − v² = C/x. With v = y/x: (x² − y²)/x² = C/x, giving x² − y² = Cx. Check: differentiate, 2x − 2y y′ = C = (x² − y²)/x, so 2y y′ = 2x − (x² − y²)/x = (x² + y²)/x and y′ = (x² + y²)/(2xy).
Worked example 2: x dy/dx = y + x tan(y/x), with y(1) = π/2
Divide by x: dy/dx = y/x + tan(y/x). Put y = vx: v + x dv/dx = v + tan v, so x dv/dx = tan v. Separate: cot v dv = dx/x. Integrate: log|sin v| = log|x| + log C, so sin v = Cx, that is sin(y/x) = Cx. When x = 1, y = π/2: sin(π/2) = 1 = C. The particular solution is sin(y/x) = x.
First-order linear differential equations
A first-order linear equation has the form dy/dx + Py = Q, where P and Q are functions of x only. Multiply by e^(∫P dx). Since d/dx[y e^(∫P dx)] = e^(∫P dx)(dy/dx + Py) = Q e^(∫P dx), integrating both sides gives the solution. The factor e^(∫P dx) is called the integrating factor (I.F.).
For dy/dx + Py = Q: I.F. = e^(∫P dx) and the solution is y × (I.F.) = ∫ Q × (I.F.) dx + C. For dx/dy + Px = Q (P, Q functions of y): x × e^(∫P dy) = ∫ Q e^(∫P dy) dy + C.
Solving a linear equation
- Standard form Make the coefficient of dy/dx equal to 1; read off P and Q.
- Integrating factor I.F. = e^(∫P dx); simplify e^(log u) = u.
- Multiply and integrate y × I.F. = ∫ Q × I.F. dx + C.
- Tidy and check Solve for y and substitute back.
Worked example 3: dy/dx − y = e^(2x)
P = −1, Q = e^(2x). I.F. = e^(∫−1 dx) = e^(−x). Then y e^(−x) = ∫ e^(2x)e^(−x) dx + C = ∫ eˣ dx + C = eˣ + C, so y = e^(2x) + C eˣ. Check: y′ = 2e^(2x) + C eˣ, and y′ − y = e^(2x).
Worked example 4: x dy/dx + 2y = x², x > 0, with y(1) = 1
Divide by x to make the coefficient of dy/dx equal to 1: dy/dx + (2/x)y = x. So P = 2/x, Q = x. ∫P dx = 2 log x = log x², so I.F. = e^(log x²) = x². Then y x² = ∫ x·x² dx + C = x⁴/4 + C, so y = x²/4 + C/x². Using y(1) = 1: 1 = 1/4 + C, so C = 3/4 and y = x²/4 + 3/(4x²).
Worked example 5: dy/dx + y tan x = sec x
P = tan x, so ∫P dx = log sec x and I.F. = sec x. Then y sec x = ∫ sec x·sec x dx + C = tan x + C. Multiplying by cos x: y = sin x + C cos x. Check: y′ = cos x − C sin x and y tan x = sin²x/cos x + C sin x, so y′ + y tan x = cos x + sin²x/cos x = (cos²x + sin²x)/cos x = sec x.
Worked example 6: x as the dependent variable, dx/dy + x/y = y², y > 0
This is linear in x: P = 1/y, Q = y². I.F. = e^(∫dy/y) = e^(log y) = y. So x y = ∫ y²·y dy + C = y⁴/4 + C, that is x = y³/4 + C/y.
Key takeaways: a homogeneous equation dy/dx = g(y/x) separates after y = vx, because dy/dx = v + x dv/dx. A linear equation dy/dx + Py = Q is solved by multiplying by I.F. = e^(∫P dx), giving y × I.F. = ∫Q × I.F. dx + C; first make the coefficient of dy/dx equal to 1. If the equation is linear in x instead, swap the roles of x and y.
Check your understanding
-
1. Which function is homogeneous of degree 2?
- x² + y
- x² + sin y
- x³ + y²
- x² + xy + 3y²
Show answer
Answer: D. For f = x² + xy + 3y², f(tx, ty) = t²x² + t²xy + 3t²y² = t²f, so it is homogeneous of degree 2. In the others the terms have different degrees or contain sin y, so no single power of t comes out.
-
2. What is the general solution of dy/dx = 1 + y/x (x > 0)?
- y = x log x + Cx
- y = log x + C
- y = x² + Cx
- y = Cx − log x
Show answer
Answer: A. Put y = vx: v + x dv/dx = 1 + v, so x dv/dx = 1 and dv = dx/x. Then v = log x + C, so y = x log x + Cx.
-
3. What is the integrating factor of dy/dx + (1/x)y = x², x > 0?
- 1/x
- x
- eˣ
- log x
Show answer
Answer: B. P = 1/x, so ∫P dx = log x and I.F. = e^(log x) = x.
-
4. What is the integrating factor of dy/dx − y cot x = sin x, 0 < x < π?
- sin x
- cosec x
- cos x
- −sin x
Show answer
Answer: B. P = −cot x, so ∫P dx = −log sin x and I.F. = e^(−log sin x) = 1/sin x = cosec x.
-
5. What is the general solution of dy/dx + y = 1?
- y = Ceˣ − 1
- y = x + C
- y = 1 + Ce^(−x)
- y = 1 + Ceˣ
Show answer
Answer: C. P = 1, Q = 1, I.F. = eˣ. Then y eˣ = ∫ eˣ dx + C = eˣ + C, so y = 1 + Ce^(−x). Check: y′ = −Ce^(−x) and y′ + y = 1.
Sign in to keep track of the lessons you finish.