# 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{align} \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{align}\] where \(C\) is the constant of integration. \(_\square\)

## Exact Differential Equations

Let's take the following differential equation: \[\begin{align} A(x,y)dy+B(x,y)dx&=0\\ \Rightarrow \frac{dy}{dx}&=-\frac{B(x,y)}{A(x,y)}. \end{align}\] 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{align} 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{align}\] As \(F\) is \(C^2,\) we can conclude \[\begin{align} \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{align}\] 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{align} \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{align}\] So it is exact, and we know \[\begin{align} \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{align}\] and \[\begin{align} \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{align}\]

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/