11.2. Introduction to Differential Equations#

import sympy as sym

Note

Differential equations form a fundamental branch of mathematics that deals with the modeling and analysis of change and variation. They play a crucial role in describing and understanding various phenomena across different fields, including physics, engineering, biology, economics, and many others. In simple terms, a differential equation is an equation that involves derivatives. It expresses a relationship between an unknown function and its derivatives, representing how the function changes with respect to one or more independent variables. These equations capture dynamic processes and allow us to study how quantities evolve and interact with each other.

Differential equations arise naturally when trying to model real-world problems. Applying mathematics to practical problems often leads to a situation where it’s simpler to establish a connection between a function and its rate of change, rather than figuring out the function’s exact formula. This relationship, between an unknown function and its derivatives, essentially gives rise to a differential equation.

Solving differential equations involves finding the function or functions that satisfy the equation. This task can be challenging as it often requires advanced mathematical techniques, including integration, differentiation, linear algebra, and complex analysis. Differential equations can exhibit a wide range of behaviors. Some equations have simple and explicit solutions, while others may require numerical methods or approximation techniques. Understanding the solutions to differential equations provides valuable insights into the underlying processes and helps make predictions about future behavior.

Moreover, differential equations serve as a bridge between theoretical mathematics and real-world applications. They enable us to formulate mathematical models that accurately represent complex systems and phenomena, allowing us to analyze, optimize, and make informed decisions. For instance, in physics, they describe the motion of objects, the flow of fluids, and the behavior of electromagnetic fields. In biology, differential equations help us analyze population growth, the spread of diseases, and the dynamics of biological systems. Engineers rely on differential equations to study control systems, electrical circuits, and structural stability.

11.2.1. Basic Terminology#

A differential equation is any equation involving an unknown function and one or more of its derivatives. Differential equations can be largely classified into two categories: ordinary differential equations and partial differential equations. When the unknown function within the equation only relies on a single variable, we label it as an ordinary differential equation. However, when the unknown function depends on multiple independent variables, we refer to it as a partial differential equation. In this latter scenario, the derivatives present in the equation are identified as partial derivatives.

Example 1#

Example 1

  • \(y' = x^3\) is an ordinary differential equation.

  • \(\frac{dx}{dt} = kx^2\sin(t)\) is an ordinary differential equation.

  • \(y'(x) + \mu \sqrt{y(x)} = 0\) is an ordinary differential equation.

  • \(\frac{\partial Q}{\partial t} + Q(s,t) = 5\) is a partial differential equation.

Note that in this chapter we will primarily be working with ordinary differential equations. A differential equation can consist of three distinct types of quantities. First, the unknown function, which the equation aims to solve, is referred to as the dependent variable. In the context of ordinary differential equations, this dependent variable is a function of a single independent variable. Beyond the independent and dependent variables, there’s a third variable known as a parameter that may feature in the equation. A parameter is a value that stays constant within a specific problem, but it can vary when comparing different problems. The order of a differential equation is determined by the rank of the highest derivative of the unknown function included in the equation.

Example 1 (continued)#

Example 1 (continued)

  • \(y''(x) = x^3\) is an ODE. The dependent variable is \(y\). The independent variable is \(x\). There are no parameters and the order is \(2\).

  • \(\frac{dx}{dt} = kx^2\sin(t)\) is an ODE. The dependent variable is \(x\). The independent variable is \(t\). There is one parameter, \(k\). The order is \(1\).

  • \(y^{(5)}(x) + \mu \sqrt{y(x)} = 0\) is an ODE. The dependent variable is \(y\). The independent variable is \(x\). There is one parameter, \(\mu\). The order is \(5\).

An \(n^{th}\) order ordinary differential equation is said to be linear if it can be written in the form

\(a_n(x)y^{(n)}(x)+a_{n-1}(x)y^{(n-1)}(x)+...+a_1(x)y'(x)+a_0(x)y(x) = g(x).\)

If it cannot be written in that form, we say that the ordinary differential equation is nonlinear.

Example 1 (continued)#

Example 1 (continued)

  • \(y''(x) = x^3\) is a linear ODE.

  • \(\frac{dx}{dt} = kx^2\sin(t)\) is a nonlinear ODE. This is because \(x\), the dependent variable, is raised to the second power.

  • \(y^{(5)}(x) + \mu \sqrt{y(x)} = 0\) is a nonlinear ODE. This is because \(y\) is under a radical sign. Note that the parameters in either problem, \(k\) and \(\mu\), do not affect the linearity of either of these last two problems.

A solution to a differential equation is a sufficiently differentiable function that, if substituted into the equation together with its necessary derivatives, makes the equation an identity over some interval of the independent variable.

Example 2#

Example 2

Show that \(f(x) = e^{-x}\) is a solution for all \(x\) to \(2y'+3y = e^{-x}\).

Hide code cell source
x = sym.Symbol('x')
#Define f(x)
f = sym.exp(-x)
print('This is the function f(x):', f)

#Define f'(x)
dfdx = sym.diff(f)
print('This is the derivative of f(x):', dfdx)

#See if f(x) is a solution to the differential equation. If it outputs True, f(x) is a solution.
2*dfdx+3*f == sym.exp(-x)
This is the function f(x): exp(-x)
This is the derivative of f(x): -exp(-x)
True

11.2.2. Exercises#

Exercises

  1. List the type and order of each of the following differential equations. For each ordinary differential equation, determine if it is linear or nonlinear.

    • \(\dfrac{dQ}{dt} = \dfrac{tP}{100}\)

    • \(\frac{\partial^2 v}{\partial t^2} + \frac{\partial^2 v}{\partial w^2} = 5\)

    • \(2\dfrac{d^2q}{dt^2} + \cos(t) \dfrac{dq}{dt} = E(t)\)

  2. Show that \(f(x) = \sin(x)+\cos(x)+x^2-2\) is a solution for all \(x\) to \(y''+y = x^2\).