
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
Consider the ellipse $C:\frac{{x}^{2}}{{a}^{2}}+\frac{{{y}^{2}}}{{{b}^{2}}}=1(a > b > 0)$ with an eccentricity of $\frac{1}{2}$. The distance from its left focus to the point $P(2,1)$ is $\sqrt{10}$. The line $l$ passing through the origin $O$ intersects $C$ at points $A$ and $B$, and the line segment $AB$ is bisected by the line $OP$.

(1) Find the equation of the ellipse $C$;

(2) Find the equation of the line $l$ when the area of $\triangle APB$ is maximized.

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