Solve 1st Order DE: y+y'=x, y(0)=0

  • Thread starter Thread starter James889
  • Start date Start date
  • Tags Tags
    First order
James889
Messages
190
Reaction score
1
Hi,

I have the first order differential equation y+y' = x
y(0) = 0
First i tried to assume a solution of the form Ax+b, that didn't quite work.

Then i tried to use the Integrating factor technique, work follows

e^{\int1} = e^x

\int e^x(y+y') = \int{xe^x}

ye^x = \int xe^x

let u = x, du=1
v = e^x dv=e^x

So i end up with:
ye^x = xe^x -e^x

which is wrong...
Any ideas?
 
Physics news on Phys.org
You forgot your " + C" at the end of your integration. : )
 
The answer is supposed to be y = ce^{-x} + x-1

But the answer i get when dividing both sides by e^x is y = x-1
 
Last edited:
Did you read my post?

James889 said:
e^{\int1} = e^x

\int e^x(y+y') = \int{xe^x}

ye^x = \int xe^x

let u = x, du=1
v = e^x dv=e^x

So i end up with:
ye^x = xe^x -e^x

Where is the integration constant? Where is the "+ C"? That is important because when you divide by e^x, you'll end up with the e^(-x) you were looking for.
 
James889 said:
Hi,

I have the first order differential equation y+y' = x
y(0) = 0
First i tried to assume a solution of the form Ax+b, that didn't quite work.
What didn't work when you did this? Is it the same problem where you're missing the e-x term?
 
vela said:
What didn't work when you did this? Is it the same problem where you're missing the e-x term?

Yes,

Put y = Ax + b
then y' = A

So i get: Ax + b + A = x
 
James889 said:
Yes,

Put y = Ax + b
then y' = A

So i get: Ax + b + A = x

What values of A and b make the left hand side also equal to x?

if y=f(x) is a single solution of the equation y'+y = x the other solutions
are y = f(x) + C g(x) where y= g(x) is a solution of y' + y = 0.
 
willem2 said:
What values of A and b make the left hand side also equal to x?
The values A=1, b=-1

But does this mean i have to guess G(x) ?
 
No, you have to solve the corresponding homogeneous equation y' + y = 0 and add that solution to the other one, yp=x-1, to get the general solution.
 
  • #10
James889 said:
Hi,

I have the first order differential equation y+y' = x
y(0) = 0
First i tried to assume a solution of the form Ax+b, that didn't quite work.

Then i tried to use the Integrating factor technique, work follows

e^{\int1} = e^x

\int e^x(y+y') = \int{xe^x}

ye^x = \int xe^x

let u = x, du=1
v = e^x dv=e^x

So i end up with:
ye^x = xe^x -e^x

which is wrong...
Any ideas?

l'Hôpital said:
You forgot your " + C" at the end of your integration. : )

James889 said:
The answer is supposed to be y = ce^{-x} + x-1

But the answer i get when dividing both sides by e^x is y = x-1
As l'Hopital said, you forgot the "constant of integration", C, in your original solution:
ye^x= xe^x- e^x+ C[/itex]<br /> <br /> Now, dividing through by e^x gives y= x- 1+ Ce^{-x}
 
Back
Top