JustToThePoint English Website Version
JustToThePoint en español

Solving First-Order Linear Ordinary Differential Equations with Sinusoidal Inputs

The real problem of humanity is the following: We have Paleolithic emotions, medieval institutions and godlike technology. And it is terrifically dangerous, and it is now approaching a point of crisis overall, Edward O. Wilson.

Basic Linear ODE

Recall

Definition. A differential equation is an equation that involves one or more dependent variables, their derivatives with respect to one or more independent variables, and the independent variables themselves, e.g., $\frac{dy}{dx} = 3x +5y, y' + y = 4xcos(2x), \frac{dy}{dx} = x^2y+y, etc.$

It involves (e.g., $\frac{dy}{dx} = 3x +5y$):

Basic linear ODE

In mathematics, a linear ordinary differential equation (ODE) is an equation involving an unknown function and its derivatives, characterized by the property that both the function and its derivatives appear linearly. This means that the unknown function and its derivatives are raised only to the first power. They are never multiplied together, nor are they composed within nonlinear functions (such as $\sin(y)$ or $e^y$). The general form for a first-order linear ODE is: a(x)y’ + b(x)y = c(x).

This property of linearity is fundamental. While most physical systems are inherently nonlinear, many can be accurately approximated by linear models over a specific range. This linearity allows mathematicians and engineers to utilize a vast and powerful toolkit of analytical solution methods that are unavailable for nonlinear systems. Consequently, linear ODEs are the bedrock of modeling in numerous fields, including:

In this article, we will explore different forms of linear ODEs, their applications, and their solutions, with a focus on understanding their behavior in real-world contexts.

Mathematical Definition of Linearity

An ODE of order n is linear if it can be expressed in the form: $a_n(t)\frac{d^ny}{dt^n} +a_{n-1}(t)\frac{d^{n-1}y}{dt^{n-1}} + ··· + a_1(t)\frac{dy}{dt} + a_0(t)y = q(t)$ where

The function y and its derivatives appear to the first power and are not multiplied together.

In this second article, we will continue exploring different forms of linear ODEs, their applications, and their solutions, with a focus on understanding their behavior in real-world contexts.

Solving First-Order Linear Ordinary Differential Equations with Sinusoidal Inputs

First-order linear ordinary differential equations (ODEs) with sinusoidal inputs frequently appear in engineering and physics. They model systems driven by oscillation, such as RL electrical circuits supplied by AC voltage or mechanical systems subjected to periodic forcing.

The general form of such an equation is: x ’ + kx = cos(wt), where:

To solve this, we will employ the standard Integrating Factor technique combined with the powerful method of Complex Exponents (Complexification). Finally, we will use the Principle of Superposition to handle more complex combinations of inputs.

The Method of Complex Exponentials

While this equation can be solved using method of undetermined coefficients, using complex exponentials often simplifies the algebra, particularly when analyzing phase shifts.

Step 1. Complexify the Input.
To simplify the solution process, we express the input as the real part of a complex exponential. Using Euler’s formula: $\cos(wt) = Re[e^{i wt}]$

Step 2. Formulating the Complex ODE. By substituting the complex exponential into the original differential equation, we obtain a complex helper ODE: $z' + kz = e^{i wt}$ analogous to the original equation. This equation is easier to solve, and we can later take the real part to find the solution to the original equation.

Step 3. A first-order linear ODE can be solved using an integrating factor. The standard form is: y′ +P(t)y = Q(t). For our complex ODE, $P(t) = k, Q(t) = e^{i wt}$.

($\star$) Calculate the Integrating Fact: $μ(t) = e^{\int kdt} = e^{kt}$
($\star$) Multiplying both side of the complex ODE by the integrator factor: $z'e^{kt} + kze^{kt} = e^{kt}e^{iwt}$
($\star$) Recognize the left side as a product rule derivative: $\frac{d}{dt}(z·e^{kt})= e^{(k + iw)t}$
($\star$) Integrate both sides with respect to t: $\int \frac{d}{dt}(z·e^{kt})dt = \int e^{(k + iw)t}dt \implies z·e^{kt} = \frac{1}{k+iw}e^{(k + iw)t} + c$ where c is the constant of integration. ($\star$) Solving for z. The Complex General Solution. $z = ce^{-kt}+ \frac{1}{k+iw}e^{iwt}$. This is the general solution to the complex ODE.

This expression consists of two parts:

  1. Homogeneous Solution (Transient Solution): The solution that comes from the homogeneous equation, $ce^{-kt}$, it decays exponentially over time (if k > 0).
  2. Particular Solution (Steady-State Solution). The solution that comes from the sinusoidal input is the particular solution, $\frac{1}{k+iw}e^{iwt}$.

Step 4: Extracting the Real Part to Find x(t). To find the real solution, we take the real part of z(t): x(t) = Re[z(t)] = $ce^{-kt}+ Re[\frac{1}{k+iw}e^{iwt}]$

To extract the real part of the second term (the particular solution), we perform two steps: algebra on the complex coefficient, and application of Euler’s formula.

  1. Rationalize the complex coefficient (multiply by the conjugate k−iω):

$\frac{1}{k + i\omega} = \frac{1}{k + i\omega} \cdot \frac{k - i\omega}{k - i\omega} = \frac{k - i\omega}{k^2 + \omega^2}$

  1. Expand using Euler’s Formula and multiply:
$$\text{Re}\left[ \left( \frac{k - i\omega}{k^2 + \omega^2} \right) (\cos(\omega t) + i\sin(\omega t)) \right]$$

$$= \frac{1}{k^2 + \omega^2} \text{Re}\left[ \underbrace{k\cos(\omega t)}_{\text{Real}} + \underbrace{ik\sin(\omega t)}_{\text{Imag}} - \underbrace{i\omega\cos(\omega t)}_{\text{Imag}} - \underbrace{i^2\omega\sin(\omega t)}_{\text{Real, since } i^2=-1} \right]$$

$$= \frac{1}{k^2 + \omega^2} \text{Re}\left[ (k\cos(\omega t) + \omega\sin(\omega t)) + i(k\sin(\omega t) - \omega\cos(\omega t)) \right]$$
  1. Take the Real Part:
$$x_p(t) = \frac{k}{k^2 + \omega^2}\cos(\omega t) + \frac{\omega}{k^2 + \omega^2}\sin(\omega t)$$

Step 5: Final Solution and Analysis

Combining the homogeneous and particular parts, we get the general solution for $x(t)$:

$x(t) = \underbrace{Ce^{-kt}}_{x_h} + \underbrace{\frac{1}{k^2 + \omega^2}\left[k\cos(\omega t) + \omega\sin(\omega t)\right]}_{x_p}$

Note: If given an initial condition $x(0)$, $C$ is determined using the full equation above.

The solution is composed of two distinct physical responses

  1. Homogeneous Solution (Transient Response): $x_h(t)=ce^{-kt}$, decays exponentially over time due to the exponential term if k > 0. It represents the natural response of the system without external input based on its initial state.
  2. Particular Solution (Steady-State Response): $x_p(t)=\frac{1}{k^2+w^2}[kcos(wt)+wsin(wt)]$. This term persists as long as the input is applied. It represents the forced response due to the input cos(ωt). Notably, even though the input is purely cosine, the steady-state response contains both cosine and sine terms.

Example: Solving x’ + kx = Fsin(wt)

Let’s consider a more general differential equation where the input is a scaled sine function: x’ + kx = Fsin(wt), where F is a constant amplitude.

Step 1: Express sin(ωt) as a Complex Exponential. Using Euler’s formula: sin(wt) = Im(eiwt).

Step 2. Formulate the complex ODE: z’ + kz = Feiwt.

Step 3: Solve the Complex ODE. Following a similar analysis, μ(t) = ekt, $\frac{d}{dt}(e^{kt}z)=Fe^{(k+iw)t}, e^{kt}z = \int Fe^{(k+iw)t}dt + C ↭ e^{kt}z = \frac{F}{k+iw}e^{(k+iw)t} + C↭ e^{kt}z = \frac{F}{k+iw}e^{(k+iw)t} + C$, then (multiplying both sides by e-kit) the general solution to the complex ODE is: $z = ce^{-kt}+ \frac{F}{k+iw}e^{iwt}$

Step 4: Extract the Imaginary Part: $\frac{F}{k+iw}e^{iwt} = \frac{F(k-iw)}{k^2+w^2}(cos(wt)+isin(wt))$

x = $ce^{-kt}+ Im[\frac{F}{k+iw}e^{iwt}] = ce^{-kt}+ Im[\frac{F(k-iw)}{k^2+w^2}(cos(wt)+isin(wt))] = ce^{-kt}+ \frac{F}{k^2+w^2}[ksin(wt)-wcos(wt)]$

Physical Interpretation: Amplitude and Phase

Engineers rarely leave the steady-state solution in the standard algebraic form ($\text{A}\cos + \text{B}\sin$). It is much more useful to express $x_p(t)$ as a single, phase-shifted sinusoid: $x_p(t) = M \cos(\omega t - \phi)$ where:

We can derive these values directly from the complex coefficient in Step 4, $\frac{1}{k+i\omega}$. We convert this complex number from rectangular form ($a+bi$) to polar form ($Re^{-i\phi}$).

$|k + i\omega| = \sqrt{k^2 + \omega^2}$, $\text{Angle}(k + i\omega) = \tan^{-1}\left(\frac{\omega}{k}\right)$

Therefore, $\frac{1}{k + i\omega} = \frac{1}{\sqrt{k^2 + \omega^2}e^{i\tan^{-1}(\omega/k)}} = \underbrace{\frac{1}{\sqrt{k^2 + \omega^2}}}_{M} e^{-i\underbrace{\tan^{-1}(\omega/k)}_{\phi}}$

Substituting this polar form back into the complex particular solution $z_p = \frac{1}{k+i\omega}e^{i\omega t}$:

$$z_p(t) = \left( M e^{-i\phi} \right) e^{i\omega t} = M e^{i(\omega t - \phi)}$$

Taking the real part yields the physical steady-state solution:

$$\mathbf{x_p(t) = \frac{1}{\sqrt{k^2 + \omega^2}} \cos\left(\omega t - \tan^{-1}\left(\frac{\omega}{k}\right)\right)}$$

Interpretation:

The system is first‑order and linear. When you drive it with a cosine input of frequency 𝜔, the long‑term output is also a cosine of the same frequency, but: its amplitude is reduced and its phase is shifted (delayed).

This is the hallmark of a low‑pass filter.

Amplitude (Gain) $M = \frac{1}{\sqrt{k^2 + \omega^2}}$.
The system has an internal “relaxation rate” 𝑘.
The term 𝑘𝑥(𝑡) is like a drag, leak, or relaxation rate. Large 𝑘 → the system reacts quickly to changes. Small 𝑘 → the system reacts slowly. Think of k as the system’s internal speed limit. If the input oscillates slowly ($\omega ≪ 𝑘$), $M = \frac{1}{\sqrt{k^2 + \omega^2}} \approx \frac{1}{k}$ (the maximum possible amplitude for this system) the system can follow it easily (it has plenty of time to adjust) → large amplitude.
If the input oscillates quickly ($\omega ≫ 𝑘$), $M = \frac{1}{\sqrt{k^2 + \omega^2}} \approx \frac{1}{w} \to 0$ the system cannot keep up → tiny amplitude.
Behavior in limits. Low frequency ($\omega \to 0$): $M \to \frac{1}{k}$. The system tracks the input almost perfectly.
High frequency ($\omega \to \infty$): $M \to 0$. The system barely moves at all.
This is exactly what a low‑pass filter does: it passes slow signals, suppresses fast ones.

Phase Lag. A first‑order system cannot respond instantly. When the input rises, the system needs time to “catch up,” so the peak of the output occurs later.

$\phi = \tan^{-1}(\omega/k)$: Because $\omega$ and $k$ are positive, $\phi$ is between $0$ and $\pi/2$ ($90^\circ$). The system’s peak response always occurs after the input peak.

Low frequency ($\omega ≪ 𝑘$), $\phi \approx 0$. The system keeps up → almost no lag.
High frequency ($\omega ≫ 𝑘$), $\phi \approx \frac{\pi}{2}$. The system is so slow that the output is almost a quarter‑cycle behind.

Solving x’ + kx = cos(wt) + 3sin(wt)

Finally, let’s solve x’ + kx = cos(wt) + 3sin(wt).

The superposition principle states that for linear systems, the response (output) due to multiple inputs is the sum of the responses due to each input separately.

Because the equation is linear, we can treat the right-hand side as a sum of two inputs: x’1 + k1 = cos(wt), x’2 + kx2 = 3sin(wt).

Find the particular solutions for each equation. From earlier analysis, xp1(t) = $\frac{1}{k^2+w^2}[kcos(wt)+wsin(wt)]$, xp2(t) = $\frac{3}{k^2+w^2}[ksin(wt)-wcos(wt)]$

The total particular solution is xp = xp1 + xp2 = $\frac{1}{k^2+w^2}[kcos(wt)+wsin(wt)+3ksin(wt)-3wcos(wt)] = \frac{(k-3w)cos(wt)+(w+3k)sin(wt)}{k^2+w^2}$

Write the general solution (include the homogeneous solution xh(t) = ce-kt): x(t) = xh(t) + xp(t) = $ce^{-kt} + \frac{(k-3w)cos(wt)+(w+3k)sin(wt)}{k^2+w^2}$

Interpretation

Bibliography

This content is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License and is based on MIT OpenCourseWare.
  1. NPTEL-NOC IITM, Introduction to Galois Theory.
  2. Algebra, Second Edition, by Michael Artin.
  3. LibreTexts, Calculus and Calculus 3e (Apex). Abstract and Geometric Algebra, Abstract Algebra: Theory and Applications (Judson).
  4. Field and Galois Theory, by Patrick Morandi. Springer.
  5. Michael Penn, and MathMajor.
  6. Contemporary Abstract Algebra, Joseph, A. Gallian.
  7. YouTube’s Andrew Misseldine: Calculus. College Algebra and Abstract Algebra.
  8. MIT OpenCourseWare [18.03 Differential Equations, Spring 2006], YouTube by MIT OpenCourseWare.
  9. Calculus Early Transcendentals: Differential & Multi-Variable Calculus for Social Sciences.
Bitcoin donation

JustToThePoint Copyright © 2011 - 2026 Anawim. ALL RIGHTS RESERVED. Bilingual e-books, articles, and videos to help your child and your entire family succeed, develop a healthy lifestyle, and have a lot of fun. Social Issues, Join us.

This website uses cookies to improve your navigation experience.
By continuing, you are consenting to our use of cookies, in accordance with our Cookies Policy and Website Terms and Conditions of use.