# First Order Differential Equations - Problem Solving

## Change of Variables

A homogenous equation with change of variables needs to be in the form $\frac{dy}{dx}=F(x,y),$ with a function $F(x,y)$ such that $F(tx,ty)=F(x,y) \Rightarrow F(x,y)=F\big(1,\frac{y}{x}\big)$. So we can do the change of variables $u=\frac{y}{x} \Rightarrow \frac{dy}{dx}=\frac{du}{dx}x+u$, getting the equation (most of the time, separable) $\frac{du}{dx}x+u=F(1,u).$

Solve the differential equation $\frac{dy}{dx}=\frac{y(y+x)}{x^2}.$

At first we can find out that this equation is said to be homogenous: $\frac{dy}{dx}=\frac{y(y+x)}{x^2}=\frac{ty(ty+tx)}{t^2x^2}=\frac{t^2y(y+x)}{t^2x^2}=\frac{y(y+x)}{x^2}.$ Then, we can do the change of variables: $u=\frac{y}{x} \Rightarrow \frac{dy}{dx}=\frac{du}{dx}x+u,$ and get the following separable equation: $\begin{aligned} \frac{du}{dx}x+u&=u^2+u \\\\ \frac{du}{dx}&=\frac{u^2}{x} \\\\ \int \frac{du}{u^2}&=\displaystyle \int \frac{dx}{x}\\\\ \frac{1}{u}&=-\ln(x)+C \\\\ u&=-\frac{1}{\ln(x)+C} \\\\ y&=-\frac{x}{\ln(x)+C}, \end{aligned}$ where $C$ is the constant of integration. $_\square$

## Exact Differential Equations

Let's take the following differential equation: $\begin{aligned} A(x,y)dy+B(x,y)dx&=0\\ \Rightarrow \frac{dy}{dx}&=-\frac{B(x,y)}{A(x,y)}. \end{aligned}$ It would be a very nice coincidence that there was a function $F(x,y)$ such that $\frac{dy}{dx}=-\frac{\frac{\partial F(x,y)}{\partial x}}{\frac{\partial F(x,y)}{\partial y}}=-\frac{\partial y}{\partial x}.$ A differential equation is said to be exact iif there exists a $C^2$ function $F(x,y)$ such that $A(x,y)=\frac{\partial F(x,y)}{\partial y}$ and $B(x,y)=\frac{\partial F(x,y)}{\partial x}$. $$ To prove that such a function exists we can use partial derivatives: $\begin{aligned} A(x,y)=\frac{\partial F(x,y)}{\partial y} &\Rightarrow \frac{\partial A(x,y)}{\partial x}=\frac{\partial ^2 F(x,y)}{\partial x \partial y}\\ B(x,y)=\frac{\partial F(x,y)}{\partial x} &\Rightarrow \frac{\partial B(x,y)}{\partial y}=\frac{\partial ^2 F(x,y)}{\partial y \partial x}. \end{aligned}$ As $F$ is $C^2,$ we can conclude $\begin{aligned} \frac{\partial ^2 F(x,y)}{\partial y \partial x}&=\frac{\partial ^2 F(x,y)}{\partial x \partial y}\\ \Rightarrow \frac{\partial A(x,y)}{\partial x}&=\frac{\partial B(x,y)}{\partial y}. \end{aligned}$ And that is the most important requirement for saying a differential equation is exact. $$ When the function $F$ is found, the solution to the differential equation is given, implicitly, by $F(x,y)=0.$

Solve the differential equation $\ln\big(x^2y\big)dy+\frac{2\ln(y)}{x}dx=0.$

On the way to prove that is an exact equation is to take $\begin{aligned} \frac{\partial}{\partial x}\big(\ln(x^2y)\big)&=\frac{\partial}{\partial y}\left(\frac{2\ln(y)}{x}\right)\\ \frac{2}{xy}&=\frac{2}{xy}. \end{aligned}$ So it is exact, and we know $\begin{aligned} \ln(x^2y)=\frac{\partial F(x,y)}{\partial y} \Rightarrow F(x,y) &= \int \ln(x^2y)dy \\ &=y\ln(x^2y)-\displaystyle \int dy\\ &=y\big(\ln(x^2y)+1\big)+C(x) \end{aligned}$ and $\begin{aligned} \frac{2\ln(y)}{x}&=\frac{\partial F(x,y)}{\partial x} \\ \frac{2\ln(y)}{x}&=\frac{2}{x}+C'(x)\\ C(x)&=2\ln(x)\ln(y)-2\ln(x)+C\\ F(x,y)&=y\big(\ln(x^2y)+1\big)+2\ln(x)\big(\ln(y)+1\big)+C. \end{aligned}$

So the solution to the differential equation is given by

$y\big(\ln(x^2y)+1\big)+2\ln(x)\big(\ln(y)+1\big)+C=0.\ _\square$

**Cite as:**First Order Differential Equations - Problem Solving.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/first-order-differential-equations-problem-solving/