3. Given planar vectors $\boldsymbol{a}=(\sqrt{3},-1), \boldsymbol{b}=$ $\left(\frac{1}{2}, \frac{\sqrt{3}}{2}\right)$. If there exist non-zero real numbers $k$ and angle $\alpha, \alpha \in$ $\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$, such that $\boldsymbol{c}=\boldsymbol{a}+\left(\tan ^{2} \alpha-3\right) \boldsymbol{b}, \boldsymbol{d}=$ $-k \boldsymbol{a}+(\tan \alpha) \boldsymbol{b}$, and $\boldsymbol{c} \perp \boldsymbol{d}$, then $k=$ $\qquad$ (expressed in terms of $\alpha$).
3. $\frac{1}{4}\left(\tan ^{3} \alpha-3 \tan \alpha\right), \alpha \in\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$.

From $\boldsymbol{a} \cdot \boldsymbol{b}=(\sqrt{3},-1) \cdot\left(\frac{1}{2}, \frac{\sqrt{3}}{2}\right)=0$, we get $\boldsymbol{a} \perp \boldsymbol{b}$.
Also, $\boldsymbol{c} \perp \boldsymbol{d}$, then
$$
\left[\boldsymbol{a}+\left(\tan ^{2} \alpha-3\right) \boldsymbol{b}\right] \cdot[-k \boldsymbol{a}+(\tan \alpha) \boldsymbol{b}]=0 \text {, }
$$

which means
$$
\begin{array}{l}
k \boldsymbol{a}^{2}=\left(\tan ^{3} \alpha-3 \tan \alpha\right) \boldsymbol{b}^{2}, \\
k|\boldsymbol{a}|^{2}=\left(\tan ^{3} \alpha-3 \tan \alpha\right)|\boldsymbol{b}|^{2} .
\end{array}
$$

Given that $|\boldsymbol{a}|=2,|\boldsymbol{b}|=1$, we have
$$
k=\frac{1}{4}\left(\tan ^{3} \alpha-3 \tan \alpha\right), \alpha \in\left(-\frac{\pi}{2}, \frac{\pi}{2}\right) .
$$