Question 23

Mathematics Differential Equations Medium

Given differential equation \(\frac{dy}{dx}+y=1\) and the initial condition \(y(0)=2\), what is the value of y when \(x=1\)?

(A) \(y(1)=2e^{-1}+1\)
(B) \(y(1)=e^{-1}+2\)
(C) \(y(1)=1+e^{-1}\)
(D) \(y(1)=1-e^{-1}\)
View Dynamic Solution & Explanation
Correct Solution: Option C

Step-by-step Solution:

This problem requires solving a first-order initial value problem. The given differential equation is both linear and separable. We will solve it using the method of separation of variables.

1. Solve the general differential equation:
The given equation is \(\frac{dy}{dx}+y=1\).
First, we rearrange the equation to separate the variables \(x\) and \(y\) onto different sides of the equation:
\[\frac{dy}{dx} = 1-y\]
This can be written as:
\[\frac{dy}{1-y} = dx\]
Next, we integrate both sides:
\[\int \frac{1}{1-y} dy = \int dx\]
The integration results in:
\[-\ln|1-y| = x + C_1\]
where \(C_1\) is the constant of integration. To solve for \(y\), we manipulate this equation:
\[\ln|1-y| = -x - C_1\]
By exponentiating both sides, we remove the logarithm:
\[|1-y| = e^{-x - C_1} = e^{-C_1}e^{-x}\]
We can combine the constant terms by letting \(C = \pm e^{-C_1}\). This gives us the general solution:
\[1-y = Ce^{-x}\]\[y = 1 - Ce^{-x}\]
2. Apply the initial condition to find the constant C:
We are given the initial condition \(y(0)=2\). We substitute \(x=0\) and \(y=2\) into our general solution to find the specific value of \(C\).
\[2 = 1 - Ce^{-0}\]\[2 = 1 - C(1)\]\[C = 1 - 2 = -1\]
3. Write the particular solution:
Now we substitute the value \(C=-1\) back into the general solution to get the particular solution for this problem.
\[y = 1 - (-1)e^{-x}\]\[y = 1 + e^{-x}\]
4. Calculate y(1):
Finally, to find the value of \(y\) when \(x=1\), we substitute \(x=1\) into our particular solution.
\[y(1) = 1 + e^{-1}\]
Result:
The value of y when \(x=1\) is \(1+e^{-1}\).