Ask a question

Find the general solution?

Find the general solution for the equation dy/dx+y=xe^-x.
Answer: y=(x^2/2)e^(-x)+Ce^-x
Please show all your work.

2 Answers by Expert Tutors

Tutors, sign in to answer this question.
Kenneth G. | Experienced Tutor of Mathematics and StatisticsExperienced Tutor of Mathematics and Sta...
Problem:  Solve for y(x):   dy/dx + y = xe-x
Step 1:  multiply both sides of the equation by ex to get   ex(dy/dx) + yex = x
Step 2:   Substitute ex = d(ex)/dx  to get ex(dy/dx) + y(dex/dx) = x
Step 3:  Apply the product rule in reverse:  g(df/dx) + f(dg/dx) = d(fg)/dx to get
                 d(yex)/dx = x.
Step 5:  Integrate both sides with respect to x to get
                 yex = x2/2  + C
Step 5:  Divide both sides by ex,   giving y = e-x((x2/2) + C) 
Step 6:  Multiply by the distributive law to get y = (x2/2)e-x + Ce-x
Andre W. | Friendly tutor for ALL math and physics coursesFriendly tutor for ALL math and physics ...
5.0 5.0 (3 lesson ratings) (3)
There are several methods for solving first-order linear equations. Here's one of them:
Bring the equation into standard form, y'+p(x) y = q(x). Then find the function r(x)=e∫p(x)dx. This function is called an integrating factor. When you multiply the equation by this factor, the left-hand side will become a total derivative, which is then easy to integrate.
Your equation is already in standard form:
y'+y=xe-x, with p(x)=1, q(x)=xe-x.
Then r(x)=e∫1dx=ex is an integrating factor, so multiply the equation by ex:
The left side is the derivative of exy:
so that when you integrate both sides of the equation,


Great general rule, Andre! 
Thanks, Kenneth! Wish I could claim ownership of this rule, but a guy named Euler beat me by some 250 years!