Two charges $-q$ each are separated by distance $2 d$. A third charge $+q$ is kept at mid-point 0 . Find potential energy of $+q$ as a function of small distance $x$ from 0 due to $-q$ charges. Sketch PE Vs $/ x$ and convince yourself that the charge at 0 is in an unstable equilibrium.
Let third charge $+q$ is slightly displaced from mean position towards first charge. So, the total potential energy of the system is given by
$$\begin{aligned} U & =\frac{1}{4 \pi \varepsilon_0}\left\{\frac{-q^2}{(d-x)}+\frac{-q^2}{(d+x)}\right\} \\ U & =\frac{-q^2}{4 \pi \varepsilon_0} \frac{2 d}{\left(d^2-x^2\right)} \\ \frac{d U}{d x} & =\frac{-q^2 \cdot 2 d}{4 \pi \varepsilon_0} \cdot \frac{2 x}{\left(d^2-x^2\right)^2} \end{aligned}$$
The system will be in equilibrium, if
$$F=-\frac{d U}{d x}=0$$
On solving, $x=0$. So for, $+q$ charge to be in stable/unstable equilibrium, finding second derivative of PE.
$$\begin{aligned} \frac{d^2 U}{d x^2} & =\left(\frac{-2 d q^2}{4 \pi \varepsilon_0}\right)\left[\frac{2}{\left(d^2-x^2\right)^2}-\frac{8 x^2}{\left(d^2-x^2\right)^3}\right] \\ & =\left(\frac{-2 d q^2}{4 \pi \varepsilon_0}\right) \frac{1}{\left(d^2-x^2\right)^3}\left[2\left(d^2-x^2\right)^2-8 x^2\right] \\ \text{At}\quad x & =0 \\ \frac{d^2 U}{d x^2} & =\left(\frac{-2 d q^2}{4 \pi \varepsilon_0}\right)\left(\frac{1}{d^6}\right)\left(2 d^2\right), \text { which is }<0 \end{aligned}$$
This shows that system will be unstable equilibrium.