$I = \dfrac{k\sin \theta}{d^2}$

From the figure:

$\cos \theta = \dfrac{a}{d}$

$d = \dfrac{a}{\cos \theta}$

$I = \dfrac{k\sin \theta}{\left( \dfrac{a}{\cos \theta} \right)^2}$

$I = \dfrac{k\sin \theta}{\dfrac{a^2}{\cos^2 \theta}}$

$I = \dfrac{k}{a^2}\cos^2 \theta \, \sin \theta$

$I = \dfrac{k}{a^2}(1 - \sin^2 \theta) \sin \theta$

$I = \dfrac{k}{a^2}(\sin \theta - \sin^3 \theta)$

$\dfrac{dI}{d\theta} = \dfrac{k}{a^2}(\cos \theta - 3\sin^2 \theta \, \cos \theta) = 0$

$\cos \theta - 3\sin^2 \theta \, \cos \theta = 0$

$1 - 3\sin^2 \theta = 0$

$\sin^2 \theta = 1/3$

$\sin \theta = 1/\sqrt{3}$

$\tan \theta = \dfrac{h}{a}$

$h = a\tan \theta$

$h = a\left( \frac{1}{\sqrt{2}} \right)$

$h = \frac{1}{\sqrt{2}}\,\,a = \frac{1}{\sqrt{2}} \times \frac{\sqrt{2}}{\sqrt{2}}\,\,a$

$h = \frac{1}{2} \sqrt{2}\,a$ *answer*