Using separation of variables Solve $\frac{dy}{dx} = 3y +1.$ My final answer I got was: $y = \pm C \frac{e^x}{3} - \frac{1}{3}.$
But I don't how to take the derivative of that to get it back to my orig problem
Using separation of variables Solve $\frac{dy}{dx} = 3y +1.$ My final answer I got was: $y = \pm C \frac{e^x}{3} - \frac{1}{3}.$
But I don't how to take the derivative of that to get it back to my orig problem
First, note that a constant divided by $3$ is just a constant, so you could rewrite what you have without the fraction. Also, plus or minus a constant is just a constant. So you could rewrite your solution as $y = Ce^x - \frac{1}{3}.$
To check, you just take the derivative: $C$ is a constant, so $\frac{dy}{dx} = \frac{d}{dx}\left(Ce^x - \frac{1}{3}\right) = C\frac{d}{dx}e^x - \frac{d}{dx}\frac{1}{3} = Ce^x.$
Then you compute $3y + 1 = 3Ce^x - 1 + 1 = 3Ce^x$.
This is not the same as $\frac{dy}{dx}$, so this is not a correct answer.
And, no, it wasn't my "simplifications" that did you in: $\frac{d}{dx}\left( \pm \frac{Ce^x}{3} - \frac{1}{3}\right) = \pm\frac{C}{3}\frac{d}{dx}e^x = \pm\frac{C}{3}e^x,$ and $3\left(\pm\frac{Ce^x}{3}-\frac{1}{3}\right) + 1 = \pm Ce^x\neq \pm\frac{Ce^x}{3}.$
So in fact, you did a mistake in your derivation.
From $\frac{dy}{dx} = 3y+1,$ we must consider the possibility that $3y+1=0$; this will occur if $y=-\frac{1}{3}$; that is one possible solution.
If $3y+1\neq 0$, then separating variables we get $\frac{dy}{3y+1} = dx,$ and integrating both sides, we have $\int\frac{dy}{3y+1} = \int\,dx.$ To do the integral on the left, we let $u=3y+1$; then $du = 3dy$, so $\frac{1}{3}du = dy$. Hence $\int\frac{dy}{3y+1} = \int\frac{\frac{1}{3}du}{u} = \frac{1}{3}\int\frac{du}{u} = \frac{1}{3}\ln|u|+C = \frac{1}{3}\ln|3y+1|+C;$ so, consolidating constants, we have: $\begin{align*} \int\frac{dy}{3y+1} &= \int\,dx\\ \frac{1}{3}\ln|3y+1| &= x+C&&C\text{ an arbitrary constant}\\ \ln|3y+1| &= 3x + D&&D\text{ an arbitrary constant}\\ e^{\ln|3y+1|} &= e^{3x+D}\\ |3y+1| &= e^De^{3x}\\ |3y+1| &= Ae^{3x} &&A\text{ a positive constant}\\ 3y+1 &=\pm Ae^{3x} &&A\text{ a positive constant}\\ 3y+1 &= Be^{3x} &&B\text{ a non-zero constant}\\ 3y &= Be^{3x} - 1\\ y &= \frac{B}{3}e^{3x} - \frac{1}{3}\\ y &= Ke^{3x} - \frac{1}{3} &&K\text{ a non-zero constant} \end{align*}$ I set $D=3C$, still a constant, then $A=e^D$, a positive constant (because $e^D$ is always positive); then $B=\pm A$, a nonzero constant (because $A$ is never zero, so $B$ is never zero); and finally $K=\frac{B}{3}$, a nonzero constant (because $B$ is never zero).
So putting it together with the special case considered before, we have that the solutions are: $\text{Either }y=-\frac{1}{3}\quad\text{or}\quad y = Ke^{3x}-\frac{1}{3}\text{ with }K\text{ non-zero.}$ Then we may realize that if we allow $K=0$, then we get the special case, so we can summarize the two cases by saying $ y = Ke^{3x} - \frac{1}{3},\quad K\text{ an arbitrary constant.}$
Now take derivatives and plug in to verify this is correct.