What is a solution to the differential equation #dy/dx=(2y+x^2)/x#?

2 Answers
Oct 2, 2016

#y(x) = (C+log_e(x))x^2#

Explanation:

This is a linear differential equation. Its solution can be composed of the homogeneous solution (#y_h(x)#) plus a particular solution (#y_p(x)#) so

#y(x) = y_h(x) + y_p(x)#

The homogeneous solution obeys

#(dy_h)/(dx) -2/x y_h(x) = 0#. Here, clearly the solution is

#y_h(x) = C x^2#

By grouping variables:
#dy_h/(y_h)=2dx/x->ln y_h=C_1lnx^2->y_h=Cx^2#

The determination of #y_p(x)# must obey

#(dy_p)/(dx)-2/x y_p(x) = x#.

To solve this, we will use a technique due to Lagrange
(https://en.wikipedia.org/wiki/Joseph-Louis_de_Lagrange)

called the constant variation technique.

We will suppose that #y_p(x) = c(x)y_h(x)#. Substituting we obtain

#y_h(x)(dc(x))/(dx) + c(x) ((dy_h(x))/(dx)-(2 y_h(x))/x) = x# or

#y_h(x)(dc(x))/(dx) = x# so

#(dc(x))/(dx) = x/(y_h(x)) = x/( x^2) = 1/x# so

#c(x)= log_e x# and finally

#y(x) = C x^2+log_e(x) x^2 = (C+log_e(x))x^2#

Oct 3, 2016

#y= x^2 (ln x + C)#

Explanation:

Alternative Approach

#y'=(2y+x^2)/x = 2 y/x + x#

#y'- 2/x y = x#

This is exact if we times it by a factor of #1/x^2# [See below for mechanical process to find that factor]

#1/x^2 y'- 2/x^3 y = 1/x#

ie
#(1/x^2 y)'= 1/x#

#1/x^2 y= ln x + C#

#y= x^2 (ln x + C)#

Integrating Factor
We can extract the "integrating factor" #eta(x)# for the DE in form #y' color(red)(- 2/x) y = x# as:

#eta = exp (int color(red)( -2/x) dx )#

# = e^(-2 ln x )#

# = 1/x^2#