
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
Given point $P(4,4)$, circle $C$: $(x-m)^{2}+y^{2}=5$ $(m < 3)$ and ellipse $E$: $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1$ $(a > b > 0)$ have a common point $A(3,1)$. $F_{1}$ and $F_{2}$ are the left and right foci of the ellipse, respectively. The line $PF_{1}$ is tangent to circle $C$.

$(1)$ Find the value of $m$ and the equation of ellipse $E$;

$(2)$ Let $Q$ be a moving point on ellipse $E$, find the range of $\overrightarrow{AP} \cdot \overrightarrow{AQ}$.

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