# Solve differential equations (solve_ode)

Solve a differential equation, or a system, with optional initial conditions.

Also written solve_pde.

With this function, the solver shows the steps whenever it finds them.

## How to write it

### solve_ode(equations, unknown, variable)

Solve for the unknown function of the variable.

**equations**

The equation, or a list that includes initial conditions such as y(0) = 1. Takes an equation, or a list of equations in brackets.

**unknown**

The unknown to solve for, such as y. Takes a variable, or a list of variables.

**variable**

The variable to work with, a name such as x. Takes a variable, or a list of variables.

## Examples

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

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

  In the solver, `solve_ode(y'(x) = y(x), y, x)` gives `[[y(x) -> C(1)*e^x]]`.

  [Open in the solver](https://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)`

  In the solver, `solve_ode([y'(x) = y(x), y(0) = 1], y, x)` gives `[[y(x) -> e^x]]`.

  [Open in the solver](https://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)`

  In the solver, `solve_ode(y''(x) + y(x) = 0, y, x)` gives `[[y(x) -> C(1)*cos(x) + C(2)*sin(x)]]`.

  [Open in the solver](https://hilberon.com/?q=solve_ode%28y''%28x%29%20%2B%20y%28x%29%20%3D%200%2C%20y%2C%20x%29)

## Related functions

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

  Solve a recurrence relation for a sequence.
- [recurrence_growth](https://hilberon.com/library/recurrence_growth)

  The order of growth of a divide-and-conquer recurrence, as big_theta of a simple function.

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