Đặt $t=\dfrac{x}{y}$ ta có:
$B=\dfrac{\left(\dfrac{x}{y}\right)^2+3\dfrac{x}{y}+1}{\sqrt{\dfrac{x}{y}}\left(\dfrac{x}{y}+1\right)}$
$=\dfrac{t^2+3t+1}{(t+1)\sqrt t}=f(t)$
Ta có:
$f'(t)=\dfrac{t^3-1}{2(t+1)^2\sqrt{t^3}}$
$f'(t)=0 \Leftrightarrow t=1$
Từ đó suy ra: $\min f(t)=\dfrac{5}{2} \Leftrightarrow t=1$
Vậy $\min B=\dfrac{5}{2} \Leftrightarrow x=y$