Migrated
This commit is contained in:
89
Calculus 2/Differential Equations and ODE.md
Normal file
89
Calculus 2/Differential Equations and ODE.md
Normal file
@ -0,0 +1,89 @@
|
||||
---
|
||||
date: 02.09.2024
|
||||
type: math
|
||||
---
|
||||

|
||||
|
||||
## Definitions and Basic Concepts
|
||||
|
||||
### What is a Differential Equation?
|
||||
|
||||
A **differential equation** is an equation that involves an unknown function and its derivatives. It describes how a quantity changes with respect to another (e.g., time, space). Differential equations are widely used in physics, engineering, economics, biology, and many other fields to model various phenomena.
|
||||
|
||||
In mathematical terms, a differential equation can be written in the form:
|
||||
|
||||
$$
|
||||
F\left(x, y, \frac{dy}{dx}, \frac{d^2y}{dx^2}, \ldots\right) = 0,
|
||||
$$
|
||||
|
||||
where $y = y(x)$ is the unknown function, and $\frac{dy}{dx}, \frac{d^2y}{dx^2}, \ldots$ are its derivatives.
|
||||
|
||||
### What is an ODE?
|
||||
|
||||
An **Ordinary Differential Equation (ODE)** is a type of differential equation that involves functions of only one independent variable and its derivatives. The general form of an ODE is:
|
||||
|
||||
$$
|
||||
F\left(x, y, y', y'', \ldots, y^{(n)}\right) = 0,
|
||||
$$
|
||||
|
||||
where $x$ is the independent variable, $y = y(x)$ is the dependent variable, and $y', y'', \ldots, y^{(n)}$ represent the first, second, and $n$-th derivatives of $y$ with respect to $x$.
|
||||
|
||||
**Example:**
|
||||
A simple example of an ODE is the first-order linear ODE:
|
||||
|
||||
$$
|
||||
\frac{dy}{dx} + p(x)y = q(x),
|
||||
$$
|
||||
|
||||
where $p(x)$ and $q(x)$ are given functions.
|
||||
|
||||
### What is a Linear and Homogeneous ODE?
|
||||
|
||||
- A **linear ODE** is an ODE in which the dependent variable $y$ and its derivatives appear to the first power and are not multiplied together. A general $n$-th order linear ODE can be written as:
|
||||
|
||||
$$
|
||||
a_n(x)y^{(n)} + a_{n-1}(x)y^{(n-1)} + \cdots + a_1(x)y' + a_0(x)y = g(x),
|
||||
$$
|
||||
|
||||
where $a_i(x)$ are functions of $x$ and $g(x)$ is a given function.
|
||||
|
||||
- A **homogeneous ODE** is a special type of linear ODE where $g(x) = 0$. The general form is:
|
||||
|
||||
$$
|
||||
a_n(x)y^{(n)} + a_{n-1}(x)y^{(n-1)} + \cdots + a_1(x)y' + a_0(x)y = 0.
|
||||
$$
|
||||
|
||||
**Example:**
|
||||
The second-order homogeneous linear ODE:
|
||||
|
||||
$$
|
||||
y'' - 3y' + 2y = 0
|
||||
$$
|
||||
|
||||
is homogeneous because the right-hand side is zero. It can be solved by finding the characteristic equation and determining the general solution.
|
||||
|
||||
### What is a Particular Solution of ODEs?
|
||||
|
||||
A **particular solution** of an ODE is a specific solution that satisfies both the differential equation and any given initial or boundary conditions. It is different from the **general solution**, which contains arbitrary constants that represent the family of all possible solutions to the differential equation.
|
||||
|
||||
To find a particular solution, you substitute the initial or boundary conditions into the general solution and solve for the arbitrary constants.
|
||||
|
||||
**Example:**
|
||||
Consider the ODE:
|
||||
|
||||
$$
|
||||
y'' - 3y' + 2y = 0.
|
||||
$$
|
||||
|
||||
The general solution is:
|
||||
|
||||
$$
|
||||
y(x) = C_1 e^{2x} + C_2 e^x,
|
||||
$$
|
||||
|
||||
where $C_1$ and $C_2$ are arbitrary constants. If we are given initial conditions $y(0) = 1$ and $y'(0) = 0$, we can substitute these into the general solution to find the values of $C_1$ and $C_2$, giving us a **particular solution**.
|
||||
|
||||
**Steps to find a Particular Solution:**
|
||||
1. Find the general solution of the ODE.
|
||||
2. Use the given initial or boundary conditions to determine the values of the arbitrary constants in the general solution.
|
||||
3. Substitute these values back into the general solution to get the particular solution.
|
89
Calculus 2/Integral Curves and the Cauchy problem.md
Normal file
89
Calculus 2/Integral Curves and the Cauchy problem.md
Normal file
@ -0,0 +1,89 @@
|
||||
---
|
||||
date: 04.09.2024
|
||||
type: math
|
||||
---
|
||||
|
||||

|
||||
## Integral Curve
|
||||
- **What is it?**
|
||||
|
||||
An **integral curve** of a vector field is a curve that is tangent to the vector field at every point. In simpler terms, given a vector field (which can be thought of as arrows pointing in various directions), an integral curve is a path that follows the directions of these arrows.
|
||||
|
||||

|
||||
|
||||
For a vector field $\mathbf{F}(x, y) = (P(x, y), Q(x, y))$ in 2D, an integral curve $\mathbf{r}(t) = (x(t), y(t))$ is a solution to the system of ordinary differential equations:
|
||||
|
||||
$$
|
||||
\frac{dx}{dt} = P(x(t), y(t)), \quad \frac{dy}{dt} = Q(x(t), y(t)).
|
||||
$$
|
||||
|
||||
**Example:**
|
||||
Consider a simple vector field defined by $\mathbf{F}(x, y) = (y, -x)$. The integral curves of this field are solutions to the differential equations:
|
||||
|
||||
$$
|
||||
\frac{dx}{dt} = y, \quad \frac{dy}{dt} = -x.
|
||||
$$
|
||||
|
||||
Solving this system, we get solutions of the form:
|
||||
|
||||
$$
|
||||
x(t) = A \cos(t) + B \sin(t), \quad y(t) = -A \sin(t) + B \cos(t),
|
||||
$$
|
||||
|
||||
which represent circles centered at the origin.
|
||||
|
||||
## Cauchy Problem
|
||||
|
||||

|
||||
The Cauchy problem is a fundamental concept in the study of partial differential equations (PDEs[^1]}). It refers to the problem of finding a solution to a PDE given initial conditions along a certain hypersurface[^2].
|
||||
|
||||
- **How do we solve it?**
|
||||
|
||||
To solve a Cauchy problem for a PDE, we generally follow these steps:
|
||||
|
||||
1. **Formulate the PDE and Initial Conditions:**
|
||||
Define the PDE and the initial conditions. The initial conditions are given on a hypersurface, such as a line (in 2D) or a plane (in 3D). For example, consider the wave equation in one dimension:
|
||||
|
||||
$$
|
||||
\frac{\partial^2 u}{\partial t^2} - c^2 \frac{\partial^2 u}{\partial x^2} = 0.
|
||||
$$
|
||||
|
||||
The initial conditions could be:
|
||||
|
||||
$$
|
||||
u(x, 0) = f(x), \quad \frac{\partial u}{\partial t}(x, 0) = g(x),
|
||||
$$
|
||||
|
||||
where$f(x)$and$g(x)$are given functions.
|
||||
|
||||
2. **Find a General Solution:**
|
||||
Solve the PDE using a method that applies to the type of PDE (e.g., separation of variables, Fourier transforms, or characteristic methods). For the wave equation, the general solution can be written using d'Alembert's formula:
|
||||
|
||||
$$
|
||||
u(x, t) = \frac{1}{2} \left( f(x - ct) + f(x + ct) \right) + \frac{1}{2c} \int_{x - ct}^{x + ct} g(s) \, ds.
|
||||
$$
|
||||
|
||||
3. **Apply the Initial Conditions:**
|
||||
Substitute the initial conditions into the general solution to find specific forms of the arbitrary functions or constants.
|
||||
|
||||
4. **Verify the Solution:**
|
||||
Check that the obtained solution satisfies both the PDE and the initial conditions.
|
||||
|
||||
**Example:**
|
||||
For the heat equation in one dimension:
|
||||
|
||||
$$
|
||||
\frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2},
|
||||
$$
|
||||
|
||||
with initial condition$u(x, 0) = f(x)$, the solution is:
|
||||
|
||||
$$
|
||||
u(x, t) = \frac{1}{\sqrt{4 \pi \alpha t}} \int_{-\infty}^\infty e^{-\frac{(x - \xi)^2}{4 \alpha t}} f(\xi) \, d\xi,
|
||||
$$
|
||||
|
||||
which uses a convolution of the initial condition$f(x)$with a Gaussian kernel.
|
||||
|
||||
|
||||
[^1]: Partial differential equation
|
||||
[^2]: A **hypersurface** is a generalization of the concept of a surface to higher dimensions. Similar to matrices in linear algebra. In 3D, it's a plane, in 2D it's a curve/line.
|
132
Calculus 2/Linear ODEs.md
Normal file
132
Calculus 2/Linear ODEs.md
Normal file
@ -0,0 +1,132 @@
|
||||
---
|
||||
date: 09.09.2024
|
||||
type: math
|
||||
---
|
||||
|
||||
## Method of Variation of Constants
|
||||

|
||||
The **method of variation of constants** is a technique used to find a particular solution to a non-homogeneous linear differential equation. This method generalizes the solution of homogeneous equations by allowing the constants in the general solution to vary as functions of the independent variable.
|
||||
|
||||
Notice how it's similar to [Recurrence relations](Discrete%20Structures/Recurrence%20relations.md)
|
||||
|
||||
|
||||
1. **Solve the homogeneous equation:** Start by solving the associated homogeneous differential equation. For an ODE of the form:
|
||||
|
||||
$$
|
||||
y'' + p(x)y' + q(x)y = g(x),
|
||||
$$
|
||||
|
||||
solve the homogeneous part:
|
||||
|
||||
$$
|
||||
y'' + p(x)y' + q(x)y = 0.
|
||||
$$
|
||||
|
||||
The general solution to the homogeneous equation will be:
|
||||
|
||||
$$
|
||||
y_h(x) = C_1 y_1(x) + C_2 y_2(x),
|
||||
$$
|
||||
|
||||
where $y_1(x)$ and $y_2(x)$ are linearly independent solutions.
|
||||
|
||||
2. **Replace constants with functions:** Replace the constants $C_1$ and $C_2$ with functions $u_1(x)$ and $u_2(x)$:
|
||||
|
||||
$$
|
||||
y_p(x) = u_1(x)y_1(x) + u_2(x)y_2(x).
|
||||
$$
|
||||
|
||||
3. **Set up equations for $u_1(x)$ and $u_2(x)$:** Differentiate $y_p(x)$ and use the condition that $u_1'(x)y_1(x) + u_2'(x)y_2(x) = 0$ to avoid second derivatives of $u_1(x)$ and $u_2(x)$. This gives:
|
||||
|
||||
$$
|
||||
u_1'(x)y_1(x) + u_2'(x)y_2(x) = 0,
|
||||
$$
|
||||
$$
|
||||
u_1'(x)y_1'(x) + u_2'(x)y_2'(x) = g(x).
|
||||
$$
|
||||
|
||||
4. **Solve for $u_1'(x)$ and $u_2'(x)$:** Solve this system of equations to find $u_1'(x)$ and $u_2'(x)$.
|
||||
|
||||
5. **Integrate to find $u_1(x)$ and $u_2(x)$:** Integrate to find $u_1(x)$ and $u_2(x)$.
|
||||
|
||||
6. **Form the particular solution:** The particular solution is:
|
||||
|
||||
$$
|
||||
y_p(x) = u_1(x)y_1(x) + u_2(x)y_2(x).
|
||||
$$
|
||||
|
||||
## Bernoulli Equation
|
||||

|
||||

|
||||
|
||||
A **Bernoulli equation** is a type of first-order nonlinear differential equation of the form:
|
||||
|
||||
$$
|
||||
\frac{dy}{dx} + P(x)y = Q(x)y^n,
|
||||
$$
|
||||
|
||||
where $n \neq 0, 1$.
|
||||
|
||||
- **When and how do we apply it?**
|
||||
|
||||
To solve a Bernoulli equation:
|
||||
|
||||
1. **Divide through by $y^n$:**
|
||||
|
||||
$$
|
||||
y^{-n} \frac{dy}{dx} + P(x)y^{1-n} = Q(x).
|
||||
$$
|
||||
|
||||
2. **Make a substitution:** Let $v = y^{1-n}$. Then $\frac{dv}{dx} = (1-n)y^{-n} \frac{dy}{dx}$.
|
||||
|
||||
3. **Rewrite the equation in terms of $v$:**
|
||||
|
||||
$$
|
||||
\frac{dv}{dx} + (1-n)P(x)v = (1-n)Q(x).
|
||||
$$
|
||||
|
||||
This is now a linear differential equation in $v(x)$.
|
||||
|
||||
4. **Solve the linear ODE for $v$:**
|
||||
|
||||
Use an integrating factor to solve for $v(x)$.
|
||||
|
||||
5. **Substitute back to find $y(x)$:**
|
||||
|
||||
Since $v = y^{1-n}$, solve for $y(x)$.
|
||||
|
||||
## Riccati Equation
|
||||

|
||||
|
||||
A **Riccati equation** is a first-order nonlinear differential equation of the form:
|
||||
|
||||
$$
|
||||
\frac{dy}{dx} = a(x) + b(x)y + c(x)y^2.
|
||||
$$
|
||||
|
||||
- **When do we use it?**
|
||||
|
||||
Riccati equations are used in various fields such as control theory and fluid dynamics. They can sometimes be solved by making an appropriate substitution if a particular solution is known. In general, Riccati equations do not have a straightforward general solution like linear ODEs.
|
||||
|
||||
## $n \geq 2$ Linear ODE
|
||||
|
||||

|
||||
- **What do we do with those?**
|
||||
|
||||
For linear ODEs of order $n \geq 2$, we typically look for a general solution that is a linear combination of $n$ linearly independent solutions.
|
||||
|
||||
### General Properties of Spaces of Solutions of such $\epsilon$
|
||||
|
||||
- **Linear dependence:** Solutions $y_1(x), y_2(x), \ldots, y_n(x)$ are linearly independent if no solution can be written as a linear combination of the others.
|
||||
|
||||
- **Dimension:** The solution space of a linear homogeneous ODE of order $n$ has dimension $n$.
|
||||
|
||||
- **Fundamental theorem:** If $y_1(x), y_2(x), \ldots, y_n(x)$ are $n$ linearly independent solutions to an $n$-th order linear homogeneous ODE, then any solution can be written as:
|
||||
|
||||
$$
|
||||
y(x) = C_1 y_1(x) + C_2 y_2(x) + \cdots + C_n y_n(x),
|
||||
$$
|
||||
|
||||
where $C_1, C_2, \ldots, C_n$ are constants.
|
||||
|
||||
- **Structure of the space:** The space of solutions is a vector space, where each solution can be represented as a linear combination of a set of basis solutions.
|
29
Calculus 2/Non-homogeneous ODE.md
Normal file
29
Calculus 2/Non-homogeneous ODE.md
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
type: math
|
||||
---
|
||||
## Finding particular solutions
|
||||
|
||||
### Definitions
|
||||
|
||||
- RHS $f(x) = P_{deg}(x) \cdot e^{rx}, p\in \mathbb{R}[x]$
|
||||
- P is a polynomial
|
||||
- Of **first kind**
|
||||
- i.e. $e^{-3x}$; $2x^2+x -3$; $xe^x$
|
||||
- RHS $f(x) = e^{rx} \cdot [P_{deg}(x)\\cdot \cos qx + Q_{deg_{2}}(x)\cdot \sin qx]$
|
||||
- P, Q are polynomials
|
||||
- Of **second kind**
|
||||
- i.e. $2\cos x-\sin x$;$x^2e^{-x}\cos 2x$
|
||||
- A "constant" is a polynomial of degree 0
|
||||
|
||||
##### Hyperbolic sin ($\sinh$)
|
||||
Just as a fun fact, it doesn't fit neither of the kinds.
|
||||
$$
|
||||
\sinh x = \frac{e^x - e^{-x}}{2}
|
||||
$$
|
||||
### Method of undetermined coeffs
|
||||
- RHS of 1st kind
|
||||
- There exists a particular solution of the form
|
||||
$$
|
||||
y_{*}(x) = x^s \cdot R_{m}(x)\cdot e^{rx}
|
||||
$$
|
||||
- Where $s \rightarrow^{\text{{def}}} \text{multiplicity } r\in \mathbb{R}$ among the roots of characteristic polynomials for the LHS of the equation
|
181
Calculus 2/Solving 1st order ODE.md
Normal file
181
Calculus 2/Solving 1st order ODE.md
Normal file
@ -0,0 +1,181 @@
|
||||
---
|
||||
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 (Euler–Cauchy) Equation
|
||||

|
||||
|
||||
An **Equidimensional (Euler–Cauchy) 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 Euler–Cauchy 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
|
||||

|
||||
|
||||
- **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.
|
BIN
Calculus 2/assets/Integral Curve in a Vector field.png
Normal file
BIN
Calculus 2/assets/Integral Curve in a Vector field.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user