
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 electronics company produced a certain electronic product in the year $2023$, with fixed costs of $2$ million yuan. An additional investment of $0.1$ million yuan is required for every ten thousand units of the electronic product produced. It is known that the total revenue $R (\text{in million yuan})$ as a function of total output $x$ (in ten thousand units) satisfies the function:
$R(x)=\left\{\begin{array}{l}40x-\frac{1}{2}x^{2},0\leq x\leq 40\\ 1500-\frac{25000}{x},x>40\end{array}\right.$
$(1)$ Express the profit $f(x)$ (in million yuan) as a function of total output $x$ (in ten thousand units);  
$(2)$ For what value of total output $x$ (in ten thousand units) does the electronic company achieve the maximum profit, and what is the maximum profit in million yuan? (Profit + Total cost = Total revenue).

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