
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
Environmental protection is a major theme in today's society. A certain company actively responds to the call and innovatively develops an environmentally friendly product. After multiple inspections of the product quality, it has been decided to mass-produce and market the product. It is known that the annual fixed research and development cost of the product is $6$ million yuan, and an additional $1000$ yuan is required for each unit produced. According to statistics, the company found that when the annual output is $x$ thousand units, the total sales revenue is given by $Q(x)=\left\{{\begin{array}{l}{-{x^2}+1040x+1200,0＜x≤30,}\\{998x-\frac{{2048}}{{x-2}}+1800,x＞30．}\end{array}}\right.$<br/>$(1)$ Find the analytical expression of the annual total profit $W\left(x\right)$ (in million yuan) in terms of $x$ (thousand units) (where annual total profit $=$ annual total sales revenue $-$ annual cost);<br/>$(2)$ Analyze at what production level the company should produce the product to maximize profit. What is the maximum profit?

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