Differential equations are an important concept in calculus as they can be used to describe how things change over time or space. For example, differential equations can be used to model changes in the speed of an object, the changing size of a population, changes in the number of people infected with a disease, how temperature changes as heat spreads in an object, and more.
However, while they are very good at expressing these changes, differential equations on their own are generally difficult to use. For this reason it is good to have an understanding of how to solve them, and while this can be tricky, this page covers a technique to solve differential equations that are in a certain form. First, though, we look at what exactly differential equations are, and the different types.
A differential equation is an equation that involves one or more derivatives. For example, the following are all differential equations:
\[\begin{aligned} \frac{dy}{dx} &= 4x + 5 \\\ \frac{dP}{dt} &= rP(1-\frac{P}{k}) \\\ 4x^2\cos\,y\,\frac{dy}{dx} &= 10 \\\ 7\,\frac{d^2x}{dt^2} + 2\,\frac{dx}{dt} + 2x &= \frac{4}{t^2} \\\ \end{aligned}\]In particular, these are all examples of what are called ordinary differential equations, as they each only contain derivatives taken with respect to one variable (that is, they only contain derivatives with respect to \(x\) or \(t\) but not both). If a differential equation contains derivatives with respect to more than one variable these are partial derivatives and the equation is a partial differential equation, but these are not covered here.
Differential equations also differ in terms of their order and degree. The order of a differential equation refers to the highest derivative contained in the equation. If it is a first derivative then it is referred to as a first order differential equation, if it is a second derivative it is a second order differential equation, and so on. For example, the first three differential equations above are first order differential equations, while the fourth one is a second order differential equation.
The degree of a differential equation is the exponent of the highest derivative in the equation. For example, the following differential equation is a second degree differential equation (actually it is a first order second degree ordinary differential equation):
\[(\frac{dy}{dx})^2 + 2y = 3x^3\]The differential equation below, on the other hand, is only a first degree differential equation as its highest derivative does not have an exponent (in fact it is a second order first degree ordinary differential equation).
\[\frac{d^2y}{dx^2} - (\frac{dy}{dx})^3 = 4x\]In this page we will look at a method of solving first order first degree differential equations only.
Finally, a special kind of first order differential equation is a linear differential equation, which is a first order differential equation in the following form (where \(p(x)\) and \(q(x)\) are functions of \(x\)):
\[\frac{dy}{dx} + p(x)y = q(x)\]Test your understanding of the different types of differential equations by working through the questions below:
This is a second order differential equation, as the highest derivative is a second derivative.
This is a second degree differential equation, as the highest derivative has an exponent of \(2.\)
This is a second order second degree ordinary differential equation.
No, because it contains a \(y^3\) instead of just \(y.\)
Just as there are many different types of differential equations, there are also many different ways to solve them - if indeed they can be solved at all. While some of these methods are very complex, one of the simplest methods is a technique called separation of variables. This technique can be used when the differential equation is separable, that is, when it can be written in the form:
\[f(y)\,\frac{dy}{dx} = g(x)\]If it can be written in this form, then the differential equation can be rearranged as follows:
\[f(y)\,dy = g(x) dx\]We can then integrate both sides of the equation to solve for \(y\):
\[\int f(y)\,dy = \int g(x)\,dx\]Note that if you are provided with an initial condition, such as the value of \(y\) when \(x\) is equal to a certain value, then you can substitute these values into the solution to find the constant of integration. Otherwise, you can leave it as part of the solution.
Example 1:
Solve \(2y\,\frac{dy}{dx} = 4x - 5\)
Solution:
This equation is in the form \(f(y)\,\frac{dy}{dx} = g(x),\) so we can rearrange it and then integrate as follows:
\[\begin{aligned} 2y\,\frac{dy}{dx} &= 4x - 5 \\\ \therefore \int 2y\,dy &= \int (4x - 5)\,dx \\\ \therefore y^2 &= 2x^2 - 5x + C \\\ \therefore y &= \sqrt{2x^2 - 5x + C} \\\ \end{aligned}\]Example 2:
Solve \(\frac{dy}{dx} = \frac{3x^2(4x + 1)}{2y}\) given that when \(x = 1,\) \(y = 6\)
Solution:
This equation is in the form \(f(y)\,\frac{dy}{dx} = g(x),\) so we can rearrange it and then integrate as follows:
\[\begin{aligned} \frac{dy}{dx} &= \frac{3x^2(4x + 1)}{2y} \\\ \therefore \int 2y\,dy &= \int 3x^2(4x + 1)\,dx \\\ \therefore \int 2y\,dy &= \int (12x^3 + 3x^2)\,dx \\\ \therefore y^2 &= 3x^4 + x^3 + C\\\ \therefore y &= \sqrt{3x^4 + x^3 + C} \\\ \end{aligned}\]Given that when \(x = 1\) we have \(y = 6,\) it follows that:
\[\begin{aligned} 6 &= \sqrt{1 + 1 + C} \\\ \therefore 6 &= \sqrt{2 + C} \\\ \therefore 36 &= 2 + C \\\ \therefore C &= 34 \\\ \end{aligned}\]So the solution to the differential equation is \(y = \sqrt{3x^4 + x^3 + 34}\)
Test your knowledge of the separation of variables technique by using it to solve the differential equations below:
Note we can write this as \(y = Ce^{2x^2}\) as the exponent laws tell us we can rewrite \(e^{2x^2 + C}\) as \(e^{2x^2}.e^C,\) and \(e^C\) is just another constant.
Note we can write this as \(y = Ce^{x^2 + x}\) as the exponent laws tell us we can rewrite \(e^{x^2 + x + C}\) as \(e^{x^2 + x}.e^C,\) and \(e^C\) is just another constant.
Given that when \(x = 0\) we have \(y = 5,\) it follows that:
\[\begin{aligned} 5 &= ln\,C \\\ \therefore C &= e^5 \\\ \end{aligned}\]So the solution to the differential equation is \(y = ln(2x^4 + e^5)\)
We can integrate the left hand side of this equation using integration by substitution where we set \(u = y - 4.\) This gives:
\[\begin{aligned} \int \frac{1}{u}\,du &= ln\,|u|\,\\\ &= ln\,|y - 4|\,\\\ \end{aligned}\]And so, using the logarithm laws, we have:
\[\begin{aligned} \int \frac{1}{y-4}\,dy &= \int \frac{2}{x}\,dx\\\ \therefore ln\,|y - 4|\, &= 2\,ln\,|x|\, + ln\,C \\\ \therefore ln\,|y - 4|\, &= ln\,|x^2|\, + ln\,C \\\ \therefore ln\,|y - 4|\, &= ln\,|Cx^2|\, \\\ \therefore y - 4 &= Cx^2 \\\ \therefore y &= Cx^2 + 4\\\ \end{aligned}\]Finally, given that when \(x = 3\) we have \(y = 22,\) it follows that:
\[\begin{aligned} 22 &= 9C + 4 \\\ \therefore 9C &= 18 \\\ \therefore C &= 2 \\\ \end{aligned}\]So the solution to the differential equation is \(y = 2x^2 + 4\)