
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
A factory uses radiation to sterilize food, and now plans to build a worker dormitory nearby and provide radiation protection for it. The choice of radiation shielding materials for the building is related to the distance from the dormitory to the factory. The relationship between the total cost $p$ (in ten thousand yuan) of building the dormitory and the distance $x$ (in km) from the dormitory to the factory is given by $p= \frac {1000}{x+5}$ where $2 \leq x \leq 8$. For convenience, a simple access road will be constructed between the factory and the dormitory. The cost per kilometer for constructing the road is 5 ten thousand yuan, and the factory also provides a one-time subsidy for staff transportation costs amounting to $ \frac {1}{2}(x^{2}+25)$ in ten thousand yuan. Let $f(x)$ represent the sum of the costs of building the dormitory, constructing the road, and the transportation subsidy for the staff.

$(1)$ Find the expression for $f(x)$;

$(2)$ Determine how far from the factory the dormitory should be built to minimize the total cost $f(x)$, and find the minimum value.

Present the answer in LaTex format: \boxed{Your answer}
user