Nonlinear first order ordinary differential equation

130 Views Asked by At

How to solve the differential equation $(dy/dx)^2 = (x-y)^2$ with initial condition $y(0) = 0$?

I solved the equation by partitioning it into two differential equations.

1) $dy/dx = x-y $ The solution is —> $1-x+y = -\exp(-x)$

and

2) $dy/dx = -(x-y)$ Solution —> $1+x-y = \exp(x)$

How do we write combined solution of such equations.

2

There are 2 best solutions below

2
On

$$y'+y=x \implies y=x-1+Ke^{-x}$$ Don't forget the constant of integration $$y'-y=-x \implies y(x)=x+1+Ke^x$$

2
On

Both distinct solutions are correct, as $$ y(x)=1+x-e^x=-\frac12x^2+O(x^3) $$ and also $$ y(x)=e^{-x}-(1-x)=\frac12x^2+O(x^3) $$ have a horizontal tangent at the origin.

enter image description here

You get another two valid solutions if you switch at $x=0$ from one solution to the other.