# 求解微分方程（Solve differential equations，solve_ode）

求解微分方程或方程组，可附带初始条件。

也可以写作 solve_pde。

使用这个函数时，求解器只要找到步骤就会展示。

## 怎么写

### solve_ode(equations, unknown, variable)

求关于该变量的未知函数。

**equations**

方程，或包含初始条件（如 y(0) = 1）的列表。接受一个方程或放在方括号中的方程列表。

**unknown**

要求解的未知数，例如 y。接受一个变量或变量列表。

**variable**

要处理的变量，是一个名称，例如 x。接受一个变量或变量列表。

## 示例

- $\displaystyle y'(x) = y(x) \Rightarrow y(x) = C_{1} e^{x}$

  `solve_ode(y'(x) = y(x), y, x)`

  在求解器中，`solve_ode(y'(x) = y(x), y, x)` 的结果是 `[[y(x) -> C(1)*e^x]]`。

  [在求解器中打开](https://zh.hilberon.com/?q=solve_ode%28y'%28x%29%20%3D%20y%28x%29%2C%20y%2C%20x%29)
- $\displaystyle \begin{cases} y'(x) = y(x) \\ y(0) = 1 \end{cases} \Rightarrow y(x) = e^{x}$

  `solve_ode([y'(x) = y(x), y(0) = 1], y, x)`

  在求解器中，`solve_ode([y'(x) = y(x), y(0) = 1], y, x)` 的结果是 `[[y(x) -> e^x]]`。

  [在求解器中打开](https://zh.hilberon.com/?q=solve_ode%28%5By'%28x%29%20%3D%20y%28x%29%2C%20y%280%29%20%3D%201%5D%2C%20y%2C%20x%29)
- $\displaystyle y''(x)+y(x) = 0 \Rightarrow y(x) = C_{1} \cos(x)+C_{2} \sin(x)$

  `solve_ode(y''(x) + y(x) = 0, y, x)`

  在求解器中，`solve_ode(y''(x) + y(x) = 0, y, x)` 的结果是 `[[y(x) -> C(1)*cos(x) + C(2)*sin(x)]]`。

  [在求解器中打开](https://zh.hilberon.com/?q=solve_ode%28y''%28x%29%20%2B%20y%28x%29%20%3D%200%2C%20y%2C%20x%29)

## 相关函数

- [solve_recurrence](https://zh.hilberon.com/library/solve_recurrence)

  求解数列的递推关系。
- [recurrence_growth](https://zh.hilberon.com/library/recurrence_growth)

  分治递推式的增长阶，以简单函数的 big_theta 表示。

---
Source: https://zh.hilberon.com/library/solve_ode
