Step 1: Name the function:
Let $y = \sqrt{x^2+ax+1}$. Squaring both sides gives $y^2 = x^2 + ax + 1$.
Step 2: Differentiate both sides with respect to x:
On the left, $y^2$ is a function of $y$, and $y$ depends on $x$, so $\frac{d}{dx}(y^2) = 2y\frac{dy}{dx}$. On the right we get $2x + a$.
\[ 2y\,\frac{dy}{dx} = 2x + a \]
Step 3: Solve for dy/dx:
\[ \frac{dy}{dx} = \frac{2x+a}{2y} = \frac{2x+a}{2\sqrt{x^2+ax+1}} \]
Step 4: Match with the options:
This is option (B). A quick check at $x = 0$, $a = 0$: the function is $\sqrt{x^2+1}$ with slope 0 at $x = 0$, and (B) gives $0$. Option (D) would give $\frac{1}{2}$ there, so it is wrong, and (A) and (C) differ from (B) by a missing factor.
Final Answer:
The derivative is $\frac{2x+a}{2\sqrt{x^2+ax+1}}$, option (B).
\[ \boxed{\frac{2x+a}{2\sqrt{x^2+ax+1}}} \]