
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 certain company has a fixed cost of 20,000 yuan for producing an electronic instrument. It costs an additional 100 yuan to produce each instrument. The total revenue function $R(x)$ is given by
$$ R(x) = \begin{cases} 400x-\frac{1}{2}x^2, & 0 \leq x \leq 400 \\ 80000, & x > 400 \end{cases} $$
where $x$ is the number of instruments produced (in units);
(1) Express the profit function $f(x)$ as a function of the output $x$ (profit = total revenue - total cost);
(2) At what production level $x$ does the company maximize its profit? What is the maximum profit in yuan?

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