General solution of $\frac{dy}{dx}+y=1$, $(y\neq 1)$

111 Views Asked by At

Solve $\frac{dy}{dx}+y=1$, $(y\neq 1)$

The general solution for this differential equation is given in my reference as $y=1+Ae^{-x}$, but is it a complete solution ?

My Attempt

$$ \frac{dy}{dx}=1-y\implies \frac{dy}{1-y}=dx\\ \int\frac{dy}{1-y}=\int dx\implies\int\frac{dy}{y-1}=-\int dx\\ \log|y-1|=-x+C_1\implies |y-1|=e^{-x}.e^{C_1}\\ |y-1|=A.e^{-x}\\ y=\begin{cases}1+A.e^{-x};\quad y\geq1\\ 1-A.e^{-x};\quad y<1 \end{cases} $$ right ?

2

There are 2 best solutions below

5
On BEST ANSWER

You can combine both of these cases into

$$ y(x) = 1 + ce^{-x} $$

where $c$ can be positive or negative. Then $c = A > 0$ implies $y > 1$, and $c = -A < 0$ implies $y < 1$

Also $c=0$ includes the trivial solution $y\equiv 1$.

0
On

Suppose that $y$ is a solution. Define $$ u(x) = y(x) - 1. $$ then $u'(x) = y'(x)$, so $u$ is a solution to $$ u(x) + u'(x) = 0 $$ Now let $v(x) = u(-x)$. Then $v'(x) = -u'(x)$, so $$ v(x) = v'(x). $$ The only solution to this equation (I'm assuming you've seen this before!) is $$ v(x) = ce^x $$ (for any real constant $c$). Hence $u(x) = c e^{-x}$, and $y(x) = c e^{-x} + 1$.

If you want to restrict to solutions where $y$ is not the constant function $y(x) = 1$, then you need to choose $c$ to be any nonzero real number.