# Ordinary Differential Equations/Introduction
## Directly integrable differential equations

An example of an ordinary differential equation is the equation
    $x'(t)=0$.
To solve this equation shall mean that we find a function $x:I\to \mathbb {R}$ defined on some interval $I=(a,b)$ such that the above equation holds for all $t\in I$. That is, as opposed to "normal" algebraic equations such as
    $x-3={\frac {1}{2}}$,
to which the solution is a number (in this case $x={\frac {7}{2}}=3.5$), the solution to an ordinary differential equation is a function.
There is a theorem in calculus that says that a differentiable function $x:I\to \mathbb {R}$ on a connected interval $I=(a,b)$ has vanishing derivative if and only if it is a constant function. Thus, the solutions to the equation
    $x'(t)=0$
are precisely the constant functions $x\equiv c$ ($c\in \mathbb {R}$). Note here that we have lost the uniqueness of solutions (which we had in our example for an algebraic equation); every constant function is a solution. We will later be able to restore the uniqueness of solutions (at least in some special cases) by imposing initial conditions; for example, if we additionally require that
    $x(t_{0})=x_{0}\in \mathbb {R}$
(where we also require that $t_{0}$ is contained within the solution interval $I$), then we have only one choice for a solution to our equation: $c=x_{0}$.
Let's turn to a slightly more difficult differential equation:
    $x'(t)=f(t)$
for some function $f:\mathbb {R} \to \mathbb {R}$. In this case, by the fundamental theorem of calculus we have
    $x(t)=\int _{t_{0}}^{t}f(s)ds+C$ for some $t_{0}$ to be contained in the solution interval $I$,
where again $C\in \mathbb {R}$ is an arbitrary integration constant. The arbitraryness of $C$ of course implies that we have infinitely many solutions, but by imposing an initial condition $x(t_{0})=x_{0}$, we get that $C$ must equal $x_{0}$, and hence we have once again obtained a unique solution if we additionally require the initial condition to be satisfied.

### Exercises

* Solve the differential equation $x'(t)=t^{2}$ under the initial condition $x(0)=0$. More generally, solve the differential equation $x'(t)=t^{k}$ under the initial condition $x(2-k)=k-2$.

## Order of an ordinary differential equation

Instead of looking at the equation
    $x'(t)=0$,
we may instead look at the equation
    $x''(t)=0$, or, more generally, $x''(t)=f(t)$
for some function $f:\mathbb {R} \to \mathbb {R}$. Note the difference: Previously, we had only had a first-order derivative, and now we have a second order derivative. The new equation is still an ordinary differential equation (we will give the precise definition of an ordinary differential equation at the end, when we are finished with the simple examples), but this time involving a second-order derivative. This gives rise to the following definition.
Definition 1.1 (order of an ordinary differential equation):
The order of an ordinary differential equation is defined to be the order of the highest order derivative occurring in it. That is, if $x^{(n)}$ is appearing in the ordinary differential equation, but for all $m>n$, $x^{(m)}$ does not appear in the ordinary differential equation, then $n$ is the order of that ordinary differential equation.
In fact, for the above examples, we can easily compute the solutions using just integration. If $x''(t)=0$, then $x'(t)=c_{1}$ for some constant $c_{1}\in \mathbb {R}$. Therefore, integrating that again, we get
    $x(t)=\int _{t_{0}}^{t}x'(s)ds=(t-t_{0})c_{1}+c_{2}$
for some constant $c_{2}\in \mathbb {R}$.

### Exercises

* What is the order of the ordinary differential equation $x'(t)+2x''(t)+3x'''(t)=2t$? What is the order of the ODE $x^{(k)}(t)=t^{2}$? Based on the last question, write down an ordinary differential equation of order 23.
* Solve the differential equation $x''(t)=t^{3}$ under the conditions $x(0)=1$ and $x(1)=2$.

## Linear differential equations

Consider the differential equation
    $x'(t)=cx(t)$,
where $c\in \mathbb {R}$ is an arbitrary constant. This differential equation has a remarkable property: Whenever $x_{1},x_{2}$ are solutions to it, so is $ax_{1}+bx_{2}$ for arbitrary $a,b\in \mathbb {R}$ (in fact, complex numbers are permissible as well). More generally, every linear combination of solutions is again a solution. This is a direct consequence of linearity of the derivatives as follows:
    $(a_{1}x_{1}(t)+\cdots +a_{n}x_{n}(t))'=a_{1}x_{1}'(t)+\cdots +a_{n}x_{n}'(t)=a_{1}cx_{1}(t)+\cdots a_{n}cx_{n}(t)=c(a_{1}x_{1}(t)+\cdots +a_{n}x_{n}(t))$.
Differential equations with this property are called linear.
Definition 1.2 (linear ordinary differential equation):
A linear ordinary differential equation is an ODE such that any linear combination of solutions to it is again a solution to it.
Note that since zero can be written as a linear combination of any existing solution (as $0\cdot x$), a linear ODE has either no solution or zero is a solution.
There is also such a thing as an inhomogenous linear equation, which is closely related, but not equal, to linear equations.
Consider the ordinary differential equation
    $x'(t)=cx(t)+g(t)$
for some function $g(t)$. This is an example of what's called an inhomogenous linear equation, for the following reason: Suppose it has a solution $x$, and $y$ is a solution of the above equation $y'(t)=cy(t)$. Then any superposition $z(t):=x(t)+ay(t)$ ($a\in \mathbb {R}$) is again a solution:
    $z'(t)=(x(t)+ay(t))'=x'(t)+ay'(t)=cx(t)+g(t)+acy(t)=cz(t)+g(t)$.
We capture this property in the following definition.
Definition 1.3 (inhomogenous linear ordinary differential equation):
An inhomogenous linear ordinary differential equation is an ODE such that there is a corresponding linear ODE, of which we can add solutions and obtain still a solution.
To contrast linear ODEs from inhomogeneous linear ODEs, we often call the former homogenous linear ODEs. Some mathematicians also use the term "linear" to refer to homogenous or inhomogenous ODEs, which is why it is advisable to use the term "homogenous" anyway.
We will see only later how to solve these things, although it's actually very easy.

### Exercises

Let $\lambda \in \mathbb {C}$. Prove by direct computation that the function $x(t):=e^{\lambda t}$ is a solution to the ODE $x'(t)=\lambda x(t)$.