# Ordinary Differential Equations:Cheat Sheet/First Order Ordinary Differential Equations

## Linear, Inhomogeneous Type

### General Form

${dy \over dx}+p(x)y=q(x)$

### Solution

$y(x)={\int u(x)q(x)dx+C \over u(x)}$ , where

• $C$  is a constant and
• $u(x)=e^{\int p(x)dx}$

## Separable

### General Form

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

### Solution

Rearrange to get ${dy \over h(y)}=g(x)dx$ , and integrate

## Bernoulli's

### General Form

${dy \over dx}+p(x)y=q(x)y^{n}$

### Solution

Substitute $v=y^{1-n}$

## Exact Equations

### General Form

$M(x,y)dx+N(x,y)dy=0$ , with ${\partial M \over \partial y}={\partial N \over \partial x}$

### Solution

Solution is of the form $F(x,y)=C$ , a constant, where $F_{x}=M$  and $F_{y}=N$

## Approximation Methods

Let $y'=f(x,y),y(0)=y_{0}$

### Euler's Method

Euler's method with step size $h$  is given by:

$y_{n+1}=y_{n}+hf(x_{n},y_{n})$ .

### Improved Euler's Method

Improved Euler's method with step size $h$  is given by:

$y_{n+1}=y_{n}+{\frac {h}{2}}\left[f(x_{n},y_{n})+f(x_{n+1},{\bar {y}}_{n+1})\right],{\bar {y}}_{n+1}=y_{n}+hf(x_{n},y_{n})$ .

### Runge-Kutta Method of Fourth Order

For step size $h$ ,

$y_{n+1}=y_{n}+{\frac {h}{6}}\left[k_{1}+2k_{2}+2k_{3}+k_{4}\right]$ , where

• $k_{1}=f(x_{n},y_{n})$
• $k_{2}=f(x_{n}+{\frac {h}{2}},y_{n}+{\frac {h}{2}}k_{1})$
• $k_{3}=f(x_{n}+{\frac {h}{2}},y_{n}+{\frac {h}{2}}k_{2})$
• $k_{4}=f(x_{n}+h,y_{n}+hk_{3})$