In one of my course textbook's examples, we are given this DE: $\frac{dy}{dx}=x + xy$, and also that $y(0)=1$. We are asked to find its particular solution.

So, in my textbook the solution was found by the 'method of solving a linear differential equation of the first-order'.

But I decided to solve it by the 'method of separation of variables'.

So after a couple of steps, I arrived at: $$\ln|1+y| = \frac{x^2}{2} + \ln|k|$$ $$\implies \ln\left|\frac{1+y}{k}\right| = \frac{x^2}{2}$$

Now, putting the values of $x$ & $y$ we get; $k=2$. So, $$ \ln\left|\frac{1+y}{2}\right| = \frac{x^2}{2}$$ $\implies$ $y = -1$ $\pm$ $2 (e)^{\dfrac{x^2}{2}} $

But according to my textbook the solution is (only) : $y = -1 + 2(e)^\dfrac{x^2}{2}$.

So did I do something wrong (And if so, what?)

  • 2
    $\begingroup$ Note that you have to not only find solutions to the differential equation, but also satisfy a given initial condition $\endgroup$ – AnotherJohnDoe Oct 12 '17 at 12:52
  • $\begingroup$ Yes, don't forget that $y(0) = 1$ $\endgroup$ – John Lou Oct 12 '17 at 12:53
  • $\begingroup$ @JohnLou, @AnotherJohnDoe; yes I did do that- that's how I got the value of k as 2. $\endgroup$ – Mr Reality Oct 12 '17 at 12:58

$y=-1-2e^{\frac{x^2}{2}}$ is not a solution because $y(0)=-1-2e^0=-1-2*1=-3 \neq 1$

  • $\begingroup$ So, if we hadn't been given that y(0)=1 then would $y= -1 - 2e^{\frac{x^2}{2}}$ be a solution too? $\endgroup$ – Mr Reality Oct 12 '17 at 13:45
  • $\begingroup$ I have some questions (you do not need to respond to each one if you don't want to) :- 1) For such questions, do we have to do what you did or/and check whether all the conditions are followed in order to get rid of the solutions which are not correct?; 2) I mean my textbook didn't mention why this solution is not correct, so did it just skip the step you''ve written ( and so is it something I'm expected to do?) or was there something in this particular solution (or the 'other' solution) because of which it was obvious? Thanks! $\endgroup$ – Mr Reality Oct 12 '17 at 13:55
  • $\begingroup$ I just wanted to show, in the simplest way possible, why the solution was incorrect. That doesn't mean this is the best way to answer a question (in a test or homework assignment). The best way to answer is what @Kevin did. I can't see what your textbook says, so I cannot comment on that. $\endgroup$ – Donat Pants Oct 12 '17 at 14:03
  • $\begingroup$ Then, can you answer my first comment- if it was not given that y(0)=1, then both of the obtained solutions would be correct, right? $\endgroup$ – Mr Reality Oct 12 '17 at 14:14
  • $\begingroup$ Not just that, the equation $$\ln|1+y| = \frac{x^2}{2} + \ln|k| => $$ $$y = -1 + k(e)^\dfrac{x^2}{2}$$ would be correct, you can put $$ k = 2 $$ or $$ k = -2 $$ and get your 2 solutions as private cases. $\endgroup$ – Donat Pants Oct 12 '17 at 14:16

You should have, as your general solution, $$ \ln|1+y|=\frac{x^2}{2}+C\ \quad\iff\quad |1+y|=e^C e^{\frac{x^2}{2}} . $$

If $1+y>0$, you have the solution $$1+y= e^Ce^{\frac{x^2}{2}}\ \quad\iff\quad y=-1+ e^Ce^{\frac{x^2}{2}} . $$

If $1+y<0$, you have the solution $$-y-1= e^Ce^{\frac{x^2}{2}}\ \quad\iff\quad -y=1+ e^Ce^{\frac{x^2}{2}} . $$

In either case, the solution can be written as $y=-1+\widehat{C}e^{\frac{x^2}{2}} $, for some constant $\widehat{C}$ (different from the $C$ above).

Placing in the initial condition then specifies the particular solution.

  • $\begingroup$ Ok, this seems amazing. So am I (..more generally, is one..) expected to solve these type of problems (e.g. finding particular solutions) like you've done? Because I see that if I had done what you did, then I wouldn't have needed to even use y(0)=1 to try to find the right solution. $\endgroup$ – Mr Reality Oct 12 '17 at 14:09
  • $\begingroup$ @MrReality Yes, well there are some folks who use the absolute value as a nicety to let the reader know that the $\ln$ cannot take negative values. With the absolute value though, there will always be two cases to consider. $\endgroup$ – Kevin Oct 12 '17 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.