Stuck solving this differential equation I'm trying to solve this differential equation: $y' = 9x^2+y+4+3x(2y+1)$
My approach to the problem:
First, I multiplied $3x$ by $(2y+1)$, which brought me to this equation:
\begin{align*}
    y' &= 9x^2+y^2+y+4+6xy+3x \\
    y' &= (3x+y)^2+(3x+y)+4
\end{align*}
Then I tried replacing $(3x+y)$ with $u$, so $y = u - 3x$ and $y' = u' - 3$
With this kind of replacement the equation then looked like this:
\begin{align*}
    u' - 3 &= u^2 + u + 4 \\
    u' &= u^2 + u + 7 \\
    du &/ (u^2+u+7)=dx 
\end{align*}
Problem:
This led to some confusion because $u^2 + u + 7$ does not seem to have any rational solutions and there is no mention of complex numbers in the answer. What exactly I might be doing wrong here? Maybe I've picked the wrong path from the start? Would really appreciate any help.
Answer to the differential equation:

 A: $$u^2+u+7=\left(u+\dfrac 12\right)^2+\dfrac {27}4$$
Then:
$$I= \int \dfrac  {du}{(u+\dfrac 12)^2+\dfrac {27}{4}}$$
$$I= \int \dfrac  {dv}{v^2+\dfrac {27}{4}}$$
$$I= \dfrac {2}{3  \sqrt 3 }\int \dfrac  {dw}{w^2+1}$$
Where  $w = \dfrac {2}{3 \sqrt 3} v$. Use the $\arctan$ function.
$$\int \dfrac {dw}{w^2+1}=\arctan w +C$$
A: Well, we can rewrite your equation:
$$\text{y}'\left(x\right)-\text{y}\left(x\right)\left(6x+1\right)=9x^2+3x+4\tag1$$
Now, let:
$$\mu\left(x\right):=\exp\left\{-\int\left(6x+1\right)\space\text{d}x\right\}=\exp\left(-x\left(3x+1\right)\right)\tag2$$
Multiply both sides by $\mu\left(x\right)$, substitute:
$$\frac{\text{d}}{\text{d}x}\left(\exp\left(-x\left(3x+1\right)\right)\right)=-\left(6x+1\right)\exp\left(-x\left(3x+1\right)\right)\tag3$$
And apply the reverse product rule, to end up with
$$\frac{\text{d}}{\text{d}x}\left(\text{y}\left(x\right)\exp\left(-x\left(3x+1\right)\right)\right)=\left(9x^2+3x+4\right)\exp\left(-x\left(3x+1\right)\right)\tag4$$
Integrate both sides with respect to $x$:
$$\text{y}\left(x\right)\exp\left(-x\left(3x+1\right)\right)=\int\left(9x^2+3x+4\right)\exp\left(-x\left(3x+1\right)\right)\space\text{d}x\tag5$$
So:
$$\text{y}\left(x\right)=\frac{1}{\exp\left(-x\left(3x+1\right)\right)}\int\left(9x^2+3x+4\right)\exp\left(-x\left(3x+1\right)\right)\space\text{d}x\tag6$$
And the integral on the RHS of $(6)$ is defined in terms of the error function.
