- Published on
Engineering Mathematics 1: Ordinary Differential Equations & Laplace Transform - Complete Guide
- Authors

- Name
- Youngju Kim
- @fjvbn20031
Engineering Mathematics 1: Ordinary Differential Equations (ODE)
Engineering mathematics is an unavoidable subject for any engineering student. In particular, Ordinary Differential Equations (ODEs) form the mathematical foundation of virtually every engineering discipline — from circuit analysis and control system design to mechanical vibration analysis. This article systematically explains ODEs from the basics to Laplace transforms, centered on engineering application examples.
1. Fundamentals of Differential Equations
What is a Differential Equation?
A differential equation is an equation that expresses a relationship between an unknown function and its derivatives. For example:
Differential equations are a core tool for mathematically modeling natural phenomena and engineering systems.
Classification: ODE vs PDE
Ordinary Differential Equation (ODE): Contains derivatives with respect to only one independent variable.
Partial Differential Equation (PDE): Contains partial derivatives with respect to two or more independent variables.
This article focuses on ODEs.
Order and Degree
The order is the highest derivative appearing in the equation.
- First-order ODE: (highest derivative is )
- Second-order ODE: (highest derivative is )
The degree is the exponent of the highest-order derivative. In most engineering problems, the degree is 1.
Linear vs Nonlinear
Linear ODE: The unknown function and its derivatives appear only as first-degree terms.
Nonlinear ODE: Contains nonlinear terms such as , , , etc.
General Solution, Particular Solution, Singular Solution
- General solution: A complete solution containing arbitrary constants
- Particular solution: A solution obtained by applying initial conditions to determine the constants
- Singular solution: A special solution that cannot be obtained from the general solution
ODEs in Engineering
Most engineering systems are described by ODEs.
RC charging circuit:
Spring-mass-damper system:
Population growth model:
RL circuit:
All of these are ODEs. Learning how to solve them allows you to fully analyze the dynamic behavior of engineering systems.
2. First-Order Ordinary Differential Equations
2.1 Separation of Variables
Form:
Solution procedure:
Integrate both sides:
Example: RC Charging Circuit
Circuit equation:
Separation of variables:
Integration:
Applying initial condition :
This result represents the transient response of an RC circuit. The voltage converges to at a rate determined by the time constant .
Physical interpretation:
- At : (63.2% charged)
- At : (almost fully charged)
2.2 Integrating Factor Method
Standard form of a first-order linear ODE:
Integrating factor:
Derivation:
Multiply both sides by :
The left side, by the product rule:
Integrating:
Example: RL Circuit
Converting to standard form:
Integrating factor:
Integrating:
Applying initial condition :
The current converges to steady state with time constant .
2.3 Exact ODEs
Form:
Exactness condition:
When this condition is satisfied, there exists a potential function such that .
Solution procedure:
- Integrate with respect to to find
- Use the condition to determine the integration constant
- General solution:
Example:
Checking exactness:
Since it is exact:
Since , we have ,
General solution:
2.4 Bernoulli Equation
Form:
Substitution: Setting transforms this into a linear ODE.
Since , dividing the original equation by :
This is a first-order linear ODE in , solvable by the integrating factor method.
Application: The logistic growth model is a Bernoulli equation with .
3. Second-Order Linear Ordinary Differential Equations
3.1 Homogeneous Equations
Standard form:
Characteristic equation derivation: Substitute .
Three cases arise depending on the sign of the discriminant .
Case 1: Two distinct real roots ()
For :
Case 2: Repeated real root ()
For :
The term must be added so that the Wronskian is nonzero, constructing an independent second solution.
Case 3: Complex conjugate roots ()
For (where , ):
This form is converted to real solutions using Euler's formula .
3.2 Complete Analysis of RLC Circuits
Circuit equation (in terms of charge ):
In standard form:
Characteristic equation:
Defining the damping coefficient and resonant frequency :
Overdamped: ()
A sum of two exponential terms — decays monotonically without oscillation.
Critically Damped: ()
Returns to equilibrium most rapidly without oscillation. Very important in control system design.
Underdamped: ()
Defining the damped oscillation frequency :
Oscillates while decaying. Commonly seen in communication circuits and vibration systems.
Summary of physical interpretation:
| Condition | Name | Response Characteristics |
|---|---|---|
| Overdamped | Slow decay without oscillation | |
| Critically damped | Fastest decay without oscillation | |
| Underdamped | Oscillates and decays | |
| Undamped | Continuous oscillation |
3.3 Non-homogeneous Equations
Form:
Complete solution:
- : General solution of the homogeneous equation (complementary function)
- : Particular solution
Method of Undetermined Coefficients
Guess the form of based on the form of .
| Form of | Guessed form of |
|---|---|
| or | |
Note: If the guessed form of overlaps with a term in , multiply by .
Example:
Homogeneous solution:
Since the guessed form of overlaps with , modify:
After substitution: ,
This is resonance, where the amplitude increases proportionally with time.
Forced vibration response:
Steady-state particular solution:
Where frequency ratio and damping ratio .
The amplitude is maximum at (resonance condition).
Variation of Parameters
Used for general where the method of undetermined coefficients cannot be applied.
Given :
Wronskian:
This formula applies to any continuous function .
4. Systems of Differential Equations
4.1 Matrix Representation
A system of first-order ODEs:
Where and is an coefficient matrix.
4.2 Eigenvalue/Eigenvector Solution
Form of solution:
Substituting:
So is an eigenvalue of , and is the corresponding eigenvector.
Characteristic equation:
Example: Two connected tanks system
Characteristic equation:
Eigenvectors: ,
General solution:
4.3 Application to Circuit Network Analysis
Circuit with two loops (Kirchhoff's voltage law):
Where is the mutual inductance. This can be written in matrix form and solved using the eigenvalue method or Laplace transform.
5. Laplace Transform
5.1 Definition and Convergence
Definition:
is a complex variable. For convergence, (half-plane of convergence) must be satisfied.
Why use the Laplace transform?
- Differential operations are converted to algebraic operations
- Initial conditions are automatically incorporated
- Complex ODEs can be solved as simple algebraic equations
- It forms the basis of the transfer function concept
5.2 Key Transform Pairs
| (unit step) | |
| (impulse) | |
| (delayed step) |
Derivation example:
Converges when .
5.3 Key Properties
Linearity:
Time shift (First shifting theorem):
Frequency shift (Second shifting theorem):
Differentiation transform (most important property):
Initial conditions are automatically included in the s-domain.
Integration transform:
Convolution theorem:
Where
This theorem mathematically proves that the output of a system is the convolution of the impulse response and the input signal.
Final value theorem:
Allows determination of the steady-state value without solving in the t-domain.
Initial value theorem:
5.4 Inverse Laplace Transform
Partial Fraction Decomposition:
For , factor the denominator and decompose into a sum of table transform pairs.
Case 1: Distinct real poles
Case 2: Repeated poles ( is an -fold root)
Case 3: Complex conjugate poles
Heaviside Expansion Theorem:
When the denominator is a product of distinct linear factors:
5.5 Solving ODEs with the Laplace Transform
Example: RLC Series Circuit Transient Response
Initial conditions: , (no charge on capacitor)
Solution:
Applying the Laplace transform to both sides:
Defining , , (underdamped case):
Inverse Laplace transform (from table: ):
This is the impulse response of the RLC circuit, which is also its Green's function.
6. Numerical ODE Solutions with Python
6.1 Using scipy.integrate.solve_ivp
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
# RLC circuit simulation (2nd order ODE -> system of 1st order ODEs)
# L * q'' + R * q' + q/C = Vs (step input)
# State variables: y[0] = q (charge), y[1] = i = dq/dt (current)
def rlc_circuit(t, y, R, L, C, Vs):
q, dq_dt = y
# q'' = (Vs - R*i - q/C) / L
d2q_dt2 = (Vs - R * dq_dt - q / C) / L
return [dq_dt, d2q_dt2]
# Circuit parameters
R = 100 # Resistance (Ohm)
L = 0.1 # Inductance (H)
C = 1e-6 # Capacitance (F)
Vs = 10.0 # Supply voltage (V)
# Calculate resonant frequency and damping ratio
omega_0 = 1.0 / np.sqrt(L * C)
alpha = R / (2 * L)
zeta = alpha / omega_0
print(f"Resonant frequency: {omega_0/(2*np.pi):.1f} Hz")
print(f"Damping ratio zeta: {zeta:.3f}")
if zeta > 1:
print("-> Overdamped")
elif zeta == 1:
print("-> Critically damped")
else:
print("-> Underdamped")
# Numerical solution
y0 = [0.0, 0.0] # Initial conditions: q(0) = 0, i(0) = 0
t_span = (0, 0.01)
t_eval = np.linspace(0, 0.01, 2000)
sol = solve_ivp(
rlc_circuit, t_span, y0,
t_eval=t_eval,
args=(R, L, C, Vs),
method='RK45',
rtol=1e-8,
atol=1e-10
)
# Voltage calculation: v_C = q/C
v_C = sol.y[0] / C
i = sol.y[1]
# Visualization
fig, axes = plt.subplots(2, 1, figsize=(10, 8))
axes[0].plot(sol.t * 1e3, v_C, 'b-', linewidth=2, label='Capacitor voltage')
axes[0].axhline(y=Vs, color='r', linestyle='--', label=f'Steady state {Vs}V')
axes[0].set_xlabel('Time (ms)')
axes[0].set_ylabel('Voltage (V)')
axes[0].set_title('RLC Series Circuit - Step Response')
axes[0].legend()
axes[0].grid(True, alpha=0.3)
axes[1].plot(sol.t * 1e3, i * 1e3, 'g-', linewidth=2, label='Current')
axes[1].set_xlabel('Time (ms)')
axes[1].set_ylabel('Current (mA)')
axes[1].set_title('RLC Circuit Current')
axes[1].legend()
axes[1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('rlc_response.png', dpi=150)
plt.show()
6.2 Analytical Solutions with SymPy
import sympy as sp
# Symbol definitions
t, s = sp.symbols('t s')
R_sym, L_sym, C_sym = sp.symbols('R L C', positive=True)
Vs_sym = sp.Symbol('Vs')
# RC circuit analytical solution (solving ODE with sympy)
v = sp.Function('v')
tau = sp.Symbol('tau', positive=True)
# dv/dt = (Vs - v) / (R*C)
ode = sp.Eq(v(t).diff(t), (Vs_sym - v(t)) / (R_sym * C_sym))
# Initial condition v(0) = 0
solution = sp.dsolve(ode, v(t), ics={v(0): 0})
print("RC circuit solution:")
print(solution)
sp.pprint(solution)
# Laplace transform calculation
f = sp.exp(-t) * sp.sin(2*t)
F = sp.laplace_transform(f, t, s, noconds=True)
print(f"\nL{{e^(-t) sin(2t)}} = {F}")
# Inverse Laplace transform
F_inv = sp.inverse_laplace_transform(
1 / (s**2 + 2*s + 5), s, t
)
print(f"L^(-1){{1/(s^2+2s+5)}} = {F_inv}")
6.3 Comparing Different Integrators
import numpy as np
import matplotlib.pyplot as plt
# Euler method vs RK4 comparison
# Example: y' = -y, y(0) = 1, exact solution y = e^(-t)
def f(t, y):
return -y
def euler_method(f, t0, y0, h, n):
t = np.zeros(n+1)
y = np.zeros(n+1)
t[0], y[0] = t0, y0
for i in range(n):
y[i+1] = y[i] + h * f(t[i], y[i])
t[i+1] = t[i] + h
return t, y
def rk4_method(f, t0, y0, h, n):
t = np.zeros(n+1)
y = np.zeros(n+1)
t[0], y[0] = t0, y0
for i in range(n):
k1 = h * f(t[i], y[i])
k2 = h * f(t[i] + h/2, y[i] + k1/2)
k3 = h * f(t[i] + h/2, y[i] + k2/2)
k4 = h * f(t[i] + h, y[i] + k3)
y[i+1] = y[i] + (k1 + 2*k2 + 2*k3 + k4) / 6
t[i+1] = t[i] + h
return t, y
h = 0.5
n = 10
t0, y0 = 0.0, 1.0
t_euler, y_euler = euler_method(f, t0, y0, h, n)
t_rk4, y_rk4 = rk4_method(f, t0, y0, h, n)
t_exact = np.linspace(0, n*h, 200)
y_exact = np.exp(-t_exact)
plt.figure(figsize=(10, 5))
plt.plot(t_exact, y_exact, 'k-', linewidth=2, label='Exact solution')
plt.plot(t_euler, y_euler, 'r--o', label=f'Euler method (h={h})')
plt.plot(t_rk4, y_rk4, 'b--s', label=f'RK4 (h={h})')
plt.xlabel('t')
plt.ylabel("y(t)")
plt.title("Euler vs RK4 Comparison: y' = -y")
plt.legend()
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
# Error comparison
print(f"Euler method error at t=5: {abs(y_euler[-1] - np.exp(-5)):.6f}")
print(f"RK4 error at t=5: {abs(y_rk4[-1] - np.exp(-5)):.6f}")
6.4 Automating Laplace Transforms with Python
import sympy as sp
s, t = sp.symbols('s t', real=True)
a, omega = sp.symbols('a omega', positive=True)
# Auto-generate Laplace transform table
functions = {
'1': sp.Integer(1),
't': t,
't^2': t**2,
't^n': t**3,
'e^(at)': sp.exp(a*t),
'sin(wt)': sp.sin(omega*t),
'cos(wt)': sp.cos(omega*t),
't*e^(at)': t * sp.exp(a*t),
'e^(at)*sin(wt)': sp.exp(a*t) * sp.sin(omega*t),
}
print("Laplace Transform Table:")
print("-" * 50)
for name, func in functions.items():
F = sp.laplace_transform(func, t, s, noconds=True)
print(f"L{{{name}}} = {sp.simplify(F)}")
7. Comprehensive Engineering Application Examples
7.1 Transient Analysis of RLC Circuit with Power Source
Problem: A series RLC circuit with , , is connected to a DC source at . Initial conditions are , .
Solving with the Laplace Transform:
Kirchhoff's voltage law:
Substituting and writing in terms of charge :
Laplace transform:
Substituting values: ,
Since , this is underdamped.
After partial fraction decomposition and inverse Laplace transform:
7.2 Resonance Analysis of Spring-Mass-Damper System
Problem: , , ,
Natural frequency:
Damping ratio: (underdamped)
Steady-state response amplitude:
At (resonance):
This is 2.5 times the static deflection without resonance. This is the danger of resonance.
Summary and Next Steps
Topics covered in this article:
- Differential equation basics: Classification, order, linearity, types of solutions
- First-order ODE methods: Separation of variables, integrating factor, exact ODE, Bernoulli equation
- Second-order linear ODE: Characteristic equation, three cases, complete RLC circuit analysis
- Non-homogeneous equations: Undetermined coefficients, variation of parameters, forced vibration
- Systems of ODEs: Matrix representation, eigenvalue/eigenvector solution
- Laplace transform: Definition, transform pairs, properties, inverse transform, ODE solving
- Python implementation: Numerical and symbolic solutions with scipy and sympy
The next article will cover Fourier series/transform and partial differential equations (PDEs) — the core mathematical tools for signal processing and electromagnetics.
References
- Kreyszig, E. "Advanced Engineering Mathematics", 10th Edition, Wiley
- Boyce, W. & DiPrima, R. "Elementary Differential Equations", 11th Edition, Wiley
- Simmons, G. "Differential Equations with Applications and Historical Notes", 3rd Edition
- SciPy ODE Solver Documentation
- SymPy Laplace Transform Documentation
Quiz
Q1. What is the integrating factor method used for, and what is the integrating factor for dy/dx + P(x)y = Q(x)?
Answer: The integrating factor method is used to solve first-order linear ODEs of the standard form dy/dx + P(x)y = Q(x). The integrating factor is mu(x) = exp(integral of P(x) dx).
Explanation: Multiplying both sides by mu(x) transforms the left side into the derivative of mu(x)*y, allowing direct integration. This is a systematic technique applicable to any first-order linear ODE.
Q2. In the RLC series circuit, what are the three damping cases and their conditions?
Answer: The three cases depend on the damping coefficient alpha = R/(2L) and resonant frequency omega_0 = 1/sqrt(LC):
- Overdamped: alpha greater than omega_0, i.e., R greater than 2*sqrt(L/C) — slow decay without oscillation
- Critically damped: alpha equals omega_0, i.e., R equals 2*sqrt(L/C) — fastest decay without oscillation
- Underdamped: alpha less than omega_0, i.e., R less than 2*sqrt(L/C) — oscillates and decays
Explanation: The characteristic equation r^2 + (R/L)r + 1/(LC) = 0 has roots r = -alpha plus/minus sqrt(alpha^2 - omega_0^2). The sign of the discriminant determines whether roots are real or complex.
Q3. What is the convolution theorem in the Laplace transform and why is it important?
Answer: The convolution theorem states that the Laplace transform of the convolution of two functions equals the product of their individual Laplace transforms: L{(f*g)(t)} = F(s)*G(s).
Explanation: This theorem is fundamental to engineering because it proves that the output of a linear time-invariant system equals the convolution of the input signal with the system's impulse response. In the s-domain, this becomes simple multiplication, making system analysis much easier.
Q4. What is resonance in a forced vibration system and what conditions cause it?
Answer: Resonance occurs when the frequency ratio r = omega/omega_n equals 1, meaning the driving frequency equals the natural frequency of the system. Under resonance conditions, the steady-state amplitude is X = (F_0/k) / (2*zeta), which can be many times larger than the static deflection.
Explanation: In the method of undetermined coefficients for y'' + 4y = 3*cos(2x), the forcing frequency matches the natural frequency, causing the particular solution to include a factor of x (secular growth). In real systems with damping, amplitude does not grow to infinity but reaches a finite maximum at resonance. Avoiding resonance is critical in structural and mechanical engineering.
Q5. How are eigenvalues and eigenvectors used to solve systems of first-order ODEs?
Answer: For a system dX/dt = AX, we assume solutions of the form X = vexp(lambdat). Substituting gives lambdav = Av, so lambda are eigenvalues and v are eigenvectors of matrix A. The general solution is a linear combination of all eigenvalue-eigenvector pairs: X = sum of Ck * vk * exp(lambda_k * t).
Explanation: Eigenvalues determine the stability and time constants of each mode. If all eigenvalues have negative real parts, the system is stable. The eigenvectors define the directions of each natural mode of the system.