Squaring both sides, we get
\[x + \sqrt{3x + 6} + 2 \sqrt{x + \sqrt{3x + 6}} \sqrt{x - \sqrt{3x + 6}} + x - \sqrt{3x + 6} = 36.\]Then
\[2x + 2 \sqrt{x^2 - 3x - 6} = 36,\]so
\[\sqrt{x^2 - 3x - 6} = 18 - x.\]Squaring both sides, we get $x^2 - 3x - 6 = 324 - 36x + x^2.$  Hence, $x = \boxed{10}.$  We check that this solution works.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Solve
\[\sqrt{x + \sqrt{3x + 6}} + \sqrt{x - \sqrt{3x + 6}} = 6.\]
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
10
Solve
\[\sqrt{x + \sqrt{3x + 6}} + \sqrt{x - \sqrt{3x + 6}} = 6.\]
test