Solution to $y'=y^2-4$

1.8k Views Asked by At

I recognize this as a separable differential equation and receive the expression:

$\frac{dy}{y^2-4}=dx$

The issue comes about when evaluating the left hand side integral:

$\frac{dy}{y^2-4}$

I attempt to do this integral through partial fraction decomposition using the following logic:

$\frac{1}{(y+2)(y-2)} = \frac{A}{y+2}+\frac{B}{y-2}$

Therefore, $1=Ay-2A+By+2B$.

Since the coefficients must be the same on both sides of the equation it follows that:

$0=A+B$ and $1=-2A+2B$. Hence, $A=-B$, $B=\frac14$, $A=-\frac14$.

Thus the differential equation should be transformed into:

$-\frac{1}{4} \frac{dy}{y+2} + \frac14 \frac{dy}{y-2} = x+C$

Solving this should yield:

$-\frac14 \ln|y+2| + \frac14 \ln|y-2| = x+C$

which simplifies as:

$\ln(y-2)-\ln(y+2)=4(x+c)$

$\ln[(y-2)/(y+2)]=4(x+c)$

$(y-2)/(y+2)=\exp(4(x+c))$

$y-2=y*\exp(4(x+c)+2\exp(4(x+c))$

$y-y\exp(4(x+c))=2+2\exp(4(x+c))$

$y(1-\exp(4(x+c)))=2(1+\exp(4(x+c)))$

$y= 2(1+\exp(4(x+c)))/(1-\exp(4(x+c)))$

However, when done in Mathematica/Wolfram Alpha the result is given as (proof in the attached image)

$\frac14 \ln(2-y) -\frac14 \ln(2+y) = x + C$

and returns an answer of:

$y= 2(1-\exp(4(x+c)))/(1+\exp(4(x+c)))$.

Can anyone figure out where I have made an error? The only thing I can think of is something with evaluating the absolute values of the natural logarithms.

2

There are 2 best solutions below

0
On BEST ANSWER

Saturday morning: I do like robjohn's point about $\log |x|$ giving the student some incorrect expectations. What I wrote here is correct and careful, but the same conclusions come from dropping the absolute value signs and doing the calculations three times, $y < -2,$ $-2 < y < 2,$ $y > 2.$ At some point the vertical asymptotes will be revealed, how solutions with $y > 2$ reach a vertical asymptote and then jump below to $y < -2.$ That is how I usually do things, split into cases early.

Lost my train of thought. However, if I want $\int \frac{1}{x} dx,$ without absolute values, the answer would be $\log x$ for $x > 0,$ but $\log (-x)$ for $x < 0.$

$-\frac14 \log|y+2| + \frac14 \log|y-2| = x+C$

which simplifies as:

$\log|y-2|-\log|y+2|=4(x+c),$ or

$$ \left| \frac{y-2}{y+2} \right| = k e^{4x} $$ with $k > 0$ for the nonconstant solutions. The item inside absolute value signs is a linear fractional or Mobius transformation, once we decide about the $\pm$ signs the inverse is given by the matrix $$ \left( \begin{array}{rr} 2 & 2 \\ -1 & 1 \end{array} \right) $$ If $y > 2$ or $y < -2,$ those inequalities hold true forever, we have $$ \frac{y-2}{y+2} = k e^{4x} $$ and we get robjohn's $$ y = \frac{2k e^{4x} + 2}{-k e^{4x} + 1}. $$ There is a jump discontinuity: for some value of $x,$ we find that $-k e^{4x} + 1= 0,$ indeed $e^{4x} = 1/k,$ $4x = - \log k,$ x = $-(1/4) \log k.$ For $x < -(1/4) \log k,$ we have $y > 2.$ There is a vertical asymptote, then for $x > -(1/4) \log k,$ we have $y < -2.$

In all cases, the curves are asymptotic to the lines $y=2$ and $y=-2.$ Also, note that the ODE is autonomous. Given one of the solutions described, we get another solution by shifting $x$ by any constant we like. If preferred, we can drop the multiplier $k$ by emphasizing the horizontal shifts.

If, however, we begin with $-2 < y < 2,$ then those inequalites hold forever, we have $$ \frac{y-2}{y+2} = - k e^{4x} $$ and we get the continuous $$ y = \frac{-2k e^{4x} + 2}{k e^{4x} + 1}. $$

In the picture below, I took $k=1.$ To find all other solutions, replace $x$ by some $x - x_0.$ Put another way, we can take $e^{-4 x_0}= k;$ thus, we can account for all solutions either by varying $k,$ or by deleting $k$ and adjusting $x_0.$ Note also that the part with $y>2$ and the part with $y < -2$ are tied together, the same vertical asymptote.

enter image description here

3
On

$$ \begin{align} x &=\int\frac{\,\mathrm{d}y}{y^2-4}\\ &=\frac14\int\left(\frac1{y-2}-\frac1{y+2}\right)\,\mathrm{d}y\\ &=\frac14\log\left(\frac{y-2}{y+2}\right)+C \end{align} $$ Therefore, $$ \frac{y-2}{y+2}=ke^{4x} $$ or, solving for $y$, $$ y=2\,\frac{1+ke^{4x}}{1-ke^{4x}} $$ We get your form of the answer by letting $k\lt0$. It is hard to see this since you need to use a complex $c$ to get the equivalent answer. Check your answer in the original equation. You'll see that it works.