Error on Matlab and Wolfram Alpha?

195 Views Asked by At

I solved the differential equation $\frac{\mathrm{d} y}{\mathrm{d} x}= \frac{y^2-1}{2y}$, in the following way:

$\frac{\mathrm{d} y}{\mathrm{d} x}= \frac{y^2-1}{2y} <=>$ $\int \frac{2y}{y^{2}-1}dy=\int1dx <=> ln\left| y^2-1\right |=x+C<=>$

$|y^2-1|=e^xe^C <=> \pm (y^2-1)=e^xe^C <=> y^2-1=Ke^x$, for a constant K, such that $K=\pm e^c$

$<=> y^2=Ke^x+1<=> y= \pm \sqrt{Ke^x+1}$

Now Wolfram Alpha(http://www.wolframalpha.com/input/?i=dy%2Fdx%3D%28y%5E2-1%29%2F%282y%29) and Matlab both tell me that the solution to the original equation is:

$\pm \sqrt{e^Ce^x+1}$, meaning that my constant K can only assume positive values. Is my solution wrong or are both of these software wrong?

Thanks in advance.

2

There are 2 best solutions below

2
On BEST ANSWER

You could have negative values for K in your solutions. There are two branches to this DE. If you had a suitable initial condition to the DE then wolfram (I don't have maple) find it, e.g.: http://www.wolframalpha.com/input/?i=dy%2Fdx%3D%28y%5E2-1%29%2F%282y%29%2C+y%280%29%3D-1%2F2

As mentioned in the comments a complex value of $C$ could give rise to a negative value for $K$.

4
On

You are right, except that you should be more careful with the constant solutions $y=\pm 1$. (In the final answer, they correspond to $K=0$, but you have defined $K=\pm e^C$, which can never be zero, so you have to "repair" the solution by including those cases "by hand".)