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.

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