First order ODEs
Selecting a method to solve first order ODEs (flowchart)
When one encounters an ODE in the wild, a plan of attack is necessary. We’ve met lots of methods that can be used to solve first order ODEs (detailed below and more thoroughly in your lecture notes). You may find the following flowchart useful as a guide for the kind of thought processes that will lead you to pick the appropriate method.
First order ODEs flowchart
Siart Llif (Cymraeg) [PDF]
Simple first order, first degree ODEs
An ODE of the form
where \(f(x)\) is a known function, can be solved directly by integrating both sides with respect to \(x\). Remember to include an arbitrary constant!
Also note (strongly) that this method of direct integration works ONLY for ODEs of this form. Other types require more sophisticated treatments.
Boundary conditions
Solutions to ODEs which contain arbitrary constants are called general solutions. Boundary conditions can then be applied to general solutions in order to find specific values for these constants; after doing so the solution is referred to as a particular solution.
Boundary conditions usually specify the value of the dependent variable \(y(x)\) (i.e. the function we’re usually trying to find) for some specific value of \(x\). For instance, a boundary condition \(y(2)=15\) tells us that when \(x\) takes the value 2, \(y\) should take the value 15.
After applying boundary conditions (provided there are as many boundary conditions as the order of the equation), the particular solution should contain no arbitrary constants.
Implicit and explicit solutions
Solutions that directly express the dependent variable as a function of the independent variable (i.e. expressions of the form \(y=y(x)\)) are known as explicit solutions. For instance, the ODE \(\frac{\mathrm{d}y}{\mathrm{d}x}=3x^2-x+1\) has an explicit general solution given by
where \(A\) is an arbitrary constant.
It is not always possible or straightforward to express solutions in such a form. Instead, some less straightforward releationship between \(x\) and \(y\) (without any derivative terms) may result; such solutions are known as implicit solutions. Examples include solutions like \(y^2=4(x+1),\) or \(\left|\frac{y+1}{x-1}\right|=1.\)
Separation of variables
If one can re-arrange an ODE into the following standard form:
then the solution may be found by the method of separable variables:
This result is obtained by dividing the standard form by \(g(y)\) and then integrating both sides with respect to \(x\).
Homogeneous functions and ODEs
A function \(f(x,y)\) is said to be homogeous of degree \(n\) if \(f(kx,ky)=k^n f(x,y)\) for any number \(k\neq0\).
Any function that is homogeneous of degree \(n\) can be written in the form \(f(x,y)=x^n\phi\left(\frac{y}{x}\right)\) for some function \(\phi\) of a single variable.
An ordinary differential equation (ODE) of the form:
where \(F(x,y)\) is homogeneous of degree zero, is said to be a homogeneous ODE.
Solving Homogeneous ODEs
Suppose we have a first order homogeneous ODE
If we make the substitution \(y=vx\) then by the product rule, we have that \(\frac{\mathrm{d}y}{\mathrm{d}x}=v+x\frac{\mathrm{d}v}{\mathrm{d}x}.\) Moreover, by our earlier observation regarding being able to write a homogeneous function of \(x\) and \(y\) as a function of one variable, we can write \(F(x,y)=\phi(v).\) Substituting these observations into the original ODE gives that
This is now an ODE with dependent variable \(v\) and independent variable \(x\).
We can solve this by separable variable techniques, since rearranging yields
whose right hand side is the product of a function of the dependent variable \(v\) and a function of the independent variable \(x\). Therefore
where \(c\) is an arbitrary constant.
Reduction to 1st order homogeneous form
Consider ODEs of the form
where \(a,b,c,l,m,n\) are constants. This is not a homogeneous ODE but it can be made homogeneous via the change of variables
where \(x_0,y_0\) are constants. Then
We can then choose \(x_0\) and \(y_0\) (by solving a system of two simultaneous equations) in such a way that both expressions in curly brackets are equal to zero. Consequently the ODE becomes
which is homogeneous. This equation can now be solved by our usual method for homogeneous first order ODEs to give a solution in terms of \(u\) and \(v\). Finally, everything can be put back in terms of the original variables \(x\) and \(y\) to complete the problem.
Solving 1st order linear ODEs: Integrating factor
A first order linear ordinary differential equation can always be written in the form (note: some rearranging may be required first)
Such differential equations can be solved by multiplying both sides by a so-called “integrating factor” \(R(x)\), which we choose as
By doing so, the original ODE becomes
We can then notice that the left hand side is the derivative with respect to \(x\) of \(R(x)y\) (this can be verified by differentiating \(R(x)y\) using the product rule), giving
Integrating both sides with respect to \(x\) yields \(R(x)y=\int R(x)Q(x)\mathrm{d}x+c,\) where \(c\) is an arbitrary constant, and so rearranging gives the explicit solution
Bernoulli’s equation
A differential equation of the form
where \(n\) is a constant, is called Bernoulli’s equation. If \(n=0\) or \(n=1\) then it is linear; otherwise it is non-linear.
Such an equation can be reduced to a linear first order ODE by making the substitution \(z=y^{1-n}.\) After some simplification and manipulation (as we’ve seen in the lectures), the equation reduces to a first order linear ODE that can be solved by using an integrating factor.