I like to do these all in present value. Somehow it is easier for me to think about things relative to today. And we need to convert everything to quarters because that is our compounding period.
I am guessing that what is intended here is 4% per annum compounded quarterly. So the quarterly rate is 4% / 4 = 1%.
6000 due 2 years ago, so minus 8 quarters.
4000 due 3 years from now, so plus 12 quarters.
1000 due today, so 0 quarters.
3000 due 30 months from now, so 2.5 years, or plus 10 quarters.
x due 5 years from now so plus 20 quarters.
Notice that if you treat the present as zero, past periods are negative, and future periods are positive. This keeps me from getting my brains scrambled.
You have now done the preliminary work required before setting up the equation.
[MATH]\therefore \dfrac{6000}{1.01^{-8}} + \dfrac{4000}{1.01^{12}} = \dfrac{1000}{1.01^0} + \dfrac{3000}{1.01^{10}} + \dfrac{x}{1.01^{20}}.[/MATH]
Now you can proceed in a number of ways, but I hate fractions so I would clear fractions first.
[MATH]1.01^{20} * \left ( \dfrac{6000}{1.01^{-8}} + \dfrac{4000}{1.01^{12}} \right ) = 1.01^{20} * \left ( \dfrac{1000}{1.01^0} + \dfrac{3000}{1.01^{10}} + \dfrac{x}{1.01^{20}} \right ) \implies .[/MATH]
[MATH]6000(1.01)^{\{20-(-8)\}} + 4000(1.01)^{(20-12)} = 1000(1.01)^{(20-0)} + 3000(1.01)^{(20 -10)} + x(1.01)^{(20-20)} \implies [/MATH]
[MATH]6000(1.01)^{28} + 4000(1.01)^8 = 1000(1.01)^{20} + 3000(1.01)^{10} + x(1.01)^0.[/MATH]
Which gets you to the equation that you were looking for with no muss no fuss. Furthermore it simplifies nicely to
[MATH]6000(1.01)^{28} + 4000(1.01)^8 = 1000(1.01)^{20} + 3000(1.01)^{10} + x \implies[/MATH]
[MATH]x = 1000\{6(1.01)^{28} + 4(1.01)^8 - (1.01)^{20} - 3(1.01)^{10}\}.[/MATH]
Now it is just arithmetic.
If you wanted to define x in terms of thousands of dollars, you could eliminate all those thousands from the get go.
EDIT: My original equation was done in terms of present value, but when I cleared fractions, that transformed it into a future value equation. Probably you were taught in terms of future value to avoid fractions, but, as I said, it gets tricky thinking that way when some numbers are in the past relative to the present. But obviously the present value and future value equations are just different ways to get to the same result. You just need to insure that you are consistent with your temporal reference point.