Notes/Calculus 2/Solving 1st order ODE.md

181 lines
4.3 KiB
Markdown
Raw Permalink Normal View History

2024-12-07 21:07:38 +01:00
---
date: 11.09.2024
type: math
---
## Separable ODE
- **What is it?**
A **separable ODE** is a type of first-order differential equation where the variables can be separated on opposite sides of the equation. In other words, it can be written in the form:
$$
\frac{dy}{dx} = g(x)h(y),
$$
where the right-hand side is a product of a function of $x$ and a function of $y$. This allows the equation to be rewritten so that all $y$-terms are on one side and all $x$-terms are on the other.
- **What are the solution steps?**
To solve a separable ODE, follow these steps:
1. **Rewrite the equation:** Separate the variables by moving all terms involving $y$ to one side and all terms involving $x$ to the other:
$$
\frac{1}{h(y)} \, dy = g(x) \, dx.
$$
2. **Integrate both sides:** Integrate both sides with respect to their respective variables:
$$
\int \frac{1}{h(y)} \, dy = \int g(x) \, dx.
$$
3. **Solve for $y(x)$:** Find the general solution by solving for $y$ in terms of $x$. This may involve finding an explicit or implicit form.
4. **Apply initial conditions (if any):** If an initial condition is provided (e.g., $y(x_0) = y_0$), substitute it into the general solution to find the particular solution.
**Example:**
Consider the separable ODE:
$$
\frac{dy}{dx} = xy.
$$
Separating variables:
$$
\frac{1}{y} \, dy = x \, dx.
$$
Integrating both sides:
$$
\ln |y| = \frac{x^2}{2} + C.
$$
Solving for $y$, we get:
$$
y(x) = Ce^{x^2/2}.
$$
## Equidimensional (EulerCauchy) Equation
![Solving](https://www.youtube.com/watch?v=zXZ4qmDpblE)
An **Equidimensional (EulerCauchy) equation** is a type of second-order linear differential equation with variable coefficients that are powers of the independent variable $x$. It has the form:
$$
x^2 y'' + ax y' + b y = 0,
$$
where $a$ and $b$ are constants.
- **How do we solve it?**
To solve the EulerCauchy equation:
1. **Use the substitution:** $y = x^m$, where $m$ is a constant to be determined.
2. **Find derivatives:** Compute $y'$ and $y''$ in terms of $m$:
$$
y' = mx^{m-1}, \quad y'' = m(m-1)x^{m-2}.
$$
3. **Substitute into the original equation:** Substitute $y$, $y'$, and $y''$ into the differential equation and simplify.
4. **Solve the characteristic equation:** The resulting equation will be a quadratic in terms of $m$:
$$
m(m-1) + am + b = 0.
$$
Solve this quadratic equation for $m$.
5. **Form the general solution:** Depending on the roots $m_1$ and $m_2$, the general solution will be:
- If $m_1 \neq m_2$: $y(x) = C_1 x^{m_1} + C_2 x^{m_2}$.
- If $m_1 = m_2$: $y(x) = (C_1 + C_2 \ln x) x^{m_1}$.
**Example:**
Solve $x^2 y'' - 4xy' + 6y = 0$.
1. Substitute $y = x^m$, $y' = mx^{m-1}$, and $y'' = m(m-1)x^{m-2}$.
2. The characteristic equation becomes:
$$
m(m-1) - 4m + 6 = 0 \implies m^2 - 5m + 6 = 0.
$$
3. Solving, we find $m_1 = 2$, $m_2 = 3$.
4. The general solution is:
$$
y(x) = C_1 x^2 + C_2 x^3.
$$
## Linear ODEs of Order 1
A **linear ODE of order 1** is a first-order differential equation that can be written in the form:
$$
\frac{dy}{dx} + P(x)y = Q(x),
$$
where $P(x)$ and $Q(x)$ are functions of $x$.
- **What are the rules for finding out if $\epsilon$ is homogeneous?**
An ODE is **homogeneous** if $Q(x) = 0$. Thus, the equation becomes:
$$
\frac{dy}{dx} + P(x)y = 0.
$$
In this case, the solution involves finding an integrating factor:
$$
\mu(x) = e^{\int P(x) \, dx}.
$$
Multiplying through by $\mu(x)$ makes the left side an exact derivative:
$$
\frac{d}{dx} \left( \mu(x) y \right) = 0,
$$
which can then be integrated to solve for $y(x)$.
## Examples of Different Types of Differential Equations
![Types of ODEs and their solutions](https://www.youtube.com/watch?v=ccRJtV6XWQE)
- **Non-linear:**
- An ODE that cannot be written in a linear form, for example:
$$
\frac{dy}{dx} = y^2 + x.
$$
The function $y^2$ makes it nonlinear.
- **Linear, Homogeneous:**
- An ODE where the function and its derivatives appear linearly and the right-hand side is zero:
$$
\frac{d^2y}{dx^2} - 3\frac{dy}{dx} + 2y = 0.
$$
Here, all terms involve $y$ or its derivatives to the first power, and the equation is set to 0.
- **Linear, Non-homogeneous:**
- A linear ODE with a non-zero right-hand side:
$$
\frac{d^2y}{dx^2} - 3\frac{dy}{dx} + 2y = e^x.
$$
The term $e^x$ makes it non-homogeneous.