Answer:
Explanation:
To solve the given differential equation, which is a first-order linear ordinary differential equation (ODE), we can use the method of separation of variables.
The given differential equation is: xy' = 2y + x^3 * e^x
First, we'll separate the variables y and x by moving all y-related terms to one side and all x-related terms to the other side:
xy' - 2y = x^3 * e^x
Next, we'll divide both sides by x to make the equation look like the standard form of a first-order linear ODE:
y' - (2/x)y = x^2 * e^x
Now, we'll find the integrating factor (IF) to solve the equation. The integrating factor is given by the exponential of the integral of the coefficient of y:
IF = e^(∫(-2/x) dx)
IF = e^(-2 ln|x|)
IF = e^(ln|x^(-2)|)
IF = |x^(-2)|
Now, we'll multiply both sides of the equation by the integrating factor:
|x^(-2)| * y' - 2|x^(-2)| * y = |x^(-2)| * x^2 * e^x
The left side can be written as the derivative of the product of the integrating factor and y:
d/dx (|x^(-2)| * y) = |x^(-2)| * x^2 * e^x
Now, we'll integrate both sides with respect to x:
∫ d/dx (|x^(-2)| * y) dx = ∫ |x^(-2)| * x^2 * e^x dx
The left side is just the integral of a derivative, so it simplifies to:
|x^(-2)| * y = ∫ |x^(-2)| * x^2 * e^x dx
Now, we need to evaluate the integral on the right side. To do this, we'll consider two cases: x > 0 and x < 0.
Case 1: x > 0
∫ x^2 * e^x dx
We can integrate this by parts:
Let u = x^2 (differential: du = 2x dx)
Let dv = e^x dx (differential: v = e^x)
∫ x^2 * e^x dx = x^2 * e^x - ∫ 2x * e^x dx
∫ x^2 * e^x dx = x^2 * e^x - 2 ∫ x * e^x dx
Now, we'll integrate the remaining integral on the right side by parts again:
Let u = x (differential: du = dx)
Let dv = e^x dx (differential: v = e^x)
∫ x * e^x dx = x * e^x - ∫ 1 * e^x dx
∫ x * e^x dx = x * e^x - e^x
Now, substituting this back into the previous result:
∫ x^2 * e^x dx = x^2 * e^x - 2(x * e^x - e^x)
∫ x^2 * e^x dx = x^2 * e^x - 2x * e^x + 2e^x
Case 2: x < 0
In this case, the absolute value |x^(-2)| is just 1/x^2, and we integrate in a similar way:
∫ x^2 * e^x dx = x^2 * e^x + 2x * e^x + 2e^x
Now that we have evaluated the integral for both cases, we can continue with the solution:
|x^(-2)| * y = ∫ |x^(-2)| * x^2 * e^x dx
|x^(-2)| * y = {
x^2 * e^x - 2x * e^x + 2e^x, if x > 0,
x^2 * e^x + 2x * e^x + 2e^x, if x < 0
}
We can simplify the right side by removing the absolute value, as the function x^(-2) is positive for both positive and negative x:
y = {
x^2 * e^x / x^2 - 2x * e^x / x^2 + 2e^x / x^2, if x > 0,
x^2 * e^x / x^2 + 2x * e^x / x^2 + 2e^x / x^2, if x < 0
}
Now, simplify further:
y = {
e^x - 2x * e^x / x^2 + 2e^x / x^2, if x > 0,
e^x + 2x * e^x / x^2 + 2e^x / x^2, if x < 0
}
Finally, we can express the solution in a unified form:
y = e^x + 2x * e^x / x^2 + 2e^x / x^2
So, the solution to the given differential equation is y = e^x + 2x * e^x / x^2 + 2e^x / x^2.