Question Statement
Solve the differential equation:
2dxdy=4xe−x;y(0)=2
Background and Explanation
This is a first-order separable differential equation where we can isolate dy and dx on opposite sides before integrating. The solution requires integration by parts to handle the ∫xe−xdx term, since it involves a product of algebraic and exponential functions.
Solution
We begin by rearranging the equation to separate y and x terms:
2dxdy=4xe−x
Multiply both sides by dx and divide by 2:
2dy=4xe−xdx
dy=2xe−xdx
Now we integrate both sides to find the general solution:
∫dy=2∫xe−xdx
The left side integrates directly to y. For the right side, we use integration by parts (formula: ∫udv=uv−∫vdu).
Let u=x and dv=e−xdx. Then:
Applying integration by parts:
∫xe−xdx=x(−e−x)−∫(−e−x)dx=−xe−x+∫e−xdx
=−xe−x−e−x+C
Substituting back into our equation:
y=2[−xe−x−e−x]+c
y=−2xe−x−2e−x+c
Factor out −2e−x:
y=−2e−x(x+1)+c
We are given y(0)=2, which means when x=0, y=2.
Substitute into equation (1):
2=−2e−0(0+1)+c
2=−2(1)(1)+c
2=−2+c
c=4
Substituting c=4 back into equation (1):
y=−2e−x(x+1)+4
This can also be written as:
y+2e−x(x+1)−4=0
Or equivalently:
y=4−2(x+1)e−x
- Separation of variables: Rearranging dxdy=f(x)g(y) into dy=f(x)dx (when g(y) is constant or separable)
- Integration by parts: ∫udv=uv−∫vdu
- Exponential integration: ∫e−xdx=−e−x+C
- Initial value problem: Using y(x0)=y0 to determine the constant of integration c
Summary of Steps
- Separate variables: Divide by 2 to get dy=2xe−xdx
- Integrate: Write y=2∫xe−xdx and apply integration by parts with u=x, dv=e−xdx
- General solution: Obtain y=−2e−x(x+1)+c
- Find constant: Substitute x=0,y=2 to get c=4
- Final answer: y=4−2(x+1)e−x or y=−2e−x(x+1)+4