# Solution of $\frac{dy}{dx}=ye^x$ given $x=0, y=e$

$\frac{dy}{dx}=ye^x$ and $x=0, y=e$, find particular solution

Attempt 1 $$\frac{dy}{dx}=ye^x\implies \frac{dy}{y}=e^xdx\implies \log|y|=e^x+C\\ {x=0,y=e}\implies\log|e|=\log e=1=1+C\implies C=0\\ \log|y|=e^x\implies|y|=e^{e^x}\implies \color{red}{y=\pm e^{e^x}}$$ Attempt 2 $$\frac{dy}{dx}=ye^x\implies \frac{dy}{y}=e^xdx\implies e^x=\log|y|+\log|C_1|=\log|C_1.y|\\ e^{e^x}=|C_1.y|=\pm C_1.y=C.y\\ {x=0,y=e}\implies e=C.e\implies C=1\\ \implies \color{red}{y=e^{e^x}}$$ My reference also gives the solution $\log y=e^x$ as in attempt 2. Why do I seem to get +ve and -ve solutions in attempt 1 ?

How do I eliminate the solution $y=-e^{e^x}$ in attempt 1 ?

Note: I am not quite familiar with the idea of singularity or intermediate value theorem, as i have only done preliminary maths on first order differential equations.

• FWIW, $e^x > 0$ for all $x \in \mathbb{R}$. EDIT: nevermind, that means you could have $y<0$ for your attempt 1. – Mateen Ulhaq Jun 15 '18 at 7:38
• @AnotherJohnDoe : Or go right where previously it was wrong. The sign of $y$ has to be constant, as $y=0$ is a constant solution, thus no crossing the zero-line. The sign of the solution is decided by the sign of the initial value, $y(x)=y(0)e^{\exp(x)-1}$, this was not used in the first attempt. – Lutz Lehmann Jun 15 '18 at 8:13
• I do not see what in this step is wrong. Removing the absolute value introduces a sign, the sign can be absorbed into the constant. – Lutz Lehmann Jun 15 '18 at 8:31
• @AnotherJohnDoe how do the step $|C_1y|=\pm C_1y=Cy$ be wrong ? – ss1729 Jun 15 '18 at 10:12

Your first attempt is incomplete. You got to the point where two solutions $y(x)=e^{e^x}$ and $y(x)=-e^{e^x}$ are possible. The sign can not change inside a solution as they never take the value zero but have to be continuous. A sign change would thus contradict the intermediate value theorem.

As $y(0)=e>0$, you can reduce the number of possible solutions to one.

• Thnx. but I am not quite familiar with intermediate value theorem. Is it possible to understand eliminating the solution $y=-e^{e^x}$ if have only basic knowledge about first order differential equations ? – ss1729 Jun 15 '18 at 10:38
• Look at the initial condition. Does it satisfy $y(0)=e$? – Dylan Jun 15 '18 at 11:02
• A continuous function on $[a,b]$ takes any value between $f(a)$ and $f(b)$. This is the basic property of continuous functions. Any solution that has $y(x_0)=0$ somewhere is the zero solution everywhere by the uniqueness theorem. – Lutz Lehmann Jun 15 '18 at 11:06

When dealing with the integral

$$\int \frac{dy}y=\log|y|+C$$ you are not allowed to cross the singularity at $y=0$ so that the solution is more precisely one of

$$\log y=e^x+C\text{ or }\log(-y)=e^x+C$$ (for all $x$).

With the given initial condition, the second option is excluded.

• $\log|y|=e^x\implies \log y=e^x$ or $\log -y=e^x$. How does the condition $x=0,y=e$ decides the second option is excluded ?. Can I understand it if i have only basic knowledge on differential equations ? – ss1729 Jun 23 '18 at 15:38