The given differential equation is:
dxdy+y=1
Rearrange it as:
dxdy=1−y
Now, separate the variables:
y−1dy=−dx
Integrate both sides:
∫y−1dy=∫−1dx
The integral on the left side is:
∫y−1dy=log∣y−1∣
On the right side, the integral is:
∫−1dx=−x+C
So, we get:
log∣y−1∣=−x+C
Now, solve for y:
∣y−1∣=e−x+C
y−1=±eCe−x
y=1+Ae−xwhereA=±eC
Hence, the required general solution is:
y=1+Ae−x