What is the mistake in this solution? Problem: Solve the initial value problem $y’=3y; y(0)=a>0$.
My solution:
Exploiting variable separable method,
$${dy\over y}=3\, dx$$
$$\implies\ln |y|=3x+C$$
where $C$ is the constant of integration. Now using $y(0)=a$ and $a>0$,
$\ln a=C$.
$$\therefore\ln |y|=3x+\ln a$$
$$\implies |y|=e^{3x+\ln a}$$
$$\implies y=\pm ae^{3x}$$
But clearly $y=-ae^{3x}$ isn’t a solution for the given problem.
So what went wrong?
 A: There is no error, as $-ae^{3x}$ is not a solution, violating the initial condition, and $+ae^{3x}$ is a solution, you have found the unique solution.
It is always possible that some non-equivalent step increases the number of intermediate solution candidates, so that you have to compare back with the original problem to select the true solutions.

You could also have done the preliminary analysis of the ODE in that $y=0$ is a constant, stationary solution of the ODE, so that by uniqueness no other solution can change its sign (as a sign change would imply the crossing of two solutions). Then because of $y(0)=a>0$, the solution of the IVP is positive, so that you can resolve the absolute value in $\ln|y|$ immediately to $\ln y$, removing the ambiguity.

Or staying with your solution method, observe that by dividing by $y$ the result is only valid as long as $y\ne 0$ to avoid division by zero. By the initial condition this means the obtained solution is only valid where $y>0$, again giving $|y|=y$. In the finished solution you can then find that the solution function has no zero crossings, thus is valid everywhere.
A: The implications are only flowing forward, not backwards. You know, from your argument,
$$((y' = 3y) \land (y(0) = a > 0)) \implies (y = ae^{3x}) \lor (y = -ae^{3x}).$$
You don't know the converse:
$$(y = ae^{3x}) \lor (y = -ae^{3x}) \implies ((y' = 3y) \land (y(0) = a > 0)).$$
In fact, the converse is false, as you noted. If $y = -ae^{3x}$, then the right side is not satisfied.
This is a common thing in many equation-solving methods: an infinite set of potential solutions is reduced to a small finite set of possible solutions, but none of the potential solutions are actually proven by the method. There may even be no solutions! It is important to verify the potential solutions you obtain from such a solving method, otherwise you might settle on erroneous possible solutions.
