Comprehensive Guide to Differential Equations
Introduction to Differential Equations
A differential equation is an equation that relates a function with its derivatives. They are used to describe various phenomena in physics, engineering, economics, and other disciplines where change is involved.
Definition: A differential equation is an equation containing derivatives of a function or functions.
Key Classifications
- Ordinary Differential Equations (ODEs): Contain derivatives with respect to a single independent variable.
- Partial Differential Equations (PDEs): Contain partial derivatives with respect to multiple independent variables.
- Order: The highest derivative present in the equation.
- Linear vs. Nonlinear: Linear equations involve linear combinations of the function and its derivatives.
- Homogeneous vs. Non-homogeneous: Determined by the presence of a constant term or function.
First-Order Ordinary Differential Equations
1. Separable Equations
A separable equation can be written in the form: g(y) dy = f(x) dx
The solution method involves integration: ∫g(y) dy = ∫f(x) dx + C
Example 1:
Solve the differential equation: dy/dx = xy
Solution:
Rearrange to separate variables: dy/y = x dx
Integrate both sides: ∫dy/y = ∫x dx
This gives: ln|y| = x²/2 + C
Solving for y: y = Ce^(x²/2) where C is an arbitrary constant.
2. Linear First-Order Equations
A linear first-order equation has the form: dy/dx + P(x)y = Q(x)
The solution method uses an integrating factor: μ(x) = e^(∫P(x)dx)
Example 2:
Solve the differential equation: dy/dx + 2y = 4x
Solution:
Identify P(x) = 2 and Q(x) = 4x
Find the integrating factor: μ(x) = e^(∫2dx) = e^(2x)
Multiply both sides of the equation by μ(x): e^(2x)dy/dx + 2e^(2x)y = 4xe^(2x)
The left side is now the derivative of e^(2x)y: d/dx(e^(2x)y) = 4xe^(2x)
Integrate both sides: e^(2x)y = 4∫xe^(2x)dx = 4(xe^(2x)/2 - e^(2x)/4) + C = 2xe^(2x) - e^(2x) + C
Solve for y: y = 2x - 1 + Ce^(-2x)
3. Exact Equations
An equation of the form M(x,y)dx + N(x,y)dy = 0 is exact if ∂M/∂y = ∂N/∂x
The solution is found by determining a function F(x,y) where ∂F/∂x = M and ∂F/∂y = N
Example 3:
Solve the exact differential equation: (2xy + y²)dx + (x² + 2xy)dy = 0
Solution:
Let M(x,y) = 2xy + y² and N(x,y) = x² + 2xy
Check if it's exact: ∂M/∂y = 2x + 2y and ∂N/∂x = 2x + 2y
Since they're equal, the equation is exact.
Find F(x,y) such that ∂F/∂x = M and ∂F/∂y = N
Integrate ∂F/∂x = 2xy + y² with respect to x: F(x,y) = x²y + xy² + h(y)
Differentiate with respect to y: ∂F/∂y = x² + 2xy + h'(y)
Compare with N(x,y): x² + 2xy = x² + 2xy + h'(y), so h'(y) = 0 and h(y) = C
Therefore, F(x,y) = x²y + xy² + C
The solution is given implicitly by x²y + xy² = C
4. Bernoulli Equations
A Bernoulli equation has the form: dy/dx + P(x)y = Q(x)y^n where n ≠ 0, 1
The substitution u = y^(1-n) transforms it into a linear equation.
Example 4:
Solve the Bernoulli equation: dy/dx + y = y²
Solution:
Rearrange to standard form: dy/dx + y = y²
Here, P(x) = 1, Q(x) = 1, and n = 2
Substitute u = y^(1-n) = y^(-1) = 1/y
This gives du/dx = -y^(-2)dy/dx
The original equation becomes -y^2 du/dx + y = y²
Simplify: du/dx = -1
Integrate: u = -x + C
Substitute back: 1/y = -x + C
Therefore, y = 1/(C-x)
Second-Order Ordinary Differential Equations
1. Homogeneous Linear Equations with Constant Coefficients
Equations of the form ay'' + by' + cy = 0 where a, b, c are constants.
The general solution depends on the roots of the characteristic equation ar² + br + c = 0
Example 1:
Solve the differential equation: y'' - 5y' + 6y = 0
Solution:
The characteristic equation is r² - 5r + 6 = 0
Factoring: (r - 2)(r - 3) = 0
So r = 2 or r = 3
The general solution is y = C₁e^(2x) + C₂e^(3x)
Example 2:
Solve the differential equation: y'' + 4y' + 4y = 0
Solution:
The characteristic equation is r² + 4r + 4 = 0
Factoring: (r + 2)² = 0
So r = -2 (repeated root)
The general solution is y = C₁e^(-2x) + C₂xe^(-2x)
Example 3:
Solve the differential equation: y'' + 4y = 0
Solution:
The characteristic equation is r² + 4 = 0
Solving: r = ±2i
The general solution is y = C₁cos(2x) + C₂sin(2x)
2. Non-homogeneous Linear Equations
Equations of the form ay'' + by' + cy = g(x)
The solution is the sum of the complementary solution (solution to the homogeneous equation) and a particular solution.
Example 4:
Solve the differential equation: y'' - 3y' + 2y = 4e^x
Solution:
First, find the complementary solution by solving y'' - 3y' + 2y = 0
The characteristic equation is r² - 3r + 2 = 0
Factoring: (r - 1)(r - 2) = 0, so r = 1 or r = 2
The complementary solution is y_c = C₁e^x + C₂e^(2x)
For the particular solution, since g(x) = 4e^x and e^x is part of the complementary solution, try y_p = Axe^x
Substituting into the original equation and solving for A gives y_p = -4e^x
The general solution is y = y_c + y_p = C₁e^x + C₂e^(2x) - 4e^x
3. Method of Undetermined Coefficients
A systematic approach for finding particular solutions when g(x) has specific forms (polynomials, exponentials, sines, cosines).
Example 5:
Find a particular solution for: y'' + y = 3x² + 2
Solution:
Since g(x) = 3x² + 2 is a polynomial, try a particular solution of the form y_p = Ax² + Bx + C
y_p' = 2Ax + B
y_p'' = 2A
Substituting into the original equation: 2A + (Ax² + Bx + C) = 3x² + 2
Comparing coefficients:
x²: A = 3
x¹: B = 0
x⁰: 2A + C = 2, so C = 2 - 2A = 2 - 6 = -4
Therefore, y_p = 3x² - 4
4. Variation of Parameters
A general method for finding particular solutions to non-homogeneous equations when the complementary solution is known.
Example 6:
Use variation of parameters to solve: y'' + y = sec(x)
Solution:
The complementary solution to y'' + y = 0 is y_c = C₁cos(x) + C₂sin(x)
Using variation of parameters, let y = u₁(x)cos(x) + u₂(x)sin(x)
This gives:
u₁'(x)cos(x) + u₂'(x)sin(x) = 0
u₁'(x)(-sin(x)) + u₂'(x)cos(x) = sec(x)
Solving this system:
u₁'(x) = -sin(x)sec(x) = -tan(x)
u₂'(x) = cos(x)sec(x) = 1
Integrating:
u₁(x) = ln|cos(x)|
u₂(x) = x
Therefore, y_p = ln|cos(x)|cos(x) + x·sin(x)
The general solution is y = C₁cos(x) + C₂sin(x) + ln|cos(x)|cos(x) + x·sin(x)
Systems of Differential Equations
1. Linear Systems with Constant Coefficients
Systems of the form:
dx/dt = ax + by
dy/dt = cx + dy
These can be solved using matrices, eigenvalues, and eigenvectors.
Example 1:
Solve the system:
dx/dt = 3x + 2y
dy/dt = 2x + 3y
Solution:
The system can be written as X' = AX where:
X = [x, y]^T and A = [[3, 2], [2, 3]]
Find the eigenvalues of A by solving det(A - λI) = 0:
det([[3-λ, 2], [2, 3-λ]]) = (3-λ)² - 4 = 0
This gives λ = 1 or λ = 5
For λ = 1, find the eigenvector by solving (A-λI)v = 0:
[[2, 2], [2, 2]]v = 0
This gives v₁ = [1, -1]^T
For λ = 5, find the eigenvector:
[[-2, 2], [2, -2]]v = 0
This gives v₂ = [1, 1]^T
The general solution is X = C₁e^(1t)[1, -1]^T + C₂e^(5t)[1, 1]^T
Or explicitly:
x(t) = C₁e^t + C₂e^(5t)
y(t) = -C₁e^t + C₂e^(5t)
2. Phase Plane Analysis
Visualizing the behavior of systems of two first-order ODEs in the phase plane.
Example 2:
Analyze the phase plane for the system:
dx/dt = y
dy/dt = -x
Solution:
This system represents simple harmonic motion.
Find critical points by setting dx/dt = dy/dt = 0, which gives (0,0) as the only critical point.
The eigenvalues of the coefficient matrix [[0, 1], [-1, 0]] are ±i.
Since the eigenvalues are purely imaginary, the critical point is a center.
Solutions follow elliptical trajectories around the origin, representing oscillatory behavior.
The general solution is:
x(t) = C₁cos(t) + C₂sin(t)
y(t) = -C₁sin(t) + C₂cos(t)
These equations describe circles in the phase plane with radius dependent on initial conditions.
Partial Differential Equations
1. Classification of Second-Order PDEs
Second-order PDEs in two variables can be classified as:
- Elliptic: b² - 4ac < 0 (e.g., Laplace's equation)
- Parabolic: b² - 4ac = 0 (e.g., Heat equation)
- Hyperbolic: b² - 4ac > 0 (e.g., Wave equation)
where a, b, c are coefficients in the standard form: au_xx + bu_xy + cu_yy + ...
2. Heat Equation
The one-dimensional heat equation: ∂u/∂t = k(∂²u/∂x²)
Solutions often involve Fourier series.
Example 1:
Solve the heat equation: ∂u/∂t = ∂²u/∂x² for 0 < x < L, t > 0
With boundary conditions: u(0,t) = 0, u(L,t) = 0
And initial condition: u(x,0) = f(x)
Solution:
Use separation of variables: u(x,t) = X(x)T(t)
Substituting into the PDE: X(x)T'(t) = X''(x)T(t)
Rearranging: T'(t)/T(t) = X''(x)/X(x) = -λ (a constant)
This gives two ODEs:
T'(t) + λT(t) = 0
X''(x) + λX(x) = 0
With boundary conditions: X(0) = X(L) = 0
The eigenvalues are λₙ = (nπ/L)² for n = 1, 2, 3, ...
The corresponding eigenfunctions are Xₙ(x) = sin(nπx/L)
The time-dependent part is Tₙ(t) = e^(-λₙt) = e^(-(nπ/L)²t)
The general solution is:
u(x,t) = Σₙ₌₁^∞ Bₙsin(nπx/L)e^(-(nπ/L)²t)
Using the initial condition: u(x,0) = f(x) = Σₙ₌₁^∞ Bₙsin(nπx/L)
The coefficients are given by Bₙ = (2/L)∫₀^L f(x)sin(nπx/L)dx
3. Wave Equation
The one-dimensional wave equation: ∂²u/∂t² = c²(∂²u/∂x²)
Describes vibrations in strings, sound waves, etc.
Example 2:
Solve the wave equation: ∂²u/∂t² = ∂²u/∂x² for 0 < x < L, t > 0
With boundary conditions: u(0,t) = 0, u(L,t) = 0
And initial conditions: u(x,0) = f(x), ∂u/∂t(x,0) = g(x)
Solution:
Similar to the heat equation, use separation of variables.
The eigenvalues are λₙ = (nπ/L)²
The spatial eigenfunctions are Xₙ(x) = sin(nπx/L)
The time-dependent part satisfies T''(t) + c²λₙT(t) = 0
Which has solutions Tₙ(t) = Aₙcos(nπct/L) + Bₙsin(nπct/L)
The general solution is:
u(x,t) = Σₙ₌₁^∞ sin(nπx/L)[Aₙcos(nπct/L) + Bₙsin(nπct/L)]
Using the initial conditions:
Aₙ = (2/L)∫₀^L f(x)sin(nπx/L)dx
Bₙ = (2/(nπc))(L)∫₀^L g(x)sin(nπx/L)dx
4. Laplace's Equation
Laplace's equation in two dimensions: ∂²u/∂x² + ∂²u/∂y² = 0
Used in electrostatics, fluid dynamics, and other fields.
Example 3:
Solve Laplace's equation: ∂²u/∂x² + ∂²u/∂y² = 0 in the rectangle 0 < x < a, 0 < y < b
With boundary conditions:
u(0,y) = 0, u(a,y) = 0, u(x,0) = 0, u(x,b) = f(x)
Solution:
Use separation of variables: u(x,y) = X(x)Y(y)
Substituting into the PDE: X''(x)Y(y) + X(x)Y''(y) = 0
Rearranging: X''(x)/X(x) = -Y''(y)/Y(y) = -λ
This gives two ODEs:
X''(x) + λX(x) = 0
Y''(y) - λY(y) = 0
With boundary conditions: X(0) = X(a) = 0
The eigenvalues are λₙ = (nπ/a)²
The corresponding X functions are Xₙ(x) = sin(nπx/a)
For Y, we have Y''(y) - (nπ/a)²Y(y) = 0
With general solution Yₙ(y) = Aₙsinh(nπy/a) + Bₙcosh(nπy/a)
Using boundary conditions: u(x,0) = 0 implies Bₙ = 0
The solution has the form u(x,y) = Σₙ₌₁^∞ Cₙsin(nπx/a)sinh(nπy/a)
Using the final boundary condition: u(x,b) = f(x) = Σₙ₌₁^∞ Cₙsin(nπx/a)sinh(nπb/a)
Solving for Cₙ: Cₙ = (2/a)/sinh(nπb/a) ∫₀^a f(x)sin(nπx/a)dx
Applications of Differential Equations
1. Population Growth Models
Simple growth models use the differential equation: dP/dt = kP
Logistic growth models use: dP/dt = kP(1-P/M) where M is the carrying capacity.
Example 1:
A population grows according to dP/dt = 0.03P(1-P/1000)
If the initial population is 100, find the population after 50 years.
Solution:
This is a logistic growth model with k = 0.03 and M = 1000.
The solution to the logistic equation is:
P(t) = (MP₀)/(P₀ + (M-P₀)e^(-kt))
Substituting the values:
P(50) = (1000×100)/(100 + (1000-100)e^(-0.03×50))
P(50) = 100000/(100 + 900e^(-1.5))
P(50) = 100000/(100 + 900×0.223)
P(50) = 100000/(100 + 200.7) ≈ 332.5
After 50 years, the population will be approximately 333 individuals.
2. Mechanical Vibrations
A spring-mass system can be modeled by: mx'' + cx' + kx = F(t)
where m is mass, c is damping coefficient, k is spring constant, and F(t) is external force.
Example 2:
A mass of 2 kg is attached to a spring with constant k = 8 N/m and damping coefficient c = 4 Ns/m.
If the mass is displaced 0.5 m from equilibrium and released from rest, find its position at time t.
Solution:
The differential equation is 2x'' + 4x' + 8x = 0
Dividing by 2: x'' + 2x' + 4x = 0
The characteristic equation is r² + 2r + 4 = 0
Using the quadratic formula: r = -1 ± i√3
The general solution is x(t) = e^(-t)(C₁cos(√3t) + C₂sin(√3t))
Initial conditions: x(0) = 0.5, x'(0) = 0
From x(0) = 0.5: C₁ = 0.5
From x'(0) = 0: -C₁ + C₂√3 = 0, so C₂ = 1/(√3) ≈ 0.289
Therefore: x(t) = e^(-t)(0.5cos(√3t) + 0.289sin(√3t))
This represents damped harmonic motion - the mass oscillates with decreasing amplitude over time.
3. Electrical Circuits
An RLC circuit is described by: L(d²q/dt²) + R(dq/dt) + (1/C)q = E(t)
where L is inductance, R is resistance, C is capacitance, q is charge, and E(t) is EMF.
Example 3:
In an RLC circuit with L = 1 H, R = 2 Ω, and C = 0.25 F, find the charge if q(0) = 0 and i(0) = dq/dt(0) = 1 A.
Solution:
The differential equation is q'' + 2q' + 4q = 0
This is identical to the spring-mass system in the previous example.
The characteristic equation is r² + 2r + 4 = 0
With roots r = -1 ± i√3
The general solution is q(t) = e^(-t)(C₁cos(√3t) + C₂sin(√3t))
Initial conditions: q(0) = 0, q'(0) = 1
From q(0) = 0: C₁ = 0
From q'(0) = 1: -C₁ + C₂√3 = 1, so C₂ = 1/√3 ≈ 0.577
Therefore: q(t) = 0.577e^(-t)sin(√3t)
This represents an oscillating charge that gradually decreases to zero.
4. Heat Transfer
Newton's Law of Cooling: dT/dt = -k(T-T_a)
where T is the object's temperature, T_a is ambient temperature, and k is a proportionality constant.
Example 4:
A cup of coffee at 90°C is placed in a room at 20°C. After 5 minutes, the coffee temperature is 60°C. Find its temperature after 15 minutes.
Solution:
Using Newton's Law of Cooling: dT/dt = -k(T-20)
The solution to this equation is T(t) = 20 + (T₀-20)e^(-kt)
Given T₀ = 90 and T(5) = 60, find k:
60 = 20 + (90-20)e^(-5k)
40 = 70e^(-5k)
40/70 = e^(-5k)
ln(40/70) = -5k
k = -ln(4/7)/5 ≈ 0.1116
Now find T(15):
T(15) = 20 + (90-20)e^(-0.1116×15)
T(15) = 20 + 70e^(-1.674)
T(15) = 20 + 70×0.1875 ≈ 33.1°C
Differential Equations Quiz
Question 1: Solve the separable differential equation: dy/dx = xy
Question 2: What is the general solution to the differential equation: y'' - y = 0?
Question 3: Which of the following is a linear differential equation?
Question 4: The solution to the initial value problem y' = 2y, y(0) = 3 is:
Question 5: What is the order of the differential equation: d³y/dx³ + (dy/dx)² = x²?
Quiz Results
Your score: /5