How to solve this first order linear differential equation?

#xy'-1/(x+1)y=x #
y(1) = 0

(According to our professor, I.F. = #e^(intf(x))#, and we should just leave the integral be for now if the integral cannot be solved by hand or conventional methods)

2 Answers
May 28, 2018

# y = x/(x+1)(x + lnx -1) #

Explanation:

We have:

# xy'-1/(x+1)y=x # with # y(1) = 0#

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) #

So, we can put the equation in standard form:

# y'-1/(x(x+1))y = 1 #

Then the integrating factor is given by;

# I = e^(int P(x) dx) #
# \ \ = exp(int \ -1/(x(x+1)) \ dx) #

We can readly evaluate this integral if we perform a partial fraction decomposition of the integrand:

# 1/(x(x+1)) -= A/x + B/(x+1) => 1 -= A(x+1)+Bx #

Then:

# x= \ \ \ \ \ 0 => A=1 #
# x=-1 => B=-1#

So we can write:

# I = exp(int \ -1/x + 1/(x+1) ) \ dx) #
# \ \ = exp(ln(x+1)-lnx) #
# \ \ = exp( ln((x+1)/x) ) #
# \ \ = (x+1)/x #

And if we multiply the DE [A] by this Integrating Factor, #I#, we will have a perfect product differential (in fact the original equation);

# :. ((x+1)/x)y' - ((x+1)/x) 1/(x(x+1))y = ((x+1)/x) #

# :. (1+1/x)y' - 1/x^2y = 1+1/x #

# :. d/dx ((1+1/x)y) = 1+1/x #

This is now separable, so by "separating the variables" we get:

# (1+1/x)y = int \ 1+1/x \ dx #

Which is trivial to integrate to get the General Solution:

# (1+1/x)y = x + lnx + C #

Applying the initial condition #y(1)=0# we get:

# 0 = 1 +ln1 + C => C=-1 #

Leading to the Particular Solution:

# (x+1)/x \ y = x + lnx -1 #

# :. y = x/(x+1)(x + lnx -1) #

May 28, 2018

#y=x/(x+1)(x+lnx-1)#

Explanation:

.

#xy'-1/(x+1)y=x#

A first Order linear Differential Equation has the form of:

#y'(x)+p(x)y=q(x)#

Let's put our ODE in this form by dividing the entire equation by #x#:

#y'-1/(x(x+1))y=1#, which shows that:

#p(x)=-1/(x(x+1))# and #q(x)=1#

The integration factor is:

#mu(x)=e^(intp(x)dx)=e^(int-1/(x(x+1))dx)=e^I#

#I=int-1/(x(x+1))dx=-int1/(x(x+1))dx#

We can use partial fraction expansion to solve it:

#1/(x(x+1))=A/x+B/(x+1)=(A(x+1)+Bx)/(x(x+1))=(Ax+A+Bx)/(x(x+1))=((A+B)x+A)/(x(x+1))#

#A+B=0# and #A=1#

Therefore, #B=-1#

#I=-int(1/x-1/(x+1))dx=-lnabsx+lnabs(x+1)+C#

#mu(x)=e^(-lnabsx+ln(x+1)+C)=e^-lnabsx*e^(lnabs(x+1))*e^C=1/e^lnabsx(e^lnabs(x+1))e^C=1/x(x+1)e^C=(e^C(x+1))/x#

The constant #e^C# is redundant and can be ignored. Therefore,our integration factor is:

#mu(x)=(x+1)/x#

Now, we multiply both sides of our ODE by this integration factor:

#y'((x+1)/x)-1/(x(x+1))((x+1)/x)y=(x+1)/x#

Then, we simplify and refine:

#((x+1)y')/x-y/x^2=1/x+1# #color(red)(Equation-1)#

If #f=(x+1)/x and g=y# then applying the product rule of differentiation we get:

#(f*g)'=f*g'+f'*g#

#f'=(x-(x+1))/x^2=-1/x^2# (we used the quotient rule)

#g'=y'#

#f*g'+f'*g=((x+1)/x)y'+(-1/x^2)y=((x+1)y')/x-y/x^2#

which is the same as Left Hand Side of #color(red)(Equation-1)#.

Therefore, the Right Hand Side of it must be equal to #(f*g)'#.

#(f*g)'=1/x+1#

#(((x+1)y)/x)'=1/x+1#, i.e:

#d/dx((x+1)/xy)=1/x+1#

We now take the integral of both sides:

#(x+1)/xy=int(1/x+1)dx=int1/xdx+intdx#

#(x+1)/xy=lnx+x+c#

We now proceed to isolate #y#:

Let's multiply both sides by #x#:

#(x+1)y=xlnx+x^2+cx#

Let's divide both sides by #x+1#:

#y=(xlnx+x^2+cx)/(x+1)#

Now, we can apply the initial conditions:

#y(1)=0#

#((1)(ln1)+(1)^2+c(1))/((1)+1)=((1)(0)+1+c)/2=(c+1)/2=0#

#c+1=0#

#c=-1#

Therefore,

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