evan's notes
cal 3discreteodeenv systems
中文

On this page

  • Homogeneous equations with constant coefficients
  • Why exponential trial functions work
  • Example: two distinct real roots
  • The principle of superposition
  • A complete initial-value problem
  • Existence and uniqueness on an interval
  • The Wronskian and fundamental solutions
  • Distinct real roots in general
  • Applying the distinct-root formula
  • Example: two opposite real roots
  • Complex characteristic roots
  • Euler's formula
  • Turning one complex solution into two real solutions
  • Applying the complex-root formula
  • Example: a complex-root initial-value problem
  • Repeated roots
  • Constructing the second solution
  • Example: a repeated-root initial-value problem
  • Choosing the right pair of solutions
  • Reduction of order with variable coefficients
  • Example: finding a second power-function solution
  • Nonhomogeneous equations
  • Why the solutions add this way
  • The method of undetermined coefficients
  • Example: exponential forcing
  • Example: trigonometric forcing
  • Choosing a complete trial
  • Splitting a sum of forcing terms
  • Resonance in undetermined coefficients
  • Example: a simple characteristic root
  • Example: a repeated characteristic root
  • The trial-form rule
  • Variation of parameters
  • Choosing the two unknown functions
  • Solving the two conditions
  • The general solution
  • Example: recovering the resonant exponential
  • Example: tangent forcing
  • Choosing a particular-solution method

Ordinary Differential Equations

§3 Second-Order Linear Equations

Evan Luo · Sep 23, 2026

Ordinary Differential Equations

§3 Second-Order Linear Equations

Evan LuoSep 23, 2026

36 min read

A second-order differential equation has y′′y''y′′ as its highest derivative; it may also contain y′y'y′ and yyy. For a linear equation, the normalized form is

y′′+p(t)y′+q(t)y=g(t).y''+p(t)y'+q(t)y=g(t). y′′+p(t)y′+q(t)y=g(t).

Here ppp, qqq, and ggg are known functions of the independent variable ttt. The equation is homogeneous when g(t)=0g(t)=0g(t)=0 throughout the interval under consideration:

y′′+p(t)y′+q(t)y=0.y''+p(t)y'+q(t)y=0. y′′+p(t)y′+q(t)y=0.

If ggg is not identically zero, the equation is nonhomogeneous. The function ggg is the input or forcing term.

Because the equation is second order, an initial-value problem normally needs two pieces of information at the same time t0t_0t0​:

y(t0)=y0,y′(t0)=y0′.y(t_0)=y_0, \qquad y'(t_0)=y'_0. y(t0​)=y0​,y′(t0​)=y0′​.

The first condition fixes the starting value. The second fixes the starting slope. We need two independent solutions to accommodate both conditions; later, the Wronskian will tell us whether a chosen pair does that.

Homogeneous equations with constant coefficients

Start with

ay′′+by′+cy=0,ay''+by'+cy=0, ay′′+by′+cy=0,

where aaa, bbb, and ccc are constants. We assume a≠0a\ne0a=0 so that this is genuinely a second-order equation. If a=0a=0a=0 but b≠0b\ne0b=0, it reduces to the first-order equation

y′=−cby,y'=-\frac cb y, y′=−bc​y,

whose solutions are y(t)=Ce−(c/b)ty(t)=Ce^{-(c/b)t}y(t)=Ce−(c/b)t.

Why exponential trial functions work

The equation balances a function's value, slope, and second derivative. For a≠0a\ne0a=0, we want a function whose derivatives keep the same shape, so all three terms can share a common factor. Exponentials do exactly that. Try

y(t)=ert,y(t)=e^{rt}, y(t)=ert,

where rrr is a constant that we still need to find. Exponentials are useful here because differentiating them only introduces powers of rrr:

y′(t)=rert,y′′(t)=r2ert.y'(t)=re^{rt}, \qquad y''(t)=r^2e^{rt}. y′(t)=rert,y′′(t)=r2ert.

Put these expressions into the differential equation:

ar2ert+brert+cert=0.ar^2e^{rt}+bre^{rt}+ce^{rt}=0. ar2ert+brert+cert=0.

Factor out the common exponential:

ert(ar2+br+c)=0.e^{rt}\bigl(ar^2+br+c\bigr)=0. ert(ar2+br+c)=0.

The exponential erte^{rt}ert is never zero, so the polynomial factor must vanish:

ar2+br+c=0.\boxed{ar^2+br+c=0}. ar2+br+c=0​.

The polynomial

P(r)=ar2+br+cP(r)=ar^2+br+c P(r)=ar2+br+c

is the characteristic polynomial, and P(r)=0P(r)=0P(r)=0 is the characteristic equation. Each real root gives a real exponential solution. Repeated or non-real roots require an extra step, so the first example uses two distinct real roots.

Example: two distinct real roots

Consider

y′′+5y′+6y=0.y''+5y'+6y=0. y′′+5y′+6y=0.

Its characteristic equation is

r2+5r+6=0.r^2+5r+6=0. r2+5r+6=0.

Factor it:

(r+2)(r+3)=0.(r+2)(r+3)=0. (r+2)(r+3)=0.

The roots are

r1=−2,r2=−3,r_1=-2, \qquad r_2=-3, r1​=−2,r2​=−3,

so we get two solutions:

y1(t)=e−2t,y2(t)=e−3t.y_1(t)=e^{-2t}, \qquad y_2(t)=e^{-3t}. y1​(t)=e−2t,y2​(t)=e−3t.

The principle of superposition

For the homogeneous equation

y′′+p(t)y′+q(t)y=0,y''+p(t)y'+q(t)y=0, y′′+p(t)y′+q(t)y=0,

any linear combination of solutions is another solution. This is the principle of superposition: if y1y_1y1​ and y2y_2y2​ solve the equation, then

y(t)=C1y1(t)+C2y2(t)y(t)=C_1y_1(t)+C_2y_2(t) y(t)=C1​y1​(t)+C2​y2​(t)

also solves it for every C1,C2∈RC_1,C_2\in\mathbb RC1​,C2​∈R.

The reason is the linearity of differentiation. Define the differential operator

L[y]=y′′+p(t)y′+q(t)y.L[y]=y''+p(t)y'+q(t)y. L[y]=y′′+p(t)y′+q(t)y.

Then

L[C1y1+C2y2]=C1L[y1]+C2L[y2]=C1(0)+C2(0)=0.\begin{aligned} L[C_1y_1+C_2y_2] &=C_1L[y_1]+C_2L[y_2]\\ &=C_1(0)+C_2(0)\\ &=0. \end{aligned} L[C1​y1​+C2​y2​]​=C1​L[y1​]+C2​L[y2​]=C1​(0)+C2​(0)=0.​

This argument depends on the right side being zero. If L[y1]=gL[y_1]=gL[y1​]=g and L[y2]=gL[y_2]=gL[y2​]=g, then

L[C1y1+C2y2]=(C1+C2)g,L[C_1y_1+C_2y_2]=(C_1+C_2)g, L[C1​y1​+C2​y2​]=(C1​+C2​)g,

which is not generally equal to ggg. Arbitrary superposition is therefore a property of the associated homogeneous equation, not of a nonhomogeneous equation with fixed forcing.

A complete initial-value problem

Return to

y′′+5y′+6y=0.y''+5y'+6y=0. y′′+5y′+6y=0.

Superposition gives the family

y(t)=C1e−2t+C2e−3t.y(t)=C_1e^{-2t}+C_2e^{-3t}. y(t)=C1​e−2t+C2​e−3t.

Now impose

y(0)=2,y′(0)=3.y(0)=2, \qquad y'(0)=3. y(0)=2,y′(0)=3.

Evaluating the solution and its derivative at t=0t=0t=0 gives

C1+C2=2,C_1+C_2=2, C1​+C2​=2,

and

−2C1−3C2=3.-2C_1-3C_2=3. −2C1​−3C2​=3.

The same system can be written as

(11−2−3)(C1C2)=(23).\begin{pmatrix} 1&1\\ -2&-3 \end{pmatrix} \begin{pmatrix} C_1\\ C_2 \end{pmatrix} = \begin{pmatrix} 2\\ 3 \end{pmatrix}. (1−2​1−3​)(C1​C2​​)=(23​).

Its determinant is −1-1−1, so the system has one solution:

C1=9,C2=−7.C_1=9, \qquad C_2=-7. C1​=9,C2​=−7.

Therefore the unique solution of the IVP is

y(t)=9e−2t−7e−3t.\boxed{y(t)=9e^{-2t}-7e^{-3t}}. y(t)=9e−2t−7e−3t​.

A quick check confirms both initial conditions:

y(0)=9−7=2,y′(t)=−18e−2t+21e−3t,y′(0)=−18+21=3.\begin{aligned} y(0)&=9-7=2,\\ y'(t)&=-18e^{-2t}+21e^{-3t},\\ y'(0)&=-18+21=3. \end{aligned} y(0)y′(t)y′(0)​=9−7=2,=−18e−2t+21e−3t,=−18+21=3.​

The initial slope lifts the solution before both modes decay

Solution of the second-order initial-value problemThe solution starts at height two with initial slope three, rises to one maximum, and then approaches zero from above as time increases.y(0)=2y′(0)=3y(t)=9e−2t−7e−3tty
The curve y(t)=9e−2t−7e−3t starts at y(0)=2 and initially rises because y′(0)=3. Both exponential modes decay, so the solution eventually approaches zero from above.

The positive initial slope explains why the curve rises at first. Both exponential terms decay as ttt increases, so the solution eventually approaches zero.

Existence and uniqueness on an interval

Consider the linear IVP

y′′+p(t)y′+q(t)y=g(t),y(t0)=y0,y′(t0)=y0′.\begin{aligned} y''+p(t)y'+q(t)y&=g(t),\\ y(t_0)&=y_0,\\ y'(t_0)&=y'_0. \end{aligned} y′′+p(t)y′+q(t)yy(t0​)y′(t0​)​=g(t),=y0​,=y0′​.​

Let III be an open interval with t0∈It_0\in It0​∈I. If ppp, qqq, and ggg are continuous on the interval III, then the IVP has exactly one solution on the entire interval III:

y:I→R.y:I\to\mathbb R. y:I→R.

This is stronger than a merely local statement. The solution does not stop at an interior point where the normalized coefficients remain continuous. The interval ends only where the chosen coefficient interval ends; it need not be all of R\mathbb RR.

If an equation is initially written as

a2(t)y′′+a1(t)y′+a0(t)y=h(t),a_2(t)y''+a_1(t)y'+a_0(t)y=h(t), a2​(t)y′′+a1​(t)y′+a0​(t)y=h(t),

first divide by a2(t)a_2(t)a2​(t). The normalized coefficients are

p(t)=a1(t)a2(t),q(t)=a0(t)a2(t),g(t)=h(t)a2(t).p(t)=\frac{a_1(t)}{a_2(t)}, \qquad q(t)=\frac{a_0(t)}{a_2(t)}, \qquad g(t)=\frac{h(t)}{a_2(t)}. p(t)=a2​(t)a1​(t)​,q(t)=a2​(t)a0​(t)​,g(t)=a2​(t)h(t)​.

The theorem applies on an interval where a2(t)≠0a_2(t)\ne0a2​(t)=0 and these three quotients are continuous. A zero of a2a_2a2​ can split the real line into separate coefficient intervals.

The Wronskian and fundamental solutions

The Wronskian answers a concrete question: do two solutions provide enough freedom to match any starting value and slope? Given two differentiable functions fff and ggg, their Wronskian is

W[f,g](t)=det⁡(f(t)g(t)f′(t)g′(t))=f(t)g′(t)−f′(t)g(t).\begin{aligned} W[f,g](t) &=\det \begin{pmatrix} f(t)&g(t)\\ f'(t)&g'(t) \end{pmatrix}\\ &=f(t)g'(t)-f'(t)g(t). \end{aligned} W[f,g](t)​=det(f(t)f′(t)​g(t)g′(t)​)=f(t)g′(t)−f′(t)g(t).​

The Wronskian tells us whether two solution functions provide independent initial data. Suppose y1y_1y1​ and y2y_2y2​ solve the same homogeneous second-order linear equation on III, with ppp and qqq continuous there. To make

y=C1y1+C2y2y=C_1y_1+C_2y_2 y=C1​y1​+C2​y2​

satisfy prescribed values at t0t_0t0​, the constants must solve

(y1(t0)y2(t0)y1′(t0)y2′(t0))(C1C2)=(y0y0′).\begin{pmatrix} y_1(t_0)&y_2(t_0)\\ y_1'(t_0)&y_2'(t_0) \end{pmatrix} \begin{pmatrix} C_1\\ C_2 \end{pmatrix} = \begin{pmatrix} y_0\\ y'_0 \end{pmatrix}. (y1​(t0​)y1′​(t0​)​y2​(t0​)y2′​(t0​)​)(C1​C2​​)=(y0​y0′​​).

The determinant of the coefficient matrix is exactly

W[y1,y2](t0).W[y_1,y_2](t_0). W[y1​,y2​](t0​).

The matrix can match every pair of initial values if and only if

W[y1,y2](t0)≠0.\boxed{W[y_1,y_2](t_0)\ne0}. W[y1​,y2​](t0​)=0​.

When this condition holds, the matrix is invertible, so every pair of initial values determines one pair of constants C1,C2C_1,C_2C1​,C2​. The existence-and-uniqueness theorem then shows that this linear combination is the only solution with those initial values.

In that case, {y1,y2}\{y_1,y_2\}{y1​,y2​} is called a fundamental set of solutions on III, and

y(t)=C1y1(t)+C2y2(t)\boxed{y(t)=C_1y_1(t)+C_2y_2(t)} y(t)=C1​y1​(t)+C2​y2​(t)​

is the general solution of the homogeneous equation: every solution on III appears exactly once for a choice of C1C_1C1​ and C2C_2C2​.

For the example y1=e−2ty_1=e^{-2t}y1​=e−2t and y2=e−3ty_2=e^{-3t}y2​=e−3t,

W[y1,y2](t)=e−2t(−3e−3t)−(−2e−2t)e−3t=−e−5t.\begin{aligned} W[y_1,y_2](t) &=e^{-2t}\bigl(-3e^{-3t}\bigr) -\bigl(-2e^{-2t}\bigr)e^{-3t}\\ &=-e^{-5t}. \end{aligned} W[y1​,y2​](t)​=e−2t(−3e−3t)−(−2e−2t)e−3t=−e−5t.​

This never vanishes, so the two exponentials form a fundamental set of solutions on R\mathbb RR.

Distinct real roots in general

Assume a,b,c∈Ra,b,c\in\mathbb Ra,b,c∈R and a≠0a\ne0a=0. The quadratic formula gives

r=−b±Δ2a,Δ=b2−4ac,r=\frac{-b\pm\sqrt{\Delta}}{2a}, \qquad \Delta=b^2-4ac, r=2a−b±Δ​​,Δ=b2−4ac,

where Δ\DeltaΔ, read “delta,” is the discriminant. Its sign separates the three possible root patterns:

  • Δ>0\Delta>0Δ>0: two distinct real roots;
  • Δ<0\Delta<0Δ<0: two complex-conjugate roots;
  • Δ=0\Delta=0Δ=0: one repeated real root.

For now, consider the first case. Let r1≠r2r_1\ne r_2r1​=r2​ be the two real roots. Then

y1(t)=er1t,y2(t)=er2ty_1(t)=e^{r_1t}, \qquad y_2(t)=e^{r_2t} y1​(t)=er1​t,y2​(t)=er2​t

are solutions. Their Wronskian is

W[y1,y2](t)=∣er1ter2tr1er1tr2er2t∣=(r2−r1)e(r1+r2)t.\begin{aligned} W[y_1,y_2](t) &= \begin{vmatrix} e^{r_1t}&e^{r_2t}\\ r_1e^{r_1t}&r_2e^{r_2t} \end{vmatrix}\\ &=(r_2-r_1)e^{(r_1+r_2)t}. \end{aligned} W[y1​,y2​](t)​=​er1​tr1​er1​t​er2​tr2​er2​t​​=(r2​−r1​)e(r1​+r2​)t.​

The exponential is never zero, and r2−r1≠0r_2-r_1\ne0r2​−r1​=0. Therefore the Wronskian never vanishes, so the two exponentials form a fundamental set. Every real solution is

y(t)=C1er1t+C2er2t.\boxed{y(t)=C_1e^{r_1t}+C_2e^{r_2t}}. y(t)=C1​er1​t+C2​er2​t​.

Applying the distinct-root formula

Example: two opposite real roots

Consider the initial-value problem

y′′−y=0,y(0)=1,y′(0)=−1.y''-y=0, \qquad y(0)=1, \qquad y'(0)=-1. y′′−y=0,y(0)=1,y′(0)=−1.

The characteristic equation factors as

r2−1=(r−1)(r+1)=0,r^2-1=(r-1)(r+1)=0, r2−1=(r−1)(r+1)=0,

so the roots are −1-1−1 and 111. Choose

y1(t)=e−t,y2(t)=et.y_1(t)=e^{-t}, \qquad y_2(t)=e^t. y1​(t)=e−t,y2​(t)=et.

Their Wronskian is

W[y1,y2](t)=∣e−tet−e−tet∣=2,W[y_1,y_2](t) = \begin{vmatrix} e^{-t}&e^t\\ -e^{-t}&e^t \end{vmatrix} =2, W[y1​,y2​](t)=​e−t−e−t​etet​​=2,

so the general solution is

y(t)=C1e−t+C2et.y(t)=C_1e^{-t}+C_2e^t. y(t)=C1​e−t+C2​et.

The initial conditions give

C1+C2=1,−C1+C2=−1.C_1+C_2=1, \qquad -C_1+C_2=-1. C1​+C2​=1,−C1​+C2​=−1.

Adding the equations gives C2=0C_2=0C2​=0, and then C1=1C_1=1C1​=1. Thus the unique solution is

y(t)=e−t.\boxed{y(t)=e^{-t}}. y(t)=e−t​.

Complex characteristic roots

Now suppose Δ<0\Delta<0Δ<0. The quadratic formula can be written as

r=−b2a±−Δ2ai=λ±iμ,r= \frac{-b}{2a} \pm \frac{\sqrt{-\Delta}}{2a}i =\lambda\pm i\mu, r=2a−b​±2a−Δ​​i=λ±iμ,

where iii is the imaginary unit, i2=−1i^2=-1i2=−1, and

λ=−b2a,μ=−Δ2a≠0.\lambda=-\frac{b}{2a}, \qquad \mu=\frac{\sqrt{-\Delta}}{2a}\ne0. λ=−2ab​,μ=2a−Δ​​=0.

Both λ\lambdaλ and μ\muμ are real. The two roots are complex conjugates: they have the same real part and opposite imaginary parts.

Euler's formula

To turn the complex exponentials into real functions, start with the Taylor series

ez=∑k=0∞zkk!,z∈C.e^z=\sum_{k=0}^{\infty}\frac{z^k}{k!}, \qquad z\in\mathbb C. ez=k=0∑∞​k!zk​,z∈C.

Here C\mathbb CC is the set of complex numbers and k!k!k! is the factorial of the nonnegative integer kkk. Put z=ixz=ixz=ix for a real number xxx. Using i2=−1i^2=-1i2=−1, i3=−ii^3=-ii3=−i, and i4=1i^4=1i4=1 gives

eix=1+ix−x22!−ix33!+x44!+ix55!−⋯=(1−x22!+x44!−⋯ )+i(x−x33!+x55!−⋯ ).\begin{aligned} e^{ix} &=1+ix-\frac{x^2}{2!}-i\frac{x^3}{3!} +\frac{x^4}{4!}+i\frac{x^5}{5!}-\cdots\\ &=\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}-\cdots\right) +i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots\right). \end{aligned} eix​=1+ix−2!x2​−i3!x3​+4!x4​+i5!x5​−⋯=(1−2!x2​+4!x4​−⋯)+i(x−3!x3​+5!x5​−⋯).​

The first parenthesis is the Taylor series for cosine, and the second is the series for sine. Therefore

eix=cos⁡x+isin⁡x.\boxed{e^{ix}=\cos x+i\sin x}. eix=cosx+isinx​.

This is Euler's formula.

Turning one complex solution into two real solutions

Use Euler's formula with x=μtx=\mu tx=μt:

e(λ+iμ)t=eλteiμt=eλt(cos⁡(μt)+isin⁡(μt))=eλtcos⁡(μt)+i eλtsin⁡(μt).\begin{aligned} e^{(\lambda+i\mu)t} &=e^{\lambda t}e^{i\mu t}\\ &=e^{\lambda t}\bigl(\cos(\mu t)+i\sin(\mu t)\bigr)\\ &=e^{\lambda t}\cos(\mu t) +i\,e^{\lambda t}\sin(\mu t). \end{aligned} e(λ+iμ)t​=eλteiμt=eλt(cos(μt)+isin(μt))=eλtcos(μt)+ieλtsin(μt).​

The real and imaginary parts are the real-valued functions:

y1(t)=eλtcos⁡(μt),y2(t)=eλtsin⁡(μt).y_1(t)=e^{\lambda t}\cos(\mu t), \qquad y_2(t)=e^{\lambda t}\sin(\mu t). y1​(t)=eλtcos(μt),y2​(t)=eλtsin(μt).

To see why each part solves the ODE, define

L[y]=ay′′+by′+cy,L[y]=ay''+by'+cy, L[y]=ay′′+by′+cy,

where aaa, bbb, and ccc are real. If y=y1+iy2y=y_1+iy_2y=y1​+iy2​ solves the equation, linearity gives

0=L[y1+iy2]=L[y1]+iL[y2].0=L[y_1+iy_2]=L[y_1]+iL[y_2]. 0=L[y1​+iy2​]=L[y1​]+iL[y2​].

A complex number is zero only when both its real and imaginary parts are zero. Hence

L[y1]=0,L[y2]=0.L[y_1]=0, \qquad L[y_2]=0. L[y1​]=0,L[y2​]=0.

So the real and imaginary parts are each real-valued solutions of the original equation.

Their Wronskian is

W[y1,y2](t)=∣eλtcos⁡(μt)eλtsin⁡(μt)eλt(λcos⁡(μt)−μsin⁡(μt))eλt(λsin⁡(μt)+μcos⁡(μt))∣=μe2λt(cos⁡2(μt)+sin⁡2(μt))=μe2λt≠0.\begin{aligned} W[y_1,y_2](t) &= \begin{vmatrix} e^{\lambda t}\cos(\mu t)&e^{\lambda t}\sin(\mu t)\\ e^{\lambda t}\bigl(\lambda\cos(\mu t)-\mu\sin(\mu t)\bigr)& e^{\lambda t}\bigl(\lambda\sin(\mu t)+\mu\cos(\mu t)\bigr) \end{vmatrix}\\ &=\mu e^{2\lambda t} \bigl(\cos^2(\mu t)+\sin^2(\mu t)\bigr)\\ &=\mu e^{2\lambda t}\ne0. \end{aligned} W[y1​,y2​](t)​=​eλtcos(μt)eλt(λcos(μt)−μsin(μt))​eλtsin(μt)eλt(λsin(μt)+μcos(μt))​​=μe2λt(cos2(μt)+sin2(μt))=μe2λt=0.​

Thus the two real functions form a fundamental set, and the real general solution is

y(t)=C1eλtcos⁡(μt)+C2eλtsin⁡(μt).\boxed{ y(t)=C_1e^{\lambda t}\cos(\mu t) +C_2e^{\lambda t}\sin(\mu t) }. y(t)=C1​eλtcos(μt)+C2​eλtsin(μt)​.

Applying the complex-root formula

Example: a complex-root initial-value problem

Solve

y′′−2y′+5y=0,y(0)=1,y′(0)=0.y''-2y'+5y=0, \qquad y(0)=1, \qquad y'(0)=0. y′′−2y′+5y=0,y(0)=1,y′(0)=0.

The characteristic equation is

r2−2r+5=0,r^2-2r+5=0, r2−2r+5=0,

and the quadratic formula gives

r=2±4−202=1±2i.r=\frac{2\pm\sqrt{4-20}}{2}=1\pm2i. r=22±4−20​​=1±2i.

Therefore λ=1\lambda=1λ=1, μ=2\mu=2μ=2, and

y(t)=C1etcos⁡(2t)+C2etsin⁡(2t).y(t)=C_1e^t\cos(2t)+C_2e^t\sin(2t). y(t)=C1​etcos(2t)+C2​etsin(2t).

Differentiate before applying the slope condition:

y′(t)=C1et(cos⁡(2t)−2sin⁡(2t))+C2et(sin⁡(2t)+2cos⁡(2t)).\begin{aligned} y'(t) &=C_1e^t\bigl(\cos(2t)-2\sin(2t)\bigr)\\ &\quad+C_2e^t\bigl(\sin(2t)+2\cos(2t)\bigr). \end{aligned} y′(t)​=C1​et(cos(2t)−2sin(2t))+C2​et(sin(2t)+2cos(2t)).​

At t=0t=0t=0,

y(0)=C1=1,y′(0)=C1+2C2=0.y(0)=C_1=1, \qquad y'(0)=C_1+2C_2=0. y(0)=C1​=1,y′(0)=C1​+2C2​=0.

Hence C2=−1/2C_2=-1/2C2​=−1/2, and the unique solution is

y(t)=etcos⁡(2t)−12etsin⁡(2t).\boxed{ y(t)=e^t\cos(2t)-\frac12e^t\sin(2t) }. y(t)=etcos(2t)−21​etsin(2t)​.

Repeated roots

If the discriminant is zero, the characteristic equation has only one root, counted twice:

r=−b2a,b2−4ac=0.r=-\frac{b}{2a}, \qquad b^2-4ac=0. r=−2ab​,b2−4ac=0.

The exponential y1(t)=erty_1(t)=e^{rt}y1​(t)=ert is still a solution. But writing C1ert+C2ertC_1e^{rt}+C_2e^{rt}C1​ert+C2​ert does not give two independent solutions: it is just (C1+C2)ert(C_1+C_2)e^{rt}(C1​+C2​)ert. We need a second function that is not a constant multiple of the first.

For example,

y′′−2y′+y=0y''-2y'+y=0 y′′−2y′+y=0

has characteristic equation (r−1)2=0(r-1)^2=0(r−1)2=0, so y1(t)=ety_1(t)=e^ty1​(t)=et. To find the missing solution, we keep the exponential and let its multiplier vary with time.

Constructing the second solution

For the general repeated root r=−b/(2a)r=-b/(2a)r=−b/(2a), look for a solution of the form

y2(t)=v(t)y1(t),y_2(t)=v(t)y_1(t), y2​(t)=v(t)y1​(t),

where y1(t)=erty_1(t)=e^{rt}y1​(t)=ert is known and v(t)v(t)v(t) is unknown. This is the idea of reduction of order: use one known solution to turn the search for another into a first-order problem.

Apply the product rule:

y2′=v′y1+vy1′,y2′′=v′′y1+2v′y1′+vy1′′.\begin{aligned} y_2'&=v'y_1+vy_1',\\ y_2''&=v''y_1+2v'y_1'+vy_1''. \end{aligned} y2′​y2′′​​=v′y1​+vy1′​,=v′′y1​+2v′y1′​+vy1′′​.​

Putting these into ay2′′+by2′+cy2=0ay_2''+by_2'+cy_2=0ay2′′​+by2′​+cy2​=0 and grouping by derivatives of vvv gives

ay1v′′+(2ay1′+by1)v′+(ay1′′+by1′+cy1)v=0.ay_1v''+(2ay_1'+by_1)v' +(ay_1''+by_1'+cy_1)v=0. ay1​v′′+(2ay1′​+by1​)v′+(ay1′′​+by1′​+cy1​)v=0.

The coefficient of vvv is zero because y1y_1y1​ already solves the equation. What remains is

ay1v′′+(2ay1′+by1)v′=0.ay_1v''+(2ay_1'+by_1)v'=0. ay1​v′′+(2ay1′​+by1​)v′=0.

There is no undifferentiated vvv in this equation. Setting w=v′w=v'w=v′ makes it first order:

ay1w′+(2ay1′+by1)w=0.ay_1w'+(2ay_1'+by_1)w=0. ay1​w′+(2ay1′​+by1​)w=0.

For a repeated root, it simplifies even further. Since y1′=ry1y_1'=ry_1y1′​=ry1​ and 2ar+b=02ar+b=02ar+b=0,

2ay1′+by1=(2ar+b)y1=0.2ay_1'+by_1=(2ar+b)y_1=0. 2ay1′​+by1​=(2ar+b)y1​=0.

Thus ay1w′=0ay_1w'=0ay1​w′=0. Both aaa and the exponential y1y_1y1​ are nonzero, so w′=0w'=0w′=0. Integrating twice gives

w(t)=K,v(t)=Kt+D,w(t)=K, \qquad v(t)=Kt+D, w(t)=K,v(t)=Kt+D,

where KKK and DDD are constants. Therefore

v(t)y1(t)=Ktert+Dert.v(t)y_1(t)=Kte^{rt}+De^{rt}. v(t)y1​(t)=Ktert+Dert.

The term DertDe^{rt}Dert is a multiple of the solution we already have. Choosing D=0D=0D=0 and K=1K=1K=1 leaves the new solution

y2(t)=tert.\boxed{y_2(t)=te^{rt}}. y2​(t)=tert​.

Its Wronskian with y1y_1y1​ is

W[y1,y2](t)=∣erttertrertert+rtert∣=ert(ert+rtert)−rerttert=e2rt≠0.\begin{aligned} W[y_1,y_2](t) &=\begin{vmatrix} e^{rt}&te^{rt}\\ re^{rt}&e^{rt}+rte^{rt} \end{vmatrix}\\ &=e^{rt}(e^{rt}+rte^{rt})-re^{rt}te^{rt}\\ &=e^{2rt}\ne0. \end{aligned} W[y1​,y2​](t)​=​ertrert​tertert+rtert​​=ert(ert+rtert)−rerttert=e2rt=0.​

So {ert,tert}\{e^{rt},te^{rt}\}{ert,tert} is a fundamental set on R\mathbb RR. The general solution is

y(t)=C1ert+C2tert=(C1+C2t)ert.\boxed{y(t)=C_1e^{rt}+C_2te^{rt}=(C_1+C_2t)e^{rt}}. y(t)=C1​ert+C2​tert=(C1​+C2​t)ert​.

In particular, the equation y′′−2y′+y=0y''-2y'+y=0y′′−2y′+y=0 has general solution y(t)=(C1+C2t)ety(t)=(C_1+C_2t)e^ty(t)=(C1​+C2​t)et.

Example: a repeated-root initial-value problem

Solve

y′′−y′+14y=0,y(0)=2,y′(0)=13.y''-y'+\frac14y=0, \qquad y(0)=2, \qquad y'(0)=\frac13. y′′−y′+41​y=0,y(0)=2,y′(0)=31​.

The characteristic polynomial factors as

r2−r+14=(r−12)2,r^2-r+\frac14=\left(r-\frac12\right)^2, r2−r+41​=(r−21​)2,

so the repeated root is r=1/2r=1/2r=1/2. The general solution and its derivative are

y(t)=C1et/2+C2tet/2,y′(t)=C12et/2+C2et/2+C22tet/2.\begin{aligned} y(t)&=C_1e^{t/2}+C_2te^{t/2},\\ y'(t)&=\frac{C_1}{2}e^{t/2} +C_2e^{t/2}+\frac{C_2}{2}te^{t/2}. \end{aligned} y(t)y′(t)​=C1​et/2+C2​tet/2,=2C1​​et/2+C2​et/2+2C2​​tet/2.​

The starting value determines C1C_1C1​; then the slope determines C2C_2C2​:

C1=2,C12+C2=13,C2=−23.C_1=2, \qquad \frac{C_1}{2}+C_2=\frac13, \qquad C_2=-\frac23. C1​=2,2C1​​+C2​=31​,C2​=−32​.

Hence the unique solution is

y(t)=(2−23t)et/2.\boxed{y(t)=\left(2-\frac23t\right)e^{t/2}}. y(t)=(2−32​t)et/2​.

Although et/2e^{t/2}et/2 grows, the factor in front changes sign. The derivative makes the behavior clear:

y′(t)=1−t3et/2.y'(t)=\frac{1-t}{3}e^{t/2}. y′(t)=31−t​et/2.

For t≥0t\ge0t≥0, the solution rises until t=1t=1t=1, then falls. It crosses zero at t=3t=3t=3.

If we keep y(0)=2y(0)=2y(0)=2 but change the initial slope to y′(0)=2y'(0)=2y′(0)=2, the constants instead satisfy C1=2C_1=2C1​=2 and 1+C2=21+C_2=21+C2​=2. This gives

y(t)=(2+t)et/2,y(t)=(2+t)e^{t/2}, y(t)=(2+t)et/2,

which keeps increasing for t≥0t\ge0t≥0. Both curves solve the same ODE and start at the same point; the second initial condition determines which one we get.

The same initial value, two different slopesBoth solutions start at time zero with value two. The blue curve has initial slope one third, reaches a maximum at time one, and crosses zero at time three. The dark curve has initial slope two and keeps rising beyond the top of the plotted window.000111222333−1-1−1111222333444tttyyy
y′(0)=13y'(0)=\frac13y′(0)=31​y=(2−23t)et/2y=\left(2-\frac23t\right)e^{t/2}y=(2−32​t)et/2
y′(0)=2y'(0)=2y′(0)=2y=(2+t)et/2y=(2+t)e^{t/2}y=(2+t)et/2
The smaller initial slope gives a brief rise followed by a fall. Its maximum is at t=1t=1t=1, and it crosses zero at t=3t=3t=3. The other solution keeps increasing; it does not end where it leaves the plotted window.

Choosing the right pair of solutions

For ay′′+by′+cy=0ay''+by'+cy=0ay′′+by′+cy=0 with real constant coefficients and a≠0a\ne0a=0, the three characteristic-root cases give these fundamental sets:

Characteristic rootsFirst solutionSecond solution
Distinct real roots r1≠r2r_1\ne r_2r1​=r2​er1te^{r_1t}er1​ter2te^{r_2t}er2​t
Nonreal roots λ±iμ\lambda\pm i\muλ±iμ, μ≠0\mu\ne0μ=0eλtcos⁡(μt)e^{\lambda t}\cos(\mu t)eλtcos(μt)eλtsin⁡(μt)e^{\lambda t}\sin(\mu t)eλtsin(μt)
Repeated real root rrrerte^{rt}erttertte^{rt}tert

In each case, combine the two functions as y=C1y1+C2y2y=C_1y_1+C_2y_2y=C1​y1​+C2​y2​, then use the initial value and initial slope to find the constants.

Reduction of order with variable coefficients

The same substitution works even when the coefficients are not constant. Start with

y′′+p(t)y′+q(t)y=0,y''+p(t)y'+q(t)y=0, y′′+p(t)y′+q(t)y=0,

where ppp and qqq are continuous on an open interval III. Suppose a solution y1y_1y1​ is known. Work on an interval where y1(t)≠0y_1(t)\ne0y1​(t)=0, since we will divide by it. If the known solution has a zero, use a smaller interval that avoids that zero rather than dividing through it.

Again, set y2=vy1y_2=vy_1y2​=vy1​. The product-rule derivatives above give

y1v′′+(2y1′+p(t)y1)v′+(y1′′+p(t)y1′+q(t)y1)v=0.y_1v''+\bigl(2y_1'+p(t)y_1\bigr)v' +\bigl(y_1''+p(t)y_1'+q(t)y_1\bigr)v=0. y1​v′′+(2y1′​+p(t)y1​)v′+(y1′′​+p(t)y1′​+q(t)y1​)v=0.

The last bracket vanishes because y1y_1y1​ solves the original equation. This leaves

y1v′′+(2y1′+p(t)y1)v′=0.y_1v''+\bigl(2y_1'+p(t)y_1\bigr)v'=0. y1​v′′+(2y1′​+p(t)y1​)v′=0.

With w=v′w=v'w=v′, divide by y1y_1y1​ to obtain

w′+(2y1′y1+p(t))w=0.\boxed{w'+\left(2\frac{y_1'}{y_1}+p(t)\right)w=0}. w′+(2y1​y1′​​+p(t))w=0​.

This is a first-order linear equation in www, and it is also separable. Unlike the repeated-root case, the coefficient of www need not vanish.

Solve this equation for www, integrate v′=wv'=wv′=w, and multiply the result by y1y_1y1​. A constant added to vvv only adds a multiple of y1y_1y1​, so it can be set to zero when choosing one second solution. The choice w=0w=0w=0 also gives only a multiple of y1y_1y1​; to find an independent solution, choose a nonzero solution for www.

Example: finding a second power-function solution

Consider

y′′+32ty′−12t2y=0,t>0.y''+\frac{3}{2t}y'-\frac{1}{2t^2}y=0, \qquad t>0. y′′+2t3​y′−2t21​y=0,t>0.

We are given y1(t)=1/ty_1(t)=1/ty1​(t)=1/t. First check that it really is a solution:

y1′=−1t2,y1′′=2t3,y_1'=-\frac{1}{t^2}, \qquad y_1''=\frac{2}{t^3}, y1′​=−t21​,y1′′​=t32​,

so

y1′′+32ty1′−12t2y1=2t3−32t3−12t3=0.y_1''+\frac{3}{2t}y_1'-\frac{1}{2t^2}y_1 =\frac{2}{t^3}-\frac{3}{2t^3}-\frac{1}{2t^3}=0. y1′′​+2t3​y1′​−2t21​y1​=t32​−2t33​−2t31​=0.

Here p(t)=3/(2t)p(t)=3/(2t)p(t)=3/(2t) and y1y_1y1​ is nonzero on (0,∞)(0,\infty)(0,∞). Substituting into the equation for w=v′w=v'w=v′ gives

1tw′+(−2t2+32t2)w=0.\frac1t w' +\left(-\frac{2}{t^2}+\frac{3}{2t^2}\right)w=0. t1​w′+(−t22​+2t23​)w=0.

Multiply by ttt and simplify:

w′−12tw=0.w'-\frac{1}{2t}w=0. w′−2t1​w=0.

For the nonzero solution we want, separate variables and integrate:

dww=dt2t,ln⁡∣w∣=12ln⁡t+C.\frac{dw}{w}=\frac{dt}{2t}, \qquad \ln|w|=\frac12\ln t+C. wdw​=2tdt​,ln∣w∣=21​lnt+C.

The absolute value allows either sign of www. Since t>0t>0t>0, no absolute value is needed around ttt. Exponentiating and absorbing the sign into a constant KKK gives

w(t)=Kt1/2.w(t)=Kt^{1/2}. w(t)=Kt1/2.

There is one constant at this stage. The second constant appears when we integrate v′=wv'=wv′=w:

v(t)=2K3t3/2+B.v(t)=\frac{2K}{3}t^{3/2}+B. v(t)=32K​t3/2+B.

Consequently,

v(t)y1(t)=(2K3t3/2+B)1t=2K3t1/2+Bt.v(t)y_1(t) =\left(\frac{2K}{3}t^{3/2}+B\right)\frac1t =\frac{2K}{3}t^{1/2}+\frac Bt. v(t)y1​(t)=(32K​t3/2+B)t1​=32K​t1/2+tB​.

The term B/tB/tB/t is already a multiple of y1y_1y1​. Choose B=0B=0B=0 and K=32K=\frac32K=23​ to obtain the convenient second solution

y2(t)=t1/2.y_2(t)=t^{1/2}. y2​(t)=t1/2.

Choosing any other nonzero value of KKK would only rescale this second solution. The Wronskian confirms independence:

W[y1,y2](t)=∣t−1t1/2−t−212t−1/2∣=12t−3/2+t−3/2=32t−3/2≠0,t>0.\begin{aligned} W[y_1,y_2](t) &=\begin{vmatrix} t^{-1}&t^{1/2}\\ -t^{-2}&\frac12t^{-1/2} \end{vmatrix}\\ &=\frac12t^{-3/2}+t^{-3/2}\\ &=\frac32t^{-3/2}\ne0, \qquad t>0. \end{aligned} W[y1​,y2​](t)​=​t−1−t−2​t1/221​t−1/2​​=21​t−3/2+t−3/2=23​t−3/2=0,t>0.​

Thus {1/t,t1/2}\{1/t,t^{1/2}\}{1/t,t1/2} is a fundamental set on (0,∞)(0,\infty)(0,∞), and

y(t)=C1t+C2t1/2,t>0.\boxed{y(t)=\frac{C_1}{t}+C_2t^{1/2},\qquad t>0}. y(t)=tC1​​+C2​t1/2,t>0​.

The zero solution of the first-order equation for www gives the C2=0C_2=0C2​=0 part of this family, so it has not been lost. The domain restriction remains essential: the original coefficients are undefined at t=0t=0t=0.

Nonhomogeneous equations

What changes when the right-hand side is not zero? Consider

y′′+p(t)y′+q(t)y=g(t),y''+p(t)y'+q(t)y=g(t), y′′+p(t)y′+q(t)y=g(t),

where ppp, qqq, and ggg are continuous on an open interval III. Its associated homogeneous equation keeps the same left-hand side but replaces the forcing g(t)g(t)g(t) with zero:

y′′+p(t)y′+q(t)y=0.y''+p(t)y'+q(t)y=0. y′′+p(t)y′+q(t)y=0.

Suppose {y1,y2}\{y_1,y_2\}{y1​,y2​} is a fundamental set of solutions of the homogeneous equation on III. Its general solution, called the complementary solution, is

yc(t)=C1y1(t)+C2y2(t).y_c(t)=C_1y_1(t)+C_2y_2(t). yc​(t)=C1​y1​(t)+C2​y2​(t).

A particular solution, written ypy_pyp​, is any one function that solves the nonhomogeneous equation. It need not satisfy any prescribed initial conditions; its job is to produce the forcing g(t)g(t)g(t) when put into the left-hand side.

Once we find one such ypy_pyp​, the general nonhomogeneous solution is

y(t)=C1y1(t)+C2y2(t)+yp(t)=yc(t)+yp(t),C1,C2∈R.\boxed{y(t)=C_1y_1(t)+C_2y_2(t)+y_p(t)=y_c(t)+y_p(t)}, \qquad C_1,C_2\in\mathbb R. y(t)=C1​y1​(t)+C2​y2​(t)+yp​(t)=yc​(t)+yp​(t)​,C1​,C2​∈R.

The constants in ycy_cyc​ still give the freedom to match an initial value and slope. The particular solution does not add another arbitrary constant.

Why the solutions add this way

Use the linear differential operator

L[u]=u′′+p(t)u′+q(t)u.L[u]=u''+p(t)u'+q(t)u. L[u]=u′′+p(t)u′+q(t)u.

Both yyy and ypy_pyp​ solve L[u]=gL[u]=gL[u]=g. Their difference therefore solves the homogeneous equation:

L[y−yp]=L[y]−L[yp]=g−g=0.L[y-y_p]=L[y]-L[y_p]=g-g=0. L[y−yp​]=L[y]−L[yp​]=g−g=0.

Since {y1,y2}\{y_1,y_2\}{y1​,y2​} is a fundamental set, this difference must be

y−yp=C1y1+C2y2.y-y_p=C_1y_1+C_2y_2. y−yp​=C1​y1​+C2​y2​.

Rearranging gives the claimed formula. Conversely, adding any complementary solution to ypy_pyp​ works because

L[yc+yp]=L[yc]+L[yp]=0+g=g.L[y_c+y_p]=L[y_c]+L[y_p]=0+g=g. L[yc​+yp​]=L[yc​]+L[yp​]=0+g=g.

This proves both that the formula gives solutions and that it includes every solution on III. There may be many choices for ypy_pyp​, but any two differ by a homogeneous solution, so they give the same general family.

To solve a nonhomogeneous equation:

  1. Find the complementary solution ycy_cyc​ from the associated homogeneous equation.
  2. Find one particular solution ypy_pyp​ of the original equation.
  3. Add them: y=yc+ypy=y_c+y_py=yc​+yp​. If initial conditions are given, apply them to this full sum, not to ycy_cyc​ alone.

The new work is the second step: finding ypy_pyp​.

The method of undetermined coefficients

For an equation with constant coefficients,

ay′′+by′+cy=g(t),a≠0,ay''+by'+cy=g(t), \qquad a\ne0, ay′′+by′+cy=g(t),a=0,

we can often choose a trial form for ypy_pyp​ by looking at g(t)g(t)g(t). The method of undetermined coefficients puts unknown constants into that trial form, then finds their values by substitution.

The standard method applies when g(t)g(t)g(t) is built from polynomials, exponentials, sine, and cosine through finite sums and products. These functions are useful because their derivatives stay within a finite collection of the same kinds of terms. With constant coefficients, substituting the trial then gives algebraic equations for its unknown constants.

For the starting guesses below, λ\lambdaλ and μ\muμ are known real constants from the forcing, while AAA and BBB are the coefficients to determine:

Forcing termTrial particular solution
eλte^{\lambda t}eλtAeλtAe^{\lambda t}Aeλt
cos⁡(μt)\cos(\mu t)cos(μt) or sin⁡(μt)\sin(\mu t)sin(μt), with μ≠0\mu\ne0μ=0Acos⁡(μt)+Bsin⁡(μt)A\cos(\mu t)+B\sin(\mu t)Acos(μt)+Bsin(μt)

An exponential keeps its form under differentiation. Sine and cosine turn into each other, so the trial includes both even when the forcing contains only one.

Before using a trial, check the complementary solution. If the trial already solves the homogeneous equation, substitution produces zero rather than the required nonzero forcing, so the trial must be adjusted. Neither example below has that overlap.

Unlike C1C_1C1​ and C2C_2C2​, the coefficients in a particular-solution trial are not left arbitrary: the equation determines them. Variation of parameters is a more general method for finding particular solutions, including in variable-coefficient problems, but it is a separate method from the coefficient matching used here.

Example: exponential forcing

Solve

y′′−3y′−4y=3e2t.y''-3y'-4y=3e^{2t}. y′′−3y′−4y=3e2t.

First find the complementary solution. The characteristic equation is

r2−3r−4=(r−4)(r+1)=0,r^2-3r-4=(r-4)(r+1)=0, r2−3r−4=(r−4)(r+1)=0,

so the two distinct roots are 444 and −1-1−1. Thus

yc(t)=C1e4t+C2e−t.y_c(t)=C_1e^{4t}+C_2e^{-t}. yc​(t)=C1​e4t+C2​e−t.

The forcing is a multiple of e2te^{2t}e2t, which is not one of those homogeneous solutions. Try

yp(t)=Ae2t,yp′(t)=2Ae2t,yp′′(t)=4Ae2t.y_p(t)=Ae^{2t}, \qquad y_p'(t)=2Ae^{2t}, \qquad y_p''(t)=4Ae^{2t}. yp​(t)=Ae2t,yp′​(t)=2Ae2t,yp′′​(t)=4Ae2t.

Substitution gives

yp′′−3yp′−4yp=4Ae2t−6Ae2t−4Ae2t=−6Ae2t.\begin{aligned} y_p''-3y_p'-4y_p &=4Ae^{2t}-6Ae^{2t}-4Ae^{2t}\\ &=-6Ae^{2t}. \end{aligned} yp′′​−3yp′​−4yp​​=4Ae2t−6Ae2t−4Ae2t=−6Ae2t.​

This must equal 3e2t3e^{2t}3e2t. Since the exponential is never zero,

−6A=3,A=−12.-6A=3, \qquad A=-\frac12. −6A=3,A=−21​.

Therefore

yp(t)=−12e2t,y_p(t)=-\frac12e^{2t}, yp​(t)=−21​e2t,

and the general solution is

y(t)=C1e4t+C2e−t−12e2t.\boxed{y(t)=C_1e^{4t}+C_2e^{-t}-\frac12e^{2t}}. y(t)=C1​e4t+C2​e−t−21​e2t​.

No initial conditions are given, so C1C_1C1​ and C2C_2C2​ remain arbitrary. All the coefficients and forcing are continuous for real ttt, and the solution family is valid on R\mathbb RR.

Example: trigonometric forcing

Now change only the forcing:

y′′−3y′−4y=2sin⁡t.y''-3y'-4y=2\sin t. y′′−3y′−4y=2sint.

The associated homogeneous equation has not changed, so neither has the complementary solution:

yc(t)=C1e4t+C2e−t.y_c(t)=C_1e^{4t}+C_2e^{-t}. yc​(t)=C1​e4t+C2​e−t.

For the particular solution, include both sine and cosine:

yp(t)=Asin⁡t+Bcos⁡t,yp′(t)=Acos⁡t−Bsin⁡t,yp′′(t)=−Asin⁡t−Bcos⁡t.\begin{aligned} y_p(t)&=A\sin t+B\cos t,\\ y_p'(t)&=A\cos t-B\sin t,\\ y_p''(t)&=-A\sin t-B\cos t. \end{aligned} yp​(t)yp′​(t)yp′′​(t)​=Asint+Bcost,=Acost−Bsint,=−Asint−Bcost.​

Put these into the ODE and group like terms:

yp′′−3yp′−4yp=(−Asin⁡t−Bcos⁡t)−3(Acos⁡t−Bsin⁡t)−4(Asin⁡t+Bcos⁡t)=(−5A+3B)sin⁡t+(−3A−5B)cos⁡t.\begin{aligned} y_p''-3y_p'-4y_p &=(-A\sin t-B\cos t)\\ &\quad-3(A\cos t-B\sin t)\\ &\quad-4(A\sin t+B\cos t)\\ &=(-5A+3B)\sin t+(-3A-5B)\cos t. \end{aligned} yp′′​−3yp′​−4yp​​=(−Asint−Bcost)−3(Acost−Bsint)−4(Asint+Bcost)=(−5A+3B)sint+(−3A−5B)cost.​

We need this identity to hold for every ttt:

(−5A+3B)sin⁡t+(−3A−5B)cos⁡t=2sin⁡t.(-5A+3B)\sin t+(-3A-5B)\cos t=2\sin t. (−5A+3B)sint+(−3A−5B)cost=2sint.

Sine and cosine are linearly independent, so match their coefficients. The right-hand side has sine coefficient 222 and cosine coefficient 000:

{−5A+3B=2,−3A−5B=0.\begin{cases} -5A+3B=2,\\ -3A-5B=0. \end{cases} {−5A+3B=2,−3A−5B=0.​

The second equation gives B=−3A/5B=-3A/5B=−3A/5. Put this into the first:

−5A−95A=2⟹−345A=2.-5A-\frac95A=2 \quad\Longrightarrow\quad -\frac{34}{5}A=2. −5A−59​A=2⟹−534​A=2.

Hence

A=−517,B=317,A=-\frac5{17}, \qquad B=\frac3{17}, A=−175​,B=173​,

so a particular solution is

yp(t)=−517sin⁡t+317cos⁡t.y_p(t)=-\frac5{17}\sin t+\frac3{17}\cos t. yp​(t)=−175​sint+173​cost.

Adding the complementary solution gives the general solution, again valid for all real ttt:

y(t)=C1e4t+C2e−t−517sin⁡t+317cos⁡t.\boxed{ y(t)=C_1e^{4t}+C_2e^{-t} -\frac5{17}\sin t+\frac3{17}\cos t }. y(t)=C1​e4t+C2​e−t−175​sint+173​cost​.

As a check, the coefficients produce −5A+3B=2-5A+3B=2−5A+3B=2 and −3A−5B=0-3A-5B=0−3A−5B=0, so the left-hand side is exactly 2sin⁡t2\sin t2sint, with no cosine term.

Choosing a complete trial

Matching the forcing means including every kind of term that differentiation can produce, not just copying the terms that happen to appear on the right-hand side.

  • If g(t)=t2+7g(t)=t^2+7g(t)=t2+7, start with yp=At2+Bt+Cy_p=At^2+Bt+Cyp​=At2+Bt+C. The forcing has no linear term, but derivatives of the quadratic can produce one, so the trial still needs BtBtBt.
  • If g(t)=−8etcos⁡(2t)g(t)=-8e^t\cos(2t)g(t)=−8etcos(2t), start with yp=et(Acos⁡(2t)+Bsin⁡(2t))y_p=e^t\bigl(A\cos(2t)+B\sin(2t)\bigr)yp​=et(Acos(2t)+Bsin(2t)). Differentiation mixes the two trigonometric functions while retaining the exponential.
  • If g(t)=7tetsin⁡(8t)g(t)=7te^t\sin(8t)g(t)=7tetsin(8t), start with
yp=et[(A+Ct)sin⁡(8t)+(B+Dt)cos⁡(8t)].y_p=e^t\bigl[(A+Ct)\sin(8t)+(B+Dt)\cos(8t)\bigr]. yp​=et[(A+Ct)sin(8t)+(B+Dt)cos(8t)].

In the last trial, each trigonometric function needs both a constant coefficient and a coefficient multiplying ttt. Differentiating ttt creates a constant term. In all three cases, the capital letters are unknown constants, and the trial may still need an extra factor if it overlaps the complementary solution.

Splitting a sum of forcing terms

Linearity lets us find particular solutions in pieces. For the same operator L[y]=ay′′+by′+cyL[y]=ay''+by'+cyL[y]=ay′′+by′+cy, suppose

L[yp,1]=g1,L[yp,2]=g2.L[y_{p,1}]=g_1, \qquad L[y_{p,2}]=g_2. L[yp,1​]=g1​,L[yp,2​]=g2​.

The subscripts label two particular solutions, one for each forcing term. Their sum satisfies

L[yp,1+yp,2]=g1+g2.L[y_{p,1}+y_{p,2}]=g_1+g_2. L[yp,1​+yp,2​]=g1​+g2​.

This does not say that an arbitrary sum of solutions keeps the same forcing: the forcing terms add too.

For example, consider

y′′−3y′−4y=3e2t+2sin⁡t.y''-3y'-4y=3e^{2t}+2\sin t. y′′−3y′−4y=3e2t+2sint.

The previous two examples already did the coefficient matching. Add their particular solutions:

yp(t)=−12e2t−517sin⁡t+317cos⁡t.y_p(t)=-\frac12e^{2t}-\frac5{17}\sin t+\frac3{17}\cos t. yp​(t)=−21​e2t−175​sint+173​cost.

The complementary solution is unchanged, so the general solution is

y(t)=C1e4t+C2e−t−12e2t−517sin⁡t+317cos⁡t.\boxed{ y(t)=C_1e^{4t}+C_2e^{-t} -\frac12e^{2t}-\frac5{17}\sin t+\frac3{17}\cos t }. y(t)=C1​e4t+C2​e−t−21​e2t−175​sint+173​cost​.

Resonance in undetermined coefficients

What if the trial is already a homogeneous solution? The differential operator sends it to zero for every choice of coefficient. No coefficient matching can make that trial produce a nonzero forcing. This overlap is called resonance in the method of undetermined coefficients.

Example: a simple characteristic root

Solve

y′′−y=7et.y''-y=7e^t. y′′−y=7et.

The starting trial yp=Aety_p=Ae^typ​=Aet fails:

yp′′−yp=Aet−Aet=0≠7et.y_p''-y_p=Ae^t-Ae^t=0\ne7e^t. yp′′​−yp​=Aet−Aet=0=7et.

The failure is in the trial, not in the existence of a solution. The associated homogeneous equation is y′′−y=0y''-y=0y′′−y=0, whose characteristic equation is

r2−1=(r−1)(r+1)=0.r^2-1=(r-1)(r+1)=0. r2−1=(r−1)(r+1)=0.

Thus

yc(t)=C1e−t+C2et.y_c(t)=C_1e^{-t}+C_2e^t. yc​(t)=C1​e−t+C2​et.

The function ete^tet is already in this family. Multiply the trial by ttt to get a different function:

yp(t)=Atet,yp′(t)=A(1+t)et,yp′′(t)=A(2+t)et.\begin{aligned} y_p(t)&=Ate^t,\\ y_p'(t)&=A(1+t)e^t,\\ y_p''(t)&=A(2+t)e^t. \end{aligned} yp​(t)yp′​(t)yp′′​(t)​=Atet,=A(1+t)et,=A(2+t)et.​

Now the tette^ttet terms cancel, but a nonzero exponential remains:

yp′′−yp=2Aet=7et.y_p''-y_p=2Ae^t=7e^t. yp′′​−yp​=2Aet=7et.

Therefore A=7/2A=7/2A=7/2, so

yp(t)=72tet.y_p(t)=\frac72te^t. yp​(t)=27​tet.

Adding the complementary solution gives

y(t)=C1e−t+C2et+72tet.\boxed{y(t)=C_1e^{-t}+C_2e^t+\frac72te^t}. y(t)=C1​e−t+C2​et+27​tet​.

Example: a repeated characteristic root

One factor of ttt is not always enough. Consider

y′′−2y′+y=7et.y''-2y'+y=7e^t. y′′−2y′+y=7et.

The characteristic equation is

r2−2r+1=(r−1)2=0,r^2-2r+1=(r-1)^2=0, r2−2r+1=(r−1)2=0,

so 111 is a double root and

yc(t)=(C1+C2t)et.y_c(t)=(C_1+C_2t)e^t. yc​(t)=(C1​+C2​t)et.

Both AetAe^tAet and AtetAte^tAtet are homogeneous solutions. Each makes the left-hand side zero. The first trial that avoids those two functions is

yp(t)=At2et.y_p(t)=At^2e^t. yp​(t)=At2et.

Differentiate and substitute:

yp′=A(t2+2t)et,yp′′=A(t2+4t+2)et,yp′′−2yp′+yp=Aet[(t2+4t+2)−2(t2+2t)+t2]=2Aet.\begin{aligned} y_p'&=A(t^2+2t)e^t,\\ y_p''&=A(t^2+4t+2)e^t,\\ y_p''-2y_p'+y_p &=Ae^t\bigl[(t^2+4t+2)-2(t^2+2t)+t^2\bigr]\\ &=2Ae^t. \end{aligned} yp′​yp′′​yp′′​−2yp′​+yp​​=A(t2+2t)et,=A(t2+4t+2)et,=Aet[(t2+4t+2)−2(t2+2t)+t2]=2Aet.​

Again 2A=72A=72A=7, giving

yp(t)=72t2et,y_p(t)=\frac72t^2e^t, yp​(t)=27​t2et,

and hence

y(t)=(C1+C2t+72t2)et.\boxed{y(t)=\left(C_1+C_2t+\frac72t^2\right)e^t}. y(t)=(C1​+C2​t+27​t2)et​.

Both resonance examples are valid for all real ttt. Neither has initial conditions, so the two complementary constants remain arbitrary.

The trial-form rule

The power of ttt is determined by the multiplicity of a characteristic root: the number of times that root occurs in the characteristic polynomial. A value that is not a root has multiplicity zero.

Let Pn(t)P_n(t)Pn​(t) be a known polynomial of degree nnn. Let Qn(t)Q_n(t)Qn​(t) and Rn(t)R_n(t)Rn​(t) be polynomials with separate unknown coefficients for every power from tnt^ntn down to the constant term. For example,

Qn(t)=Antn+An−1tn−1+⋯+A0.Q_n(t)=A_nt^n+A_{n-1}t^{n-1}+\cdots+A_0. Qn​(t)=An​tn+An−1​tn−1+⋯+A0​.

The symbols α\alphaα and β\betaβ below are known real constants from the forcing. Use β≠0\beta\ne0β=0 in the trigonometric row. The exponent sss is the multiplicity of the root listed in the last column. For ay′′+by′+cy=g(t)ay''+by'+cy=g(t)ay′′+by′+cy=g(t) with constant coefficients and a≠0a\ne0a=0:

Forcing componentTrial particular solutionRoot whose multiplicity is sss
Pn(t)P_n(t)Pn​(t)tsQn(t)t^sQ_n(t)tsQn​(t)000
Pn(t)eαtP_n(t)e^{\alpha t}Pn​(t)eαttseαtQn(t)t^se^{\alpha t}Q_n(t)tseαtQn​(t)α\alphaα
Pn(t)eαtcos⁡(βt)P_n(t)e^{\alpha t}\cos(\beta t)Pn​(t)eαtcos(βt) or Pn(t)eαtsin⁡(βt)P_n(t)e^{\alpha t}\sin(\beta t)Pn​(t)eαtsin(βt)tseαt[Qn(t)cos⁡(βt)+Rn(t)sin⁡(βt)]t^se^{\alpha t}\bigl[Q_n(t)\cos(\beta t)+R_n(t)\sin(\beta t)\bigr]tseαt[Qn​(t)cos(βt)+Rn​(t)sin(βt)]α+iβ\alpha+i\betaα+iβ

The exponent sss is the smallest nonnegative integer that removes overlap with the homogeneous solution space. In a second-order equation it is 000, 111, or 222; a nonreal root of a real quadratic can only be simple. Multiply the whole trial by tst^sts, not just one of its terms.

This recovers both examples: the root 111 is simple for r2−1r^2-1r2−1, so use tette^ttet; it is double for (r−1)2(r-1)^2(r−1)2, so use t2ett^2e^tt2et. For a sum of forcing components, choose the appropriate trial for each component and add the resulting particular solutions.

Variation of parameters

Undetermined coefficients works by recognizing a finite family of functions that stays closed under differentiation. Variation of parameters takes a different approach: start with two known homogeneous solutions and replace their constant multipliers with unknown functions. This works for more general forcing terms and for variable coefficients, provided we know a fundamental set for the homogeneous equation.

Consider the normalized equation

y′′+p(t)y′+q(t)y=g(t),y''+p(t)y'+q(t)y=g(t), y′′+p(t)y′+q(t)y=g(t),

where ppp, qqq, and ggg are continuous on an open interval III. Let {y1,y2}\{y_1,y_2\}{y1​,y2​} be a fundamental set for the associated homogeneous equation on III. Write its Wronskian as

W(t)=y1(t)y2′(t)−y1′(t)y2(t)≠0,t∈I.W(t)=y_1(t)y_2'(t)-y_1'(t)y_2(t)\ne0, \qquad t\in I. W(t)=y1​(t)y2′​(t)−y1′​(t)y2​(t)=0,t∈I.

Normalization matters here. If the original equation is a2(t)y′′+a1(t)y′+a0(t)y=h(t)a_2(t)y''+a_1(t)y'+a_0(t)y=h(t)a2​(t)y′′+a1​(t)y′+a0​(t)y=h(t), divide by a2(t)a_2(t)a2​(t) on an interval where it is nonzero. The forcing used in this method is g=h/a2g=h/a_2g=h/a2​, not the original hhh.

Choosing the two unknown functions

Keep the known functions y1y_1y1​ and y2y_2y2​, but replace their constant multipliers with unknown functions u1u_1u1​ and u2u_2u2​. Look for a particular solution of the form

yp(t)=u1(t)y1(t)+u2(t)y2(t).y_p(t)=u_1(t)y_1(t)+u_2(t)y_2(t). yp​(t)=u1​(t)y1​(t)+u2​(t)y2​(t).

The product rule gives

yp′=u1′y1+u1y1′+u2′y2+u2y2′.y_p'=u_1'y_1+u_1y_1'+u_2'y_2+u_2y_2'. yp′​=u1′​y1​+u1​y1′​+u2′​y2​+u2​y2′​.

We have introduced two unknown functions to construct one solution. Use that freedom to impose an auxiliary condition that cancels the first and third terms:

y1u1′+y2u2′=0.\boxed{y_1u_1'+y_2u_2'=0}. y1​u1′​+y2​u2′​=0​.

This is a condition we choose for the construction, not an identity that holds for arbitrary u1,u2u_1,u_2u1​,u2​. It leaves

yp′=u1y1′+u2y2′,y_p'=u_1y_1'+u_2y_2', yp′​=u1​y1′​+u2​y2′​,

so differentiating again gives

yp′′=u1′y1′+u1y1′′+u2′y2′+u2y2′′.y_p''=u_1'y_1'+u_1y_1''+u_2'y_2'+u_2y_2''. yp′′​=u1′​y1′​+u1​y1′′​+u2′​y2′​+u2​y2′′​.

The benefit is that no second derivatives of u1u_1u1​ or u2u_2u2​ appear. Put these expressions into the nonhomogeneous equation and group the terms multiplying each unknown function:

yp′′+pyp′+qyp=u1(y1′′+py1′+qy1)+u2(y2′′+py2′+qy2)+u1′y1′+u2′y2′.\begin{aligned} y_p''+py_p'+qy_p &=u_1\bigl(y_1''+py_1'+qy_1\bigr)\\ &\quad+u_2\bigl(y_2''+py_2'+qy_2\bigr)\\ &\quad+u_1'y_1'+u_2'y_2'. \end{aligned} yp′′​+pyp′​+qyp​​=u1​(y1′′​+py1′​+qy1​)+u2​(y2′′​+py2′​+qy2​)+u1′​y1′​+u2′​y2′​.​

Both parentheses vanish because y1y_1y1​ and y2y_2y2​ solve the homogeneous equation. To produce the required forcing, the remaining terms must satisfy

y1′u1′+y2′u2′=g(t).\boxed{y_1'u_1'+y_2'u_2'=g(t)}. y1′​u1′​+y2′​u2′​=g(t)​.

Solving the two conditions

Together, the auxiliary condition and the ODE give a linear system for the derivatives u1′u_1'u1′​ and u2′u_2'u2′​:

(y1y2y1′y2′)(u1′u2′)=(0g).\begin{pmatrix} y_1&y_2\\ y_1'&y_2' \end{pmatrix} \begin{pmatrix} u_1'\\ u_2' \end{pmatrix} = \begin{pmatrix} 0\\ g \end{pmatrix}. (y1​y1′​​y2​y2′​​)(u1′​u2′​​)=(0g​).

All functions in this system are evaluated at the same ttt. The determinant of its coefficient matrix is W(t)W(t)W(t), which is nonzero on III. Its inverse is therefore

(y1y2y1′y2′)−1=1W(t)(y2′−y2−y1′y1).\begin{pmatrix} y_1&y_2\\ y_1'&y_2' \end{pmatrix}^{-1} = \frac1{W(t)} \begin{pmatrix} y_2'&-y_2\\ -y_1'&y_1 \end{pmatrix}. (y1​y1′​​y2​y2′​​)−1=W(t)1​(y2′​−y1′​​−y2​y1​​).

Multiplying by the column with entries 000 and ggg gives

u1′=−y2gW,u2′=y1gW.\boxed{ u_1'=-\frac{y_2g}{W}, \qquad u_2'=\frac{y_1g}{W} }. u1′​=−Wy2​g​,u2′​=Wy1​g​​.

The minus sign in the first formula comes from the upper-right entry of the inverse matrix. Keep the Wronskian in the same order, W[y1,y2]W[y_1,y_2]W[y1​,y2​], in both formulas.

Integrate to find one choice of the two functions:

u1(t)=−∫y2(t)g(t)W(t) dt,u2(t)=∫y1(t)g(t)W(t) dt.u_1(t)=-\int\frac{y_2(t)g(t)}{W(t)}\,dt, \qquad u_2(t)=\int\frac{y_1(t)g(t)}{W(t)}\,dt. u1​(t)=−∫W(t)y2​(t)g(t)​dt,u2​(t)=∫W(t)y1​(t)g(t)​dt.

Why can we omit the integration constants? Adding constants k1,k2k_1,k_2k1​,k2​ to u1,u2u_1,u_2u1​,u2​ adds only k1y1+k2y2k_1y_1+k_2y_2k1​y1​+k2​y2​ to ypy_pyp​. Those terms are already included in the complementary solution. Choose any antiderivatives on III to obtain one particular solution.

The general solution

Putting u1u_1u1​ and u2u_2u2​ back into yp=u1y1+u2y2y_p=u_1y_1+u_2y_2yp​=u1​y1​+u2​y2​ gives

yp(t)=−y1(t)∫y2(t)g(t)W(t) dt+y2(t)∫y1(t)g(t)W(t) dt.\boxed{ \begin{aligned} y_p(t) &=-y_1(t)\int\frac{y_2(t)g(t)}{W(t)}\,dt\\ &\quad+y_2(t)\int\frac{y_1(t)g(t)}{W(t)}\,dt. \end{aligned} } yp​(t)​=−y1​(t)∫W(t)y2​(t)g(t)​dt+y2​(t)∫W(t)y1​(t)g(t)​dt.​​

The two conditions ensure that this function satisfies the nonhomogeneous equation. The general solution on III is

y(t)=C1y1(t)+C2y2(t)−y1(t)∫y2(t)g(t)W(t) dt+y2(t)∫y1(t)g(t)W(t) dt,\boxed{ \begin{aligned} y(t) &=C_1y_1(t)+C_2y_2(t)\\ &\quad-y_1(t)\int\frac{y_2(t)g(t)}{W(t)}\,dt\\ &\quad+y_2(t)\int\frac{y_1(t)g(t)}{W(t)}\,dt, \end{aligned} } y(t)​=C1​y1​(t)+C2​y2​(t)−y1​(t)∫W(t)y2​(t)g(t)​dt+y2​(t)∫W(t)y1​(t)g(t)​dt,​​

where C1,C2∈RC_1,C_2\in\mathbb RC1​,C2​∈R. If initial conditions are given, apply them to this full solution. Variation of parameters supplies the integrals without guessing a trial family, though those integrals need not have elementary antiderivatives.

We can also choose a fixed t0∈It_0\in It0​∈I as the lower limit of both integrals and combine them:

yp(t)=∫t0ty1(s)y2(t)−y1(t)y2(s)W(s)g(s) ds.y_p(t)=\int_{t_0}^t \frac{y_1(s)y_2(t)-y_1(t)y_2(s)}{W(s)}g(s)\,ds. yp​(t)=∫t0​t​W(s)y1​(s)y2​(t)−y1​(t)y2​(s)​g(s)ds.

Here sss is just the integration variable; ttt is the time at which we want the answer. This form gives yp(t0)=yp′(t0)=0y_p(t_0)=y_p'(t_0)=0yp​(t0​)=yp′​(t0​)=0. It is still a valid particular solution when the integral cannot be simplified further.

Example: recovering the resonant exponential

Return to y′′−y=7ety''-y=7e^ty′′−y=7et, now using variation of parameters rather than a modified trial. Choose the ordered pair

y1=et,y2=e−t,W=−2.y_1=e^t,\qquad y_2=e^{-t},\qquad W=-2. y1​=et,y2​=e−t,W=−2.

With g(t)=7etg(t)=7e^tg(t)=7et, the parameter integrals are

u1=−∫e−t(7et)−2 dt=72t,u2=∫et(7et)−2 dt=−74e2t.\begin{aligned} u_1&=-\int\frac{e^{-t}(7e^t)}{-2}\,dt=\frac72t,\\ u_2&=\int\frac{e^t(7e^t)}{-2}\,dt=-\frac74e^{2t}. \end{aligned} u1​u2​​=−∫−2e−t(7et)​dt=27​t,=∫−2et(7et)​dt=−47​e2t.​

Multiplying by the corresponding homogeneous solutions gives

yp=u1y1+u2y2=72tet−74et.y_p=u_1y_1+u_2y_2=\frac72te^t-\frac74e^t. yp​=u1​y1​+u2​y2​=27​tet−47​et.

The last term is itself homogeneous. Absorb it into the arbitrary coefficient of ete^tet to obtain

y(t)=C1et+C2e−t+72tet,t∈R.\boxed{y(t)=C_1e^t+C_2e^{-t}+\frac72te^t},\qquad t\in\mathbb R. y(t)=C1​et+C2​e−t+27​tet​,t∈R.

This is the same family found by undetermined coefficients. Variation of parameters produces the needed factor of ttt through integration, without requiring us to guess it.

Example: tangent forcing

Now consider an input outside the usual undetermined-coefficients families:

y′′+y=tan⁡t,−π2<t<π2.y''+y=\tan t,\qquad -\frac\pi2<t<\frac\pi2. y′′+y=tant,−2π​<t<2π​.

The endpoints are excluded because tan⁡t\tan ttant is undefined there. On this open interval, the coefficients and forcing are continuous. The homogeneous equation has roots ±i\pm i±i, so choose

y1=sin⁡t,y2=cos⁡t,W=sin⁡t(−sin⁡t)−cos⁡2t=−1.y_1=\sin t,\qquad y_2=\cos t,\qquad W=\sin t(-\sin t)-\cos^2t=-1. y1​=sint,y2​=cost,W=sint(−sint)−cos2t=−1.

Keep this order when applying the formulas. The first integral simplifies immediately:

u1=−∫cos⁡ttan⁡t−1 dt=∫sin⁡t dt=−cos⁡t.u_1=-\int\frac{\cos t\tan t}{-1}\,dt =\int\sin t\,dt=-\cos t. u1​=−∫−1costtant​dt=∫sintdt=−cost.

For the second, rewrite sin⁡2t=1−cos⁡2t\sin^2t=1-\cos^2tsin2t=1−cos2t:

u2=∫sin⁡ttan⁡t−1 dt=−∫sin⁡2tcos⁡t dt=∫(cos⁡t−sec⁡t) dt=sin⁡t−ln⁡∣sec⁡t+tan⁡t∣.\begin{aligned} u_2&=\int\frac{\sin t\tan t}{-1}\,dt =-\int\frac{\sin^2t}{\cos t}\,dt\\ &=\int(\cos t-\sec t)\,dt\\ &=\sin t-\ln|\sec t+\tan t|. \end{aligned} u2​​=∫−1sinttant​dt=−∫costsin2t​dt=∫(cost−sect)dt=sint−ln∣sect+tant∣.​

To check the logarithm, differentiate it: (sec⁡t+tan⁡t)′=sec⁡t(sec⁡t+tan⁡t)(\sec t+\tan t)'=\sec t(\sec t+\tan t)(sect+tant)′=sect(sect+tant), so its logarithmic derivative is sec⁡t\sec tsect.

The mixed sine–cosine terms cancel when we form the particular solution:

yp=(−cos⁡t)sin⁡t+(sin⁡t−ln⁡∣sec⁡t+tan⁡t∣)cos⁡t=−cos⁡tln⁡∣sec⁡t+tan⁡t∣.\begin{aligned} y_p&=(-\cos t)\sin t +\bigl(\sin t-\ln|\sec t+\tan t|\bigr)\cos t\\ &=-\cos t\ln|\sec t+\tan t|. \end{aligned} yp​​=(−cost)sint+(sint−ln∣sect+tant∣)cost=−costln∣sect+tant∣.​

Thus the general solution on the stated interval is

y(t)=C1sin⁡t+C2cos⁡t−cos⁡tln⁡∣sec⁡t+tan⁡t∣.\boxed{y(t)=C_1\sin t+C_2\cos t-\cos t\ln|\sec t+\tan t|}. y(t)=C1​sint+C2​cost−costln∣sect+tant∣​.

For a direct check, let H(t)=ln⁡∣sec⁡t+tan⁡t∣H(t)=\ln|\sec t+\tan t|H(t)=ln∣sect+tant∣. Since H′=sec⁡tH'=\sec tH′=sect,

yp′=sin⁡t H−1,yp′′=cos⁡t H+tan⁡t,y_p'=\sin t\,H-1,\qquad y_p''=\cos t\,H+\tan t, yp′​=sintH−1,yp′′​=costH+tant,

and yp′′+yp=tan⁡ty_p''+y_p=\tan typ′′​+yp​=tant, as required.

Choosing a particular-solution method

Use undetermined coefficients when the coefficients are constant and the forcing is built from polynomials, exponentials, sine, and cosine. Check for overlap with the homogeneous solutions and multiply the whole trial by the required power of ttt.

Use variation of parameters for more general forcing or variable coefficients when a fundamental homogeneous pair is known. It does not find that pair for us, and its integrals may need to remain unevaluated.

These methods now let us study mechanical vibrations and RLC circuits: the same second-order equation describes both systems.

Source: https://notes.ohevan.com/notes/ode/03-second-order-linear-equations

© 2026 Evan Luo. All rights reserved.

Back to Ordinary Differential Equations

0 reads

·Last edited Oct 12, 2026
  • newsletter

  • about me

  • sponsor

© 2026 Evan Luo. All rights reserved.