# Solving Riccati type differential equation

I'm stuck at solving this differential equation. I know it is of Riccati type but I have no clue how to proceed. Any help would be appreciated.

$y'+y^{2}+2a\tanh(x)y+a(a-1)\tanh(x)^{2}+1=0$

• Looking sharply at the last terms one can recognize the square of $u(x)=1+a\tanh(x)$. As $u'(x)=-a\tanh(x)^2$ you can write the ODE as $$y'+y^2 + u'+u^2=0$$ Are you sure that the task reproduction is correct? If it were $y'+y^2=u'+u^2$ you would have $y=u$ as a particular solution and could proceed in the standard way. Even with $y'-y^2+u'+u^2=0$ you get $y=-u$ as particular solution. – LutzL Jul 6 '18 at 9:40
• Actually, I got a term wrong. Edited it now. Sorry – Sudheesh Surendranath Jul 6 '18 at 10:03

By completing the square one finds $$(y+a\tanh(x))'+(y+a\tanh(x))^2+1=0$$ so setting $u=y+a\tanh(x)$ gets the separable equation $$u'=-(1+u^2).$$