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

## Linear, Inhomogeneous Type

### General Form

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

### Solution

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

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

## Separable

### General Form

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

### Solution

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

## Bernoulli's

### General Form

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

### Solution

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

## Exact Equations

### General Form

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

### Solution

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

## Approximation Methods

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

### Euler's Method

Euler's method with step size ${\displaystyle h}$  is given by:

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

### Improved Euler's Method

Improved Euler's method with step size ${\displaystyle h}$  is given by:

${\displaystyle 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 ${\displaystyle h}$ ,

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

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