27-02 — First-Order ODEs
Phase: Ordinary Differential Equations | Subject: 27-02 Prerequisites: 27-01-introduction-to-differential-equations.md, 05-04-integration-by-substitution.md Next subject: 27-03-second-order-linear-odes-homogeneous.md
Learning Objectives
By the end of this subject, you will be able to:
- Solve separable ODEs: $g(y) dy = f(x) dx$
- Solve linear first-order ODEs using integrating factors
- Identify and solve exact differential equations
- Apply first-order ODEs to growth/decay, cooling, and mixing problems
- Choose the appropriate method based on equation form
Core Content
Separable Equations
A first-order ODE is separable if it can be written as:
$$\frac{dy}{dx} = g(x)h(y) \quad \Rightarrow \quad \int \frac{1}{h(y)} dy = \int g(x) dx$$
Example: $\frac{dy}{dx} = xy$ $\int \frac{dy}{y} = \int x dx \Rightarrow \ln |y| = \frac{x^2}{2} + C \Rightarrow y = Ae^{x^2/2}$.
Linear First-Order ODEs: Integrating Factor
Standard form: $y' + P(x)y = Q(x)$.
The integrating factor is $\mu(x) = e^{\int P(x) dx}$.
Multiply the equation by $\mu(x)$: $\mu y' + \mu P y = \mu Q \Rightarrow (\mu y)' = \mu Q$. Integrate: $\mu y = \int \mu Q dx + C \Rightarrow y = \frac{1}{\mu(x)}\left(\int \mu(x)Q(x)dx + C\right)$.
Example: $y' + 2xy = x$ $\mu(x) = e^{\int 2x dx} = e^{x^2}$. $(e^{x^2} y)' = x e^{x^2}$. $e^{x^2} y = \int x e^{x^2} dx = \frac{1}{2}e^{x^2} + C$. $y = \frac{1}{2} + Ce^{-x^2}$.
Exact Equations
$M(x, y) dx + N(x, y) dy = 0$ is exact if $\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}$.
Solution Method: 1. Find $F(x, y)$ such that $\frac{\partial F}{\partial x} = M$ and $\frac{\partial F}{\partial y} = N$. 2. Integrate $M$ with respect to $x$: $F(x, y) = \int M(x, y) dx + g(y)$. 3. Differentiate with respect to $y$ and set equal to $N$ to find $g'(y)$. 4. Solution: $F(x, y) = C$.
Example: $(2xy + 1)dx + (x^2 + 2y)dy = 0$. Check: $\partial M/\partial y = 2x$, $\partial N/\partial x = 2x$. ✓ Exact. $F(x,y) = \int (2xy + 1)dx = x^2 y + x + g(y)$. $\partial F/\partial y = x^2 + g'(y) = x^2 + 2y \Rightarrow g'(y) = 2y \Rightarrow g(y) = y^2$. Solution: $x^2 y + x + y^2 = C$.
Application: Exponential Growth and Decay
$$\frac{dP}{dt} = kP \quad \Rightarrow \quad P(t) = P_0 e^{kt}$$
Doubling time: $t_d = \frac{\ln 2}{k}$. Half-life: $t_{1/2} = \frac{\ln 2}{|k|}$.
Application: Newton's Law of Cooling
$$\frac{dT}{dt} = -k(T - T_{\text{env}}), \quad T(0) = T_0$$
Solution: $T(t) = T_{\text{env}} + (T_0 - T_{\text{env}})e^{-kt}$.
Key Terms
- Separable ODE
- Integrating Factor
- Exact Equation
- Newton's Law of Cooling
Worked Examples
Example 1: Separable with IVP
Solve $\frac{dy}{dx} = y^2 \cos x$, $y(0) = 1$.
Solution: $\int \frac{dy}{y^2} = \int \cos x dx \Rightarrow -\frac{1}{y} = \sin x + C$. $y(0) = 1$: $-1/1 = 0 + C \Rightarrow C = -1$. $-\frac{1}{y} = \sin x - 1 \Rightarrow y = \frac{1}{1 - \sin x}$.
Click for answer
$y = \frac{1}{1 - \sin x}$. Valid for $\sin x \neq 1$.Example 2: Integrating Factor
Solve $y' + \frac{1}{x} y = x^2$, $x > 0$.
Solution: $\mu(x) = e^{\int (1/x) dx} = e^{\ln x} = x$. $(xy)' = x \cdot x^2 = x^3$. $xy = \int x^3 dx = \frac{x^4}{4} + C$. $y = \frac{x^3}{4} + \frac{C}{x}$.
Click for answer
$y = x^3/4 + C/x$.Example 3: Cooling Problem
Coffee at 95°C is placed in a 20°C room. After 5 minutes, it's 70°C. Find the temperature after 20 minutes.
Solution: $T(t) = 20 + 75e^{-kt}$. At $t=5$: $70 = 20 + 75e^{-5k} \Rightarrow e^{-5k} = 50/75 = 2/3$. $k = -\ln(2/3)/5 \approx 0.0811$. At $t=20$: $T(20) = 20 + 75e^{-20k} = 20 + 75(2/3)^4 = 20 + 75(16/81) \approx 34.8°C$.
Click for answer
Approximately 34.8°C after 20 minutes.Quiz
Q1: What does the concept of Separable ODE primarily refer to in this subject?
A) A historical anecdote about Separable ODE B) A visual representation of Separable ODE C) The definition and application of Separable ODE D) A computational error related to Separable ODE
Correct: C)
- If you chose A: This is incorrect. Separable ODE is defined as: the definition and application of separable ode. The other options describe different aspects that are not the primary focus.
- If you chose B: This is incorrect. Separable ODE is defined as: the definition and application of separable ode. The other options describe different aspects that are not the primary focus.
- If you chose C: Separable ODE is defined as: the definition and application of separable ode. The other options describe different aspects that are not the primary focus. Correct!
- If you chose D: This is incorrect. Separable ODE is defined as: the definition and application of separable ode. The other options describe different aspects that are not the primary focus.
Q2: Which of the following is the key formula discussed in this subject?
A) An unrelated formula from a different topic B) g(y) dy = f(x) dx C) The inverse operation of the formula in question D) A simplified version of g(y) dy = f(x) dx...
Correct: B)
- If you chose A: This is incorrect. The formula g(y) dy = f(x) dx is central to this subject. The other options are either simplified versions or unrelated.
- If you chose B: The formula g(y) dy = f(x) dx is central to this subject. The other options are either simplified versions or unrelated. Correct!
- If you chose C: This is incorrect. The formula g(y) dy = f(x) dx is central to this subject. The other options are either simplified versions or unrelated.
- If you chose D: This is incorrect. The formula g(y) dy = f(x) dx is central to this subject. The other options are either simplified versions or unrelated.
Q3: What is the primary purpose of Integrating Factor?
A) It is primarily a historical notation system B) It replaces all other methods in this domain C) It is used only in advanced research contexts D) It is used to integrating factor in mathematical analysis
Correct: D)
- If you chose A: This is incorrect. Integrating Factor serves the purpose described in the correct answer. The other options misrepresent its role.
- If you chose B: This is incorrect. Integrating Factor serves the purpose described in the correct answer. The other options misrepresent its role.
- If you chose C: This is incorrect. Integrating Factor serves the purpose described in the correct answer. The other options misrepresent its role.
- If you chose D: Integrating Factor serves the purpose described in the correct answer. The other options misrepresent its role. Correct!
Q4: Which statement about Exact Equation is TRUE?
A) Exact Equation is mentioned only as a historical footnote B) Exact Equation is a fundamental concept covered in this subject C) Exact Equation is not related to this subject D) Exact Equation is an advanced topic beyond this subject's scope
Correct: B)
- If you chose A: This is incorrect. Exact Equation is a fundamental concept covered in this subject. This subject covers Exact Equation as part of its core content.
- If you chose B: Exact Equation is a fundamental concept covered in this subject. This subject covers Exact Equation as part of its core content. Correct!
- If you chose C: This is incorrect. Exact Equation is a fundamental concept covered in this subject. This subject covers Exact Equation as part of its core content.
- If you chose D: This is incorrect. Exact Equation is a fundamental concept covered in this subject. This subject covers Exact Equation as part of its core content.
Q5: Based on the worked examples in this subject, what is the correct result?
A) A different result from a common mistake B) The inverse of the correct answer C) Integrating Factor D) An unrelated numerical value
Correct: C)
- If you chose A: This is incorrect. The worked examples show that the result is Integrating Factor. The other options represent common errors.
- If you chose B: This is incorrect. The worked examples show that the result is Integrating Factor. The other options represent common errors.
- If you chose C: The worked examples show that the result is Integrating Factor. The other options represent common errors. Correct!
- If you chose D: This is incorrect. The worked examples show that the result is Integrating Factor. The other options represent common errors.
Q6: How are Exact Equation and Separable Equations related?
A) Exact Equation and Separable Equations are completely unrelated topics B) Exact Equation and Separable Equations are closely related concepts C) Exact Equation is the inverse of Separable Equations D) Exact Equation is a special case of Separable Equations
Correct: B)
- If you chose A: This is incorrect. Both Exact Equation and Separable Equations are covered in this subject as interconnected topics.
- If you chose B: Both Exact Equation and Separable Equations are covered in this subject as interconnected topics. Correct!
- If you chose C: This is incorrect. Both Exact Equation and Separable Equations are covered in this subject as interconnected topics.
- If you chose D: This is incorrect. Both Exact Equation and Separable Equations are covered in this subject as interconnected topics.
Q7: What is a common pitfall when working with Linear First-Order Odes: Integrating Factor?
A) The main error with Linear First-Order Odes: Integrating Factor is using it when it is not needed B) Linear First-Order Odes: Integrating Factor has no common misconceptions C) Linear First-Order Odes: Integrating Factor is always computed the same way in all contexts D) A common mistake is confusing Linear First-Order Odes: Integrating Factor with a similar concept
Correct: D)
- If you chose A: This is incorrect. Students often confuse Linear First-Order Odes: Integrating Factor with similar-sounding or related concepts. Pay attention to the precise definitions.
- If you chose B: This is incorrect. Students often confuse Linear First-Order Odes: Integrating Factor with similar-sounding or related concepts. Pay attention to the precise definitions.
- If you chose C: This is incorrect. Students often confuse Linear First-Order Odes: Integrating Factor with similar-sounding or related concepts. Pay attention to the precise definitions.
- If you chose D: Students often confuse Linear First-Order Odes: Integrating Factor with similar-sounding or related concepts. Pay attention to the precise definitions. Correct!
Q8: When should you apply Exact Equations?
A) Use Exact Equations only in pure mathematics contexts B) Avoid Exact Equations unless explicitly instructed C) Exact Equations is not practically useful D) Apply Exact Equations to solve problems in this subject's domain
Correct: D)
- If you chose A: This is incorrect. Exact Equations is a practical tool used throughout this subject to solve relevant problems.
- If you chose B: This is incorrect. Exact Equations is a practical tool used throughout this subject to solve relevant problems.
- If you chose C: This is incorrect. Exact Equations is a practical tool used throughout this subject to solve relevant problems.
- If you chose D: Exact Equations is a practical tool used throughout this subject to solve relevant problems. Correct!
Practice Problems
-
Solve $\frac{dy}{dx} = \frac{x}{y}$ (implicit form acceptable).
Click for answer
$y dy = x dx \Rightarrow y^2/2 = x^2/2 + C \Rightarrow y^2 = x^2 + 2C$, or $y = \pm\sqrt{x^2 + C_1}$. -
Solve $y' + 3y = 6$ using integrating factor.
Click for answer
$\mu = e^{\int 3 dx} = e^{3x}$. $(e^{3x}y)' = 6e^{3x}$. $e^{3x}y = 2e^{3x} + C$. $y = 2 + Ce^{-3x}$. -
Is $(3x^2 y + y^2)dx + (x^3 + 2xy)dy = 0$ exact?
Click for answer
$M_y = 3x^2 + 2y$, $N_x = 3x^2 + 2y$. Yes, they match. Solution: $F = x^3 y + xy^2 = C$. -
A population grows at 5% per year. How long to double?
Click for answer
$t_d = \ln(2)/0.05 \approx 0.6931/0.05 = 13.86$ years. -
Solve $xy' + y = x \cos x$, $x > 0$.
Click for answer
Rewrite: $y' + (1/x)y = \cos x$. $\mu = e^{\ln x} = x$. $(xy)' = x \cos x$. $xy = x \sin x + \cos x + C$. $y = \sin x + \frac{\cos x}{x} + \frac{C}{x}$.
Summary
Key takeaways:
- Separable: split $dy$ and $dx$, integrate both sides
- Linear 1st order: $y' + P(x)y = Q(x)$, use $\mu(x) = e^{\int P dx}$
- Exact: check $\partial M/\partial y = \partial N/\partial x$, find potential function $F$
- Classic applications: exponential growth/decay, Newton's law of cooling
- Always check initial conditions to find the particular solution
Pitfalls
- Separating variables when the ODE is not actually separable: The equation $y' = x + y$ is NOT separable — you cannot factor it as $f(x)g(y)$. A common error is to write $dy = (x + y) dx$ and attempt to separate, which fails. Always test: can you write $\frac{dy}{dx} = f(x)g(y)$? If not, the equation requires a different method (integrating factor, exact, etc.).
- Losing solutions when dividing by $h(y)$ in separable equations: When separating $\frac{dy}{dx} = g(x)h(y)$ to $\int \frac{dy}{h(y)} = \int g(x)dx$, any constant solution $y = c$ where $h(c) = 0$ is lost because you divided by zero. For example, $dy/dx = y(1-y)$ has constant solutions $y=0$ and $y=1$ that are not recovered from integrating $dy/[y(1-y)] = dx$.
- Forgetting the absolute value in the integrating factor logarithm: The integrating factor is $\mu(x) = e^{\int P(x)dx}$, NOT $e^{P(x)}$. When computing $\int P(x) dx$, students often drop the integration constant — but for $\mu(x)$ you only need an antiderivative, so the constant can be omitted. However, forgetting the absolute value in $\int (1/x)dx = \ln|x|$ leads to $\mu(x) = x$ for $x > 0$ only; for $x < 0$, $\mu(x) = |x| = -x$ is needed.
- Declaring an equation exact after checking only $\partial M/\partial y = \partial N/\partial x$ on a non-simply-connected domain: The condition $\partial M/\partial y = \partial N/\partial x$ is necessary and sufficient for exactness only on simply connected domains. For equations like $\frac{-y}{x^2+y^2}dx + \frac{x}{x^2+y^2}dy = 0$, the derivatives match but the potential function $F = \arctan(y/x)$ is multivalued — the equation is not globally exact. Be aware of domain restrictions.
- Applying exponential growth formulas without checking whether $k$ is positive or negative: The formula $P(t) = P_0 e^{kt}$ describes growth when $k > 0$ and decay when $k < 0$. A frequent mistake: computing a negative $k$ for decay but using the doubling-time formula $t_d = \ln(2)/k$, which would give a negative time. For decay, use half-life: $t_{1/2} = \ln(2)/|k|$.
Next Steps
Next up: 27-03-second-order-linear-odes-homogeneous.md — characteristic equations and fundamental solution sets.