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:

  1. Solve separable ODEs: $g(y) dy = f(x) dx$
  2. Solve linear first-order ODEs using integrating factors
  3. Identify and solve exact differential equations
  4. Apply first-order ODEs to growth/decay, cooling, and mixing problems
  5. 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

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)

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)

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)

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)

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)

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)

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)

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)

Practice Problems

  1. 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}$.

  2. 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}$.

  3. 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$.

  4. 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.

  5. 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:


Pitfalls



Next Steps

Next up: 27-03-second-order-linear-odes-homogeneous.md — characteristic equations and fundamental solution sets.