👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Applied Mathematics
Study mode

Differential Equations

Learning objective
Learn to formulate and solve basic differential equations relevant to engineering contexts.

Introduction to Differential Equations

In mechanical engineering, many physical phenomena such as motion, heat transfer, and fluid flow change continuously over time or space. To describe these changes mathematically, we use differential equations. A differential equation relates a function with its derivatives, capturing how the function changes. This makes differential equations powerful tools to model dynamic systems, predict behaviour, and design engineering solutions.

For example, the motion of a spring-mass system, the temperature distribution along a heated rod, or the velocity of fluid flowing through a pipe can all be described using differential equations. Understanding how to formulate and solve these equations is essential for engineers to analyze and control real-world systems.

Ordinary Differential Equations (ODEs)

An ordinary differential equation (ODE) is an equation involving a function of a single independent variable and its derivatives. The term "ordinary" distinguishes it from partial differential equations, which involve multiple independent variables.

Consider a function \( y = y(x) \), where \( x \) is the independent variable (often time or space), and \( y \) is the dependent variable (such as displacement, temperature, or velocity). An ODE relates \( y \), its derivatives like \( \frac{dy}{dx} \), \( \frac{d^2y}{dx^2} \), and possibly \( x \) itself.

Order and Degree of an ODE

The order of a differential equation is the highest order derivative present in the equation. For example, if the highest derivative is \( \frac{d^2y}{dx^2} \), the order is 2.

The degree of an ODE is the power (exponent) of the highest order derivative after the equation is free from radicals and fractions involving derivatives.

Example 1: \( \frac{dy}{dx} + y = x \) Order: 1, Degree: 1 Example 2: \( \left(\frac{d^2y}{dx^2}\right)^3 + \frac{dy}{dx} = 0 \) Order: 2, Degree: 3

Types of ODEs

ODEs can be classified based on their order, linearity, and whether they are homogeneous or non-homogeneous. We will focus on first and second order ODEs, which are most common in engineering applications.

First Order Differential Equations

A first order ODE involves only the first derivative \( \frac{dy}{dx} \). These equations often describe rates of change, such as velocity or heat flow.

graph TD    A[Given First Order ODE] --> B{Is it separable?}    B -- Yes --> C[Use Separation of Variables]    B -- No --> D{Is it linear?}    D -- Yes --> E[Use Integrating Factor Method]    D -- No --> F{Is it exact?}    F -- Yes --> G[Use Exact Equation Method]    F -- No --> H[Try other methods or transformations]

Separable Equations

A first order ODE is separable if it can be written as

Separable Equation

\[\frac{dy}{dx} = g(x)h(y)\]

Equation where variables can be separated

x = Independent variable
y = Dependent variable

We can rearrange terms to isolate \( y \) and \( x \) on opposite sides:

\[\frac{1}{h(y)} dy = g(x) dx\]

Then integrate both sides to find the solution.

Linear Equations

A first order ODE is linear if it can be expressed as

\[\frac{dy}{dx} + P(x) y = Q(x)\]

where \( P(x) \) and \( Q(x) \) are known functions of \( x \). The integrating factor method is used to solve such equations.

Exact Equations

An ODE of the form

\[M(x,y) dx + N(x,y) dy = 0\]

is exact if there exists a function \( \psi(x,y) \) such that

\[\frac{\partial \psi}{\partial x} = M(x,y), \quad \frac{\partial \psi}{\partial y} = N(x,y)\]

Solving exact equations involves finding \( \psi(x,y) = C \), where \( C \) is a constant.

Worked Example: Solving a Separable First Order ODE

Example 1: Solving separable ODE \( \frac{dy}{dx} = x y \) Easy
Solve the differential equation \( \frac{dy}{dx} = x y \).

Step 1: Recognize that the equation is separable because it can be written as

\[ \frac{dy}{dx} = x y \implies \frac{1}{y} dy = x dx \]

Step 2: Integrate both sides:

\[ \int \frac{1}{y} dy = \int x dx \] \[ \ln |y| = \frac{x^2}{2} + C_1 \]

Step 3: Solve for \( y \):

\[ y = e^{\frac{x^2}{2} + C_1} = C e^{\frac{x^2}{2}}, \quad \text{where } C = e^{C_1} \]

Answer: The general solution is

\[ y = C e^{\frac{x^2}{2}} \]

Worked Example: Solving a Linear First Order ODE

Example 2: Solve \( \frac{dy}{dx} + 2y = 4 \) Medium
Solve the linear first order differential equation \( \frac{dy}{dx} + 2y = 4 \).

Step 1: Identify \( P(x) = 2 \) and \( Q(x) = 4 \).

Step 2: Calculate the integrating factor (IF):

\[ \mu(x) = e^{\int P(x) dx} = e^{\int 2 dx} = e^{2x} \]

Step 3: Multiply both sides of the ODE by \( \mu(x) \):

\[ e^{2x} \frac{dy}{dx} + 2 e^{2x} y = 4 e^{2x} \]

Left side is the derivative of \( y e^{2x} \):

\[ \frac{d}{dx} \left( y e^{2x} \right) = 4 e^{2x} \]

Step 4: Integrate both sides:

\[ \int \frac{d}{dx} \left( y e^{2x} \right) dx = \int 4 e^{2x} dx \] \[ y e^{2x} = 2 e^{2x} + C \]

Step 5: Solve for \( y \):

\[ y = 2 + C e^{-2x} \]

Answer: The general solution is

\[ y = 2 + C e^{-2x} \]

Second Order Differential Equations

Second order ODEs involve the second derivative \( \frac{d^2y}{dx^2} \). These equations commonly arise in mechanical vibrations, beam deflections, and electrical circuits.

The general linear second order ODE with constant coefficients is

\[a \frac{d^2y}{dx^2} + b \frac{dy}{dx} + c y = f(x)\]

where \( a, b, c \) are constants and \( f(x) \) is a known function. If \( f(x) = 0 \), the equation is homogeneous; otherwise, it is non-homogeneous.

Characteristic Equation Roots and Solution Types 1. Distinct Real Roots \( r_1 eq r_2 \) Solution: \( y = C_1 e^{r_1 x} + C_2 e^{r_2 x} \) 2. Repeated Roots \( r_1 = r_2 = r \) Solution: \( y = (C_1 + C_2 x) e^{r x} \) 3. Complex Roots \( \alpha \pm i \beta \) Solution: \( y = e^{\alpha x} (C_1 \cos \beta x + C_2 \sin \beta x) \)

Characteristic Equation

To solve homogeneous second order ODEs, we assume solutions of the form \( y = e^{r x} \). Substituting into the homogeneous equation

\[a \frac{d^2y}{dx^2} + b \frac{dy}{dx} + c y = 0\]

leads to the characteristic equation:

\[a r^2 + b r + c = 0\]

The roots \( r \) determine the form of the general solution as shown above.

Worked Example: Solving a Homogeneous Second Order ODE

Example 3: Solve \( \frac{d^2y}{dx^2} - 3 \frac{dy}{dx} + 2 y = 0 \) Medium
Find the general solution of the differential equation \( \frac{d^2y}{dx^2} - 3 \frac{dy}{dx} + 2 y = 0 \).

Step 1: Write the characteristic equation:

\[ r^2 - 3 r + 2 = 0 \]

Step 2: Solve the quadratic equation:

\[ r = \frac{3 \pm \sqrt{(-3)^2 - 4 \times 1 \times 2}}{2} = \frac{3 \pm \sqrt{9 - 8}}{2} = \frac{3 \pm 1}{2} \] \[ r_1 = 2, \quad r_2 = 1 \]

Step 3: Since roots are distinct real numbers, the general solution is:

\[ y = C_1 e^{2x} + C_2 e^{x} \]

Answer: \( y = C_1 e^{2x} + C_2 e^{x} \)

Worked Example: Solving a Non-Homogeneous Second Order ODE

Example 4: Solve \( \frac{d^2y}{dx^2} + y = \cos x \) Hard
Solve the non-homogeneous differential equation \( \frac{d^2y}{dx^2} + y = \cos x \) using the method of undetermined coefficients.

Step 1: Solve the corresponding homogeneous equation:

\[ \frac{d^2y}{dx^2} + y = 0 \]

Characteristic equation:

\[ r^2 + 1 = 0 \implies r = \pm i \]

General solution of homogeneous part:

\[ y_h = C_1 \cos x + C_2 \sin x \]

Step 2: Find a particular solution \( y_p \) for the non-homogeneous part. Since the right side is \( \cos x \), try:

\[ y_p = A x \sin x + B x \cos x \]

(We multiply by \( x \) because \( \cos x \) and \( \sin x \) are solutions of the homogeneous equation.)

Step 3: Compute derivatives:

\[ y_p = A x \sin x + B x \cos x \] \[ y_p' = A \sin x + A x \cos x + B \cos x - B x \sin x \] \[ y_p'' = 2 A \cos x - A x \sin x - 2 B \sin x - B x \cos x \]

Step 4: Substitute into the ODE:

\[ y_p'' + y_p = \cos x \] \[ (2 A \cos x - A x \sin x - 2 B \sin x - B x \cos x) + (A x \sin x + B x \cos x) = \cos x \]

Simplify terms:

\[ 2 A \cos x - 2 B \sin x = \cos x \]

Step 5: Equate coefficients:

\[ 2 A = 1 \implies A = \frac{1}{2} \] \[ -2 B = 0 \implies B = 0 \]

Step 6: Particular solution:

\[ y_p = \frac{1}{2} x \sin x \]

Step 7: Write the general solution:

\[ y = y_h + y_p = C_1 \cos x + C_2 \sin x + \frac{1}{2} x \sin x \]

Answer: \( y = C_1 \cos x + C_2 \sin x + \frac{1}{2} x \sin x \)

Applications of Differential Equations in Engineering

Differential equations are fundamental in modeling engineering systems. Let's explore some common applications.

Spring-Mass System Equation: \( m \frac{d^2x}{dt^2} + k x = 0 \) Heat Flow in Rod Equation: \( \frac{dT}{dt} = \alpha \frac{d^2T}{dx^2} \) Fluid Flow Equation: \( \frac{dQ}{dt} = A \frac{dP}{dx} \)

Mechanical Vibrations: The motion of a spring-mass system is modeled by a second order ODE representing Newton's second law. The displacement \( x(t) \) satisfies

\[m \frac{d^2x}{dt^2} + k x = 0\]

where \( m \) is mass and \( k \) is spring constant.

Heat Transfer: The temperature distribution \( T(x,t) \) along a rod follows the heat equation, a partial differential equation. In simplified cases, it reduces to ODEs describing temperature change over time.

Fluid Mechanics: Flow rate and pressure variations in pipes can be modeled using ODEs derived from conservation laws and fluid properties.

Spring-Mass Vibration Equation

\[m \frac{d^2x}{dt^2} + k x = 0\]

Models simple harmonic motion

m = Mass (kg)
k = Spring constant (N/m)
x = Displacement (m)

Formula Bank

Formula Bank

General form of first order ODE
\[ \frac{dy}{dx} + P(x) y = Q(x) \]
where: \( y \) = dependent variable, \( x \) = independent variable, \( P(x), Q(x) \) = functions of \( x \)
Integrating Factor (IF)
\[ \mu(x) = e^{\int P(x) dx} \]
where: \( P(x) \) = coefficient function in linear ODE
Characteristic Equation for second order homogeneous ODE
\[ a r^2 + b r + c = 0 \]
where: \( a, b, c \) = coefficients of \( \frac{d^2y}{dx^2}, \frac{dy}{dx}, y \) respectively
General solution for distinct real roots
\[ y = C_1 e^{r_1 x} + C_2 e^{r_2 x} \]
where: \( C_1, C_2 \) = constants, \( r_1, r_2 \) = roots
General solution for repeated roots
\[ y = (C_1 + C_2 x) e^{r x} \]
where: \( C_1, C_2 \) = constants, \( r \) = repeated root
General solution for complex roots
\[ y = e^{\alpha x} (C_1 \cos \beta x + C_2 \sin \beta x) \]
where: \( C_1, C_2 \) = constants, \( \alpha \) = real part, \( \beta \) = imaginary part of roots

Worked Examples

Example 1: Solving separable ODE \( \frac{dy}{dx} = x y \) Easy
Solve the differential equation \( \frac{dy}{dx} = x y \).

Step 1: Separate variables:

\[ \frac{1}{y} dy = x dx \]

Step 2: Integrate both sides:

\[ \int \frac{1}{y} dy = \int x dx \implies \ln |y| = \frac{x^2}{2} + C \]

Step 3: Solve for \( y \):

\[ y = C_1 e^{\frac{x^2}{2}} \]

Answer: \( y = C_1 e^{\frac{x^2}{2}} \)

Example 2: Solving linear first order ODE \( \frac{dy}{dx} + 2y = 4 \) Medium
Solve \( \frac{dy}{dx} + 2y = 4 \) using the integrating factor method.

Step 1: Identify \( P(x) = 2 \), \( Q(x) = 4 \).

Step 2: Calculate integrating factor:

\[ \mu = e^{\int 2 dx} = e^{2x} \]

Step 3: Multiply ODE by \( \mu \):

\[ e^{2x} \frac{dy}{dx} + 2 e^{2x} y = 4 e^{2x} \]

Step 4: Left side is derivative:

\[ \frac{d}{dx} (y e^{2x}) = 4 e^{2x} \]

Step 5: Integrate both sides:

\[ y e^{2x} = 2 e^{2x} + C \]

Step 6: Solve for \( y \):

\[ y = 2 + C e^{-2x} \]

Answer: \( y = 2 + C e^{-2x} \)

Example 3: Solving homogeneous second order ODE \( \frac{d^2y}{dx^2} - 3 \frac{dy}{dx} + 2 y = 0 \) Medium
Find the general solution of \( \frac{d^2y}{dx^2} - 3 \frac{dy}{dx} + 2 y = 0 \).

Step 1: Write characteristic equation:

\[ r^2 - 3 r + 2 = 0 \]

Step 2: Solve quadratic:

\[ r = 1, 2 \]

Step 3: Write general solution:

\[ y = C_1 e^{x} + C_2 e^{2x} \]

Answer: \( y = C_1 e^{x} + C_2 e^{2x} \)

Example 4: Solving non-homogeneous second order ODE \( \frac{d^2y}{dx^2} + y = \cos x \) Hard
Solve \( \frac{d^2y}{dx^2} + y = \cos x \) using method of undetermined coefficients.

Step 1: Solve homogeneous equation:

\[ y_h = C_1 \cos x + C_2 \sin x \]

Step 2: Try particular solution:

\[ y_p = A x \sin x + B x \cos x \]

Step 3: Substitute and equate coefficients:

\[ A = \frac{1}{2}, \quad B = 0 \]

Step 4: Write general solution:

\[ y = C_1 \cos x + C_2 \sin x + \frac{1}{2} x \sin x \]

Answer: \( y = C_1 \cos x + C_2 \sin x + \frac{1}{2} x \sin x \)

Example 5: Application - Modeling mechanical vibration of spring-mass system Medium
A mass \( m = 2\, \mathrm{kg} \) is attached to a spring with spring constant \( k = 18\, \mathrm{N/m} \). If the mass is displaced and released, find the equation of motion assuming no damping.

Step 1: Write the governing equation:

\[ m \frac{d^2x}{dt^2} + k x = 0 \] \[ 2 \frac{d^2x}{dt^2} + 18 x = 0 \]

Step 2: Simplify:

\[ \frac{d^2x}{dt^2} + 9 x = 0 \]

Step 3: Characteristic equation:

\[ r^2 + 9 = 0 \implies r = \pm 3i \]

Step 4: General solution:

\[ x(t) = C_1 \cos 3t + C_2 \sin 3t \]

Answer: The mass oscillates with angular frequency \( 3\, \mathrm{rad/s} \) and displacement:

\[ x(t) = C_1 \cos 3t + C_2 \sin 3t \]

Tips & Tricks

Tip: Always check if the first order ODE is separable before trying other methods.

When to use: At the start of solving any first order ODE.

Tip: Use the integrating factor method for linear first order ODEs to avoid complicated rearrangements.

When to use: When the ODE is in the form \( \frac{dy}{dx} + P(x) y = Q(x) \).

Tip: For second order ODEs, find characteristic roots first to quickly determine the solution type.

When to use: When solving homogeneous second order ODEs.

Tip: Memorize common forms of particular solutions for non-homogeneous ODEs to save time.

When to use: Applying method of undetermined coefficients.

Tip: Use dimensional analysis to verify if the formulated differential equation makes physical sense.

When to use: During application-based problems.

Common Mistakes to Avoid

❌ Forgetting to include the constant of integration after solving separable equations
✓ Always add + C after integration steps
Why: Omitting constants leads to incomplete general solutions.
❌ Misidentifying the type of first order ODE and applying wrong solution method
✓ Analyze the equation form carefully before choosing the method
Why: Rushing causes confusion between separable, linear, and exact equations.
❌ Incorrectly solving characteristic equation roots, especially with complex roots
✓ Use quadratic formula carefully and identify real and imaginary parts correctly
Why: Errors in root calculation lead to wrong general solutions.
❌ Not applying initial/boundary conditions correctly to find particular constants
✓ Substitute conditions after finding general solution to solve for constants
Why: Skipping this step results in incomplete or incorrect final answers.
❌ Using wrong form of particular solution for non-homogeneous ODEs
✓ Match the form of forcing function with correct trial solution
Why: Incorrect trial solutions cause failure in finding particular integrals.
✨ AI exam tools — try them free (included in every plan)
Tip: select any text above to Explain / Example / Simplify it.
Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Differential Equations · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.