How to solve this integral w.r.t. the solution of the ODE

58 Views Asked by At

I'm currently studying ODE's and had a question regarding the solution to a problem. The exercise problem is relatively simple:

Find the solution for the following ODE:

$$y' = 1 - y^2$$

I'm experiencing some confusion regarding the solution. Probably because it's been a very long time since I've studied calculus.

My approach is:

$$ \begin{align} y' & = 1 - y^2 \\ \frac{1}{1 - y^2}y' & = 1 \\ \int \frac{1}{1 - y^2}\,dy & = \int 1 \, dx \\ \end{align} $$

Solving the integral on the left:

$$ \begin{align} \int \frac{1}{1 - y^2}\,dy & = \int \left( \frac{1}{2(1 + y)} + \frac{1}{2(1 - y)} \right)\,dy \\ & = \frac{1}{2}\int \frac{1}{1 + y}\,dy + \frac{1}{2}\int \frac{1}{1 - y}\,dy \\ & = \frac{1}{2} \ln(\vert1 + y\vert) + \frac{1}{2} \ln{(\vert 1 - y\vert)} + C \end{align} $$

And therefore I concluded that the solution to the ODE is:

$$ \begin{align} \frac{1}{2} \ln{(\vert 1 + y \vert)} + \frac{1}{2} \ln(\vert 1 - y \vert ) & = x + C \\ \ln(\vert 1 + y \vert) + \ln(\vert 1 - y \vert) & = 2x + C \\ \ln(\vert 1 - y^2 \vert ) & = 2x + C \\ \vert 1 - y^2 \vert & = Ce^{2x} \end{align} $$

and therefore:

$$ y = \begin{cases} \begin{align} \sqrt{-Ce^{2x} + 1} && 1 - y^2 \ge 0 \\ \sqrt{Ce^{2x} + 1} && 1 - y^2 \lt 0 \end{align} \end{cases} $$

However, the solution is simply:

$$ y = \tanh{(x + C)} $$

My questions are the following:

  1. How should I be able to recognize that apparently the integral that the solution uses to go to $\tanh$ is a standard integral? I've thought of ways that I could derive it, but other than memorization it seems difficult to find the connection.

  2. When do I know whether or not to include the absolute values for the solutions when a natural logarithm is involved? I've noticed in many cases the final solution doesn't include the absolute value forms, but there's rarely a justification or explanation as to why that conclusion was made.

Thanks in advance.

2

There are 2 best solutions below

0
On

You can make the problem simpler using $y=iz$ and the equation becomes $$iz'=1+z^2\implies \frac{z'}{1+z^2}=-i\implies \tan ^{-1}(z)=-i x+C$$ Back to $y$ $$\tan ^{-1}(iy)=-i x+C \implies i\tanh ^{-1}(y)=-i x+C\implies y=\tanh(x+C)$$

0
On

You have $$\ln(\vert 1 - y^2 \vert ) = 2x + C.$$ Exponentiating both sides yields $$ |1-y^2| = e^{2x}e^C = \left( e^{2x}\cdot\text{positive constant}\right). $$ From this you get $$ 1-y^2 = \left( e^{2x}\cdot\text{nonzero constant} \right) $$ where the absolute value is no longer there and the constant need not be positive. Earlier you tacitly assumed $1-y^2$ is not zero, when you divided both sides by it. That means the question of whether $1-y^2$ can be $0$ needs to be examined separately. And $y= 1$ for all $x$, and $y=-1$ for all $x$ are in fact solutions.