# What is a solution to the differential equation #dy/dx=1+2xy#?

##### 1 Answer

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

Where

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

#### Explanation:

# dy/dx = 1 + 2xy #

# :. dy/dx - 2xy = 1 # ..... [1]

This is a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

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

This is a standard form of a Differential Equation that can be solved by using an Integrating Factor:

# I = e^(int P(x) dx)#

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

# \ \ = e^(-x^2) #

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

# dy/dx - 2xy = 1 #

# :. e^(-x^2)dy/dx - 2xye^(-x^2) = 1*e^(-x^2) #

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

This has converted our DE into a First Order separable DE which we can now just separate the variables to get;

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

The RHS integral does not have an elementary form, but we can use the definition of the Error Function :

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

Which gives us:

# ye^(-x^2) = sqrt(pi)/2"erf"(x) + A#

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