Skip to main content

Calculusity

Introduction to Differential Equations

A differential equation is an equation involving derivatives of a dependent variable with respect to one or more independent ones. If we have only one independent variable $x$ (or time $t$ if it’s a physics problem) we may represent the dependent variable by $y$. We then deal with ordinary derivatives like $\frac{dy}{dx}$, $\frac{d^2y}{dx^2}$. A differential equation involving only ordinary derivatives is an ordinary differential equation or ODE. If we have several independent variables like $x$, $y$ and $z$ we may call the dependent variable $\psi$ and deal with partial derivatives like $\frac{\partial\psi}{\partial x}$, $\frac{\partial^2\psi}{\partial y^2}$ etc. A differential equation involving partial derivatives is called a partial differential equation or PDE. The solution of a differential equation whether ordinary or partial is a relation between its variables that when inserted into the original differential equation results in an identity. The order of a differential equation is the order of its highest derivative. Thus

$$\frac{dy}{dx}+x^2y=6$$

is a first order ordinary differential equation. Its solution is a function $y=y(x)$ while 

$$\frac{\partial^2\psi}{\partial x^2}+\frac{\partial^2\psi}{\partial y^2}+\frac{\partial^2\psi}{\partial z^2}=0$$

is a second order partial differential equation. Its solution is some function $\psi=\psi(x, y, z)$.

A linear differential equation takes the form

$$a_0y+a_1\frac{dy}{dx}+a_2\frac{d^2y}{dx^2}+a_3\frac{d^3y}{dx^3}+\cdots=a$$

where the $a$’s are constants or functions of $x$. A differential equation not of this form is called non-linear. The general solution of a linear differential equation of order $n$ contains $n$ independent constants and is like a family of curves. Given boundary or initial conditions ($n$ sets of corresponding values for all the variables) allows us to zero in on one particular solution like picking out one member curve from an entire family. To illustrate this consider the linear second order ODE $y^{\prime\prime}=y$ i.e.

$$\frac{d^2y}{dx^2}=y$$

Solving this means finding a function $y=(x)$ that when differentiated twice gives back the original function. Now from your studies of calculus you know that the exponential function is its own derivative thus $y=e^x$ is a solution. However a little thinking shows that $y=e^{\mathbin{-}x}$ is also a solution. In fact there are no more basic solutions and the entire solution family must be constructed from these two. The superposition principle tells us that if $y_1(x)$ and $y_2(x)$ are solutions to some linear differential equation then so is the linear combination $Ay_1(x)+By_2(x)$. This follows from the linearity property. We wouldn’t prove this but note the linear combination contains both the two original solutions as well as every solution that can be built from them. In the case of our $y^{\prime\prime}=y$ equation we may write the general solution family as 

$$y(x)=Ae^x+Be^{\mathbin{-}x}$$

Note since the starting ODE was second order we have two arbitrary constants. To pick one specific member curve from this family of curves we need two points as boundary conditions. First suppose we were told $y(x)$ passes through the origin. Then we may write

$$0=Ae^0+Be^0=A+B\implies B=\mathbin{-}A$$

thus

$$y(x)=Ae^x\mathbin{-}Ae^{\mathbin{-}x}=A(e^x\mathbin{-}e^{\mathbin{-}x})$$

As a second point suppose we are told the curve passes through $(\ln2,\frac{3}{4})$. Then

$$\frac{3}{4}=A(e^{\ln2}-e^{\mathbin{-}\ln2}=A(2\mathbin{-}\frac{1}{2})=\frac{3}{2}A$$

Thus we find

$$A=\frac{1}{2}$$ 

and can write our particular solution as

$$y(x)=\frac{1}{2}(e^x\mathbin{-}e^{\mathbin{-}x})=\sinh x$$

The general form of a linear first order differential equation is 

$$a_0y+a_1\frac{dy}{dx}=a$$

dividing by $a_1$, renaming the quotients and rearranging the terms gives

$$\frac{dy}{dx}+py=q$$

we will consider the general case where $p$ and $q$ are functions if $x$ i.e.

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

The general form of a linear second order differential equation is

$$a_0y+a_1\frac{dy}{dx}+a_2\frac{d^2y}{dx^2}=a$$

dividing by $a_2$, renaming the quotients and rearranging the terms gives

$$\frac{d^2y}{dx^2}+p\frac{dy}{dx}+qy=r$$

where $p$ and $q$ are constants. We will consider two cases:

(i) Homogeneous Linear Second Order ODEs where $r=0$. This models the case of a free, undisturbed oscillator.

(ii) Non-Homogeneous Linear Second Order ODEs where $r$ is a forcing function $F(x)$. This models the case of an oscillator that is driven by external forces.