Solve the initial value problem: $\frac{dy}{dx} = e^{x+y}$, given $y(0)=0$.

839 Views Asked by At

I have attempted the question several times so far, and I have always reached the same answer that differs from the solution, any advice would help greatly!

My attempt

$$\frac{dy}{e^y} = e^x dx$$

Taking the integral, I got $$-e^{-y} = e^x + C.$$

Solving for $y$, I got $$y=-\ln(C-e^x).$$

After subbing in $y(0)=0$, I got $$0=-\ln(C-1)$$ and solving for $C$, I got $$C=2.$$

Thus, I got $$y=-\ln(2-e^x).$$ However, the solutions have $y=-\ln(1-e^x)$ as the answer. Have I done something wrong? Thanks in advance!

2

There are 2 best solutions below

0
On BEST ANSWER

You are correct, and their solution is wrong. Their solution indeed satisfies the differential equation - however, ${y(0)}$ for their solution ${\neq 0}$. In fact, ${y(x=0)}$ doesn't even exist for their solution, since the function blows up to infinity

0
On

You are not wrong, here is another solution.

Rewrite to $e^{-y}dy=e^xdx$ then integrate from $x=0$ to $x=a$ to obtain $$\int_0^{y(a)}e^{-y}dy=\int_0^ae^xdx$$ which gives $$1-e^{-y(a)}=e^a-1$$ that after rearrangement gives $$e^{-y(a)}=2-e^a$$ take logarithm on both sides and then multiply by $-1$ to obtain $$y(a)=-\ln(2-e^a)$$ Substitute a with x to get your answer.