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

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}$$

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

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

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

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

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 h2\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 h6\left[k_1+2k_2+2k_3+k_4\right]$$, where


 * $$k_1=f(x_n,y_n)$$
 * $$k_2=f(x_n+\frac h2,y_n+\frac h2 k_1)$$
 * $$k_3=f(x_n+\frac h2,y_n+\frac h2 k_2)$$
 * $$k_4=f(x_n+h,y_n+h k_3)$$