i used to substitute a value into the actual book prescribed answer and the into the answer i got to see if the equations yield the same answer. i now want to confirm if the method i am using is legitimate.
this is my solution to the question
this is the book solution


If we fix the value error in your integral, we get $$\int\frac x{\sqrt{x+4}}\,dx$$ And your substitution becomes $t^2 = x + 4$ and $x = t^2 - 4$. Let's explicitly add the condition that $t > 0$, as that is all that is needed to cover all values of $x$. You still get $dx = 2t\,dt$.
Let's be a bit clearer about how this substitution goes than you were: $$\int\frac x{\sqrt{x+4}}\,dx = \int \frac{(t^2 - 4)}{\sqrt{t^2}}(2t\,dt)= \int 2t^2 - 8\,dt = \frac23t^3 - 8t + C$$
(You may not understand why yet, but that $+\,C$ on the end is important. Don't leave it off.)
Now you stop here, as if you were done. You are not. The original integral is in $x$, not $t$. You need to transform it back to $x$ by $t = \sqrt{x+4}$ $$\int\frac x{\sqrt{x+4}}\,dx = \frac23(\sqrt{x+4})^3 - 8\sqrt{x+4} + C$$
Still looks different from the book's answer. But it isn't different. However, I am going to leave it to you to explore why. Now it is strictly an algebra problem.