Mathematics for Electrical Science and Physical Science 1. Module 2, second-order linear odes: homogeneous, undetermined coefficients, variation of parameters.
GYMAT101 · 10 pages · Your place is saved in this browser
Contents · Second-Order Linear Ordinary Differential Equations
Second-Order Linear Ordinary Differential Equations
Learners will master techniques for solving second-order linear ordinary differential equations, covering both homogeneous and nonhomogeneous systems. They will be able to apply characteristic equations, the method of undetermined coefficients, and variation of parameters to solve initial value problems.
Before you start: Differential Calculus (differentiation rules, product rule, chain rule); Integral Calculus (integration by parts, standard trigonometric and logarithmic integrals); Basic Linear Algebra and System of Linear Equations.
Your path through this module
Structure of Second-Order Linear ODEs: Any general solution to a linear homogeneous second-order ODE is formed by a linear combination of exactly two independent solutions.
Homogeneous ODEs with Constant Coefficients: Assuming an exponential solution transforms a differential equation into a simple quadratic polynomial equation.
Method of Undetermined Coefficients: Differentiating polynomials, exponentials, and sines/cosines reproduces their own family, allowing us to guess the particular solution's algebraic form.
Method of Variation of Parameters: Replacing the constants in the homogeneous solution with variable functions yields an exact formula valid for any continuous forcing function.
Solution Verification, IVPs, and Reduction of Order: Practicing direct verification and reduction of order confirms how linear independence operates algebraically.
Constant-Coefficient Homogeneous ODEs and IVPs: Mastering the three root cases of the characteristic equation enables instant writing of the general solution.
Undetermined Coefficients: Guided Problems and IVPs: Initial conditions must always be applied to the complete solution y_h + y_p, never to y_h alone.
Undetermined Coefficients: Comprehensive Case Practice: Whenever the driving function mimics a natural solution mode, the trial solution must be boosted by powers of x to preserve independence.
Variation of Parameters Practice: Evaluating Wronskian-based integrals provides particular solutions even for functions that do not possess finite derivative sets.
Structure of Second-Order Linear ODEs
In differential calculus, you learned to take derivatives to find rates of change, such as velocity and acceleration from position. This lesson lets you classify second-order differential equations and build their complete solution spaces from individual pieces.
Imagine a mass bouncing on a spring: Newton's second law relates its acceleration (y′′) to its velocity (y′) and position (y). When the relationship involves only first powers of these terms, we write the equation in standard form as y′′+p(x)y′+q(x)y=r(x). It is called linear because y and its derivatives are never raised to powers or multiplied by each other. If the external driving force r(x)=0, the equation is homogeneous; if r(x)=0, it is nonhomogeneous.
For a homogeneous linear equation, the superposition principle guarantees that if y1(x) and y2(x) are solutions, any combination y(x)=c1y1(x)+c2y2(x) is also a solution for any constants c1 and c2. To describe every possible motion, the two solutions must be linearly independent, meaning one is not simply a constant multiple of the other (y2=ky1). Two independent solutions form a basis (or fundamental system), and their combination provides the general solution.
To test independence, we use a determinant called the Wronskian, defined as W(y1,y2)=y1y2′−y1′y2. If W(y1,y2)=0 across an interval, the two solutions are independent and span the full solution space.
If you already know one valid solution y1(x), you can find a second independent solution y2(x) using reduction of order. By substituting y2(x)=v(x)y1(x) into the ODE, the equation collapses into a simpler first-order problem for v′, yielding the formula:
y2(x)=y1(x)∫y1(x)2e−∫p(x)dxdx
Worked example
Find a second independent solution to y′′−4y′+4y=0, given that y1(x)=e2x.
Identify the coefficient p(x): In standard form, the coefficient of y′ is p(x)=−4.
Compute the numerator exponential: Calculate e−∫p(x)dx=e−∫(−4)dx=e4x.
Set up and evaluate the integral: Divide by y12=(e2x)2=e4x:
∫e4xe4xdx=∫1dx=x
Form the second solution: Multiply this result by y1(x) to get y2(x)=xe2x.
Write the general solution: Combine them to obtain y(x)=c1e2x+c2xe2x.
Remember
The general solution to y′′+p(x)y′+q(x)y=0 requires exactly two linearly independent solutions: y=c1y1+c2y2.
Two solutions are independent if their Wronskian W=y1y2′−y1′y2 is nonzero.
If one solution y1 is known, reduction of order determines y2 by setting y2=v(x)y1.
Homogeneous ODEs with Constant Coefficients
In the previous lesson, we saw that any general solution to a second-order linear homogeneous equation is built from two independent solutions: y=c1y1+c2y2. When the equation has constant coefficients, finding those two solutions requires nothing more than high school algebra.
Consider the equation y′′+ay′+by=0, where a and b are fixed real numbers. Think of a physical system like a car shock absorber: the restoring and damping forces depend directly on position and speed. The only function whose derivatives naturally match its own shape—allowing terms to cancel to zero—is the exponential function y=eλx.
If we substitute y=eλx, y′=λeλx, and y′′=λ2eλx into the differential equation, we get (λ2+aλ+b)eλx=0. Because eλx is never zero, we can divide it out. This leaves the characteristic equation (also called the auxiliary equation): λ2+aλ+b=0. Solving this quadratic gives the values of λ needed to construct our solution.
The roots fall into three distinct cases depending on the quadratic discriminant:
Distinct real roots (λ1=λ2): The solutions are pure exponentials, giving y=c1eλ1x+c2eλ2x. On a graph, this looks like smooth exponential growth or decay.
Repeated real root (λ1=λ2=λ): A single root only gives one exponential. To obtain a second independent solution, multiply by x: y=c1eλx+c2xeλx.
Complex conjugate roots (λ=α±iβ): Using Euler's formula (eiθ=cosθ+isinθ), imaginary powers convert into sines and cosines: y=eαx(c1cos(βx)+c2sin(βx)). Graphically, this is an oscillation with an exponentially growing or decaying amplitude.
An initial value problem provides starting values y(x0)=k0 and y′(x0)=k1. Substituting these values into the general solution and its derivative yields two linear equations to pin down c1 and c2.
Worked example
Solve y′′−4y′+13y=0 subject to y(0)=2 and y′(0)=1.
Write the characteristic equation: Replace derivatives with powers of λ to get λ2−4λ+13=0.
Find the roots: By the quadratic formula, λ=24±16−52=2±3i. Here α=2 and β=3.
Form the general solution: Plug α and β into the complex-root template: y(x)=e2x(c1cos(3x)+c2sin(3x)).
Differentiate to prepare for initial conditions: Using the product rule, y′(x)=2e2x(c1cos(3x)+c2sin(3x))+e2x(−3c1sin(3x)+3c2cos(3x)).
Apply y(0)=2: Since e0=1, cos(0)=1, and sin(0)=0, we find c1=2.
State the final result: y(x)=e2x(2cos(3x)−sin(3x)).
Remember
The characteristic equation λ2+aλ+b=0 converts the ODE into an algebraic quadratic problem.
Repeated roots gain a factor of x; complex roots α±iβ produce oscillations governed by eαxcos(βx) and eαxsin(βx).
Given initial conditions y(x0) and y′(x0), differentiate the general solution once to solve for constants c1 and c2.
Method of Undetermined Coefficients
Now that you can solve homogeneous equations where a system vibrates freely, we can add an external push—known as a forcing term—to model driven systems like a car riding over rhythmic bumps. This lesson shows you how to find the full response of the system by predicting the algebraic shape of the forced motion.
When an external force f(x) acts on the system, giving ay′′+by′+cy=f(x), the complete solution divides into two parts: y(x)=yh(x)+yp(x). The homogeneous solution yh describes the natural, unforced behavior, while the particular solution yp is any single specific function that balances the external push.
Why does guessing work? Differentiating polynomials, exponentials, and sines or cosines keeps them within their own algebraic families. A derivative of an exponential is an exponential, and derivatives of sines produce cosines. Therefore, we select a trial form for yp using unknown constants, plug it into the differential equation, and equate like terms on both sides to find those constants.
If the forcing function consists of several added pieces, the sum rule tells us to add the corresponding trial forms together. However, if any term in your trial guess duplicates a term already present in yh, the differential operator will crush it to zero instead of matching the force. This behavior represents resonance. To fix it, use the modification rule: multiply the trial guess by x (or x2 if the characteristic root is repeated) until no part duplicates a term in yh.
Worked example
Find the general solution to y′′−3y′+2y=4e3x.
Find the homogeneous solution yh: Solve the characteristic equation r2−3r+2=(r−1)(r−2)=0. The roots are r=1 and r=2, yielding yh=C1ex+C2e2x.
Choose the trial form for yp: The forcing term is 4e3x. Because e3x does not appear in yh, duplication is not an issue. We guess yp=Ae3x, where A is an undetermined coefficient.
Substitute into the differential equation: Taking derivatives gives yp′=3Ae3x and yp′′=9Ae3x. Substituting these into the left side yields (9Ae3x)−3(3Ae3x)+2(Ae3x)=2Ae3x.
Solve for the coefficient: Set the result equal to the forcing function: 2Ae3x=4e3x. Equating coefficients gives 2A=4, so A=2. Thus, yp=2e3x.
Write the complete solution: Combine the natural and driven responses: y(x)=C1ex+C2e2x+2e3x.
Remember
The general solution is always the sum of the natural response and the forced response: y=yh+yp.
Trial forms must mirror the family of the forcing function (polynomial, exponential, or sinusoidal combinations).
If a trial term duplicates any part of yh, multiply that trial term by x until the overlap is gone.
Method of Variation of Parameters
You already know how to find particular solutions when the forcing term has cycling derivatives, like polynomials or sines. But what happens if an engine is driven by a force like sec(x) or ln(x)? Because their derivatives keep creating new shapes indefinitely, guessing fails; variation of parameters provides a universal formula that works for any continuous forcing function.
Imagine a radio receiver with two tuning knobs, c1 and c2, in the homogeneous response yh=c1y1+c2y2. Instead of leaving those knobs permanently fixed at constant values, we let them continuously adjust over time as functions, u1(x) and u2(x). Our new particular solution takes the form yp=u1(x)y1(x)+u2(x)y2(x).
To find these functions, we measure how independent the two fundamental solutions are using the Wronskian, denoted W(y1,y2). The Wronskian is a 2×2 determinant formed by the solutions and their slopes: W=y1y2′−y2y1′. You can picture this as tracking the area spanned by the two solution states at each point; since y1 and y2 are independent, this area is never zero.
For an equation in standard form y′′+p(x)y′+q(x)y=g(x), substituting yp yields two straightforward formulas for the rates at which our knobs must turn:
u1′(x)=−W(x)y2(x)g(x),u2′(x)=W(x)y1(x)g(x)
Integrating both gives u1(x) and u2(x), directly assembling yp.
Worked example
Find the general solution to y′′+y=sec(x).
Find the homogeneous solutions: The characteristic equation r2+1=0 gives roots r=±i, so y1=cos(x) and y2=sin(x).
Compute the Wronskian: Apply the determinant definition to ensure independence:
Set up and evaluate u1 and u2: Plug g(x)=sec(x) into the rate formulas:
u1′(x)=−1sin(x)sec(x)=−tan(x)⟹u1(x)=ln∣cos(x)∣
u2′(x)=1cos(x)sec(x)=1⟹u2(x)=x
Assemble the general solution: Combine y=yh+yp:
y(x)=c1cos(x)+c2sin(x)+cos(x)ln∣cos(x)∣+xsin(x)
Remember
Always divide the ODE by the coefficient of y′′ first so that g(x) is identified correctly.
The Wronskian W=y1y2′−y2y1′ sits in the denominator of both parameter rates.
The first rate carries a negative sign: u1′=−y2g/W, while u2′=y1g/W.
Solution Verification, IVPs, and Reduction of Order
Having covered fundamental ODE properties in theory, you will now practice verifying solutions and generating independent bases from scratch. Practicing direct verification and reduction of order confirms how linear independence operates algebraically.
The idea
A function y=h(x) is a solution of a second-order ODE on an open interval I if it is twice differentiable on I and turns the equation into a true identity when you substitute h, h′, and h′′ for y, y′, and y′′. Once you verify two solutions y1 and y2 that are not proportional (y1/y2=constant), they form a basis (or fundamental system) of linearly independent solutions. Their linear combination y=c1y1+c2y2 is the general solution.
An initial value problem (IVP) pairs the ODE with two initial conditions, y(x0)=k0 and y′(x0)=k1, at a single point x0. Because the general solution contains two arbitrary constants c1 and c2, you need both the function value and the derivative value to lock in a unique curve. Substituting these conditions into y and y′ gives two algebraic equations; solving for c1 and c2 yields the particular solution.
Sometimes you only know one solution y1 of a homogeneous equation in standard form, y′′+p(x)y′+q(x)y=0, where the coefficient of y′′ is 1. Reduction of order finds a second, independent solution y2 without guessing. Seeking y2 as a non-constant multiple of y1 cancels the zero-order terms and reduces the problem to a direct integration:
y2=y1∫y121e−∫p(x)dxdx
The resulting y1 and y2 are guaranteed to form a basis.
Worked example
Given: The homogeneous ODE y′′+y=0 and the candidate functions y=cosx and y=sinx.
Find: Whether y=cosx and y=sinx are solutions of the ODE.
Differentiate the first candidate y=cosx twice to get y′=−sinx and y′′=−cosx, because we must substitute both the function and its second derivative into the ODE.
Substitute y and y′′ into y′′+y=0 to obtain −cosx+cosx=0, which simplifies to the identity 0=0 and confirms y=cosx is a solution.
Differentiate the second candidate y=sinx twice to find y′=cosx and y′′=−sinx.
Substitute these into y′′+y=0 to get −sinx+sinx=0, confirming that y=sinx is also a solution.
Answer: Both y=cosx and y=sinx are solutions of y′′+y=0.
More problems
Problem 2: Checking exponential candidates by substitution
Given: The ODE y′′−5y′+6y=0 and candidate functions y=e2x and y=ex.
Find: Whether e2x and ex are solutions of the ODE.
Differentiate y=e2x twice using the chain rule to get y′=2e2x and y′′=4e2x.
Substitute into the ODE to get 4e2x−5(2e2x)+6e2x=0, confirming y=e2x is a solution.
Differentiate y=ex twice to get y′=ex and y′′=ex.
Substitute into the ODE to get ex−5ex+6ex=2ex=0, showing ex fails the equation.
Answer:y=e2x is a solution, whereas y=ex is not a solution.
Problem 3: Solving an IVP with trigonometric solutions
Given: Solutions y1=cosx and y2=sinx for y′′+y=0, with y(0)=3 and y′(0)=−0.5.
Find: The general solution and the particular solution.
Combine the basis functions to write the general solution y=c1cosx+c2sinx.
Differentiate y to get y′=−c1sinx+c2cosx so we can apply the derivative condition.
Substitute y(0)=3 into y to get c1cos0+c2sin0=3, which gives c1=3.
Substitute y′(0)=−0.5 into y′ to get −c1sin0+c2cos0=−0.5, giving c2=−0.5.
Insert c1=3 and c2=−0.5 into the general solution to form the particular solution.
Answer: General solution: y=c1cosx+c2sinx; Particular solution: y=3cosx−0.5sinx.
Problem 4: Verifying a basis and solving an IVP
Given: Candidates y1=ex and y2=e−x for y′′−y=0, with y(0)=6 and y′(0)=−2.
Find: Verification that y1 and y2 are solutions, and the particular solution of the IVP.
Compute y1′=ex and y1′′=ex, then substitute into y′′−y=0 to get ex−ex=0.
Compute y2′=−e−x and y2′′=e−x, then substitute into y′′−y=0 to get e−x−e−x=0.
Write the general solution y=c1ex+c2e−x since ex and e−x are not proportional.
Differentiate the general solution to obtain y′=c1ex−c2e−x.
Apply y(0)=6 and y′(0)=−2 to get the system c1+c2=6 and c1−c2=−2.
Add the two equations to find 2c1=4⇒c1=2, then substitute back to get c2=4.
Substitute c1=2 and c2=4 into the general solution.
Answer: Both ex and e−x are verified solutions; the particular solution is y=2ex+4e−x.
Problem 5: Finding a second solution by reduction of order
Given: The ODE y′′−5y′+6y=0 and one known solution y1=e2x.
Find: A second linearly independent solution y2 using reduction of order.
Compare y′′−5y′+6y=0 with standard form y′′+p(x)y′+q(x)y=0 to identify p(x)=−5.
Substitute y1=e2x and p=−5 into the reduction of order formula y2=y1∫y121e−∫pdxdx.
Evaluate y12=e4x and the integrating factor e−∫−5dx=e5x to get y2=e2x∫e4xe5xdx.
Simplify the integrand to ex and integrate to find y2=e2x∫exdx=e2xex=e3x.
Watch out. Keep the negative sign attached to p(x)=−5 and remember the formula already has a minus sign in e−∫pdx, making the exponent +5x.
Answer:y2=e3x.
Constant-Coefficient Homogeneous ODEs and IVPs
With the general solution structure understood, you can now apply characteristic equations to solve homogeneous differential equations of increasing complexity. Mastering the three root cases of the characteristic quadratic equation allows you to write down the general solution instantly and solve initial value problems systematically.
The idea
Substituting the exponential trial solution y=eλx into the constant-coefficient equation y′′+ay′+by=0 transforms the calculus problem into an algebra problem: the characteristic equation (or auxiliary equation) λ2+aλ+b=0. Because every second-order linear homogeneous ODE requires two linearly independent solutions to form a basis, the algebraic nature of the roots λ1,λ2 dictates the exact functional form of the general solution (also called the complementary function, yh).
When the quadratic yields two distinct real roots λ1=λ2, the two exponential functions eλ1x and eλ2x are automatically independent, giving y=c1eλ1x+c2eλ2x. If the discriminant a2−4b is zero, you get a real double rootλ=−a/2. Because repeating eλx fails linear independence, reduction of order multiplies the second term by x, producing the basis eλx and xeλx and the general solution y=(c1+c2x)eλx. When the discriminant is negative, the quadratic formula produces complex conjugate rootsα±iβ. Applying Euler's formula converts complex exponentials into real oscillating functions modulated by an exponential envelope, yielding y=eαx[c1cos(βx)+c2sin(βx)].
To solve an initial value problem (IVP), you first write the general solution for the appropriate root case, differentiate it once to obtain y′(x), and substitute the given initial values y(x0) and y′(x0). This creates a 2×2 linear system of algebraic equations for the unknown constants c1 and c2.
Worked example
Problem 2.2:Given: The homogeneous differential equation y′′+36y=0.
Find: The general solution y(x) and check the answer by direct substitution.
Replace y′′ with λ2 and y with 1 to write the characteristic equation λ2+36=0, since y′=0⋅y′ has coefficient a=0.
Solve the quadratic equation for λ to obtain the pure imaginary conjugate roots λ=±6i, which correspond to complex roots α±iβ with real part α=0 and imaginary part β=6.
Substitute α=0 and β=6 into the Case 3 complex-root template y=eαx[c1cos(βx)+c2sin(βx)] to get the general solution y(x)=c1cos(6x)+c2sin(6x) because e0x=1.
Differentiate y(x) twice using the chain rule to verify the solution: y′(x)=−6c1sin(6x)+6c2cos(6x) and y′′(x)=−36c1cos(6x)−36c2sin(6x).
Substitute y′′ and y into the left-hand side of the ODE: [−36c1cos(6x)−36c2sin(6x)]+36[c1cos(6x)+c2sin(6x)]=0, confirming the solution is valid.
Answer:y(x)=c1cos(6x)+c2sin(6x)
More problems
Problem 2.1: Distinct real roots from a two-term ODE
Given: The differential equation 4y′′−25y=0.
Find: The general solution y(x) and verify it by substitution.
Divide the equation by 4 to put it into standard form y′′−425y=0.
Write the characteristic equation λ2−425=0 and solve to find distinct real roots λ=±25.
Write the Case 1 general solution y(x)=c1e25x+c2e−25x.
Differentiate twice to get y′(x)=25c1e25x−25c2e−25x and y′′(x)=425c1e25x+425c2e−25x.
Substitute y′′ and y into y′′−425y=0 to obtain 425c1e25x+425c2e−25x−425[c1e25x+c2e−25x]=0.
Answer:y(x)=c1e25x+c2e−25x
Problem 2.3: General solution with distinct negative roots
Given: The differential equation y′′+9y′+20y=0.
Find: The general solution y(x) and check by substitution.
Form the characteristic equation λ2+9λ+20=0 and factor it as (λ+5)(λ+4)=0.
Extract the distinct real roots λ=−5,−4 and write the general solution y=c1e−5x+c2e−4x.
Differentiate twice: y′=−5c1e−5x−4c2e−4x and y′′=25c1e−5x+16c2e−4x.
Substitute y,y′,y′′ into the ODE to get (25−45+20)c1e−5x+(16−36+20)c2e−4x=0.
Answer:y=c1e−5x+c2e−4x
Problem 2.4: Repeated transcendental root
Given: The differential equation y′′+2πy′+π2y=0.
Find: The general solution y(x) and check by substitution.
Write the characteristic equation λ2+2πλ+π2=0 and factor the perfect square as (λ+π)2=0.
Identify the real double root λ=−π and write the Case 2 general solution y(x)=(c1+c2x)e−πx.
Differentiate using the product rule to find y′(x)=(c2−πc1−πc2x)e−πx and y′′(x)=(π2c1−2πc2+π2c2x)e−πx.
Substitute y,y′,y′′ into y′′+2πy′+π2y=0 so all terms cancel to 0.
Answer:y(x)=(c1+c2x)e−πx
Problem 1.3: Initial value problem with pure imaginary roots
Given: The initial value problem y′′+y=0, y(0)=3, y′(0)=−0.5.
Find: The particular solution y(x).
Solve the characteristic equation λ2+1=0 to obtain complex roots λ=±i with α=0,β=1.
Write the general solution y=C1cosx+C2sinx and differentiate to get y′=−C1sinx+C2cosx.
Apply y(0)=3 to the general solution to find C1=3.
Apply y′(0)=−0.5 to the derivative to find C2=−0.5, and substitute both constants into y(x).
Answer:y(x)=3cosx−0.5sinx
Problem 4.2: Oscillating IVP with frequency scaling
Given: The initial value problem y′′+25y=0, y(0)=4.6, y′(0)=−1.2.
Find: The particular solution y(x).
Solve the characteristic equation λ2+25=0 to get λ=±5i, giving y=c1cos5x+c2sin5x.
Differentiate using the chain rule to obtain y′=−5c1sin5x+5c2cos5x.
Substitute y(0)=4.6 into y to get c1=4.6.
Substitute y′(0)=−1.2 into y′ to get 5c2=−1.2⟹c2=−0.24.
Watch out. Do not forget the chain-rule factor of 5 when differentiating sin5x, or c2 will be off by a factor of 5.
Answer:y=4.6cos5x−0.24sin5x
Problem 1.1: Initial value problem with distinct real roots
Given: The initial value problem y′′+y′−2y=0, y(0)=4, y′(0)=5 (solved using y′(0)=−5 in steps).
Find: The particular solution y(x).
Factor the characteristic equation λ2+λ−2=0 as (λ−1)(λ+2)=0 to get roots λ1=1,λ2=−2.
Write the general solution y=c1ex+c2e−2x and differentiate to get y′=c1ex−2c2e−2x.
Apply y(0)=4 and y′(0)=−5 to form the linear system c1+c2=4 and c1−2c2=−5.
Subtract the second equation from the first to get 3c2=9⟹c2=3, which gives c1=4−3=1.
Watch out. The problem statement prints y′(0)=5, but the worked steps and answer use y′(0)=−5 (which gives y=ex+3e−2x; using +5 gives y=313ex−31e−2x).
Answer:y=ex+3e−2x
Problem 4.1: Distinct real roots with zero initial velocity
Given: The initial value problem y′′+y′−6y=0, y(0)=10, y′(0)=0.
Find: The particular solution y(x).
Factor the characteristic equation λ2+λ−6=0 as (λ+3)(λ−2)=0 to find roots λ=−3,2.
Write the general solution y=c1e−3x+c2e2x and its derivative y′=−3c1e−3x+2c2e2x.
Substitute x=0 into both expressions to form the system c1+c2=10 and −3c1+2c2=0.
Multiply c1+c2=10 by −3 and add to −3c1+2c2=0 to find c2=6 and c1=4.
Answer:y=4e−3x+6e2x
Problem 1.2: Double root IVP via quadratic formula
Given: The initial value problem y′′+y′+0.25y=0, y(0)=3, y′(0)=−3.5.
Find: The particular solution y(x).
Apply the quadratic formula to λ2+λ+0.25=0: λ=2−1±1−4(0.25)=−0.5.
Write the Case 2 general solution for the double root: y=(C1+C2x)e−0.5x.
Differentiate using the product rule to obtain y′=C2e−0.5x−0.5(C1+C2x)e−0.5x.
Substitute y(0)=3 to get C1=3, and substitute y′(0)=−3.5 to get C2−0.5(3)=−3.5⟹C2=−2.
Answer:y=(3−2x)e−0.5x
Problem 4.3: Double root IVP via factoring
Given: The initial value problem y′′+y′+0.25y=0, y(0)=3, y′(0)=−3.5.
Find: The particular solution y(x).
Factor the characteristic equation λ2+λ+0.25=0 as (λ+0.5)2=0 to get the double root λ=−0.5,−0.5.
Write the general solution y=(c1+c2x)e−0.5x and differentiate: y′=(c1+c2x)(−0.5)e−0.5x+c2e−0.5x.
Evaluate at x=0 using y(0)=3 to get c1=3.
Evaluate y′(0)=−3.5 to get −0.5(3)+c2=−3.5⟹c2=−2, then substitute c1,c2 into y.
Watch out. The final line prints an extra leading 3+ typo in y=3+(3−2x)e−0.5x; substituting c1=3 and c2=−2 into (c1+c2x)e−0.5x gives (3−2x)e−0.5x.
Answer:y=3+(3−2x)e−0.5x (or y=(3−2x)e−0.5x)
Undetermined Coefficients: Guided Problems and IVPs
You already know how to find the general solution yh for homogeneous equations with constant coefficients and how to choose trial forms for undetermined coefficients. Now you will find particular solutions yp for driven equations and apply initial conditions to the complete solution y=yh+yp.
The idea
A nonhomogeneous linear ODE has a driving term r(x) on the right-hand side: y′′+ay′+by=r(x). Its general solution on an open interval is the sum y(x)=yh(x)+yp(x), where yh=c1y1+c2y2 solves the corresponding homogeneous equation and the particular solutionyp is any solution to the full equation containing no arbitrary constants.
To find yp using undetermined coefficients, follow three choice rules. Under the basic rule, pick a trial form matching the family of r(x); for instance, a degree-n polynomial requires a full polynomial Knxn+…+K1x+K0 because derivatives of xn generate lower powers of x that must cancel out. Under the modification rule, if your trial term is already a solution in yh, multiply it by x—or by x2 if it matches a double root of the characteristic equation—so it does not vanish when plugged into the left-hand side. Under the sum rule, if r(x) is a sum of functions, add their corresponding trial forms together.
When solving an initial value problem, the key rule in words is: initial conditions must always be applied to the complete general solution y=yh+yp, never to yh alone. The particular solution yp contributes to both the initial value y(0) and the initial slope y′(0), so finding c1 and c2 before adding yp will give the wrong constants.
Worked example
Given: The initial value problem y′′+y=0.001x2 with initial conditions y(0)=0 and y′(0)=1.5.
Find: The particular solution y(x) satisfying the ODE and initial conditions.
Solve the corresponding homogeneous equation y′′+y=0 by forming its characteristic equation m2+1=0, which gives roots m=±i and the homogeneous solution yh=C1cosx+C2sinx.
Choose the trial solution yp=K2x2+K1x+K0 using the basic rule for the polynomial r(x)=0.001x2, including all lower powers of x to balance the derivatives.
Differentiate twice to get yp′=2K2x+K1 and yp′′=2K2, and substitute yp and yp′′ into the ODE to obtain K2x2+K1x+(2K2+K0)=0.001x2.
Equate coefficients of like powers of x on both sides to find K2=0.001, K1=0, and 2K2+K0=0⟹K0=−0.002, which gives yp=0.001x2−0.002.
Combine yh and yp to form the complete general solution y=C1cosx+C2sinx+0.001x2−0.002 before touching the initial conditions.
Differentiate the complete solution to get y′=−C1sinx+C2cosx+0.002x, then apply y(0)=0⟹C1−0.002=0⟹C1=0.002 and y′(0)=1.5⟹C2=1.5.
Figure: Table of choice rules for undetermined coefficients
A two-column handwritten table specifying the choice rules for the method of undetermined coefficients. The left column header is 'Term in r(x)' and the right column header is 'Choice for y_p(x).'. Row 1: Left column has 'k e^{\alpha x}', right column has 'C e^{\alpha x}'. Row 2: Left column has 'k x^n (n = 0, 1, 2, ...)', right column has 'K_n x^n + K_{n-1} x^{n-1} + ... + K_1 x + K_0'. Row 3: Left column lists two terms stacked vertically, 'k \cos \omega x' and 'k \sin \omega x', which are grouped together by a right curly brace '}' pointing to the right column entry 'K \cos \omega x + M \sin \omega x .'. Row 4: Left column lists two terms stacked vertically, 'k e^{\alpha x} \cos \omega x' and 'k e^{\alpha x} \sin \omega x', which are grouped together by a right curly brace '}' pointing to the right column entry 'e^{\alpha x} (K \cos \omega x + M \sin \omega x)'.
Answer:y=0.002cosx+1.5sinx+0.001x2−0.002
More problems
Problem 2: Exponential forcing at a double characteristic root
Given:y′′+3y′+2.25y=−10e−1.5x with y(0)=1 and y′(0)=0.
Find: The solution y(x) to the initial value problem.
Solve the characteristic equation λ2+3λ+2.25=(λ+1.5)2=0 to get yh=(c1+c2x)e−1.5x.
Choose yp=cx2e−1.5x by multiplying by x2 because e−1.5x corresponds to a double root of the characteristic equation.
Compute the derivatives yp′=c(2x−1.5x2)e−1.5x and yp′′=c(2.25x2−6x+2)e−1.5x using the product rule.
Substitute yp,yp′,yp′′ into the ODE and cancel e−1.5x to get (2.25c−4.5c+2.25c)x2+(−6c+6c)x+2c=−10.
Solve 2c=−10 to find c=−5, giving the general solution y=(c1+c2x)e−1.5x−5x2e−1.5x.
Differentiate the general solution to get y′=(c2−1.5c1−1.5c2x+7.5x2−10x)e−1.5x.
Apply y(0)=1 and y′(0)=0 to find c1=1 and c2−1.5c1=0⟹c2=1.5.
Watch out. Because λ=−1.5 is a double root, multiplying the trial term by a single x still gives a homogeneous solution cxe−1.5x; you must multiply by x2.
Answer:y=(1+1.5x−5x2)e−1.5x
Problem 3: Sum rule with trigonometric and polynomial forcing
Given:y′′+2y′+0.75y=2cosx−0.25sinx+0.09x with y(0)=2.78 and y′(0)=−0.43.
Find: The solution y(x) to the initial value problem.
Solve the characteristic equation λ2+2λ+0.75=0 to get roots λ=−1/2,−3/2 and yh=c1e−x/2+c2e−3x/2.
Apply the sum rule to choose the combined trial form yp=Kcosx+Msinx+K1x+K0.
Compute yp′=−Ksinx+Mcosx+K1 and yp′′=−Kcosx−Msinx, then substitute into the ODE.
Group like terms to get (2M−0.25K)cosx+(−0.25M−2K)sinx+0.75K1x+(2K1+0.75K0) on the left.
Equate the cosx and sinx coefficients to 2 and −0.25, solving the system to get K=0 and M=1.
Equate the polynomial coefficients to get 0.75K1=0.09⟹K1=0.12 and 2K1+0.75K0=0⟹K0=−0.32.
Write the general solution y=c1e−x/2+c2e−3x/2+sinx+0.12x−0.32 and differentiate it.
Substitute y(0)=2.78 and y′(0)=−0.43 to get c1+c2=3.1 and −c1−3c2=−3.1, giving c1=3.1,c2=0.
Answer:y=3.1e−x/2+sinx+0.12x−0.32
Undetermined Coefficients: Comprehensive Case Practice
You have already solved basic nonhomogeneous differential equations and applied initial conditions to the complete solution y=yh+yp. Now you will tackle a wide range of forcing functions that require sinusoidal pairs, sum rules, and modifications when the forcing term overlaps with the homogeneous solution.
The idea
The method of undetermined coefficients works because differentiating polynomials, exponentials, and sines or cosines produces terms from the exact same families. For a sinusoidal forcing term like sin(ωx) or cos(ωx), differentiation switches between sine and cosine, so your trial solutionyp must always include both: Kcos(ωx)+Msin(ωx). When the forcing function r(x) is a sum of different families, the sum rule lets you add their individual trial forms together. When r(x) is a product, such as eαxcos(ωx), you multiply the corresponding trial forms together.
A critical complication arises when a term in your basic trial choice is already a solution to the homogeneous equation y′′+ay′+by=0. Substituting such a term into the left side produces zero, making it impossible to match the non-zero right side r(x). This overlap is called resonance.
The modification rule fixes this: whenever the driving function mimics a natural solution mode in yh, multiply the entire trial solution block by x to preserve linear independence. If the matching root λ of the characteristic equation is a simple root (or a complex conjugate pair), multiply the trial form by x. In a critically damped system where λ is a double root (so both eλx and xeλx are already in yh), you face double resonance and must boost the trial solution by x2.
Worked example
Problem 2: Exponential forcing with no resonance
Given:y′′−4y′−12y=3e5xFind: The general solution y(x).
Write the characteristic equation λ2−4λ−12=0 for the homogeneous ODE y′′−4y′−12y=0 to find the natural modes.
Factor as (λ−6)(λ+2)=0 to get roots λ=6,−2, giving the homogeneous solution yh=c1e6x+c2e−2x.
Choose the trial solution yp(x)=ke5x because the forcing function r(x)=3e5x is exponential and e5x does not appear in yh.
Differentiate yp twice to get yp′=5ke5x and yp′′=25ke5x so you can substitute them into the ODE.
Substitute yp,yp′,yp′′ into the given ODE to get 25ke5x−4(5ke5x)−12(ke5x)=3e5x.
Combine the left-side terms into (25k−20k−12k)e5x=−7ke5x and compare the coefficient of e5x with the right side to get −7k=3, so k=−73.
Add yh and yp=−73e5x to form the complete general solution.
Answer:y=c1e6x+c2e−2x−73e5x
More problems
Problem 1: Quadratic polynomial forcing
Given:y′′+4y=x2Find: The general solution y(x).
Solve the characteristic equation λ2+4=0 to get λ=±2i, yielding yh=C1cos2x+C2sin2x.
Choose the full quadratic trial solution yp(x)=k2x2+k1x+k0 since r(x)=x2 is a degree-2 polynomial.
Compute the derivatives yp′=2k2x+k1 and yp′′=2k2.
Substitute into the ODE to get 2k2+4(k2x2+k1x+k0)=x2.
Group by powers of x as (4k2)x2+(4k1)x+(2k2+4k0)=x2.
Equate coefficients of x2,x, and constants: 4k2=1⇒k2=41, 4k1=0⇒k1=0, and 2k2+4k0=0⇒k0=−81.
Combine yh and yp(x)=41x2−81 to write the general solution.
Answer:y=C1cos2x+C2sin2x+41x2−81
Problem 8: Linear polynomial forcing
Given:y′′+3y′+2y=x+1Find: The general solution y(x).
Solve the homogeneous equation y′′+3y′+2y=0 to write the homogeneous solution yh=c1e−3x+c2e−x.
Choose the linear trial solution yp=K1x+K0 for the degree-1 polynomial forcing term x+1.
Differentiate to get yp′=K1 and yp′′=0, and substitute into the ODE: 3K1+2(K1x+K0)=x+1.
Compare coefficients of x and constants (2K1=1 and 3K1+2K0=1) to find K1=21 and K0=−41 (printed as +41).
Sum yh and yp=2x+41 to write the general solution.
Watch out. Thecharacteristic roots of λ2+3λ+2=0 are λ=−2,−1 and the constant term satisfies 3(21)+2K0=1⇒K0=−41, which does not match the printed e−3x and +41.
Answer:y=c1e−3x+c2e−x+2x+41
Problem 7: Combined exponential and constant forcing
Given:y′′+2y=ex+2Find: The general solution y(x).
Solve λ2+2=0 to find λ=±i2, giving yh=c1cos2x+c2sin2x.
Choose yp=Kex+M by the sum rule for r(x)=ex+2.
Differentiate twice to get yp′=Kex and yp′′=Kex.
Substitute into the ODE to obtain Kex+2(Kex+M)=(K+2K)ex+2M=ex+2.
Compare coefficients to get 3K=1⇒K=31 and 2M=2⇒M=1.
Combine yh and yp=3ex+1 for the general solution.
Answer:y=c1cos2x+c2sin2x+3ex+1
Problem 3: Sinusoidal forcing with a first-derivative term
Given:y′′+y′−2y=sinxFind: The general solution y(x).
Factor the characteristic equation λ2+λ−2=(λ+2)(λ−1)=0 to get λ=−2,1 and yh=c1e−2x+c2ex.
Choose yp=Kcosx+Msinx because y′ mixes sine and cosine terms.
Differentiate to find yp′=−Ksinx+Mcosx and yp′′=−Kcosx−Msinx.
Substitute into the ODE and group: (M−3K)cosx+(−3M−K)sinx=sinx.
Set coefficients equal to the right side: M−3K=0 and −3M−K=1.
Substitute M=3K into the second equation to get −10K=1⇒K=−101 and M=−103.
Combine yh and yp=−101cosx−103sinx.
Answer:y=c1e−2x+c2ex−101cosx−103sinx
Problem 4: Simple exponential resonance
Given:y′′−2y′−3y=2e3xFind: The general solution y(x).
Factor λ2−2λ−3=(λ+1)(λ−3)=0 to get λ=3,−1, so yh=c1e3x+c2e−x.
Multiply the basic trial choice ke3x by x to get yp=Kxe3x because λ=3 is a simple root of the characteristic equation.
Apply the product rule to find yp′=K[3xe3x+e3x] and yp′′=[9Kx+6K]e3x.
Substitute into the ODE: [9Kx+6K]e3x−2K[3xe3x+e3x]−3Kxe3x=2e3x.
Simplify the left side; the xe3x terms cancel out ((9K−6K−3K)xe3x=0), leaving 4Ke3x=2e3x.
Solve 4K=2 to get K=21, so yp=21xe3x.
Add yh and yp to form the final solution.
Watch out. In step 1 the second root is λ=−1 giving c2e−x, which does not match the printed C2e−2x in the final line.
Answer:y=C1e3x+C2e−2x+2xe3x
Problem 9: Polynomial forcing with a zero characteristic root
Given:y′′+y′=x2+2x+4Find: The general solution y(x).
Solve λ2+λ=λ(λ+1)=0 to get roots λ=0,−1 and yh=c1+c2e−x.
Multiply the standard quadratic choice by x to get yp=[Ax2+Bx+C]x=Ax3+Bx2+Cx because a constant term c1 is already in yh.
Differentiate to find yp′=3Ax2+2Bx+C and yp′′=6Ax+2B.
Substitute into y′′+y′=x2+2x+4 to get 3Ax2+(6A+2B)x+(2B+C)=x2+2x+4.
Equate coefficients (3A=1, 6A+2B=2, 2B+C=4) to get A=31, B=0, and C=4.
Write yp=31x3+4x and add yh to obtain the general solution.
Answer:y=c1+c2e−x+3x3+4x
Problem 5: Double exponential resonance in a critically damped system
Given:y′′+4y′+4y=e−2xFind: The general solution y(x).
Solve λ2+4λ+4=(λ+2)2=0 to find the double root λ=−2,−2, giving yh=(C1+C2x)e−2x.
Choose yp=Kx2e−2x by multiplying by x2, because −2 is a double root so both e−2x and xe−2x are in yh.
Differentiate using the product rule to get yp′=K[−2x2e−2x+2xe−2x].
Differentiate again and simplify to get yp′′=[4Kx2−8Kx+2K]e−2x.
Substitute yp,yp′,yp′′ into the ODE: [4Kx2−8Kx+2K]e−2x+4[−2Kx2+2Kx]e−2x+4[Kx2]e−2x=e−2x.
Group terms on the left; both x2e−2x and xe−2x cancel completely, leaving 2Ke−2x=e−2x.
Solve 2K=1⇒K=21 to get yp=2x2e−2x, and add yh.
Answer:y=(C1+C2x)e−2x+2x2e−2x
Problem 6: Pure oscillatory resonance
Given:y′′+4y=cos2xFind: The general solution y(x).
Solve λ2+4=0 to get λ=±2i and yh=c1cos2x+c2sin2x.
Multiply the entire sinusoidal pair by x to get yp(x)=x[Kcos2x+Msin2x]=Kxcos2x+Mxsin2x because cos2x is in yh.
Differentiate a second time and collect terms: yp′′=K[−4xcos2x−4sin2x]+M[−4xsin2x+4cos2x].
Substitute yp′′ and yp into y′′+4y=cos2x; the xcos2x and xsin2x terms cancel, leaving −4Ksin2x+4Mcos2x=cos2x.
Compare coefficients to get −4K=0⇒K=0 and 4M=1⇒M=41.
Combine yh and yp=41xsin2x to write the general solution.
Watch out. Never try yp=Kxcos2x alone; the product rule creates a sin2x term in yp′′ that can only be balanced if Mxsin2x is included from the start.
Answer:y=c1cos2x+c2sin2x+4xsin2x
Problem 10: Combined polynomial and trigonometric forcing
Given:y′′−2y′+3y=x2+cosxFind: The general solution y(x).
Use the quadratic formula on λ2−2λ+3=0 to find λ=1±i2, giving yh=ex[c1cos2x+c2sin2x].
Combine a quadratic polynomial and a sinusoidal pair for the trial solution: yp=K2x2+K1x+K0+Acosx+Bsinx.
Compute yp′=2K2x+K1−Asinx+Bcosx and yp′′=2K2−Acosx−Bsinx.
Substitute into the ODE and group like terms: (2A−2B)cosx+(2A+2B)sinx+3K2x2+(−4K2+3K1)x+(2K2−2K1+3K0)=x2+cosx.
Equate the trigonometric coefficients (2A+2B=1 and −2A+2B=0 as written) to find A=41 and B=−41.
Equate the polynomial coefficients (3K2=1, −4K2+3K1=0, 2K2−2K1+3K0=0) to find K2=31, K1=94, and K0=272.
Sum yh and yp to form the complete general solution.
Watch out. Grouping the cosx terms from step 4 actually gives 2A−2B=1 and sinx gives 2A+2B=0 (which yields A=41,B=−41), whereas solving the written system 2A+2B=1 and −2A+2B=0 would give B=+41.
Problem 11: Exponentially damped sinusoidal forcing
Given:y′′−4y′+13y=e2xcosxFind: The general solution y(x).
Solve the auxiliary equation λ2−4λ+13=0 via the quadratic formula to get λ=2±3i and yh=e2x(c1cos3x+c2sin3x).
Choose the product trial form yp=e2x[Kcosx+Msinx] since 2±i is not a root of the auxiliary equation.
Differentiate using the product rule to get yp′=e2x[(2K+M)cosx+(−K+2M)sinx].
Differentiate again and collect terms: yp′′=e2x[(3K+4M)cosx+(−4K+3M)sinx].
Substitute yp′′,yp′,yp into the ODE and divide out e2x: [3K+4M−4M−8K+13K]cosx+[−4K+3M+4K−8M+13M]sinx=cosx.
Simplify to 8Kcosx+8Msinx=cosx and compare coefficients to find 8K=1⇒K=81 and 8M=0⇒M=0.
Combine yh and yp=8e2xcosx for the general solution.
Answer:y=e2x(c1cos3x+c2sin3x)+8e2xcosx
Variation of Parameters Practice
With undetermined coefficients mastered for elementary forms, you can now apply the universal variation of parameters technique to arbitrary driving functions. Evaluating Wronskian-based integrals provides particular solutions even for functions that do not possess finite derivative sets.
The idea
Undetermined coefficients fails when the forcing term r(x) is a function like secx, tanx, or lnx, because differentiating these functions produces an endless chain of new algebraic forms. Variation of parameters bypasses guessing altogether. By replacing the constants in the homogeneous solution yh=c1y1(x)+c2y2(x) with unknown functions, we construct a direct integral formula that works for any continuous driving term.
To execute the method, first find the solution basisy1,y2 of the corresponding homogeneous equation y′′+p(x)y′+q(x)y=0. Next, compute the WronskianW, which is the determinant W=y1y2′−y2y1′ that measures the linear independence of the basis. Because y1 and y2 are independent, W is never zero, allowing us to divide by it inside the particular solution formula:
yp(x)=−y1∫Wy2r(x)dx+y2∫Wy1r(x)dx
Notice that y1 and y2 sit outside the integrals while their partners sit inside. In practice, exponential factors in y1,y2, and r(x) often cancel against the Wronskian, leaving clean integrals that you can evaluate using trigonometric identities or integration by parts.
Worked example
Given: The nonhomogeneous differential equation y′′+y=secx.
Find: The general solution y=yh+yp.
Solve the homogeneous equation y′′+y=0 via its characteristic equation λ2+1=0 to get roots λ=±i, which gives the basis y1=cosx, y2=sinx and yh=C1cosx+C2sinx.
Compute the Wronskian determinant to form the denominator of the integral formula:
W=cosx−sinxsinxcosx=cos2x+sin2x=1
Substitute y1=cosx, y2=sinx, r(x)=secx, and W=1 into the variation of parameters formula:
yp=−cosx∫(sinxsecx)dx+sinx∫(cosxsecx)dx
Rewrite secx as 1/cosx so the integrands simplify to basic trigonometric ratios:
Solve λ2+9=0 to get λ=±3i, giving y1=cos3x, y2=sin3x, and yh=C1cos3x+C2sin3x.
Calculate the Wronskian W=(cos3x)(3cos3x)−(sin3x)(−3sin3x)=3(cos23x+sin23x)=3.
Set up the particular solution yp=−cos3x∫3sin3xsec3xdx+sin3x∫3cos3xsec3xdx.
Simplify using sec3x=1/cos3x to get yp=−3cos3x∫cos3xsin3xdx+3sin3x∫dx.
Integrate both terms (accounting for the inner derivative of 3x) to obtain yp=91cos3xln∣cos3x∣+3xsin3x.
Combine yh and yp to write the general solution.
Watch out. Both the Wronskian (W=3) and the u-substitution u=cos3x (du=−3sin3xdx) introduce a factor of 3 in the denominator, producing 91 on the logarithmic term.