Fig. 1 - Though they sound similar, homogeneous and homogenized don't have any real relation to each other.
Homogeneous vs Nonhomogeneous Differential Equation
From reading about differential equations, you already know that there are several ways to classify them. A useful one is homogeneous versus nonhomogeneous.
Homogeneous differential equations can be written with all of the functions involving dependent variables on one side of the equation, and zero on the other side. Nonhomogeneous differential equations have a function of the independent variable instead of zero on the other side of the equation, and functions of the dependent variables on the other side.
For example, the differential equation
\[ y'' + 2y' - 3xy = 0\]
is a homogeneous differential equation. It can be written with all of the functions involving the dependent variable on one side of the equation, and zero on the other side.
By contrast, the differential equation
\[ y'' + 2y' - 3xy = \sin x\]
is a nonhomogeneous differential equation. It has a function of the independent variable, \(x\), on one side of the equation instead of the zero that the previous example had.
It is important to note that whether or not a differential equation is homogeneous or nonhomogeneous has nothing to do with the order of the equation or whether or not it is linear!
What is a Linear Nonhomogeneous Differential Equation?
Now that you know a differential equation can be both linear and nonhomogeneous, doesn't have to be both linear and nonhomogeneous, let's take a look at the case where it is.
Remember the properties of a linear differential equation:
each dependent variable appears in linear fashion;
the dependent variable and/or its derivatives are all raised to the power of \(1\);
none of the dependent variables and/or its derivatives are multiplied together;
the dependent variable and/or its derivatives can not be part of a special function, like a trigonometric function or the exponential function; and
the independent variable can be non-linear (raised to a power, part of special function, etc.).
Here are some examples of linear differential equations:
\( \dfrac{\mathrm{d}y}{\mathrm{d}t}+2y=0\);
\( t^2\dfrac{\mathrm{d}^2y}{\mathrm{d}t^2} +t\dfrac{\mathrm{d}y}{\mathrm{d}t}+4y=e^t\); and
\( \dfrac{\mathrm{d}y}{\mathrm{d}t}+\left(\cos{t}\right)y=t^2\).
Of the equations listed above, only
\[ \dfrac{\mathrm{d}y}{\mathrm{d}t}+2y=0\]
is a homogeneous equation. Both of the others are nonhomogeneous. So while a differential equation can be both linear and nonhomogeneous, it doesn't have to be.
How you solve a nonhomogeneous linear equation varies depending on whether or not it is first order. Read on for techniques to solve first order nonhomogeneous differential equations.
Linear Nonhomogeneous Differential Equations with Constant Coefficients
Let's start with the constant coefficient case. A linear first order nonhomogeneous differential equation with constant coefficients has the form
\[ \frac{\mathrm{d}y}{\mathrm{d}x}+ay=f(x),\]
although this is more commonly written as
\[y'+ay=f(x).\]
The idea is to use an integrating factor to solve this kind of separable differential equation. First order linear constant coefficient equations are especially nice since the integrating factor for these sorts of equations is
\[ h(x) = e^{ax}.\]
You would then multiply both sides of the equation by the integrating factor, and integrate giving you
\[ \int (e^{ax}y)'\, \mathrm{d}x = \int e^{ax} f(x) \, \mathrm{d}x ,\]
so
\[ e^{ax}y(x) = \int e^{ax} f(x) \, \mathrm{d}x ,\]
or
\[y(x) = e^{-ax} \int e^{ax} f(x) \, \mathrm{d}x .\]
So being able to find an explicit solution to this type of equation really depends on whether or not you can integrate \(e^{ax} f(x) \). Let's take a look at a quick example.
If possible, find an explicit solution to the first order linear constant coefficient nonhomogeneous differential equation
\[ y' - 5y = 3x.\]
Solution:
Here \(a=-5\) and \(f(x) = 3x\). So the implicit solution to the equation is
\[ y(x) = e^{5x}\int 3xe^{-5x} \, \mathrm{d}x.\]
In this case, you can perform the integration, so the explicit solution is
\[ \begin{align} y(x) &= e^{5x}\int 3xe^{-5x} \, \mathrm{d}x \\ &= 3e^{5x} \left[ e^{-5x}\left(-\frac{x}{5} + \frac{1}{25} \right) + C \right] \\ &= -\frac{3x}{5} + \frac{3}{25} + 3Ce^{5x} , \end{align}\]
where you can use integration by parts to get the result.
Notice that the solution has a constant of integration in it! That is because the solution to a differential equation when you don't have an initial value is a family of functions, not a single function.
Next, let's take a look at a more general first order nonhomogeneous equation.
solving First Order Nonhomogeneous Differential Equation
A general linear first order nonhomogeneous differential equation with constant coefficients has the form
\[y'+a(x)y=f(x).\]
This kind of equation is still solved using an integrating factor. Here the integrating factor is
\[ h(x) = e^{\int a(x)\,\mathrm{d} x},\]
and the solution to the differential equation is
\[y(x) = e^{-\int a(x)\,\mathrm{d} x} \int e^{\int a(x)\,\mathrm{d} x} f(x) \, \mathrm{d}x .\]
That means finding an explicit solution still depends on being able to find a closed form integral!
For a reminder on closed form integrals, see Indefinite Integrals and Closed Forms.
Let's take a look at an example.
If possible, find an explicit solution for the first order linear nonhomogeneous differential equation
\[ y' + \frac{y}{x} = x^2.\]
Solution:
For this problem the integrating factor is
\[ \begin{align} h(x) &= e^{\int \frac{1}{x}\,\mathrm{d} x} \\ &= e^{\ln x} \\ &= x. \end{align}\]
So the implicit solution is given by
\[\begin{align} y(x) &= e^{-\int a(x)\,\mathrm{d} x} \int e^{\int a(x)\,\mathrm{d} x} f(x) \, \mathrm{d}x \\ & =\frac{1}{x} \int x (x^2) \, \mathrm{d}x. \end{align} \]
This can be integrated, so the explicit solution is
\[ \begin{align} y(x) &= \frac{1}{x} \int x^3 \, \mathrm{d}x \\ &= \frac{1}{x} \left( \frac{1}{4}x^4 + C \right) \\ &= \frac{C}{x} + \frac{x^3}{4}. \end{align}\]
Notice that the original differential equation is not well defined when \(x=0\), and neither is the explicit solution.
More examples are always good!
Nonhomogeneous Linear Equation Examples
Let's take a look at some more examples.
Solve the nonhomogeneous linear differential equation
\[ xy'-2y = \frac{1}{x}.\]
Are there any restrictions on the domain of the solution?
Solution:
The first step is to get the equation into standard form by dividing both sides of the equation by \(x\), giving you
\[y' - \frac{2}{x}y = \frac{1}{x^2}.\]
Then an integrating factor is
\[ \begin{align} h(x) &= e^{\int - \frac{2}{x}\,\mathrm{d} x} \\ &= e^{-2\ln x} \\ &= \frac{1}{x^2}. \end{align}\]
That means the implicit solution is
\[\begin{align} y(x) &= x^2 \int \frac{1}{x^2} \left(\frac{1}{x^2}\right) \, \mathrm{d}x \\ &=x^2\int \frac{1}{x^4} \, \mathrm{d}x, \end{align} \]
and the explicit solution is
\[\begin{align} y(x) &= x^2\int \frac{1}{x^4} \, \mathrm{d}x \\ &= x^2\left( -\frac{1}{3x^3} + C\right) \\ &= -\frac{1}{3x} + Cx^2.\end{align} \]
Notice that this solution is not defined at \(x=0\). That means there are two possible domains for the solution, either \((-\infty, 0)\) or \((0, \infty )\). Without initial conditions, you can't tell which is the desired domain, so both are listed as possible domains.
Let's look at another example.
Solve the nonhomogeneous linear differential equation
\[ y' + y\tan x =1.\]
Are there any restrictions on the domain of the solution?
Solution:
Notice that this equation is not well defined whenever \(\cos x = 0\), so you can expect the solution to have restrictions on the domain. This differential equation is already in standard form and the solution is given by
\[\begin{align} y(x) &= e^{-\int a(x)\,\mathrm{d} x} \int e^{\int a(x)\,\mathrm{d} x} f(x) \, \mathrm{d}x \\ &= e^{-\int \tan x\,\mathrm{d} x} \int e^{\int \tan x \,\mathrm{d} x} (1) \, \mathrm{d}x \\ &= e^{\ln|\cos x|} \int e^{-\ln|\cos x|} \, \mathrm{d}x \\ &= |\cos x| \int |\sec x| \, \mathrm{d}x \\ &= |\cos x| \left( \frac{ \sec x \ln|\tan x + \sec x|}{|\sec x| } + C\right). \end{align}\]
Just looking at the solution you can see that there will be plenty of restrictions on the domain of the solution! In fact, depending on the initial conditions there might not be a solution at all.
Nonhomogeneous Differential Equation - Key takeaways
- Homogeneous differential equations can be written with all of the functions involving dependent variables on one side of the equation, and zero on the other side.
- Nonhomogeneous differential equations have a function of the independent variable instead of zero on the other side of the equation, and functions of the dependent variables on the other side.
- The first order linear constant coefficient differential equation \(y'+ay=f(x) \) has the solution\[y(x) = e^{-ax} \int e^{ax} f(x) \, \mathrm{d}x .\]
- The general first order linear differential equation \(y'+a(x)y=f(x) \) has the solution \[y(x) = e^{-\int a(x)\,\mathrm{d} x} \int e^{\int a(x)\,\mathrm{d} x} f(x) \, \mathrm{d}x .\]
- Being able to find an explicit solution to a first order linear nonhomogeneous differential equation depends on whether or not the integral \( \int e^{\int a(x)\,\mathrm{d} x} f(x) \, \mathrm{d}x \) has a closed form.
How we ensure our content is accurate and trustworthy?
At StudySmarter, we have created a learning platform that serves millions of students. Meet
the people who work hard to deliver fact based content as well as making sure it is verified.
Content Creation Process:
Lily Hulatt is a Digital Content Specialist with over three years of experience in content strategy and curriculum design. She gained her PhD in English Literature from Durham University in 2022, taught in Durham University’s English Studies Department, and has contributed to a number of publications. Lily specialises in English Literature, English Language, History, and Philosophy.
Get to know Lily
Content Quality Monitored by:
Gabriel Freitas is an AI Engineer with a solid experience in software development, machine learning algorithms, and generative AI, including large language models’ (LLMs) applications. Graduated in Electrical Engineering at the University of São Paulo, he is currently pursuing an MSc in Computer Engineering at the University of Campinas, specializing in machine learning topics. Gabriel has a strong background in software engineering and has worked on projects involving computer vision, embedded AI, and LLM applications.
Get to know Gabriel