What is the solution of the differential equation? : # y'-2xy = 1 \ \ # with # \ \ y(0)=y_0#

1 Answer
Feb 7, 2018

# y = (sqrt(pi/2)erf(x) + y_0)e^(x^2) #

Explanation:

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

# dy/dx + P(x)y=Q(x) #

We have:

# y'-2xy = 1 \ \ # with # \ \ y(0)=y_0# ..... [1]

This is a First Order Ordinary Differential Equation in Standard Form. So we compute and integrating factor, #I#, using;

# I = e^(int P(x) dx) #
# \ \ = exp(int \ -2x \ dx) #
# \ \ = exp( -x^2 ) #
# \ \ = e^(-x^2) #

And if we multiply the DE [1] by this Integrating Factor, #I#, we will have a perfect product differential;

# dy/dxe^(-x^2) - 2xye^(-x^2) = e^(-x^2) #

# :. d/dx( ye^(-x^2))= e^(-x^2) #

This has transformed our initial ODE into a Separable ODE, so we can now "separate the variables" to get::

# ye^(-x^2) = int \ e^(-x^2) \ dx + C#

We now encounter a problem, as the RHS integral is not one that can be evaluated using standard elementary functions, and so we introduce the error function (or Gauss error function ):

# erf(x) = 2/sqrt(pi) int_0^x \ e^(-t^2) \ dt #

From which we get:

# ye^(-x^2) = sqrt(pi/2)erf(x) + C#
# :. y = (sqrt(pi/2)erf(x) + C)e^(x^2) #

And, if we apply the initial condition, #y(0)=y_0# we get:

# y_0 = (sqrt(pi/2)) xx 0 + C => C=y_0 #

Leading to the Specific Solution:

# :. y = (sqrt(pi/2)erf(x) + y_0)e^(x^2) #