DE's+with+x and y+as+a+variable

Differential equations in the form : math . \qquad \dfrac{dy}{dx}=f(x)g(y) math If it is possible to separate the equation so that all x terms are on on side and all y terms are on the other, then we can solve this type of DE.
 * Separation of Variables **

In general: math \dfrac{dy}{dx}=f(x)g(y) \\ \text{then} \\ math math \dfrac{1}{g(y)}\dfrac{dy}{dx}=f(x) \\ math Integrating with respect to x on **both** sides: math \displaystyle{ \int} \dfrac{1}{g(y)} \dfrac{dy}{dx}dx=\displaystyle{ \int} f(x)dx \\ math So: math \displaystyle{ \int} \dfrac{1}{g(y)} dy=\displaystyle{ \int} f(x)dx \\ math We can then perform the integration on each side to obtain an implicit relationship between x and y. NOTE: Each integration will give a constant of integration. These can be combined into one constant c. Additionally in some cases the equation can be rearranged to get y in terms of x.

Example 1 Find the general solution to the differential equation math \dfrac{dy}{dx}=\dfrac{x+4}{y^2+4} \\ math The first step is to seperate x and y terms onto different sides of the equation: math (y^2+4)\dfrac{dy}{dx}=x+4 \\ \text{integrating with respect to x} \\ \displaystyle{ \int} (y^2+4)\dfrac{dy}{dx}dx=\displaystyle{ \int} x+4 \;dx \\ math math \displaystyle{ \int} (y^2+4) \;dy=\displaystyle{ \int} x+4 \;dx \\ \dfrac{y^3}{3}+4y+c_1=\dfrac{x^2}{2}+4x +c_2 \\ \text{moving all x and y terms to one side and combining constants of integration:} \\ \dfrac{y^3}{3}+4y-\dfrac{x^2}{2}-4x=c math Note that in this case we cannot rearrange to get y in terms of x.

Example 2

Solve the differential equation : math \dfrac{dy}{dx}=\dfrac{ylog_e(y)}{x} \; \text{when }x=2, \; y=e \\ math Separating variables we get: math \dfrac{1}{ylog_e(y)} \dfrac{dy}{dx}= \dfrac{1}{x} \\ \text{integrating with respect to x gives} \\ math math \displaystyle{ \int} \dfrac{1}{ylog_e(y)} dy= \displaystyle{ \int} \dfrac{1}{x} dx \\ math Note that the derivative of log e (y) is present in the integrand so we can use a substitution of u=log e (y) to integrate the LHS math \dfrac{du}{dy}= \dfrac{1}{y} \\ dy=y \; du \\ math therefore math \displaystyle{ \int}\dfrac{1}{yu} y \;du = log_e(x)+c_2 \\ log_e(u)+c_1=log_e(x)+c_2 \\ math math log_e(log_e(y))=log_e(x) +c \; \text{where } c=c_2 - c_1 \\ \text{subbing in x=2, y=e} \\ log_e(log_e(e))=log_e(2)+c \\ log_e(1)=log_e(2)+c \\ 0=log_e(2)+c \\ c=-log_e(2) \\ math So math log_e(log_e(y))=log_e(x)-log_e(2) \\ log_e(log_e(y))=log_e(\dfrac{x}{2}) \\ log_e(y)=\dfrac{x}{2} \\ math Rearranging math y=e^\frac{x}{2} \; \text{where } x \in R\setminus \{0\} math