# General solution to $\frac{df}{dx}=3f$

I am learning how to do calculus and was presented with an example I am struggling a bit to understand. Why does $\frac{df}{dx}=3f$ have the general solution of $f(x)=Ce^{3x}$?

-
Have you tried differentiating $Ce^{3x}$? – J. M. Nov 24 '11 at 17:52
I suppose the deeper interpretation of the question is why this ODE only has solution $f(x) = Ce^{3x}$, i.e. why this is the most general possible solution. – user7530 Nov 24 '11 at 18:00
If we take 7530's "deeper interpretation", note that you can rearrange things as $\dfrac{f^\prime}{f}=3$. Recall that one can logarithmically differentiate: $\dfrac{\mathrm d}{\mathrm dx}\log(f(x))=\dfrac{f^\prime(x)}{f(x)}$... then integrate both sides. – J. M. Nov 24 '11 at 18:07
@J.M. What happens at the points where $f$ could be 0? For calculus, I preffer the following approach: Let $g(x)= \frac{f(x)}{e^{3x}}$. Then $g'(x)=....$... – N. S. Nov 24 '11 at 18:29
@J.M. The point I am trying to make is that the problem only gives $f'=3f$. I don't see any obvious reason (at the level of a first year calculus student) to conclude that $f$ is nowhere vanishing....Yes we know the solution is the exponential function, which doesn't vanish, but how can we use that before solving the problem? – N. S. Nov 24 '11 at 18:50

If we are worried about the hazards of division by $0$, let $$g(x)=\frac{f(x)}{e^{3x}}.$$ Differentiate, using the Quotient Rule. We get $$g'(x)=\frac{e^{3x}f'(x)-f(x)(3e^{3x})}{(e^{3x})^2}.\qquad\qquad(\ast)$$ Using $f'(x)=3f(x)$ we can see that the numerator in $(\ast)$ is $0$. So $g'(x)$ is identically $0$, and therefore $g(x)$ is a constant function $C$. Thus $$C=\frac{f(x)}{e^{3x}},$$ and $f(x)=Ce^{3x}$.
You have $\frac{dy}{dx} = 3y$. Multiply by $x$ and divide by $y$ you'll get $\frac{1}{y}dy=3dx$. By doing integration you'll have: $\int \frac{1}{y}dy=\int3dx$, and after solving the integral you'll have $\log{y} = 3x + c$. By looking at the exponent, you'll get $y = e^{3x}e^{c}$, where $c^{,} = e^{c}$ is a positive constant.