In order to find the value of the investment, we can use the following equation:
![P=P_0(1+(r)/(n))^(nt)](https://img.qammunity.org/2023/formulas/mathematics/college/jvk242a43pnxd9ypuvp7jl2j7cvtki849l.png)
Where P is the final value, P0 is the initial value, r is the annual rate, t is the amount of time and n is a factor that depends on the compound interval (for a semiannual compound, we have n = 2).
So for the first period of 4 years, we have that:
![\begin{gathered} P=4000(1+(0.08)/(2))^(2\cdot4) \\ P=4000(1+0.04)^8 \\ P=4000(1.04)^8 \\ P=4000\cdot1.368569=5474.28 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/rw76drgalv4uoaoltzg3rsrb9677xzt237.png)
Then, we had an addition of 5000, so the new initial value is:
![5474.28+5000=10474.28](https://img.qammunity.org/2023/formulas/mathematics/college/j0hpxtw2ji6qhyxvqgi6698uo9dl5curxa.png)
Now, for the next 2 years, we have that:
![\begin{gathered} P=10474.28(1+(0.08)/(2))^(2\cdot2) \\ P=10474.28(1.04)^4 \\ P=10474.28\cdot1.169859=12253.43 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/i9fzdki06s9i9j3gr24v4il9pipzilk34h.png)
So the final value at the end of 6 years is $12,253.43