Explain how to get the right solution of y $dy/dx=y$ When solving the following equation to find y as a function of x:

\begin{equation}
dy/dx=y
\end{equation}

First I divide both sides by $y$ and multiply both sides by $dx$:

$dy/y=dx$

Then I integrate both sides:

$\ln(y)+C1=x+C2$

Then:

$y=e^{x+C2-C1}=e^{x+C}$

I now know my result is problematic becomes $y=-e^x$ also satisfies $dy/dx=y$ but it is included in my solution: $y=e^{x+C}$. So can you help me find what is wrong with my analysis process and provide the right analysis process.

Thanks.

Update:
I said $y=-e^x$ is not included in $y=e^{x+C}$ because $e^C&gt;0$.
It should be noted that $$\int \frac{dy}{y} =\ln|y| + C$$ That absolute value is important.

This means that $|y| = De^x$ for some positive constant $D$.

The really odd trick is that $D=0$ works, as well...
$$\frac{dy}{dx} = y \iff$$
$$\frac{1}{y} dy = dx \iff$$
$$ \int \frac{1}{y} dy = \int dx \iff $$
$$ \ln(y) + C_1 = x+C_2 \iff$$
$$ \ln(y)  = x+C \iff$$
$$e^{\ln(y)}  = e^{x+C} \iff$$
$$e^{\ln(y)}  = e^{x}e^{C} \iff$$

$$y = D e^x$$

where $D$ may be  chosen to satisfy the initial conditions:

For example, if $y(0) = \pi$, then $y(0) = De^0 = \pi \implies D=\pi$