# Ordinary Differential Equations

### Definitions

A differential equation is an equation, where the unknown is a function and both the function and its derivatives may appear in the equation. The order of a differential equation is the order of the highest derivative. The degree of a differential equation is the algebraic degree of the highest derivative. Example of an ordinary differential equation:

Newton’s law is given by the differential equation $$m\frac{d^2x}{dt^2}(t)=f\left(t,x(t),\frac{dx}{dt}(t)\right)$$

Here $m$ is the particle's mass, $a=\frac{d^2x}{dt^2}$ is the particle's acceleration, and $f$ is the force acting on the particle. The unknown $x(t)$ is the position of the particle in space at time $t$. Since the order of the highest derivative is 2, this is a second order ordinary differential equation.

A general solution of a homogeneous differential equation is called the complementary solution and will involve arbitrary constants. A particular solution is a special case of the general solution with definite values assigned to the constants based on boundary conditions. A singular solution is a solution which cannot be obtained from the general solution by specifying the values of the arbitrary constants. For example:

For the following ordinary differential equation: \begin{align*} \frac{dy}{dx}&=x^2-1\\y(0)&=1\end{align*} the general solution is obtained by integrating both sides of the equation $$y=\frac{x^3}{3}-x+C.$$

To obtain the particular solution that satisfies the given condition, we determine a value for $C$ by substituting $y=1$ and $x=0$ into the general solution and solving for $C$: \begin{align*}1&=0-0+C\\C&=1\end{align*} which gives the particular solution $$y=\frac{x^3}{3}-x+1.$$

This satisfies both the ordinary differential equation and the given condition.

### First-order differential equation

The general first-order differential equation for the function $y=y(x)$ is written as $$\frac{dy}{dx}=f(x,y)$$ where $f(x,y)$ can be any function of the independent variable $x$ and the dependent variable $y$.

#### Solution using direct separation and separation by substitution techniques

##### Direct separation

This method can be applied when the function $f(x,y)$ involves only one of the variable $x$ or $y$, or can be written as a product or quotient of functions $g(x)$ and $h(y)$.

Differential EquationSolution
$\displaystyle{\frac{dy}{dx}=g(x)}$ $\displaystyle{y=\int{g(x)\:dx}+C}$
$\displaystyle{\frac{dy}{dx}=h(y)}$ $\displaystyle{x=\int{\frac{dy}{h(y)}}+C}$
$\displaystyle{\frac{dy}{dx}=g(x)h(y)}$ $\displaystyle{\int{\frac{dy}{h(y)}}=\int{g(x)\:dx}+C}$
$\displaystyle{\frac{dy}{dx}=\frac{g(x)}{h(y)}}$ $\displaystyle{\int{h(y)\:dy}=\int{g(x)\:dx}+C}$
$\displaystyle{\frac{dy}{dx}=\frac{h(y)}{g(x)}}$ $\displaystyle{\int{\frac{dy}{h(y)}}=\int{\frac{dx}{g(x)}}+C}$
##### Separation by substitution

This method can be used when a substitution of the variables $x$ and $y$ as noted in the second line of each example below can be used to make the differential equation separable.

Differential EquationSolution
$\displaystyle{yf(x,y)dx+xg(x,y)dy=0}$
$\displaystyle{y=rx}$
$\displaystyle{\int{\frac{dx}{x}}=\int{\frac{g(r)\:dr}{f(r)+rg(r)}}+C}$
$\displaystyle{yf(x,y)dx+xg(x,y)dy=0}$
$\displaystyle{y=\frac{r}{x}}$
$\displaystyle{\int{\frac{dx}{x}}=\int{\frac{f(r)\:dr}{r\left(g(r)-f(r)\right)}}+C}$

### Second-order differential equation

The general linear second-order differential equation with independent variable $t$ and dependent variable $x=x(t)$ is given by $$\ddot{x}+p(t)\dot{x}+q(t)x=g(t)$$ where $\dot{x} = \frac{dx}{dt}$ and $\ddot{x}=\frac{d^2x}{dt^2}$.