Solving a first order non-linear ordinary differential equation

54 Views Asked by At

I would like to know how to solve the following differential equation $$ \frac{dy}{dx} = 4y \biggl(\!-\frac{x}{2} - y \biggr) - \frac12 $$ but I'm not sure how to go about doing so given it is non-linear, inhomogeneous and has both explicit dependence on $x$ and $y$. I believe the answer is: $$ y = -\frac{x}{2} + \frac{e^{x^{2}}}{C+2\sqrt{\pi} \operatorname{Erfi}(x)} $$ where $C$ is a constant and $\operatorname{Erfi}$ is the imaginary error function. I know I could just check this solves the differential equation but I was wondering if there are any standard techniques or tricks I could use to derive this without knowing it, a priori. Thanks in advance for any help.