Content On This Page | ||
---|---|---|
Linear Differential Equations of First Order: Standard Form | Integrating Factor | Method of Solving Linear Differential Equations |
Solving Linear Differential Equations
Linear Differential Equations of First Order: Standard Form
Differential equations can be classified based on various characteristics, including their order and linearity. Linearity is a property related to how the dependent variable and its derivatives appear in the equation. A specific class of first-order differential equations is the first-order linear ODE, which has a well-established method of solution.
Definition of a Linear Differential Equation
A differential equation is said to be linear if the dependent variable ($y$) and all its derivatives ($y', y'', \dots, y^{(n)}$) appear only to the first power (exponent of 1) and are not multiplied together (e.g., no terms like $y \cdot y'$ or $(y')^2$) or involved in non-linear functions (e.g., no terms like $\sin(y)$, $e^y$, $\sqrt{y'}$). The coefficients of the dependent variable and its derivatives can be functions of the independent variable(s) only.
A first-order linear differential equation is a differential equation involving only the independent variable ($x$), the dependent variable ($y$), and the first derivative ($\frac{dy}{dx}$ or $y'$), and it must be linear in $y$ and $y'$.
Standard Form of a First-Order Linear Differential Equation
Any first-order linear ordinary differential equation can be uniquely written in a specific form called the standard form. This form is essential because the method of solution for this type of equation depends on it.
The standard form for a first-order linear differential equation is:
$\frac{dy}{dx} + P(x) y = Q(x)$
where:
- $\frac{dy}{dx}$ is the first derivative of the dependent variable $y$ with respect to the independent variable $x$.
- $P(x)$ is a function of the independent variable $x$ only (or a constant). This function is the coefficient of the $y$ term.
- $Q(x)$ is a function of the independent variable $x$ only (or a constant). This function is on the right-hand side of the equation and is sometimes called the "forcing function" or "input function".
Key Characteristics of the Standard Form:
- The term with the highest derivative, $\frac{dy}{dx}$, must have a coefficient of 1. If the original equation has a coefficient for $\frac{dy}{dx}$, you must divide the entire equation by that coefficient (assuming it's non-zero) to get it into standard form.
- The dependent variable $y$ appears only to the first power, multiplied by a coefficient that is a function of $x$ only, $P(x)$.
- There are no terms involving products of $y$ and its derivative (like $y \frac{dy}{dx}$).
- There are no terms involving derivatives raised to powers greater than one (like $(\frac{dy}{dx})^2$).
- There are no terms involving non-linear functions of $y$ or its derivatives (like $e^y$, $\sin y$, $\ln(y')$, etc.).
- The term $Q(x)$ on the right side depends only on $x$.
Being able to recognize a first-order ODE and write it in this standard form is the first step to solving it using the standard method.
Examples of First-Order Linear and Non-Linear ODEs
Let's examine some examples to distinguish linear from non-linear first-order ODEs and to practice writing linear ones in standard form.
- $\frac{dy}{dx} + 2xy = x^3$
This equation matches the standard form $\frac{dy}{dx} + P(x)y = Q(x)$ directly. $P(x) = 2x$ and $Q(x) = x^3$. Both are functions of $x$ only. The equation is linear in $y$ and $\frac{dy}{dx}$. This is a linear first-order ODE.
- $x \frac{dy}{dx} - y = x^2$
This equation is linear in $y$ and $\frac{dy}{dx}$, but it's not in standard form because the coefficient of $\frac{dy}{dx}$ is $x$. To put it in standard form, divide the entire equation by $x$ (assuming $x \neq 0$):
"$\frac{1}{x} \left( x \frac{dy}{dx} - y \right) = \frac{x^2}{x}$"
[Divide by $x$]
"$\frac{dy}{dx} - \frac{1}{x} y = x$"
[Standard form]
This is now in standard form with $P(x) = -\frac{1}{x}$ and $Q(x) = x$. $P(x)$ and $Q(x)$ are functions of $x$ only (defined for $x \neq 0$). This is a linear first-order ODE.
- $\frac{dy}{dx} + y^2 = x$
This equation contains the term $y^2$, where the dependent variable $y$ is raised to the power of 2. This violates the condition that $y$ must appear only to the first power in a linear equation. Therefore, this equation is not linear.
- $\frac{dy}{dx} + \sin y = x$
This equation contains the term $\sin y$. The dependent variable $y$ is involved in a non-linear function ($\sin y$). This violates the condition for linearity. Therefore, this equation is not linear.
- $\frac{dy}{dx} + \sin x \cdot y = \cos x$
This equation matches the standard form $\frac{dy}{dx} + P(x)y = Q(x)$ directly. $P(x) = \sin x$ and $Q(x) = \cos x$. Both are functions of $x$ only. The equation is linear in $y$ and $\frac{dy}{dx}$. This is a linear first-order ODE.
Alternative Form: Linear in $x$ as the Dependent Variable
Sometimes, a differential equation might not be linear if we consider $y$ as the dependent variable, but it might be linear if we consider $x$ as the dependent variable and $y$ as the independent variable. In this case, the equation involves $\frac{dx}{dy}$ and $x$, and it is linear in $x$ and $\frac{dx}{dy}$. The standard form for such an equation is:
$\frac{dx}{dy} + P(y) x = Q(y)$
where $P(y)$ and $Q(y)$ are functions of the independent variable $y$ only (or constants).
Example: The equation $\frac{dy}{dx} = \frac{1}{x + y^2}$ is not linear in $y$. However, if we take the reciprocal of both sides (assuming $\frac{dy}{dx} \neq 0$), we get $\frac{dx}{dy} = x + y^2$. Rearranging gives $\frac{dx}{dy} - x = y^2$. This is in the form $\frac{dx}{dy} + P(y)x = Q(y)$ with $P(y) = -1$ and $Q(y) = y^2$. This is a first-order linear ODE in $x$ as the dependent variable.
Recognizing when an equation is linear and writing it in the correct standard form is the crucial first step towards applying the standard solution method for linear first-order ODEs.
Integrating Factor
The standard form of a first-order linear differential equation, $\frac{dy}{dx} + P(x) y = Q(x)$, has a specific method of solution that involves multiplying the entire equation by a specially chosen function called the integrating factor. The purpose of the integrating factor is to transform the left-hand side of the equation into the derivative of a product, making the equation directly integrable.
Purpose of the Integrating Factor
The goal is to find a function, let's call it $I(x)$, such that when we multiply the standard linear ODE by $I(x)$, the left side becomes the result of the Product Rule applied to a product involving $y$ and $I(x)$. Specifically, we want to find $I(x)$ such that:
$I(x) \left( \frac{dy}{dx} + P(x) y \right) = \frac{d}{dx} [y \cdot I(x)]$
If we can achieve this, the original differential equation, after multiplying by $I(x)$, becomes:
$\frac{d}{dx} [y \cdot I(x)] = I(x) Q(x)$
This transformed equation is directly integrable because the left side is a perfect derivative. Integrating both sides with respect to $x$ will then allow us to solve for $y \cdot I(x)$, and subsequently for $y$.
Derivation of the Integrating Factor Formula
To find the function $I(x)$ that satisfies the condition $I(x) \left( \frac{dy}{dx} + P(x) y \right) = \frac{d}{dx} [y \cdot I(x)]$, let's expand the right side of the desired equality using the Product Rule for differentiation:
"$\frac{d}{dx}[y \cdot I(x)] = y \cdot \frac{dI}{dx} + I(x) \cdot \frac{dy}{dx}$"
[Using Product Rule]
Now, set this equal to the left side of the desired condition, $I(x) \frac{dy}{dx} + I(x) P(x) y$:
"$I(x) \frac{dy}{dx} + I(x) P(x) y = y \frac{dI}{dx} + I(x) \frac{dy}{dx}$"
[Setting sides equal]
Notice that the term $I(x) \frac{dy}{dx}$ appears on both sides of the equation. We can cancel this term from both sides:
"$I(x) P(x) y = y \frac{dI}{dx}$"
[Canceling term]
This equation must hold for any function $y$ that is a solution to the original differential equation. Assuming $y \neq 0$ (if $y=0$ is a solution, it is usually a trivial case covered by the general solution), we can divide both sides by $y$:
"$I(x) P(x) = \frac{dI}{dx}$"
[Dividing by $y$]
This is a first-order variable separable differential equation for the integrating factor $I(x)$ as a function of $x$. We can solve it by separating $I$ and $x$ terms. Divide by $I(x)$ and multiply by $dx$ (assuming $I(x) \neq 0$, which it will be since it's an exponential):
"$\frac{dI}{I(x)} = P(x) dx$"
[Separating variables]
Now, integrate both sides:
"$\int \frac{dI}{I} = \int P(x) dx$"
[Integrating both sides]
The integral on the left side is a standard logarithmic integral. Let $F(x) = \int P(x) dx$ be an antiderivative of $P(x)$.
"$\ln |I| = \int P(x) dx + C_1$"
[Performing integration, $C_1$ is integration constant]
To solve for $I$, exponentiate both sides using the base $e$:
"$|I| = e^{\int P(x) dx + C_1} = e^{\int P(x) dx} \cdot e^{C_1}$"
[Exponentiating both sides]
So, $I = \pm e^{C_1} e^{\int P(x) dx}$. Let $A = \pm e^{C_1}$. Since $e^{C_1}$ is a positive constant, $A$ is an arbitrary non-zero constant. $I(x) = A e^{\int P(x) dx}$.
We are looking for *an* integrating factor that works. Any non-zero constant multiple of an integrating factor is also an integrating factor. To find the simplest one, we can choose the constant $A=1$. Also, since $e^{\text{anything}}$ is always positive, the absolute value $|I|$ is equal to $I$ if we choose the positive sign for $A=1$.
Formula for the Integrating Factor
By choosing the arbitrary constant $A=1$ in the derivation, we get the standard formula for the integrating factor $I(x)$ for the linear differential equation $\frac{dy}{dx} + P(x) y = Q(x)$:
$I(x) = e^{\int P(x) dx}$
Note on the Constant of Integration for $\int P(x) dx$: When calculating the integral $\int P(x) dx$ to find the integrating factor, we do **not** need to include a constant of integration here. If we were to include a constant $C_2$, the integrating factor would be $e^{\int P(x) dx + C_2} = e^{\int P(x) dx} \cdot e^{C_2}$. This is just a constant multiple of the standard integrating factor $e^{\int P(x) dx}$. Multiplying the differential equation by $e^{C_2} e^{\int P(x) dx}$ results in an equation that is still directly integrable, but the arbitrary constant $e^{C_2}$ will simply factor out and cancel later in the process. Therefore, we choose the simplest form by taking the constant of integration for $\int P(x) dx$ to be zero.
The integrating factor $I(x)$ is used in the next step to solve the linear differential equation.
Method of Solving Linear Differential Equations
The standard method for solving a first-order linear differential equation, $\frac{dy}{dx} + P(x) y = Q(x)$, involves using the integrating factor. The integrating factor transforms the equation into a form that is directly integrable, allowing us to find the general solution.
Steps for Solving $\frac{dy}{dx} + P(x) y = Q(x)$ using the Integrating Factor
To solve a first-order linear differential equation, follow these steps:
- Write the Equation in Standard Form: Ensure the given differential equation is written in the standard form $\frac{dy}{dx} + P(x) y = Q(x)$. This involves isolating $\frac{dy}{dx}$ and making its coefficient equal to 1 by dividing the entire equation by the coefficient of $\frac{dy}{dx}$ if necessary. Identify the functions $P(x)$ and $Q(x)$ from this standard form. $P(x)$ is the coefficient of $y$, and $Q(x)$ is the term on the right-hand side.
- Calculate the Integrating Factor (IF): Find the integrating factor $I(x)$ using the formula derived in the previous section:
$I(x) = e^{\int P(x) dx}$
To calculate this, first find the indefinite integral of $P(x)$ with respect to $x$, $\int P(x) dx$. You do **not** need to add the constant of integration $+C$ when evaluating this integral for the integrating factor, as any arbitrary constant here will simply result in a constant multiple of the integrating factor, which does not affect the final solution method.
- Multiply the Standard Equation by the Integrating Factor: Multiply both sides of the standard form of the differential equation (from Step 1) by the integrating factor $I(x)$ calculated in Step 2:
$I(x) \left( \frac{dy}{dx} + P(x) y \right) = I(x) Q(x)$
- Recognize the Left Side as the Derivative of a Product: By the way the integrating factor was derived, the left-hand side of the equation obtained in Step 3 is guaranteed to be the exact derivative of the product of the dependent variable $y$ and the integrating factor $I(x)$:
$\frac{d}{dx}[y \cdot I(x)] = I(x) Q(x)$
- Integrate Both Sides with Respect to $x$: Integrate both sides of the equation from Step 4 with respect to the independent variable $x$:
$\int \frac{d}{dx}[y \cdot I(x)] dx = \int I(x) Q(x) dx$
On the left side, the integral of a derivative of a function simply gives back the function itself (up to a constant, which we add to the right side). On the right side, you need to evaluate the integral of the product of the integrating factor and $Q(x)$.
$y \cdot I(x) = \int I(x) Q(x) dx + C$
Now, you **must** add the constant of integration $C$ to the right-hand side. This is the arbitrary constant that will appear in the general solution.
- Solve for $y$: Obtain the explicit general solution for the dependent variable $y$ by dividing both sides of the equation from Step 5 by the integrating factor $I(x)$:
$y = \frac{1}{I(x)} \left[ \int I(x) Q(x) dx + C \right]$
This equation represents the general solution of the first-order linear differential equation.
- Apply Initial/Boundary Condition (if given): If an initial condition (e.g., $y(x_0)=y_0$) or a boundary condition is provided, substitute the values of $x$ and $y$ from the condition into the general solution (Step 6) and solve for the specific value of the arbitrary constant $C$. Substitute this value of $C$ back into the general solution to obtain the particular solution.
Example 1. Solve the differential equation $\frac{dy}{dx} - \frac{1}{x} y = x$.
Answer:
Step 1: Write in Standard Form and Identify $P(x)$ and $Q(x)$.
The given differential equation is $\frac{dy}{dx} - \frac{1}{x} y = x$. This equation is already in the standard form $\frac{dy}{dx} + P(x) y = Q(x)$.
By comparing, we identify $P(x)$ and $Q(x)$:
"$P(x) = -\frac{1}{x}$"
"$Q(x) = x$"
Note that $P(x)$ is defined for $x \neq 0$. The solution will be valid on an interval where $x \neq 0$ (either $x>0$ or $x<0$).
Step 2: Calculate the Integrating Factor (IF).
The integrating factor is $I(x) = e^{\int P(x) dx}$. We first find the integral $\int P(x) dx$:
"$\int P(x) dx = \int -\frac{1}{x} dx = - \int \frac{1}{x} dx$"
[Constant Multiple Rule]
Using the standard integral $\int \frac{1}{x} dx = \ln |x|$ (we omit the $+C$ here as per the method):
"$= -\ln|x|$"
Using the logarithm property $n \ln u = \ln (u^n)$:
"$= \ln|x|^{-1} = \ln\left|\frac{1}{x}\right|$"
[Logarithm property]
Now, substitute this into the formula for $I(x)$:
"$I(x) = e^{\int P(x) dx} = e^{\ln|1/x|}$"
Using the property $e^{\ln u} = u$ for $u > 0$: $I(x) = |1/x|$. We can choose the simplest form of the integrating factor by taking $1/x$, which corresponds to the case $x>0$. If we considered $x<0$, $|1/x| = -1/x$, and the factor would be $-1/x$, which is a constant multiple of $1/x$. For simplicity, we use $I(x) = \frac{1}{x}$.
"$I(x) = \frac{1}{x}$"
[Integrating factor (valid for $x>0$ or $x<0$ up to a sign)]
Step 3: Multiply the Standard Equation by the Integrating Factor.
Multiply both sides of the standard equation $\frac{dy}{dx} - \frac{1}{x} y = x$ by the integrating factor $I(x) = \frac{1}{x}$:
"$\frac{1}{x} \left(\frac{dy}{dx} - \frac{1}{x} y\right) = \frac{1}{x} (x)$"
[Multiply by $I(x)$]
Distribute $\frac{1}{x}$ on the left side and simplify the right side:
"$\frac{1}{x} \frac{dy}{dx} - \frac{1}{x^2} y = 1$"
Step 4: Recognize the Left Side as the Derivative of a Product.
The left side of the equation obtained in Step 3 is specifically constructed to be the derivative of the product of $y$ and the integrating factor $I(x) = \frac{1}{x}$.
"$\frac{d}{dx}\left(y \cdot \frac{1}{x}\right) = \frac{d}{dx}\left(\frac{y}{x}\right)$"
Let's verify this using the Quotient Rule: $\frac{d}{dx}\left(\frac{y}{x}\right) = \frac{x (dy/dx) - y (d/dx(x))}{x^2} = \frac{x (dy/dx) - y(1)}{x^2} = \frac{1}{x} \frac{dy}{dx} - \frac{y}{x^2}$. This indeed matches the left side.
So, the equation from Step 3 can be written as:
"$\frac{d}{dx}\left(\frac{y}{x}\right) = 1$"
[Left side is a perfect derivative]
Step 5: Integrate Both Sides with Respect to $x$.
Integrate both sides of the equation from Step 4 with respect to $x$. The integral of the derivative on the left gives the function inside.
"$\int \frac{d}{dx}\left(\frac{y}{x}\right) dx = \int 1 dx$"
[Integrate both sides]
Evaluate the integrals:
"$\frac{y}{x} = x + C$"
[Perform integration, add $C$]
Here, $C$ is the arbitrary constant of integration.
Step 6: Solve for $y$.
Multiply both sides by $x$ to isolate $y$ and obtain the explicit general solution:
"$y = x(x + C)$"
"$y = x^2 + Cx$"
The general solution to the differential equation $\frac{dy}{dx} - \frac{1}{x} y = x$ is $y = x^2 + Cx$ (for $x \neq 0$).
Example 2. Solve the differential equation $x \frac{dy}{dx} + 2y = x^2 \log x$ for $x > 0$.
Answer:
Step 1: Write in Standard Form and Identify $P(x)$ and $Q(x)$.
The given equation is $x \frac{dy}{dx} + 2y = x^2 \log x$. Assuming $\log x$ denotes the natural logarithm $\ln x$ (which is standard in calculus unless specified otherwise, and given $x>0$), the equation is $x \frac{dy}{dx} + 2y = x^2 \ln x$.
To get this into standard form $\frac{dy}{dx} + P(x) y = Q(x)$, we must divide the entire equation by the coefficient of $\frac{dy}{dx}$, which is $x$. Since the problem specifies $x>0$, this division is valid.
"$\frac{1}{x} \left(x \frac{dy}{dx} + 2y\right) = \frac{1}{x} (x^2 \ln x)$"
[Divide by $x$]
"$\frac{dy}{dx} + \frac{2}{x} y = x \ln x$"
[Standard form]
By comparing with the standard form, we identify $P(x)$ and $Q(x)$:
"$P(x) = \frac{2}{x}$"
"$Q(x) = x \ln x$"
Step 2: Calculate the Integrating Factor (IF).
The integrating factor is $I(x) = e^{\int P(x) dx}$. We first find the integral $\int P(x) dx$ for $x > 0$:
"$\int P(x) dx = \int \frac{2}{x} dx = 2 \int \frac{1}{x} dx$"
Using the standard integral $\int \frac{1}{x} dx = \ln |x|$ (since $x>0$, $\ln|x|=\ln x$; omit $+C$):
"$= 2 \ln x$"
Using the logarithm property $n \ln u = \ln (u^n)$:
"$= \ln(x^2)$"
[Logarithm property]
Now, substitute this into the formula for $I(x)$:
"$I(x) = e^{\int P(x) dx} = e^{\ln(x^2)}$"
Using the property $e^{\ln u} = u$:
"$I(x) = x^2$"
Step 3: Multiply the Standard Equation by the Integrating Factor.
Multiply both sides of the standard equation $\frac{dy}{dx} + \frac{2}{x} y = x \ln x$ by $I(x) = x^2$:
"$x^2 \left(\frac{dy}{dx} + \frac{2}{x} y\right) = x^2 (x \ln x)$"
[Multiply by $I(x)$]
Distribute $x^2$ on the left side and simplify the right side:
"$x^2 \frac{dy}{dx} + 2x y = x^3 \ln x$"
Step 4: Recognize the Left Side as the Derivative of a Product.
The left side of the equation from Step 3 is $\frac{d}{dx}[y \cdot I(x)] = \frac{d}{dx}[y \cdot x^2] = \frac{d}{dx}(y x^2)$.
Let's verify this using the Product Rule: $\frac{d}{dx}(y x^2) = \frac{dy}{dx} x^2 + y \frac{d}{dx}(x^2) = x^2 \frac{dy}{dx} + y (2x) = x^2 \frac{dy}{dx} + 2xy$. This matches the left side.
So, the equation from Step 3 can be written as:
"$\frac{d}{dx}(y x^2) = x^3 \ln x$"
[Left side is a perfect derivative]
Step 5: Integrate Both Sides with Respect to $x$.
Integrate both sides of the equation from Step 4 with respect to $x$. The integral of the derivative on the left gives the function inside.
"$\int \frac{d}{dx}(y x^2) dx = \int x^3 \ln x dx$"
[Integrate both sides]
The left side is simply $y x^2$. For the right side, we need to evaluate the integral $\int x^3 \ln x dx$. This requires Integration by Parts. Let $u = \ln x$ and $dv = x^3 dx$ (using LIATE rule: Logarithmic before Algebraic).
- $u = \ln x \implies du = \frac{1}{x} dx$.
- $dv = x^3 dx \implies v = \int x^3 dx = \frac{x^4}{4}$.
Apply the Integration by Parts formula $\int u dv = uv - \int v du$:
"$\int x^3 \ln x dx = (\ln x)\left(\frac{x^4}{4}\right) - \int \left(\frac{x^4}{4}\right) \left(\frac{1}{x} dx\right)$"
$= \frac{x^4 \ln x}{4} - \int \frac{x^3}{4} dx$"
[Simplify the new integrand]
Evaluate the remaining integral:
$= \frac{x^4 \ln x}{4} - \frac{1}{4} \int x^3 dx = \frac{x^4 \ln x}{4} - \frac{1}{4} \left(\frac{x^4}{4}\right)$"
$= \frac{x^4 \ln x}{4} - \frac{x^4}{16}$"
Now, equate the left side of Step 5 with the evaluated right side integral and add the constant of integration $C$:
"$y x^2 = \frac{x^4 \ln x}{4} - \frac{x^4}{16} + C$"
[Result after integration, add $C$]
Step 6: Solve for $y$.
Divide the entire equation by $x^2$ to solve for $y$ (assuming $x \neq 0$, which is given $x>0$):
"$y = \frac{1}{x^2} \left( \frac{x^4 \ln x}{4} - \frac{x^4}{16} + C \right)$"
[Divide by $x^2$]
Distribute $\frac{1}{x^2}$:
"$y = \frac{x^4 \ln x}{4x^2} - \frac{x^4}{16x^2} + \frac{C}{x^2}$"
Simplify the terms:
"$y = \frac{x^2 \ln x}{4} - \frac{x^2}{16} + Cx^{-2}$"
The general solution for $x > 0$ is $y = \frac{x^2 \ln x}{4} - \frac{x^2}{16} + Cx^{-2}$.