Consider the initial value problem (IVP)

$$ \begin{aligned} x=x(t), x_0 = x(t_0) \text{ for } t \geq t_0 \end{aligned} $$
$$ \begin{aligned} x=x(t), x_0 = x(t_0) \text{ for } t \geq t_0 \end{aligned} $$

where

$$ \begin{aligned} (x, t) : \vert t - t_0\vert < a, \vert x - x_0\vert < b \end{aligned} $$
$$ \begin{aligned} (x, t) : \vert t - t_0\vert < a, \vert x - x_0\vert < b \end{aligned} $$

this means that the pairs $(x, t)$ satisfies the inequalities $\vert t - t_0\vert < a, \vert x - x_0\vert < b$ for $a,b > 0$. For the sake of understanding we can say $t_0$ is initial time and $x_0$ is initial position. Therefore $(x_0, t_0)$ or $(x(t_0), t_0)$ is initial condition. In this case $t_0$ is independent variable and $x$ is dependent variable (depends on $t$).

When we encounter a differential equation we should ask following three questions:

  1. Does the solution exist?
  2. Does the solution unique?
  3. Does the solution continuous with respect to $(x_0, t_0)$?

If we have all the conditions in 1., 2., and 3. then we obtain well-posed problem. If one of the above does not satisfy, then we have ill-posed problem.

If we have well-posed problem, then we get the solution of IVP as below:

$$ \begin{aligned} x(t) = x(t, t_0, x_0) \text{ for } t \geq t_0 \end{aligned} $$
$$ \begin{aligned} x(t) = x(t, t_0, x_0) \text{ for } t \geq t_0 \end{aligned} $$

Now that we have stated the well-posed and ill-posed problem, we can move into the substitution methods. For every differential equation remember to check those questions that we have given above.

Substitution Methods

A differential equation of the form

$$ \begin{aligned} \dfrac{dy}{dx} = f(Ax + By + C) \end{aligned} $$
$$ \begin{aligned} \dfrac{dy}{dx} = f(Ax + By + C) \end{aligned} $$
our aim is to transform it into another differential equation by means of a substitution $u = Ax + By + C$

For example, find the solution of the initial value problem

$$ \begin{aligned} \dfrac{dy}{dx} = (-4x + y - 1)^2 + 5, \; y(0) = 1 \end{aligned} $$
$$ \begin{aligned} \dfrac{dy}{dx} = (-4x + y - 1)^2 + 5, \; y(0) = 1 \end{aligned} $$

Then by substitution $u = -4x + y - 1$ we can derive

$$ \begin{aligned} \dfrac{du}{dx} = -4 + \dfrac{dy}{dx} \end{aligned} $$
$$ \begin{aligned} \dfrac{du}{dx} = -4 + \dfrac{dy}{dx} \end{aligned} $$

which gives us

$$ \begin{align} \dfrac{dy}{dx} = \dfrac{du}{dx} + 4 \end{align} $$
$$ \begin{align} \dfrac{dy}{dx} = \dfrac{du}{dx} + 4 \end{align} $$

Substituting $(1)$ and $u = -4x + y - 1$ into original equation

$$ \begin{aligned} &\dfrac{du}{dx} + 4 = u^2 + 5\\ &\dfrac{du}{dx} = u^2 + 1 \end{aligned} $$
$$ \begin{aligned} &\dfrac{du}{dx} + 4 = u^2 + 5\\ &\dfrac{du}{dx} = u^2 + 1 \end{aligned} $$

which is a separable differential equation. Thus:

$$ \begin{aligned} \dfrac{1}{1+u^2}du = dx \end{aligned} $$
$$ \begin{aligned} \dfrac{1}{1+u^2}du = dx \end{aligned} $$

Integrating both sides we get

$$ \begin{aligned} &\arctan(u) = x + C\\ &u = \tan(x+C) \end{aligned} $$
$$ \begin{aligned} &\arctan(u) = x + C\\ &u = \tan(x+C) \end{aligned} $$

By back substitution

$$ \begin{aligned} -4x + y - 1 &= \tan(x+C)\\ y &= \tan(x+C) + 4x + 1 \end{aligned} $$
$$ \begin{aligned} -4x + y - 1 &= \tan(x+C)\\ y &= \tan(x+C) + 4x + 1 \end{aligned} $$

imposing the initial condition $y(0) = 1$ we get

$$ \begin{aligned} -4\cdot 0 + 1 - 1 &= \tan(0+C)\\ 0 &= \tan(C)\\ 0 &= C \end{aligned} $$
$$ \begin{aligned} -4\cdot 0 + 1 - 1 &= \tan(0+C)\\ 0 &= \tan(C)\\ 0 &= C \end{aligned} $$

and therefore the solution is

$$ \begin{aligned} y = \tan(x) + 4x + 1 \end{aligned} $$
$$ \begin{aligned} y = \tan(x) + 4x + 1 \end{aligned} $$

observe that the solution contains $x, x_0$ and $y_0$ where $y_0 = y(x_0) = 0$ and $y_0 = 1$.

Linear Differential Equations

If the differential equation is in the form of

$$ \begin{align} \dfrac{dy}{dx} + p(x) y = q(x) \end{align} $$
$$ \begin{align} \dfrac{dy}{dx} + p(x) y = q(x) \end{align} $$

with initial condition $y_0 = y(x_0)$ and $p(x)$ and $q(x)$ are continuous then it is said to be linear differential equation in $y$.

This differential equation neither separable nor homogenous so we cannot integrate both sides to get the solution of differential equation.

However, if we multiply both sides with the integrating factor, which makes the differential equation ready to integrate.

The idea is to find a function $\lambda(x)$ such that when we multiply both sides of the ODE by $\lambda(x)$, the left‑hand side becomes an exact derivative:

$$ \begin{align} \dfrac{d[\lambda(x)y(x)]}{dx} = \lambda(x)\dfrac{dy}{dx} + \dfrac{d(\lambda(x))}{dx}y \end{align} $$
$$ \begin{align} \dfrac{d[\lambda(x)y(x)]}{dx} = \lambda(x)\dfrac{dy}{dx} + \dfrac{d(\lambda(x))}{dx}y \end{align} $$

we compare this with (left-hand side of $(2)$ multiplied by $\lambda(x)$)

$$ \begin{aligned} \lambda(x)\left(\dfrac{dy}{dx} + p(x) y \right) = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$
$$ \begin{aligned} \lambda(x)\left(\dfrac{dy}{dx} + p(x) y \right) = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$

For these two expressions to match, we need

$$ \begin{aligned} \cancel{\lambda(x)\dfrac{dy}{dx}} + \dfrac{d(\lambda(x))}{dx} y &= \cancel{\lambda(x)\dfrac{dy}{dx}} + \lambda(x)p(x)y\\ \dfrac{d(\lambda(x))}{dx} y &= \lambda(x)p(x)y\\ \dfrac{d(\lambda(x))}{dx} &= \lambda(x)p(x)\\ \end{aligned} $$
$$ \begin{aligned} \cancel{\lambda(x)\dfrac{dy}{dx}} + \dfrac{d(\lambda(x))}{dx} y &= \cancel{\lambda(x)\dfrac{dy}{dx}} + \lambda(x)p(x)y\\ \dfrac{d(\lambda(x))}{dx} y &= \lambda(x)p(x)y\\ \dfrac{d(\lambda(x))}{dx} &= \lambda(x)p(x)\\ \end{aligned} $$
This is a separable ODE for $\lambda(x)$. We solve it:
$$ \begin{aligned} \dfrac{d(\lambda(x))}{\lambda(x)} &= p(x)dx\\ \int \dfrac{d(\lambda(x))}{\lambda(x)} &= \int p(x)dx\\ \ln \vert \lambda(x)\vert &= \int_{x_0}^{x} p(x)dx + C\\ \end{aligned} $$
$$ \begin{aligned} \dfrac{d(\lambda(x))}{\lambda(x)} &= p(x)dx\\ \int \dfrac{d(\lambda(x))}{\lambda(x)} &= \int p(x)dx\\ \ln \vert \lambda(x)\vert &= \int_{x_0}^{x} p(x)dx + C\\ \end{aligned} $$

Set $C = 0$ to get a particular solution.

$$ \begin{aligned} \lambda(x) &= e^{\int_{x_0}^{x} p(x) dx} \end{aligned} $$
$$ \begin{aligned} \lambda(x) &= e^{\int_{x_0}^{x} p(x) dx} \end{aligned} $$

Now that we found $\lambda(x)$ we can multiply equation $(2)$ by $\lambda(x) = e^{\int_{x_0}^{x} p(x) dx}$.

$$ \begin{aligned} \lambda(x)\dfrac{dy}{dx} +\lambda(x) p(x) y = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$
$$ \begin{aligned} \lambda(x)\dfrac{dy}{dx} +\lambda(x) p(x) y = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$

But by $(3)$

$$ \begin{aligned} \dfrac{d}{dx}[\lambda(x)y(x)] = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$
$$ \begin{aligned} \dfrac{d}{dx}[\lambda(x)y(x)] = \lambda(x) \dfrac{dy}{dx} + \lambda(x)p(x)y \end{aligned} $$

Therefore we can write

$$ \begin{aligned} \dfrac{d}{dx}[\lambda(x)y(x)] = \lambda(x)q(x) \end{aligned} $$
$$ \begin{aligned} \dfrac{d}{dx}[\lambda(x)y(x)] = \lambda(x)q(x) \end{aligned} $$

Integrating both sides from $x_0$ to $x$

$$ \begin{aligned} \int_{x_0}^{x}\dfrac{d}{ds}[\lambda(s)y(s)]ds = \int_{x_0}^{x}\lambda(s)q(s)ds \end{aligned} $$
$$ \begin{aligned} \int_{x_0}^{x}\dfrac{d}{ds}[\lambda(s)y(s)]ds = \int_{x_0}^{x}\lambda(s)q(s)ds \end{aligned} $$

By the Fundamental Theorem of Calculus, the left is $\lambda(x)y(x) - \lambda(x_0)y(x_0)$. Since $\lambda(x_0) = e^{\int_{x_0}^{x_0}p(x)dx} = e^0 = 1$. We have

$$ \begin{aligned} \lambda(x)y(x) - y_0 = \int_{x_0}^{x}\lambda(s)q(s)ds \end{aligned} $$
$$ \begin{aligned} \lambda(x)y(x) - y_0 = \int_{x_0}^{x}\lambda(s)q(s)ds \end{aligned} $$

Solve for $y(x)$

$$ \begin{aligned} \lambda(x)y(x) &= \int_{x_0}^{x}\lambda(s)q(s)ds + y_0\\ y(x) &= \dfrac{1}{\lambda(x)}\left(\int_{x_0}^{x}\lambda(s)q(s)ds + y_0\right) \end{aligned} $$
$$ \begin{aligned} \lambda(x)y(x) &= \int_{x_0}^{x}\lambda(s)q(s)ds + y_0\\ y(x) &= \dfrac{1}{\lambda(x)}\left(\int_{x_0}^{x}\lambda(s)q(s)ds + y_0\right) \end{aligned} $$

Substitute back $\lambda(x)$:

$$ \begin{aligned} y(x) &=e^{-\int_{x_0}^{x} p(s)ds}\left(\int_{x_0}^{x}q(s)e^{\int_{x_0}^{x}p(s)ds}ds + y_0\right) \end{aligned} $$
$$ \begin{aligned} y(x) &=e^{-\int_{x_0}^{x} p(s)ds}\left(\int_{x_0}^{x}q(s)e^{\int_{x_0}^{x}p(s)ds}ds + y_0\right) \end{aligned} $$

$\textbf{\small Question:}$ For the newlearners it could be great question to state “why did we use $s$ in integral as a variable instead of $t$”. I decided to give the answer at the very end of this section.

$\textbf{\small Example:} $ Find the solution of the initial value problem

$$ \begin{aligned} x\dfrac{dy}{dx} = (x-1)y+4x^3e^x, \; y(1) = 0 \end{aligned} $$
$$ \begin{aligned} x\dfrac{dy}{dx} = (x-1)y+4x^3e^x, \; y(1) = 0 \end{aligned} $$

$\textbf{\small Solution:} $ Let us rearrage the equation so that it looks like $(2)$.

$$ \begin{aligned} \dfrac{dy}{dx} + \left(\dfrac{1}{x}-1\right)y = 4x^2e^x \end{aligned} $$
$$ \begin{aligned} \dfrac{dy}{dx} + \left(\dfrac{1}{x}-1\right)y = 4x^2e^x \end{aligned} $$

which is linear nonhomogenous differential equation in $y$ since $p(x) = \frac{1}{x}-1$ and $q(x)=4x^2e^x$ and integrating factor is

$$ \begin{aligned} \lambda(x) &= e^{\int p(x)\,dx} \\ &= e^{\int \frac{1}{x} - 1 \, dx} \\ &=e^{\ln x-x} \\ &=e^{\ln x}e^{-x} \\ &=xe^{-x} \end{aligned} $$
$$ \begin{aligned} \lambda(x) &= e^{\int p(x)\,dx} \\ &= e^{\int \frac{1}{x} - 1 \, dx} \\ &=e^{\ln x-x} \\ &=e^{\ln x}e^{-x} \\ &=xe^{-x} \end{aligned} $$

Hence, multiplying this with the main equation we have

$$ \begin{aligned} xe^{-x}\dfrac{dy}{dx}+xe^{-x}\left(\dfrac{1}{x}-1\right)y &= xe^{-x}4x^2e^x\\ (xe^{-x}y)^{\prime} &= 4x^3 \end{aligned} $$
$$ \begin{aligned} xe^{-x}\dfrac{dy}{dx}+xe^{-x}\left(\dfrac{1}{x}-1\right)y &= xe^{-x}4x^2e^x\\ (xe^{-x}y)^{\prime} &= 4x^3 \end{aligned} $$

Integrating both sides we get

$$ \begin{aligned} \int (xe^{-x}y)^{\prime}\,dx &= \int 4x^3\,dx\\ xe^{-x}y + C_1 &= x^4 + C_2\\ xe^{-x}y &= x^4 + C, \; C = C_2 - C_1\\ y &= x^{-1}e^x[x^4+C] \end{aligned} $$
$$ \begin{aligned} \int (xe^{-x}y)^{\prime}\,dx &= \int 4x^3\,dx\\ xe^{-x}y + C_1 &= x^4 + C_2\\ xe^{-x}y &= x^4 + C, \; C = C_2 - C_1\\ y &= x^{-1}e^x[x^4+C] \end{aligned} $$

So $y(x)$ forms particular and complementary solutions as follows

$$ \begin{aligned} y(x) = \underbrace{x^3e^x}_{y_p} + \underbrace{\dfrac{e^x}{x}C}_{y_c} \end{aligned} $$
$$ \begin{aligned} y(x) = \underbrace{x^3e^x}_{y_p} + \underbrace{\dfrac{e^x}{x}C}_{y_c} \end{aligned} $$

where $y_c$ is complementary and $y_p$ is particular. This means that $y_p$ is a solution of

$$ \begin{aligned} y_p^{\prime}+\left(\dfrac{1}{x}-1\right)y_p = 4x^2e^x \end{aligned} $$
$$ \begin{aligned} y_p^{\prime}+\left(\dfrac{1}{x}-1\right)y_p = 4x^2e^x \end{aligned} $$

and $y_c$ is a solution of

$$ \begin{aligned} y_c^{\prime}+\left(\dfrac{1}{x}-1\right)y_c = 0 \end{aligned} $$
$$ \begin{aligned} y_c^{\prime}+\left(\dfrac{1}{x}-1\right)y_c = 0 \end{aligned} $$

Without delving more, complementary solution is the general solution to the corresponding homogenous equation. It contains arbitrary constants that are determined by IC or BD. Yet, the particular solution is any specific solution to the nonhomogenous equation. Obviously, the particular solution does not containt arbitrary constants. The general solution is given as $y = y_p + y_c$.

One last step is to impose the initial condition

$$ \begin{aligned} y(1) &= 1^3e^1+\dfrac{e^1}{1}C\\ &=e+eC\\ &=0 \end{aligned} $$
$$ \begin{aligned} y(1) &= 1^3e^1+\dfrac{e^1}{1}C\\ &=e+eC\\ &=0 \end{aligned} $$

Thus $C = -1$. All in all, the answer is

$$ \begin{aligned} y(x) &= e^x\left(x^3-\dfrac{1}{x}\right), \; x \neq 0 \end{aligned} $$
$$ \begin{aligned} y(x) &= e^x\left(x^3-\dfrac{1}{x}\right), \; x \neq 0 \end{aligned} $$

$\textbf{\small Answer:}$ If we tried to write $\lambda(x)y(x) - y_0 = \int_{x_0}^{x}\lambda(x)q(x)dx$ this would be wrong, because:

  • On the left, $x$ is a free variable.
  • On the right, $x$ is both the upper limit and the variable of the integration, which is ambiguous. So we must use a different dummy letter.

In the next section we will introduce Bernoulli’s differential equation and Ricatti’s differential equations.