I am studying the following Riccati equation $$y' + \frac{y}x + y^2 = \frac{4}{x^2},$$ and I know the following solution
$$y=\frac{a}{x}$$
I need to find a general solution for this equation, and by using the above equation and the following one
$$y' = \frac{-a}{x^2},$$
I was able to write the following equation for the unknown constant $a$:
$$
a^2 = 4
$$
Is this the correct way to find $a$? And if it is so, how do I choose between $a = 2$ and $a = -2$? Thanks
Edit
I assumed $a = 2$ therefore $y = \frac{2}{x}$
$y_1 = \frac{2}{x} + \frac{1}{u}$ and $y_1' = \frac{-2}{x^2}-\frac{u'}{u^2}$
Now I put $y_1$ and $y_1'$ in the first equation
This leads me
$u' -\frac{5}{x}u = 1 $.
I applied integrating factor to find a general solution
$u = -\frac{x}{4}+cx^5$
I put $u$ in $y_1 = \frac{2}{x} + \frac{1}{u}$ and got my final result.
$y = \frac{2}{x} + \frac{1}{\frac{-x}{4} + cx^5}$
Is this correct?
Substitute
$$y(x)=\frac{v(x)}{x}$$ then we get
$$\frac{dy(x)}{dx}=\frac{x\frac{dv(x)}{dx}-v(x)}{x^2}$$ and our equation will be
$$\frac{dv(x)}{dx}=\frac{-v(x)^2+4}{x}$$ Can you proceed? and then $$\int \frac{\frac{dv(x)}{dx}}{-v(x)^2+4}dx=\int \frac{1}{x}dx$$