Solving Common First-Order ODEs
First-order ODEs appear in various forms. Identifying the type is key to applying the correct solution strategy. Let's explore the main categories:
1. Separable Equations
Definition
An equation that can be algebraically manipulated into the form where all terms involving \(y\) and \(dy\) are on one side, and all terms involving \(x\) and \(dx\) are on the other.
Form: \( \frac{dy}{dx} = g(x)h(y) \) or \( M(x)dx + N(y)dy = 0 \)
Methodology
- Separate the variables: Arrange the equation as \( \frac{1}{h(y)} dy = g(x) dx \).
- Integrate both sides: \( \int \frac{1}{h(y)} dy = \int g(x) dx + C \).
- Solve for \(y\) if possible, or leave the solution in implicit form.
Example
Solve: \( \frac{dy}{dx} = \frac{3x^2 + 1}{2y} \)
2. Linear Equations
Definition
An equation that can be written in the standard form:
Form: \( \frac{dy}{dx} + P(x)y = Q(x) \)
Methodology (Using Integrating Factor)
- Ensure the equation is in standard form \( \frac{dy}{dx} + P(x)y = Q(x) \). Identify \(P(x)\) and \(Q(x)\).
- Calculate the integrating factor: \( \mu(x) = e^{\int P(x) dx} \). (Choose the simplest antiderivative for \( \int P(x) dx \)).
- Multiply the entire standard form equation by \( \mu(x) \): \( \mu(x)\frac{dy}{dx} + \mu(x)P(x)y = \mu(x)Q(x) \).
- Recognize that the left side is the derivative of a product: \( \frac{d}{dx}(\mu(x) y) = \mu(x)Q(x) \).
- Integrate both sides with respect to \(x\): \( \mu(x) y = \int \mu(x) Q(x) dx + C \).
- Solve for \(y\): \( y = \frac{1}{\mu(x)} \left[ \int \mu(x) Q(x) dx + C \right] \).
Example
Solve: \( x\frac{dy}{dx} - 2y = x^3 \cos(x) \) for \( x > 0 \)
3. Homogeneous Equations
Definition
An equation that can be written in the form \( \frac{dy}{dx} = F\left(\frac{y}{x}\right) \). Note: This 'homogeneous' is different from the linear homogeneous case. Here it means all terms are of the same degree.
Methodology (Substitution)
- Identify that the equation can be written as \( \frac{dy}{dx} = F\left(\frac{y}{x}\right) \).
- Use the substitution \( v = \frac{y}{x} \), which means \( y = vx \).
- Differentiate \( y = vx \) using the product rule: \( \frac{dy}{dx} = v \frac{dx}{dx} + x \frac{dv}{dx} = v + x\frac{dv}{dx} \).
- Substitute \( \frac{y}{x} = v \) and \( \frac{dy}{dx} = v + x\frac{dv}{dx} \) into the original DE. This gives \( v + x\frac{dv}{dx} = F(v) \).
- Rearrange to \( x\frac{dv}{dx} = F(v) - v \). This is now a separable equation in \(v\) and \(x\).
- Solve the separable equation for \(v\).
- Substitute back \( v = \frac{y}{x} \) to get the solution in terms of \(y\) and \(x\).
Example
Solve: \( (x^2 + y^2)dx - xy dy = 0 \)
4. Bernoulli Equations
Definition
Equations of the form:
Form: \( \frac{dy}{dx} + P(x)y = Q(x)y^n \), where \(n\) is any real number, but \(n \neq 0\) and \(n \neq 1\). (If \(n=0\) or \(n=1\), it's already linear).
Methodology (Transformation to Linear)
- Divide the equation by \(y^n\): \( y^{-n}\frac{dy}{dx} + P(x)y^{1-n} = Q(x) \).
- Use the substitution \( z = y^{1-n} \).
- Differentiate \(z\) with respect to \(x\): \( \frac{dz}{dx} = (1-n)y^{-n}\frac{dy}{dx} \). This means \( y^{-n}\frac{dy}{dx} = \frac{1}{1-n}\frac{dz}{dx} \).
- Substitute \(z\) and the expression for \(y^{-n}\frac{dy}{dx}\) into the transformed equation from step 1: \( \frac{1}{1-n}\frac{dz}{dx} + P(x)z = Q(x) \).
- Multiply by \( (1-n) \) to get the standard linear form in \(z\): \( \frac{dz}{dx} + (1-n)P(x)z = (1-n)Q(x) \).
- Solve this linear equation for \(z\) using the integrating factor method.
- Substitute back \( z = y^{1-n} \) to get the solution in terms of \(y\) and \(x\).
Example
Solve: \( \frac{dy}{dx} + y = xy^3 \)
5. Exact Equations
Definition
An equation written in the form \( M(x, y)dx + N(x, y)dy = 0 \) is exact if the following condition holds:
Condition: \( \frac{\partial M}{\partial y} = \frac{\partial N}{\partial x} \)
If it's exact, there exists a function \( \psi(x, y) \) (potential function) such that \( \frac{\partial \psi}{\partial x} = M \) and \( \frac{\partial \psi}{\partial y} = N \), and the solution is given implicitly by \( \psi(x, y) = C \).
Methodology
- Write the equation in the form \( M(x, y)dx + N(x, y)dy = 0 \). Identify \(M\) and \(N\).
- Check for exactness: Calculate \( \frac{\partial M}{\partial y} \) and \( \frac{\partial N}{\partial x} \). If they are equal, proceed.
- Integrate \( M(x, y) \) with respect to \(x\) to find a candidate for \( \psi \): \( \psi(x, y) = \int M(x, y) dx + g(y) \). (Treat \(y\) as a constant during this integration; \(g(y)\) is the "constant" of integration which might depend on \(y\)).
- Differentiate this \( \psi(x, y) \) with respect to \(y\): \( \frac{\partial \psi}{\partial y} = \frac{\partial}{\partial y} \left( \int M(x, y) dx \right) + g'(y) \).
- Set this result equal to \( N(x, y) \): \( \frac{\partial}{\partial y} \left( \int M(x, y) dx \right) + g'(y) = N(x, y) \).
- Solve this equation for \( g'(y) \). It should only depend on \(y\) (if the equation is truly exact).
- Integrate \( g'(y) \) to find \( g(y) \). (A constant of integration here can be absorbed into the final constant \(C\)).
- Substitute \( g(y) \) back into the expression for \( \psi(x, y) \) found in step 3.
- The general solution is \( \psi(x, y) = C \).
Alternative Step 3/4: Integrate \( N \) wrt \( y \) first: \( \psi = \int N dy + h(x) \), then differentiate wrt \( x \) and set equal to \( M \) to find \( h(x) \).
Example
Solve: \( (e^{2y} - y \cos(xy))dx + (2xe^{2y} - x \cos(xy) + 2y)dy = 0 \)
6. Non-Exact Equations (Made Exact with Integrating Factor)
Definition
An equation \( M(x, y)dx + N(x, y)dy = 0 \) where \( \frac{\partial M}{\partial y} \neq \frac{\partial N}{\partial x} \). Sometimes, we can find an integrating factor \( \mu(x, y) \) such that multiplying the equation by \( \mu \) makes it exact: \( \mu M dx + \mu N dy = 0 \) is exact.
Methodology (Finding Special Integrating Factors)
- Write the equation as \( Mdx + Ndy = 0 \). Calculate \( \frac{\partial M}{\partial y} \) and \( \frac{\partial N}{\partial x} \). Confirm they are not equal.
- Calculate the expression \( R_1 = \frac{1}{N} \left( \frac{\partial M}{\partial y} - \frac{\partial N}{\partial x} \right) \). If \(R_1\) depends only on \(x\), then the integrating factor is \( \mu(x) = e^{\int R_1(x) dx} \).
- If step 2 fails, calculate \( R_2 = \frac{1}{M} \left( \frac{\partial N}{\partial x} - \frac{\partial M}{\partial y} \right) \). If \(R_2\) depends only on \(y\), then the integrating factor is \( \mu(y) = e^{\int R_2(y) dy} \).
- (Other forms exist but are less common). If a factor \( \mu \) is found, multiply the original equation by \( \mu \): \( (\mu M)dx + (\mu N)dy = 0 \). Let \( M' = \mu M \) and \( N' = \mu N \).
- Verify that the new equation is exact: Check if \( \frac{\partial M'}{\partial y} = \frac{\partial N'}{\partial x} \).
- Solve the new exact equation using the method described in section 5.
Example
Solve: \( y dx + (2xy - e^{-2y}) dy = 0 \)