Have you considered the basic formulation? You can do it in stages if it is easier to keep track.
Solve for X.
Note: You may wish to eliminate some rounding. There really is no need to use the three decimal places for intermediate results. I get an error of about 0.3¢ due to the unnecessary rounding. The integrals are exact to two decimal places, so that creates no additional rounding problem.