"Find $y(x)$ to satisfy $y' = (x-2)^2$, $y(2) = 1$"
My Work:
So, this takes on the form:
$\int dy = \int (x-2)^2dx$
I then try solving via $u = x-2$, and get:
$y = \frac{(x-2)^3}{3} + C \to$ $1 = \frac{(2-2)^3}{3} + C \to C = 1 \therefore y = \frac{(x-2)^3}{3} + 1$
This is the only answer given in my book. However, I originally did the integral by expanding $(x-2)^2$, which I usually prefer to do if all the expanded integrals will be very simple. By that, I get:
$\int dy = \int (x^2 - 4x + 4)dx$
When solved:
$y = \frac{x^3}{3} - 2x^2 + 4x + C \to 1 = \frac{2^3}{3} - 2(2)^2 + 4(2) + C \to$
$1 = \frac{8}{3} - 8 + 8 + C \to C = \frac{-5}{3} \therefore y = \frac{x^3}{3} - 2x^2 + 4x -\frac{5}{3}$
So the same simple integral, when expanded, gives a totally different value for C. Is this valid? If not, what have I done wrong that leads to this result?
Your two different methods lead you to find two different constants, $c_1$ and $c_2$. That's not wrong - there are in fact infinitely many general solutions to this differential equation. That's why you need to specify an initial value condition, to nail down one particular solution.
In this case, your integration-by-substitution carries over an extra constant term, $\frac{-8}{3}$, which is basically just a parallel shift of the expression for the general solution.
What matters is your particular solution - the specific solution satisfying the initial value condition $y(2)=1$. That is, the equation you will get after you substitute in the relevant constants you found. You should try continuing your two methods of solution to their conclusion by doing this.
In both methods, you should find that the particular solution will be the same:
$y_p = \frac{x^3}{3}-2x^2+4x-\frac{5}{3}$.
Hope it helps :)