
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
In recent years, the emergence of "shared bicycles" has greatly facilitated the "green travel" of citizens. A shared bicycle company "Mobike" plans to invest a total of 1.2 million Yuan in two cities, A and B. According to industry regulations, each city needs a minimum investment of 0.4 million Yuan. Preliminary market research shows: the profit $P$ in city A is related to the investment $a$ (in units of ten thousand Yuan) by the relation $P=3\sqrt{2a}-6$, and the profit $Q$ in city B is related to the investment $a$ by $Q=\frac{1}{4}a+2$. Let the investment in city A be $x$ (in units of ten thousand Yuan), and the total profit for both cities be $f(x)$.
$(1)$ When city A receives an investment of 0.5 million Yuan, calculate the company's total profit at that time.
$(2)$ How should investments in cities A and B be arranged in order to maximize the total profit?

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