Solve the differential equation #y'=(y-x)^2#?

2 Answers
Jun 21, 2018

#y = x+ (a^2+x^2)/(a^2-x^2)#

where #a# is a constant of integration.

Explanation:

Let us change variables to #u = y-x#.

Then #u^' = y^'-1# and so the differential equation becomes

#u^' = u^2-1 implies#

#(du)/(u^2-1) = dx implies#
#1/2 log|(u-1)/(u+1)| = log x -log a#

where we have written the constant of integration as #-log a#. Thus

# (u-1)/(u+1) = x^2/a^2 implies#
#u = (a^2+x^2)/(a^2-x^2) implies#

#y = x+ (a^2+x^2)/(a^2-x^2)#

Jun 21, 2018

# y = x+(1 + Ae^(2x))/(1 - Ae^(2x))#

Explanation:

We have:

# y' =(y-x)^2 # ..... [A]

Perform the substitution:

# u =y-x #

Then differentiating wrt #x#, and applying the product rule:

# (du)/dx = dy/dx-1 => dy/dx = 1+(du)/dx #

Substituting into the DE:

# 1+(du)/dx = u^2 #
# :. (du)/dx = u^2-1 #

Reducing the DE to a separable form:

# 1/(u^2-1) \ (du)/dx = 1 #

So we can "separate the variables" to get:

# int \ 1/(u^2-1) \ du = int \ dx #

We can perform partial fraction decomposition of the LHS integrand:

# 1/(u^2-1) -= 1/((u+1)(u-1) #
# \ \ \ \ \ \ \ \ \ \ \ \ -= A/(u+1)+B/(u-1) #

And using the "cover up" methods we get:

# A=-1/2, B= 1/2 #

Allowing us to write the equation as:

# 1/2 int \ 1/(u-1)-1/(u+1) \ du = int \ dx #

And integrating, we get:

# 1/2{ln ( u-1) - ln(u+1)} = x + C #

# :. ln ((u-1)/(u+1) ) = 2x + 2C #

# :. (u-1)/(u+1) = e^(2x + 2C) #

# :. u-1 = (u+1)Ae^(2x) #

# :. u-1 = uAe^(2x) + Ae^(2x)#

# :. u - uAe^(2x) = 1 + Ae^(2x)#

# :. u(1 - Ae^(2x)) = 1 + Ae^(2x)#

# :. u = (1 + Ae^(2x))/(1 - Ae^(2x))#

And restoring the substitution:

# y-x = (1 + Ae^(2x))/(1 - Ae^(2x)) => y = x+(1 + Ae^(2x))/(1 - Ae^(2x))#