Solving a differential equation using integrating factor

chwala
Gold Member
Messages
2,827
Reaction score
415

Homework Statement


Solve ##{dy/dx}-2xy=2x##

Homework Equations

The Attempt at a Solution



Let ##P= -2x ## and Q= 2x,
Integrating factor =## e^{-x^2} ##
##y.e^{-x^2} = ∫ 2x.e^{-x^2} dx##
##y.e^{-x^2}={x^2} e^{-x^2}+∫ 2{x^3} e^{-x^2}dx##
since ##y.e^{-x^2} = ∫ 2x.e^{-x^2} dx##
then ##y.e^{-x^2}={x^2}e^{-x^2}+{x^2}.y.e^{-x^2}## dividing through by ##e^{-x^2}, ## we have
##y={x^2}+{x^2}y.##
##y= {x^2}({1+y})##
now textbook says answer is ##y+1=c{x^2} ## where have i gone wrong?
 
Last edited:
Physics news on Phys.org
chwala said:

Homework Statement


Solve ##{dy/dx}-2xy=2x##

Homework Equations

The Attempt at a Solution



Let ##P= -2x ## and Q= 2x,
Integrating factor =## e^{-x^2} ##
##y.e^{-x^2} = ∫ 2x.e^{-x^2} dx##
##y.e^{-x^2}={x^2} e^{-x^2}+∫ 2{x^3} e^{-x^2}dx##[/QUOTE]
Use substitution u=x2 to find the integral. Do not forget the integration constant.
 
Last edited:
thanks i am getting
## du= 2x dx##
on substitution to the right hand side of the integral:, we get
##ye^{-x^2} = ∫2xe^{-x^2} dx##
##ye^{-x^2}= ∫(2xe^{-u})/(2x)du##
##ye^{-x^2} = -e^{-u} + c##
##y= -e^{-x^2}+c##
## y +1 = ce^{x^2} ## looks like textbook answer is wrong...am i right?
 
Last edited:
I would just let $$u=-x^2$$

Does not really matter, but it is easier to remember the negative sign.
Also, depending on the teacher they may want to see the arbitrary constants of integration. Even tho we can ignore them throughout the problem and just tack them onto the final solution. Ask your instructor. Mine was very picky when I took this course.
 
chwala said:
thanks i am getting
## du= 2x dx##
on substitution to the right hand side of the integral:, we get
##ye^{-x^2} = ∫2xe^{-x^2} dx##
##ye^{-x^2}= ∫(2xe^{-u})/(2x)du##
##ye^{-x^2} = -e^{-u} + c##
##y= -e^{-x^2}+c##
## y +1 = ce^{x^2} ## looks like textbook answer is wrong...am i right?
Yes, the answer in the book is wrong. You can check your solution and that from the book if you substitute them into the original equation.
 
right.
##y= ce^{x^2}-1##
##\frac {dy} {dx}= ce^{x^2}2x ##
substituting this in
##\frac {dy} {dx}-2xy=2x##
we have:,
##ce^{x^2}2x-2x(ce^{x^2}-1)= ce^{x^2}2x-2xce^{x^2}+2x= 2x##
thus shown
 
chwala said:
right.
##y= ce^{x^2}-1##
##\frac {dy} {dx}= ce^{x^2}2x ##
substituting this in
##\frac {dy} {dx}-2xy=2x##
we have:,
##ce^{x^2}2x-2x(ce^{x^2}-1)= ce^{x^2}2x-2xce^{x^2}+2x= 2x##
thus shown
OK, so your solution is correct. What about the formula from the book?
 
The book does not show the method used, it only indicates solutions.
 
chwala said:
The book does not show the method used, it only indicates solutions.
Well, but you can substitute it into the differential equation and see if it is really solution.
 
  • #10
yes, it is a solution.
 
  • #11
Another approach
dy/dx = 2x(y+1)
dy/(y+1) = 2xdx
y+1 = Cex2
 
  • Like
Likes chwala
  • #12
chwala said:

Homework Statement


Solve ##{dy/dx}-2xy=2x##

Homework Equations

The Attempt at a Solution



Let ##P= -2x ## and Q= 2x,
Integrating factor =## e^{-x^2} ##
##y.e^{-x^2} = ∫ 2x.e^{-x^2} dx##
##y.e^{-x^2}={x^2} e^{-x^2}+∫ 2{x^3} e^{-x^2}dx##
since ##y.e^{-x^2} = ∫ 2x.e^{-x^2} dx##
then ##y.e^{-x^2}={x^2}e^{-x^2}+{x^2}.y.e^{-x^2}## dividing through by ##e^{-x^2}, ## we have
##y={x^2}+{x^2}y.##
##y= {x^2}({1+y})##
now textbook says answer is ##y+1=c{x^2} ## where have i gone wrong?
Multiplying both sides of your DE by ##e^{-x^2}## we have
\frac{d}{dx} e^{-x^2} y = e^{-x^2} 2x \Longrightarrow e^{-x^2} y(x) = k + \int_0^x e^{-t^2} 2t \, dt = k - e^{-x^2}+1,
or
y(x) = e^{x^2} (c - e^{-x^2}) = -1 + c e^{x^2},
where ##c = k-1##. Basically, ##k=y(0)## is a constant of integration.

I urge you to ALWAYS use definite integration when you solve DE's like you tried to do, and ALWAYS make a distinction between ##x## outside the integral and the dummy variable of integration; that is why I used ##\int \cdots \, dt## instead of ##\int \cdots \, dx##. Doing that makes everything clearer and reduces the chance of making elementary blunders.

Both your solutions and those of the book are incorrect, although the book's solution is correct in the special case that ##c = 0## (giving the trivial solution ##y(x) = -1## for all ##x##).
 
Last edited:
Back
Top