<s>[INST] Solving a separable differential equation Solve the differential equation:
$$y'=\frac{1-y^2}{1-x^2}$$
My book says the solution is: $$y=\frac{x+c}{cx+1},$$ where $c$ is a constant.
It's been ten minutes I tried to verify if it was correct but I'm pretty sure the book is wrong. Can someone confirm it?
 [/INST] We have
$$
\frac{dy}{dx}=\frac{1-y^2}{1-x^2}.
$$
Using separation variable we obtain
$$
\frac{dy}{1-y^2}=\frac{dx}{1-x^2}.
$$
Integrating both sides yields
$$\eqalign
{
\int\frac{dy}{1-y^2}&=\int\frac{dx}{1-x^2}\\
\frac12\int\left[\frac{1}{1+y}+\frac{1}{1-y}\right]\ dy&=\frac12\int\left[\frac{1}{1+x}+\frac{1}{1-x}\right]\ dx\\
\ln(1+y)-\ln(1-y)&=\ln(1+x)-\ln(1-x)+C_1\\
\ln\frac{1+y}{1-y}&=\ln\frac{1+x}{1-x}+C_1\\
\frac{1+y}{1-y}&=C_2\cdot\frac{1+x}{1-x}\\
y&=\frac{k_1x+k_2}{k_2x+k_1}\quad\Rightarrow\quad\text{dividing by}\ k_1\\
\color{blue}{y(x)}&\color{blue}{=\frac{x+c}{c\, x+1}}.
}
$$
where $C_2=e^{C_1}$, $k_1=C_2+1$, $k_2=C_2-1$, and $c=\dfrac{k_2}{k_1}$.
</s>