By the end of this week you should be able to:
classify an ODE by its order and linearity;
solve first-order separable ODEs by separation of variables;
derive and apply an integrating factor for first-order linear ODEs;
use substitutions to solve Bernoulli equations and homogeneous first-order ODEs;
solve second-order linear ODEs with constant coefficients (homogeneous and inhomogeneous);
identify and describe simple harmonic motion and damped oscillations.
An ordinary differential equation (ODE) is an equation involving an independent variable \(x\), a dependent variable \(y(x)\), and at least one of the derivatives \(\dfrac{\dd y}{\dd x}\), \(\dfrac{\dd^2 y}{\dd x^2}\), …. If \(\dfrac{\dd^n y}{\dd x^n}\) is the highest-order derivative appearing in the equation, then the equation is an \(n\)-th order ODE. For example, \(x^2\dfrac{\dd^2 y}{\dd x^2} - 2x\dfrac{\dd y}{\dd x} + 6y = x^4\) is a 2nd-order ODE.
An ODE is linear if it can be written in the form \[a_n(x)\,\frac{\dd^n y}{\dd x^n} + a_{n-1}(x)\,\frac{\dd^{n-1} y}{\dd x^{n-1}} + \cdots + a_1(x)\,\frac{\dd y}{\dd x} + a_0(x)\,y = f(x),\] where the coefficient functions \(a_0, a_1, \ldots, a_n\) and the forcing \(f\) depend only on \(x\), not on \(y\). The crucial requirement is that \(y\) and its derivatives appear only to the first power and are never multiplied together.
A useful way to think about this: define the differential operator \(\mathcal{L}\) by \[\mathcal{L}[y] = a_n(x)\,y^{(n)} + \cdots + a_1(x)\,y' + a_0(x)\,y.\] The operator \(\mathcal{L}\) is linear in the sense that for any constants \(c_1\), \(c_2\) and any functions \(y_1\), \(y_2\), \[\mathcal{L}[c_1\,y_1 + c_2\,y_2] = c_1\,\mathcal{L}[y_1] + c_2\,\mathcal{L}[y_2].\] This superposition principle is the single most important property of linear ODEs: it means we can build new solutions by adding multiples of known ones.
An ODE that is not linear is called nonlinear. Common sources of nonlinearity include powers of \(y\) (e.g. \(y^2\)), products of \(y\) with its derivatives (e.g. \(y\,y'\)), and nonlinear functions of \(y\) (e.g. \(\sin y\), \(e^y\)). Typically nonlinear ODEs are much more difficult to solve, however it is very common to meet them when we try to model real-world systems.
Example: Classifying ODEs
The following are ODEs listed with their order and linearity:
\(y'' + y = x^2\) — linear, second-order.
\(xy''' + (y')^2 - y\sin x = \log x\) — nonlinear, third-order.
\((y')^5 + y^2 = 0\) — nonlinear, first-order.
\(y'' + \sin(y) = 0\) — nonlinear, second-order.
\(p(x)\,y' + q(x)\,y = 0\) — linear, first-order.
\(y' + z = x\) and \(z'' - y = \sin x\) — a coupled system of order 2.
We say that \(y = \phi(x)\) is a solution of an ODE if the ODE is satisfied for all \(x\). For example, \(y = \sin x\) is a solution of \(y'' + y = 0\) because \[\frac{\dd^2}{\dd x^2}\sin x + \sin x = -\sin x + \sin x = 0.\] Note that \(y = \sin x\) is a solution but not the only one — \(\cos x\) is also a solution, as is any linear combination \(a\sin x + b\cos x\). This linear combination is the general solution; particular choices of \(a\) and \(b\) give particular solutions.
Example: Direct integration
Solve \(y'' = 20x^3\).
Integrating once: \(y' = 5x^4 + c_1\). Integrating again: \(y = x^5 + c_1 x + c_2\). This is the general solution — it contains two arbitrary constants, as expected for a second-order ODE.
Key Idea
Solving an \(n\)-th order ODE typically involves \(n\) integrations. The general solution therefore contains \(n\) arbitrary constants \(c_1, c_2, \ldots, c_n\). Specifying initial or boundary conditions pins down these constants and selects a particular solution.
A first-order ODE is separable if it can be written in the form \[\begin{equation} \frac{\dd y}{\dd x} = g(x)\,h(y). \label{eq:separable} \end{equation}\]
The strategy is to collect all \(y\)-dependence on one side and all \(x\)-dependence on the other. Rewrite [eq:separable] as \[\frac{1}{h(y)}\,\dd y = g(x)\,\dd x,\] then integrate both sides: \[\int \frac{1}{h(y)}\,\dd y = \int g(x)\,\dd x.\]
More formally: let \(\Phi(y)\) be an antiderivative of \(1/h(y)\) and \(G(x)\) an antiderivative of \(g(x)\). By the chain rule, \(\dfrac{\dd}{\dd x}\Phi(y) = \dfrac{1}{h(y)}\dfrac{\dd y}{\dd x}\), so the ODE becomes \(\dfrac{\dd}{\dd x}\Phi(y) = g(x)\), which integrates to give the general solution implicitly as \[\Phi(y) = G(x) + c.\]
Example: Rational right-hand side
Find the general solution of \(\dfrac{\dd y}{\dd x} = {4x^3}{y^2}\).
Step 1.Separate: \(y^{-2}\,\dd y = 4x^3\,\dd x\).
Step 2.Integrate both sides: \[\int y^{-2}\,\dd y = \int 4x^3\,\dd x \qquad\Longrightarrow\qquad -\frac{1}{y} = x^4 + c.\]
Step 3.Rearrange: \(\boxed{y(x) = \dfrac{-1}{x^4 + c}.}\)
To find the particular solution satisfying \(y(0) = 1\): substitute to get \(1 = -1/c\), so \(c = -1\), giving \(y(x) = -1/(x^4 - 1)\).
Example: Exponential growth and decay
Solve \(\dfrac{\dd y}{\dd x} = ky\), where \(k\) is a constant.
Step 1.Separate: \(\dfrac{1}{y}\,\dd y = k\,\dd x\).
Step 2.Integrate: \[\int \frac{1}{y}\,\dd y = \int k\,\dd x \qquad\Longrightarrow\qquad \log y = kx + c.\]
Step 3.Exponentiate: \(\boxed{y(x) = Ce^{kx},}\) where \(C = e^c = y(0)\).
The solution describes exponential growth if \(k > 0\) and exponential decay if \(k < 0\).
Example: Positive variable
Solve \(\dfrac{\dd y}{\dd x} = (6x^2 + 1)\,y\), where \(y > 0\).
Separating and integrating: \[\int \frac{1}{y}\,\dd y = \int (6x^2 + 1)\,\dd x \qquad\Longrightarrow\qquad \log y = 2x^3 + x + c.\] Hence \(\boxed{y(x) = Ce^{2x^3 + x},}\) where \(C = e^c\).
Not every first-order ODE is separable. A more general class are first-order linear ODEs, which take the standard form \[\begin{equation} \frac{\dd y}{\dd x} + a(x)\,y = b(x). \label{eq:linear-first} \end{equation}\]
The key idea is to multiply both sides by a function \(\mu(x)\) — the integrating factor — chosen so that the left-hand side becomes a total derivative.
Step 1.Multiply [eq:linear-first] by \(\mu(x)\): \[\begin{equation} \mu\,\frac{\dd y}{\dd x} + \mu\,a(x)\,y = \mu\,b(x). \label{eq:mu-mult} \end{equation}\]
Step 2.We want the LHS to equal \(\dfrac{\dd}{\dd x}(\mu\,y)\). By the product rule, \(\dfrac{\dd}{\dd x}(\mu\,y) = \mu\,\dfrac{\dd y}{\dd x} + \dfrac{\dd\mu}{\dd x}\,y\). Comparing with the LHS of [eq:mu-mult] requires \[\frac{\dd\mu}{\dd x} = \mu\,a(x).\]
Step 3.This is itself a separable ODE for \(\mu\). Solving: \[\int \frac{1}{\mu}\,\dd\mu = \int a(x)\,\dd x \qquad\Longrightarrow\qquad \boxed{\mu(x) = \exp\!\left(\int a(x)\,\dd x\right).}\]
Step 4.With this \(\mu\), equation [eq:mu-mult] becomes \[\frac{\dd}{\dd x}(\mu\,y) = \mu\,b(x),\] which integrates to give the general solution \[\begin{equation} \boxed{y(x) = \frac{1}{\mu(x)}\int \mu(x)\,b(x)\,\dd x.} \label{eq:IF-solution} \end{equation}\]
(The indefinite integral contains the arbitrary constant.)
Example
Solve \(x\dfrac{\dd y}{\dd x} - 3y = x^5\).
Step 1.Put in standard form by dividing by \(x\): \[\frac{\dd y}{\dd x} - \frac{3}{x}\,y = x^4.\] Here \(a(x) = -3/x\).
Step 2.Integrating factor: \[\mu(x) = \exp\!\left(\int \frac{-3}{x}\,\dd x\right) = \exp(-3\log x) = x^{-3}.\]
Step 3.Multiply through and recognise the total derivative: \[\frac{\dd}{\dd x}\!\left(\frac{y}{x^3}\right) = x^4 \cdot x^{-3} = x.\]
Step 4.Integrate: \[\frac{y}{x^3} = \int x\,\dd x = \tfrac{1}{2}x^2 + c,\] so \(\boxed{y(x) = \tfrac{1}{2}x^5 + cx^3.}\)
Example
Solve \(\dfrac{\dd y}{\dd x} + \dfrac{x+2}{x}\,y = e^{-x}\).
Step 1.Already in standard form with \(a(x) = (x+2)/x = 1 + 2/x\).
Step 2.Integrating factor: \[\mu(x) = \exp\!\left(\int 1 + \frac{2}{x}\,\dd x\right) = \exp(x + 2\log x) = x^2 e^x.\]
Step 3.Multiply and simplify: \[\frac{\dd}{\dd x}(x^2 e^x y) = e^{-x}\cdot x^2 e^x = x^2.\]
Step 4.Integrate: \[x^2 e^x y = \int x^2\,\dd x = \frac{x^3}{3} + c,\] so \(\boxed{y(x) = e^{-x}\!\left(\tfrac{1}{3}x + cx^{-2}\right).}\)
So far, every first-order method we have seen (separation of variables, integrating factors) applies to specific structural classes of ODEs. Many equations that do not fall into these classes can be transformed into one that does through a change of variable. In this section we study two important families of first-order ODEs that yield to substitution: Bernoulli equations and homogeneous equations.
Definition: Bernoulli equation
A Bernoulli equation is a first-order ODE of the form \[\begin{equation} \frac{\dd y}{\dd x} + P(x)\,y = Q(x)\,y^n, \label{eq:bernoulli} \end{equation}\] where \(P(x)\) and \(Q(x)\) are given functions and \(n\) is a real constant. The equation is named after Jacob Bernoulli (1655–1705).
If \(n = 0\) or \(n = 1\), equation [eq:bernoulli] is already linear and can be solved with an integrating factor (or separation of variables for \(n=1\)) . The interesting case is \(n \neq 0,\,1\), where the \(y^n\) term makes the equation nonlinear.
Divide [eq:bernoulli] through by \(y^n\) (assuming \(y \neq 0\)): \[y^{-n}\,\frac{\dd y}{\dd x} + P(x)\,y^{1-n} = Q(x).\] Now introduce the new variable \[\begin{equation} v = y^{1-n}. \label{eq:bernoulli-sub} \end{equation}\] By the chain rule, \[\frac{\dd v}{\dd x} = (1-n)\,y^{-n}\,\frac{\dd y}{\dd x},\] so \(y^{-n}\,\dfrac{\dd y}{\dd x} = \dfrac{1}{1-n}\,\dfrac{\dd v}{\dd x}\). Substituting: \[\frac{1}{1-n}\,\frac{\dd v}{\dd x} + P(x)\,v = Q(x),\] which rearranges to \[\begin{equation} \frac{\dd v}{\dd x} + (1-n)\,P(x)\,v = (1-n)\,Q(x). \label{eq:bernoulli-linear} \end{equation}\] This is a first-order linear ODE in \(v\), which we can solve using the integrating factor method. Once \(v(x)\) is found, we recover \(y\) from \(y = v^{1/(1-n)}\).
Key Idea
The Bernoulli substitution \(v = y^{1-n}\) converts a nonlinear ODE into a linear one. The procedure is: (1) identify \(P\), \(Q\) and \(n\); (2) substitute \(v = y^{1-n}\); (3) solve the resulting linear ODE for \(v\); (4) convert back to \(y\).
Example Solve \[\dfrac{\dd y}{\dd x} + \dfrac{y}{x} = x\,y^2.\]
Step 1:Here \(P(x) = 1/x\), \(Q(x) = x\), and \(n = 2\).
Step 2:Let \(v = y^{1-2} = y^{-1} = 1/y\). Then \[\dfrac{\dd v}{\dd x} = -y^{-2}\,\dfrac{\dd y}{\dd x}.\]
Dividing the original equation by \(y^2\): \[y^{-2}\,\frac{\dd y}{\dd x} + \frac{1}{x}\,y^{-1} = x \qquad\Longrightarrow\qquad -\frac{\dd v}{\dd x} + \frac{v}{x} = x.\] Rearranging: \[\frac{\dd v}{\dd x} - \frac{v}{x} = -x.\]
Step 3:This is linear with \(a(x) = -1/x\). The integrating factor is \[\mu = \exp\!\left(\int \frac{-1}{x}\,\dd x\right) = \exp(-\log x) = \frac{1}{x}.\] Multiplying through: \[\frac{\dd}{\dd x}\!\left(\frac{v}{x}\right) = -1.\] Integrating: \[\frac{v}{x} = -x + c \qquad\Longrightarrow\qquad v = -x^2 + cx.\]
Step 4:Since \(v = 1/y\): \[\boxed{y = \frac{1}{cx - x^2}.}\]
Example Solve \[\dfrac{\dd y}{\dd x} - y = e^x\,y^3.\]
Step 1:\(P(x) = -1\), \(Q(x) = e^x\), \(n = 3\).
Step 2:Let \(v = y^{1-3} = y^{-2}\). Then \[\dfrac{\dd v}{\dd x} = -2y^{-3}\,\dfrac{\dd y}{\dd x}.\]
Dividing the original equation by \(y^3\): \[y^{-3}\,\frac{\dd y}{\dd x} - y^{-2} = e^x \qquad\Longrightarrow\qquad -\frac{1}{2}\,\frac{\dd v}{\dd x} - v = e^x.\] Rearranging: \[\frac{\dd v}{\dd x} + 2v = -2e^x.\]
Step 3:Integrating factor: \(\mu = e^{2x}\). \[\frac{\dd}{\dd x}(e^{2x}\,v) = -2e^{3x} \qquad\Longrightarrow\qquad e^{2x}\,v = -\frac{2}{3}\,e^{3x} + c.\] So \(v = -\frac{2}{3}\,e^x + c\,e^{-2x}\).
Step 4:Since \(v = y^{-2}\): \[\boxed{y^{-2} = -\tfrac{2}{3}\,e^x + c\,e^{-2x}, \qquad\text{i.e.}\quad y = \pm\frac{1}{\sqrt{c\,e^{-2x} - \tfrac{2}{3}\,e^x}}.}\]
The word “homogeneous” is used in two different senses in the study of ODEs. Later in this chapter we will call a linear ODE homogeneous when the right-hand side is zero (i.e. no forcing term). In this subsection, the word has a completely different meaning related to scaling.
Definition: Homogeneous first-order ODE
A first-order ODE is called homogeneous if it can be written in the form \[\begin{equation} \frac{\dd y}{\dd x} = F\!\left(\frac{y}{x}\right). \label{eq:homogeneous-ode} \end{equation}\]
In other words, the right-hand side depends on \(x\) and \(y\) only through the combination \(y/x\). Equivalently, if you replace \(x\) by \(\lambda x\) and \(y\) by \(\lambda y\) in the expression for \(\dd y/\dd x\), the \(\lambda\)’s cancel completely.
An equation of the form \[\frac{\dd y}{\dd x} = \frac{M(x,y)}{N(x,y)}\] is homogeneous if \(M\) and \(N\) are both homogeneous functions of the same degree: that is, \(M(\lambda x, \lambda y) = \lambda^k\,M(x,y)\) and \(N(\lambda x, \lambda y) = \lambda^k\,N(x,y)\) for some \(k\). Setting \(\lambda = 1/x\) then gives \[\frac{M(x,y)}{N(x,y)} = \frac{x^k\,M(1,\,y/x)}{x^k\,N(1,\,y/x)} = F\!\left(\frac{y}{x}\right).\]
Let \[\begin{equation} v = \frac{y}{x}, \qquad\text{so that}\qquad y = vx. \label{eq:homog-sub} \end{equation}\] Differentiating by the product rule: \(\dfrac{\dd y}{\dd x} = v + x\,\dfrac{\dd v}{\dd x}\). Substituting into [eq:homogeneous-ode]: \[v + x\,\frac{\dd v}{\dd x} = F(v),\] which rearranges to \[\begin{equation} x\,\frac{\dd v}{\dd x} = F(v) - v. \label{eq:homog-separated} \end{equation}\] This is a separable ODE in \(v\) and \(x\): \[\frac{\dd v}{F(v) - v} = \frac{\dd x}{x}.\] After integrating both sides, substitute back \(v = y/x\) to obtain the solution in terms of \(x\) and \(y\).
Key Idea
The substitution \(v = y/x\) converts a homogeneous first-order ODE into a separable equation. The procedure is: (1) verify the equation has the form \(y' = F(y/x)\); (2) substitute \(y = vx\); (3) separate and integrate; (4) replace \(v\) by \(y/x\).
Example
Solve \[\dfrac{\dd y}{\dd x} = \dfrac{x^2 + y^2}{2xy}.\]
Step 1:Both \(x^2 + y^2\) and \(2xy\) are homogeneous of degree 2. Dividing numerator and denominator by \(x^2\): \[\frac{\dd y}{\dd x} = \frac{1 + (y/x)^2}{2(y/x)} = F\!\left(\frac{y}{x}\right).\]
Step 2:Let \(v = y/x\), so \(y = vx\) and \(y' = v + xv'\). Then \[v + x\,\frac{\dd v}{\dd x} = \frac{1 + v^2}{2v}.\] Rearranging: \[x\,\frac{\dd v}{\dd x} = \frac{1 + v^2}{2v} - v = \frac{1 + v^2 - 2v^2}{2v} = \frac{1 - v^2}{2v}.\]
Step 3: \[\frac{2v}{1 - v^2}\,\dd v = \frac{\dd x}{x}.\] The left-hand side integrates to \(-\log|1 - v^2|\) (using the substitution \(u = 1 - v^2\)). So \[-\log|1 - v^2| = \log|x| + C_1.\] Exponentiating: \(|1 - v^2| = \dfrac{A}{|x|}\) for some constant \(A > 0\), or more generally \[1 - v^2 = \frac{c}{x},\] where \(c\) is an arbitrary constant.
Step 4:Replacing \(v = y/x\): \[1 - \frac{y^2}{x^2} = \frac{c}{x} \qquad\Longrightarrow\qquad \boxed{x^2 - y^2 = cx.}\]
Example
Solve \[x\,\dfrac{\dd y}{\dd x} = y + x\,e^{-y/x}, \qquad y(1) = 0.\]
Step 1:Dividing by \(x\): \[\frac{\dd y}{\dd x} = \frac{y}{x} + e^{-y/x}.\] This has the form \(F(y/x) = v + e^{-v}\), so the equation is homogeneous.
Step 2:Let \(v = y/x\), so \(y' = v + xv'\). Then \[v + x\,\frac{\dd v}{\dd x} = v + e^{-v} \qquad\Longrightarrow\qquad x\,\frac{\dd v}{\dd x} = e^{-v}.\]
Step 3: \[e^v\,\dd v = \frac{\dd x}{x} \qquad\Longrightarrow\qquad e^v = \log|x| + c.\]
Step 4:Replacing \(v = y/x\): \[e^{y/x} = \log|x| + c.\] Applying \(y(1) = 0\): \(e^0 = \log 1 + c\), so \(c = 1\). Therefore \[\boxed{e^{y/x} = \log x + 1, \qquad\text{i.e.}\quad y = x\,\log(\log x + 1).}\]
We have now met four techniques for first-order ODEs. When faced with a new equation, the following decision process can help:
Is it separable?Can you write \(y' = g(x)\,h(y)\)? If so, separate and integrate.
Is it linear?Can you write \(y' + a(x)\,y = b(x)\)? If so, use an integrating factor.
Is it Bernoulli?Does it have the form \(y' + P(x)\,y = Q(x)\,y^n\) with \(n \neq 0,\,1\)? If so, substitute \(v = y^{1-n}\) to make it linear.
Is it homogeneous?Can you write \(y' = F(y/x)\)? If so, substitute \(v = y/x\) to make it separable.
Note that these categories overlap: a Bernoulli equation with \(Q(x) = 0\) is linear, and some homogeneous equations are also separable. With practice, recognising the right structure becomes second nature.
We now turn to equations of the form \[\begin{equation} py'' + qy' + ry = f(x), \label{eq:2nd-order} \end{equation}\] where \(p\), \(q\), \(r\) are constants. When \(f(x) = 0\) the equation is homogeneous; when \(f(x) \neq 0\) it is inhomogeneous.
Because the ODE is linear, the general solution has the structure \[y(x) = \underbrace{\text{CF}}_{\text{complementary function}} + \underbrace{\text{PI}}_{\text{particular integral}},\] where the CF is the general solution of the homogeneous equation \(py'' + qy' + ry = 0\) and the PI is any one particular solution of the full equation [eq:2nd-order].
Key Idea
Superposition: If \(\mathcal{L}\) denotes the linear operator \(p\dfrac{\dd^2}{\dd x^2} + q\dfrac{\dd}{\dd x} + r\), then \(\mathcal{L}[c_1 y_1 + c_2 y_2] = c_1\mathcal{L}[y_1] + c_2\mathcal{L}[y_2]\). This means that any linear combination of solutions to the homogeneous equation is again a solution.
To solve the homogeneous equation \[\begin{equation} py'' + qy' + ry = 0, \label{eq:homogeneous} \end{equation}\] try \(y = e^{mx}\). Then \(y' = me^{mx}\) and \(y'' = m^2 e^{mx}\), so substitution gives \[(pm^2 + qm + r)\,e^{mx} = 0.\] Since \(e^{mx} \neq 0\), we require \(m\) to satisfy the auxiliary equation (AE): \[\begin{equation} \boxed{pm^2 + qm + r = 0.} \label{eq:AE} \end{equation}\]
There are three cases depending on the discriminant \(\Delta = q^2 - 4pr\).
The general solution is \[y(x) = c_1 e^{m_1 x} + c_2 e^{m_2 x}.\]
One solution is \(e^{mx}\); a second linearly independent solution is \(xe^{mx}\) (verify by substitution). The general solution is \[y(x) = c_1 e^{mx} + c_2\,x e^{mx}.\]
Using Euler’s formula, the general solution can be written in real form as \[y(x) = e^{\alpha x}\bigl(c_1\cos\beta x + c_2\sin\beta x\bigr).\]
Example: Summary table
| ODE | AE | Roots | CF |
|---|---|---|---|
| \(y'' - 5y' + 6y = 0\) | \(t^2 - 5t + 6 = 0\) | \(2,\;3\) | \(c_1 e^{2x} + c_2 e^{3x}\) |
| \(y'' + 6y' + 9y = 0\) | \(t^2 + 6t + 9 = 0\) | \(-3\) (twice) | \(c_1 e^{-3x} + c_2\,x e^{-3x}\) |
| \(y'' - 2y' + 5y = 0\) | \(t^2 - 2t + 5 = 0\) | \(1 \pm 2i\) | \(e^x(c_1\cos 2x + c_2\sin 2x)\) |
| \(y'' + 9y = 0\) | \(t^2 + 9 = 0\) | \(\pm 3i\) | \(c_1\cos 3x + c_2\sin 3x\) |
| \(y'' - 9y = 0\) | \(t^2 - 9 = 0\) | \(\pm 3\) | \(c_1 e^{3x} + c_2 e^{-3x}\) |
A particularly important special case is \[\begin{equation} \frac{\dd^2 y}{\dd x^2} + \omega^2 y = 0, \label{eq:SHM} \end{equation}\] where \(\omega > 0\). This describes small oscillations of a pendulum or a mass on a spring. The AE is \(t^2 + \omega^2 = 0\) with roots \(\pm i\omega\), so the general solution is \[\begin{equation} y = c_1\cos\omega x + c_2\sin\omega x, \label{eq:SHM-gen} \end{equation}\] or equivalently in phase-amplitude form, \[\begin{equation} y = A\sin(\omega x + \phi), \label{eq:SHM-amp} \end{equation}\] where \(A = \sqrt{c_1^2 + c_2^2}\) is the amplitude, \(\phi\) is the phase, and the connection is \(c_1 = A\sin\phi\), \(c_2 = A\cos\phi\). Every nonzero solution is a simple harmonic oscillation with period \(2\pi/\omega\) and frequency \(\omega/(2\pi)\) Hz.
Most physical oscillators experience a frictional force proportional to velocity. The governing equation becomes \[\begin{equation} y'' + 2k\,y' + \omega^2 y = 0, \label{eq:damped} \end{equation}\] where \(k \ge 0\) is the damping coefficient. The AE is \(t^2 + 2kt + \omega^2 = 0\) with roots \(-k \pm \sqrt{k^2 - \omega^2}\). Three regimes arise:
Underdamped (\(k < \omega\)): roots are \(-k \pm ip\) where \(p = \sqrt{\omega^2 - k^2}\). The solution is \[y(x) = Ae^{-kx}\sin(px + \alpha),\] a decaying oscillation with envelope \(\pm Ae^{-kx}\).
Critically damped (\(k = \omega\)): repeated root \(-k\), giving \(y = (c_1 + c_2\,x)\,e^{-kx}\).
Overdamped (\(k > \omega\)): two distinct negative real roots, giving a sum of decaying exponentials.
Key Idea
In the underdamped case the motion is oscillatory but the amplitude decays exponentially. In the overdamped case there are no oscillations at all — the system returns to equilibrium monotonically. Critical damping is the boundary between these two behaviours and gives the fastest non-oscillatory return to equilibrium.
For the inhomogeneous equation \(py'' + qy' + ry = f(x)\), we need one particular solution. The method of undetermined coefficients works by guessing a trial form suggested by \(f(x)\) and determining the unknown constants by substitution.
Try \(y = a_0 + a_1 x + \cdots + a_n x^n\).
Try \(y = A\cos\alpha x + B\sin\alpha x\). If \(i\alpha\) is a root of the AE, multiply the trial function by \(x\).
Try \(y = Ae^{\alpha x}\). If \(\alpha\) is a simple root of the AE, try \(y = Axe^{\alpha x}\). If \(\alpha\) is a repeated root, try \(y = Ax^2 e^{\alpha x}\).
Find the PI for each term separately, then sum.
Example
Find the general solution of \(y'' + 3y' + 2y = 6e^{2x}\).
Step 1:AE: \(t^2 + 3t + 2 = (t+1)(t+2) = 0\), roots \(-1\), \(-2\). \[\text{CF} = c_1 e^{-x} + c_2 e^{-2x}.\]
Step 2:Since \(\alpha = 2\) is not a root of the AE, try \(\phi = Ae^{2x}\). Then \(\phi' = 2Ae^{2x}\), \(\phi'' = 4Ae^{2x}\), and substitution gives \[Ae^{2x}(4 + 6 + 2) = 12Ae^{2x} = 6e^{2x} \qquad\Longrightarrow\qquad A = \tfrac{1}{2}.\]
Step 3: \[\boxed{y(x) = c_1 e^{-x} + c_2 e^{-2x} + \tfrac{1}{2}e^{2x}.}\]
Example
Find the general solution of \(y'' + 3y' + 2y = 10\cos 2x\).
Step 1:As above: \(c_1 e^{-x} + c_2 e^{-2x}\).
Step 2:Try \(\phi = A\sin 2x + B\cos 2x\). Substituting: \[(-2A - 6B)\sin 2x + (-2B + 6A)\cos 2x = 10\cos 2x.\] Matching coefficients: \(-2A - 6B = 0\) and \(6A - 2B = 10\). From the first equation \(A = -3B\); substituting gives \(-10B = 10\), so \(B = -\tfrac{1}{2}\) and \(A = \tfrac{3}{2}\).
Step 3: \[\boxed{y(x) = c_1 e^{-x} + c_2 e^{-2x} + \tfrac{3}{2}\sin 2x - \tfrac{1}{2}\cos 2x.}\]
Exercise 4.1
Solve the following first-order ODEs:
\(\dfrac{\dd y}{\dd x} = \dfrac{x^2}{y}\), with \(y(0) = 2\).
\(\dfrac{\dd y}{\dd x} + 2y = e^{-x}\).
\(\dfrac{\dd y}{\dd x} = y\sin x\), with \(y(0) = 1\).
Exercise 4.2
Solve the following Bernoulli equations:
\(\dfrac{\dd y}{\dd x} + y = y^2\).
\(\dfrac{\dd y}{\dd x} - \dfrac{2y}{x} = -x^2\,y^2\), with \(y(1) = 1\).
\(\dfrac{\dd y}{\dd x} + \dfrac{y}{x} = x\,\sqrt{y}\). [Hint: \(n = \tfrac{1}{2}\).]
Exercise 4.3
Solve the following homogeneous first-order ODEs:
\(\dfrac{\dd y}{\dd x} = \dfrac{y^2 + xy}{x^2}\).
\(\dfrac{\dd y}{\dd x} = \dfrac{x + y}{x - y}\).
\((x^2 + y^2)\,\dd x - 2xy\,\dd y = 0\), with \(y(1) = 0\). [Hint: rewrite as \(y' = (x^2 + y^2)/(2xy)\).]
Exercise 4.4
Find the general solution to the following inhomogeneous ODEs:
\(y'' - 2y' - 8y = 10e^{-x}\).
\(y'' - 2y' - 8y = 12e^{4x}\).
\(y'' - 4y' + 4y = 6e^{2x}\).
\(y'' - 6y' + 5y = 6\cos x + 22\sin x\).
\(y'' + 9y = 24\cos 3x - 6\sin 3x\).
\(y'' + 8y' + 16y = 16x^2 + 26\).
Exercise 4.5
A mass on a spring satisfies \(y'' + 4y' + 13y = 0\), with \(y(0) = 1\) and \(y'(0) = 0\).
Find the roots of the auxiliary equation and classify the damping.
Write down the general solution.
Apply the initial conditions to find the particular solution.
Sketch the solution and identify the period and envelope.