# 微積分學/常微分方程

${\displaystyle \int f(x)\mathrm {d} x=g(x)}$

${\displaystyle g'(x)=f(x)\,}$

## 符號和術語

• ${\displaystyle \mathrm {D} y}$
• ${\displaystyle f'}$
• ${\displaystyle \mathrm {d} f}$
• ${\displaystyle {\mathrm {d} f \over \mathrm {d} x}}$（用於可分離變量方程）

### 術語

${\displaystyle 3f^{\prime \prime }(x)+5xf(x)=11}$

## 一些簡單的微分方程

${\displaystyle f''(x)=2\,}$

${\displaystyle \int f''(x)\,dx=\int 2\,dx}$
${\displaystyle f'(x)=2x+C_{1}\,}$

${\displaystyle f'(x)=2x+C_{1}\,}$

${\displaystyle \int f'(x)\,dx=\int 2x+C_{1}\,dx}$
${\displaystyle f(x)=x^{2}+C_{1}x+C_{2}\,}$

${\displaystyle C_{1}}$${\displaystyle C_{2}}$初始條件的值有關。如果待解方程給定了初始條件，我們可以在積分之後替換進去。

### 例題

${\displaystyle f'(0)=2(0)+C_{1}\,}$
${\displaystyle 3=C_{1}\,}$
${\displaystyle \int f'(x)\,dx=\int 2x+3\,dx}$
${\displaystyle f(x)=x^{2}+3x+C_{2}\,}$
${\displaystyle f(0)=0^{2}+3(0)+C_{2}\,}$
${\displaystyle 2=C_{2}\,}$
${\displaystyle f(x)=x^{2}+3x+2\,}$

## 基本一階微分方程

• 可分離變量方程
• 齊次方程
• 線性方程
• 全微分方程

### 可分離變量方程

${\displaystyle {dy \over dx}={f(x) \over g(y)}}$

${\displaystyle g(y)\ dy=f(x)\ dx}$

${\displaystyle \int g(y)\,dy=\int f(x)\,dx+C}$

#### 例題

${\displaystyle {dy \over dx}=3x^{2}y}$

${\displaystyle {dy \over y}=(3x^{2})\,dx}$

${\displaystyle \int {dy \over y}=\int 3x^{2}\,dx}$
${\displaystyle \ln {y}=x^{3}+C\,\!}$
${\displaystyle y=e^{x^{3}+C}}$

${\displaystyle k=e^{C}}$，其中${\displaystyle k}$為常數，得到

${\displaystyle y=ke^{x^{3}}}$

#### 驗算

${\displaystyle y=ke^{x^{3}}}$

${\displaystyle {dy \over dx}=3x^{2}y}$

${\displaystyle {dy \over dx}=3kx^{2}e^{x^{3}}}$

${\displaystyle {dy \over dx}=3x^{2}y}$

### 齊次方程

${\displaystyle {dy \over dx}=f({y \over x})}$

${\displaystyle {dy \over dx}=f(v)}$

${\displaystyle {dy \over dx}={dvx \over dx}=v+x{dv \over dx}}$

${\displaystyle v+x{dv \over dx}=f(v)}$
${\displaystyle x{dv \over dx}=f(v)-v}$
${\displaystyle {dv \over dx}={f(v)-v \over x}}$

#### 例題

${\displaystyle {dy \over dx}={y^{2}+x^{2} \over yx}}$

${\displaystyle {dy \over dx}={y^{2} \over yx}+{x^{2} \over yx}}$
${\displaystyle {dy \over dx}={x \over y}+{y \over x}}$

${\displaystyle v={y \over x}}$，得到

${\displaystyle {dy \over dx}={1 \over v}+v}$

${\displaystyle v+x{dv \over dx}={1 \over v}+v}$

${\displaystyle x{dv \over dx}={1 \over v}}$

${\displaystyle v\,dv={dx \over x}}$

${\displaystyle {1 \over 2}v^{2}+C=\ln(x)\,}$
${\displaystyle {1 \over 2}\left({y \over x}\right)^{2}=\ln(x)-C}$
${\displaystyle y^{2}=2x^{2}\ln(x)-2Cx^{2}\,}$
${\displaystyle y=x{\sqrt {2\ln(x)-2C}}}$

### 線性方程

${\displaystyle a(x){dy \over dx}+b(x)y=c(x)}$

${\displaystyle a(x){dy \over dx}+b(x)y=a(x){dy \over dx}+y{da \over dx}={d \over dx}a(x)y}$

${\displaystyle aI{dy \over dx}+bIy=cI}$

${\displaystyle {\frac {d}{dx}}aI=bI}$

${\displaystyle {\frac {1}{I}}{\frac {dI}{dx}}={\frac {b-{\frac {da}{dx}}}{a}}}$

${\displaystyle \ln I(x)=\int {\frac {b(z)}{a(z)}}dz-\ln a(x)+c\quad }$
${\displaystyle I(x)={\frac {k}{a(x)}}e^{\int {\frac {b(z)}{a(z)}}dz}}$

${\displaystyle e^{\int {\frac {b(z)}{a(z)}}dz}{dy \over dx}+e^{\int {\frac {b(z)}{a(z)}}dz}{\frac {b(x)}{a(x)}}y=e^{\int {\frac {b(z)}{a(z)}}dz}{\frac {c(x)}{a(x)}}}$

${\displaystyle {d \over dx}(ye^{\int {\frac {b(z)}{a(z)}}dz})=e^{\int {\frac {b(z)}{a(z)}}dz}{\frac {c(x)}{a(x)}}}$

${\displaystyle y=e^{-\int {\frac {b(z)}{a(z)}}dz}\left(\int e^{\int {\frac {b(z)}{a(z)}}dz}{\frac {c(x)}{a(x)}}dx+C\right)}$

#### 例題

${\displaystyle {\frac {dy}{dx}}+y\tan x=1}$，初始條件為${\displaystyle y(0)=0}$

${\displaystyle I=e^{\int \tan xdx}=e^{\ln \sec x}=\sec x}$

${\displaystyle \sec x{\frac {dy}{dx}}+y\sec x\tan x=\sec x}$

${\displaystyle {\frac {d}{dx}}y\sec x=\sec x}$

${\displaystyle y=\cos x\int _{0}^{x}\sec z\,dz=\cos x\ln(\sec x+\tan x)}$

### 全微分方程

${\displaystyle f(x,y)dx+g(x,y)dy=0}$

${\displaystyle D_{x}f=D_{y}g}$（即${\displaystyle f}$${\displaystyle x}$的導數等於${\displaystyle g}$${\displaystyle y}$的導數）

（如果微分方程沒有這個性質，那麼我們就不能再繼續解下去了。）

${\displaystyle D_{y}h=f}$，且${\displaystyle D_{x}h=g}$

${\displaystyle h(x,y)=c}$

## 基本二階和高階常微分方程

${\displaystyle n}$階常微分方程的通解會含有${\displaystyle n}$個積分常量。要把它們都計算出來，我們還需要${\displaystyle n}$個方程。大多數情況下，題目會給定

### 可降階常微分方程

${\displaystyle F\left(y,{\frac {dy}{dx}},{\frac {d^{2}y}{dx^{2}}}\right)=0}$

${\displaystyle u={\frac {dy}{dx}}}$

${\displaystyle {\frac {d^{2}y}{dx^{2}}}={\frac {du}{dx}}={\frac {du}{dy}}\cdot {\frac {dy}{dx}}={\frac {du}{dy}}\cdot u}$

${\displaystyle F\left(y,u,{\frac {du}{dy}}\cdot u\right)}$=0

#### 例題

${\displaystyle 1+2y^{2}{\frac {d^{2}y}{dx^{2}}}=0}$

${\displaystyle 1+2y^{2}u{\frac {du}{dy}}=0}$

${\displaystyle udu=-{\frac {dy}{2y^{2}}}}$

${\displaystyle {\frac {u^{2}}{2}}=c+{\frac {y}{2}}}$

${\displaystyle c={\frac {u^{2}}{2}}-{\frac {y}{2}}={\frac {1^{2}}{2}}-{\frac {1}{2\cdot 1}}={\frac {1}{2}}-{\frac {1}{2}}=0}$

${\displaystyle {\frac {dy}{dx}}^{2}=u^{2}={\frac {1}{y}}}$

${\displaystyle {\frac {dy}{dx}}=\pm {\frac {1}{\sqrt {y}}}}$

${\displaystyle {\frac {dy}{dx}}={\frac {1}{\sqrt {y}}}}$

${\displaystyle {\frac {2}{3}}y^{\frac {3}{2}}=x+d}$

${\displaystyle y=\left(1+{\frac {3x}{2}}\right)^{\frac {2}{3}}}$

${\displaystyle F\left(x,{\frac {dy}{dx}},{\frac {d^{2}y}{dx^{2}}}\right)=0}$

${\displaystyle u={\frac {dy}{dx}}}$

${\displaystyle {\frac {d^{2}y}{dx^{2}}}={\frac {du}{dx}}}$

${\displaystyle F\left(x,u,{\frac {du}{dx}}\right)}$=0

### 線性常微分方程

${\displaystyle {\frac {d^{n}y}{dx^{n}}}+a_{1}(x){\frac {d^{n-1}y}{dx^{n-1}}}+...+a_{n}y=F(x)}$

1. 一個齊次線性方程的解的任意線性組合都是該方程的解；
2. 如果已知一個非齊次線性方程的解，我們給它加上對應的齊次線性方程的任意一個解，就會得到該非齊次線性方程的另一個解。

#### 常數變易法

${\displaystyle {\frac {d^{n}y}{dx^{n}}}+a_{1}(x){\frac {d^{n-1}y}{dx^{n-1}}}+...+a_{n}(x)y=0}$

##### 例題

${\displaystyle {\frac {d^{2}y}{dx^{2}}}+{\frac {2}{x}}{\frac {dy}{dx}}-{\frac {6}{x^{2}}}y=0}$

${\displaystyle \left(x^{2}{\frac {d^{2}z}{dx^{2}}}+4x{\frac {dz}{dx}}+2z\right)+{\frac {2}{x}}\left(x^{2}{\frac {dz}{dx}}+2xz\right)-{\frac {6}{x^{2}}}x^{2}z=0}$

${\displaystyle x^{2}{\frac {d^{2}z}{dx^{2}}}+6x{\frac {dz}{dx}}=0}$

${\displaystyle z=Cx^{-5}}$${\displaystyle y=Cx^{-3}}$

${\displaystyle y=C_{1}x^{-3}+C_{2}x^{2}}$

#### 常係數線性齊次常微分方程

${\displaystyle (D^{n}+a_{1}D^{n-1}+...+a_{n-1}D+a_{0})y=0}$

${\displaystyle y=e^{px}}$

${\displaystyle (p^{n}+a_{1}p^{n-1}+...+a_{n-1}p+a_{0})y=0}$

${\displaystyle y=0}$顯然是一個解，不考慮。我們只需研究

${\displaystyle p^{n}+a_{1}p^{n-1}+...+a_{n-1}p+a_{0}=0}$

${\displaystyle y=C_{1}e^{p_{1}x}+C_{2}e^{p_{2}x}+...+C_{n}e^{p_{n}x}}$
##### 二階

${\displaystyle D^{2}y+bDy+cy=0}$

${\displaystyle p^{2}+bp+c=0}$

${\displaystyle p_{\pm }={\frac {-b\pm {\sqrt {b^{2}-4c}}}{2}}}$

${\displaystyle b^{2}-4c}$的符號不同，我們有以下三種情況：

${\displaystyle y=C_{1}e^{p_{+}}+C_{2}e^{p_{-}}}$

${\displaystyle k^{2}=4c-b^{2}}$，則解為

${\displaystyle y=C_{+}e^{ikx-{\frac {bx}{2}}}+C_{-}e^{-ikx-{\frac {bx}{2}}}}$

${\displaystyle C_{\pm }=Ce^{\pm ia}}$

${\displaystyle y=Ce^{\frac {-bx}{2}}\cos(kx+c)}$

${\displaystyle D^{2}y-2pDy+p^{2}y=0}$

${\displaystyle (e^{px}D^{2}z+2pe^{px}Dz+p^{2}e^{px}z)-2p(e^{px}Dz+pe^{px}z)+p^{2}e^{px}z=0}$

${\displaystyle z=C_{1}x+C_{2}}$${\displaystyle y=(C_{1}x+C_{2})e^{px}}$

${\displaystyle (p-1)^{4}(p-3)(p^{2}+1)^{2}=0}$

${\displaystyle y=(C_{1}+C_{2}x+C_{3}x^{2}+C_{4}x^{3})e^{x}+C_{5}e^{3x}+C_{6}\cos(x+c_{1})+C_{7}x\cos(x+c_{2})}$