Solving Common Second-Order Linear ODEs
Second-order linear ODEs are fundamental in engineering and physics. We'll cover the primary methods for solving them, focusing on equations with constant coefficients and the Cauchy-Euler equation.
1. Homogeneous Linear Equations with Constant Coefficients
Definition
Equations of the form:
\[ ay'' + by' + cy = 0 \]where \(a, b, c\) are real constants and \(a \neq 0\).
Methodology (Characteristic Equation)
- Assume a solution of the form \( y = e^{rx} \). Substitute this into the ODE: \( a(r^2 e^{rx}) + b(r e^{rx}) + c(e^{rx}) = 0 \).
- Since \( e^{rx} \) is never zero, divide by it to get the characteristic (or auxiliary) equation: \( ar^2 + br + c = 0 \).
- Solve this quadratic equation for \(r\). There are three cases based on the discriminant \( \Delta = b^2 - 4ac \):
- Case 1: Distinct Real Roots (\(\Delta > 0\))
Two distinct real roots \(r_1, r_2\).
The general solution is: \( y(x) = c_1 e^{r_1 x} + c_2 e^{r_2 x} \) - Case 2: Repeated Real Root (\(\Delta = 0\))
One real root \(r = -b/2a\).
The general solution is: \( y(x) = (c_1 + c_2 x) e^{r x} \) - Case 3: Complex Conjugate Roots (\(\Delta < 0\))
Two complex roots \(r = \alpha \pm i\beta\), where \(\alpha = -b/2a\) and \(\beta = \sqrt{4ac - b^2}/2a\).
The general solution is: \( y(x) = e^{\alpha x} (c_1 \cos(\beta x) + c_2 \sin(\beta x)) \)
Examples
a) Solve: \( y'' + 5y' + 6y = 0 \)
b) Solve: \( y'' - 6y' + 9y = 0 \)
c) Solve: \( y'' + 4y' + 13y = 0 \)
2. Non-Homogeneous Linear Equations with Constant Coefficients
Definition
Equations of the form:
\[ ay'' + by' + cy = g(x) \]where \(a, b, c\) are constants (\(a \neq 0\)) and \( g(x) \) is a non-zero function.
The general solution is \( y(x) = y_c(x) + y_p(x) \), where \( y_c \) is the solution to the homogeneous equation \( ay'' + by' + cy = 0 \), and \( y_p \) is any particular solution.
General Methodology
- Find the complementary function \(y_c(x)\) by solving the associated homogeneous equation \( ay'' + by' + cy = 0 \) using the characteristic equation method (Section 1).
- Find a particular solution \(y_p(x)\) using one of the methods below (Undetermined Coefficients or Variation of Parameters).
- The general solution is the sum: \( y(x) = y_c(x) + y_p(x) \).
Method 1: Undetermined Coefficients
This method works when \(g(x)\) is a polynomial, exponential (\(e^{kx}\)), sine (\(\sin(kx)\)), cosine (\(\cos(kx)\)), or finite sums and products of these functions.
- Based on the form of \(g(x)\), make an educated guess for the form of \(y_p(x)\) with unknown coefficients.
- If \(g(x)\) is polynomial of degree \(n\), guess \(y_p\) as a full polynomial of degree \(n\).
- If \(g(x) = A e^{kx}\), guess \(y_p = B e^{kx}\).
- If \(g(x) = A \cos(kx)\) or \(A \sin(kx)\), guess \(y_p = B \cos(kx) + D \sin(kx)\).
- Combine these for sums/products (e.g., if \(g(x)=x e^{2x}\), guess \(y_p=(Ax+B)e^{2x}\)).
- Modification Rule: Compare your initial guess for \(y_p\) with the terms in \(y_c\). If any term in the guess is already present in \(y_c\), multiply the entire guess by \(x\). If it's still present, multiply by \(x\) again.
- Substitute the (modified) guess for \(y_p\) and its derivatives into the non-homogeneous ODE.
- Equate coefficients of like terms on both sides to solve for the unknown coefficients in your guess.
- Substitute the found coefficients back into \(y_p\).
Example (Undetermined Coefficients)
Solve: \( y'' - 2y' - 3y = 5e^{3x} \)
Method 2: Variation of Parameters
This method works for any function \(g(x)\), provided you know the complementary function \( y_c = c_1 y_1(x) + c_2 y_2(x) \). It's generally more complex computationally than Undetermined Coefficients.
- Find the complementary function \( y_c = c_1 y_1(x) + c_2 y_2(x) \).
- Assume the particular solution has the form \( y_p(x) = u_1(x) y_1(x) + u_2(x) y_2(x) \).
- Calculate the Wronskian: \( W(y_1, y_2) = y_1 y_2' - y_1' y_2 \).
- Find \( u_1'(x) \) and \( u_2'(x) \) using the formulas: \[ u_1'(x) = - \frac{y_2(x) g(x)}{a W(y_1, y_2)} \] \[ u_2'(x) = \frac{y_1(x) g(x)}{a W(y_1, y_2)} \] (Remember to include the leading coefficient \(a\) from \(ay''+...\) if it's not 1).
- Integrate \( u_1'(x) \) and \( u_2'(x) \) to find \( u_1(x) \) and \( u_2(x) \). (No need for constants of integration here, they get absorbed into \(y_c\)).
- Construct the particular solution: \( y_p(x) = u_1(x) y_1(x) + u_2(x) y_2(x) \).
Example (Variation of Parameters)
Solve: \( y'' + 4y = \sec(2x) \)
3. Cauchy-Euler Equations
Definition
Equations with variable coefficients of the specific form:
\[ ax^2 y'' + bxy' + cy = g(x) \]where \(a, b, c\) are constants (\(a \neq 0\)). Typically solved for \(x > 0\).
Methodology (Homogeneous Case)
- Assume a solution of the form \( y = x^r \). Calculate \( y' = rx^{r-1} \) and \( y'' = r(r-1)x^{r-2} \).
- Substitute into the homogeneous equation \( ax^2 y'' + bxy' + cy = 0 \): \( ax^2(r(r-1)x^{r-2}) + bx(rx^{r-1}) + c(x^r) = 0 \).
- Simplify and factor out \( x^r \) (since \(x > 0\)): \( [ar(r-1) + br + c] x^r = 0 \).
- Solve the auxiliary equation: \( ar(r-1) + br + c = 0 \) or \( ar^2 + (b-a)r + c = 0 \).
- Find the roots \(r\). There are three cases:
- Case 1: Distinct Real Roots \(r_1, r_2\)
General solution: \( y_c(x) = c_1 x^{r_1} + c_2 x^{r_2} \) - Case 2: Repeated Real Root \(r\)
General solution: \( y_c(x) = (c_1 + c_2 \ln x) x^r \) - Case 3: Complex Conjugate Roots \(r = \alpha \pm i\beta\)
General solution: \( y_c(x) = x^{\alpha} [c_1 \cos(\beta \ln x) + c_2 \sin(\beta \ln x)] \) - For the non-homogeneous case \( ax^2 y'' + bxy' + cy = g(x) \), find \( y_c \) as above, then use Variation of Parameters to find \( y_p \). Remember to use \(g(x)/a\) in the formulas if \(a \neq 1\).
Alternative: Use the substitution \(x=e^t\) (\(t=\ln x\)) to transform it into a constant coefficient equation in \(t\).
Example (Homogeneous Cauchy-Euler)
Solve: \( x^2y'' + 5xy' + 4y = 0 \) for \( x > 0 \)
4. Reduction of Order
Definition
A technique used to find a second, linearly independent solution \(y_2(x)\) to a second-order linear homogeneous ODE \(a(x)y'' + b(x)y' + c(x)y = 0\), given that one non-trivial solution \(y_1(x)\) is already known.
Methodology
- Start with the homogeneous ODE \(a(x)y'' + b(x)y' + c(x)y = 0\) and known solution \(y_1(x)\).
- Assume the second solution is of the form \( y_2(x) = v(x) y_1(x) \).
- Calculate derivatives: \( y_2' = v'y_1 + vy_1' \) and \( y_2'' = v''y_1 + 2v'y_1' + vy_1'' \).
- Substitute \( y_2, y_2', y_2'' \) into the ODE.
- Simplify the equation. The terms involving \(v\) (without derivatives) will cancel out because \(y_1\) is a solution. This leaves an equation involving \(v''\) and \(v'\).
- Let \( w = v' \). The equation becomes a first-order linear ODE in \(w\). Solve for \(w\).
- Integrate \(w\) to find \(v\): \( v = \int w dx \).
- The second solution is \( y_2 = v y_1 \). (Any constant multiple can be ignored).
- The general solution is \( y(x) = c_1 y_1(x) + c_2 y_2(x) \).
- Alternatively, use the formula derived from this process (ensure ODE is in form \(y''+P(x)y'+Q(x)y=0\)): \[ y_2(x) = y_1(x) \int \frac{e^{-\int P(x) dx}}{(y_1(x))^2} dx \]
Example (Reduction of Order)
Given that \( y_1(x) = x \) is a solution to \( x^2y'' - x(x+2)y' + (x+2)y = 0 \) for \( x > 0 \), find the general solution.