Unit 2: Ordinary Differential Equation
        
        Order and Degree of a Differential Equation
        
        Order
        The order of an ordinary differential equation (ODE) is the order of the highest derivative present in the equation.
        
            - Example 1: dy/dx + 2y = x². The highest derivative is dy/dx (1st derivative). So, the order is 1.
- Example 2: d²y/dx² + 3(dy/dx)⁴ + 5y = 0. The highest derivative is d²y/dx² (2nd derivative). So, the order is 2.
Degree
        The degree of an ODE is the highest power (exponent) of the highest order derivative, after the equation has been made free from radicals and fractional powers of the derivatives.
        
            - Example 1: (d²y/dx²)³ + dy/dx = 0. The highest order derivative is d²y/dx². Its power is 3. So, the degree is 3.
- Example 2: d²y/dx² + 3(dy/dx)⁴ + 5y = 0. The highest order derivative is d²y/dx². Its power is 1. So, the degree is 1. (The power of the lower-order derivative doesn't matter).
- Example 3 (Tricky): y'' = (1 + (y')²)3/2. To find the degree, we must remove the fractional power.
                
 Square both sides: (y'')² = (1 + (y')²)³.
 The highest derivative is y'', and its power is 2. So, Order = 2, Degree = 2.
        First Order ODEs
        A first-order ODE has the general form dy/dx = f(x, y) or M(x,y)dx + N(x,y)dy = 0.
        
        Variable Separable
        This is the simplest form. The equation can be rearranged so that all terms involving 'y' are on one side (with 'dy') and all terms involving 'x' are on the other side (with 'dx').
        
            - Form: f(y) dy = g(x) dx
- Solution: Integrate both sides.
                
                    ∫ f(y) dy = ∫ g(x) dx + C
                 (where C is the constant of integration)
- Example: dy/dx = x/y.
                
 Rearrange: y dy = x dx.
 Integrate: ∫y dy = ∫x dx + C
 Solution: y²/2 = x²/2 + C  or  y² - x² = C'
Exact Equation
        An equation of the form M(x,y)dx + N(x,y)dy = 0 is called "exact" if it is the total differential (du) of some function u(x,y).
        
            - Condition for Exactness:
                
                    ∂M/∂y = ∂N/∂x
                 (The partial derivative of M with respect to y equals the partial derivative of N with respect to x).
- Solution Method:
                
                    - Check if ∂M/∂y = ∂N/∂x. If yes, proceed.
- The solution is given by:
                        ∫ M dx (treating y as constant) + ∫ (terms in N not containing x) dy = C 
 
Integrating Factors (I.F.)
        If an equation M(x,y)dx + N(x,y)dy = 0 is not exact (i.e., ∂M/∂y ≠ ∂N/∂x), we can sometimes find a function μ(x,y), called an Integrating Factor (I.F.), to multiply the entire equation by. The new equation `(μM)dx + (μN)dy = 0` will then be exact.
        Finding the I.F. can be hard. Two common cases are:
        
            - If `(1/N) * (∂M/∂y - ∂N/∂x)` is a function of x only, say f(x), then:
                I.F. = e∫f(x)dx 
- If `(1/M) * (∂N/∂x - ∂M/∂y)` is a function of y only, say g(y), then:
                I.F. = e∫g(y)dy 
Linear Equations
        A first-order linear ODE has a standard form:
        
            dy/dx + P(x)y = Q(x)
        
        where P(x) and Q(x) are functions of x (or constants).
        
            - Solution Method:
                
                    - Identify P(x) and Q(x) from the standard form.
- Calculate the Integrating Factor (I.F.):
                        I.F. = e∫P(x)dx 
- The general solution is given by the formula:
                        
                            y * (I.F.) = ∫ [ Q(x) * (I.F.) ] dx + C
                         
 
- Example: dy/dx + (1/x)y = x.
                
 Here, P(x) = 1/x and Q(x) = x.
 I.F. = e∫(1/x)dx = eln(x) = x.
 Solution: y * (x) = ∫ [ x * (x) ] dx + C
 xy = ∫x² dx + C
 xy = x³/3 + C  or  y = x²/3 + C/x
        Second Order ODEs (Homogeneous)
        We will focus on linear second-order ODEs with constant coefficients.
        The general solution (y) is the sum of two parts: the Complementary Function (yc) and the Particular Integral (yp).
        
            y = yc + yp
        
        
        Homogeneous Form:  a y'' + b y' + c y = 0
        The homogeneous form is when the right-hand side is zero. The solution to this part is the Complementary Function (yc).
        
        Step 1: The Auxiliary Equation (A.E.)
        We assume a trial solution of the form y = emx. Substituting this into the ODE gives:
        a(m²emx) + b(memx) + c(emx) = 0
        emx (am² + bm + c) = 0
        Since emx cannot be zero, we must solve the quadratic equation:
        
            am² + bm + c = 0
        
        This is the Auxiliary Equation (A.E.). Let the roots be m₁ and m₂.
        Step 2: Find yc based on the roots
        There are three possible cases for the roots of the A.E.:
        
        
            
                
                    | Case | Roots (m₁, m₂) | Complementary Function (yc) | 
            
            
                
                    | Case 1: Real and Distinct Roots | m₁ and m₂ are real, m₁ ≠ m₂ | yc = C₁em₁x + C₂em₂x | 
                
                    | Case 2: Real and Equal Roots | m₁ = m₂ = m (real) | yc = (C₁ + C₂x)emx | 
                
                    | Case 3: Complex Roots | m = α ± iβ (complex conjugate pair) | yc = eαx (C₁cos(βx) + C₂sin(βx)) | 
            
        
        where C₁ and C₂ are arbitrary constants, determined by initial/boundary conditions.
        
            Example (Simple Harmonic Motion):
            
d²x/dt² + ω²x = 0.
            
A.E: m² + ω² = 0
            
Roots: m² = -ω²  →  m = ±√(-ω²) = ±iω.
            
This is Case 3, with α = 0 and β = ω.
            
Solution: x(t) = e0t (C₁cos(ωt) + C₂sin(ωt)) = C₁cos(ωt) + C₂sin(ωt), which is the well-known SHM solution.
        
        
        Second Order ODEs (Non-Homogeneous)
        The non-homogeneous form is a y'' + b y' + c y = f(x), where f(x) is not zero.
        The General Solution is y = yc + yp.
        
            - We find yc exactly as above (by solving the homogeneous form).
- We need to find the Particular Integral (yp), which is any solution that satisfies the full non-homogeneous equation.
Method for Finding Particular Integrals (yp)
        The syllabus mentions the "Method for finding particular integrals," which typically refers to the Method of Undetermined Coefficients. This method involves making an educated guess for the form of yp based on the form of f(x).
        
            
                
                    | If f(x) is... | Trial Solution for yp | 
            
            
                
                    | A constant, k | A constant, A | 
                
                    | A polynomial, e.g., ax² + bx + c | A polynomial of the same degree, e.g., Ax² + Bx + C | 
                
                    | An exponential, keax | Aeax | 
                
                    | A sine or cosine, e.g., k sin(ax) or k cos(ax) | A sin(ax) + B cos(ax) (must include both) | 
                
                    | A product, e.g., eax sin(bx) | eax (A sin(bx) + B cos(bx)) | 
            
        
        Step-by-step to find yp:
        
            - Look at f(x) and choose the appropriate trial form for yp from the table.
- Differentiate this trial yp to find yp' and yp''.
- Substitute yp, yp', and yp'' into the full non-homogeneous equation (a y'' + b y' + c y = f(x)).
- Equate coefficients on both sides of the equation to solve for the unknown constants (A, B, C, etc.).
- The resulting expression is your yp.
            CRITICAL Exam Pitfall (Resonance):
            
            If your chosen trial solution for yp (or any part of it) is already present in the Complementary Function (yc), it will not work (it will just give 0 when plugged in).
            
            Solution: Multiply your entire trial solution by x.
            
            If that solution is *still* in yc (which happens in Case 2, repeated roots), multiply by x².
            
            Example: y'' + y = sin(x).
            
A.E: m² + 1 = 0 → m = ±i → yc = C₁cos(x) + C₂sin(x).
            
f(x) = sin(x). Our normal trial would be yp = A sin(x) + B cos(x).
            
Problem: This is the same form as yc!
            
Corrected Trial: yp = x (A sin(x) + B cos(x)).