Take the cross product with \vec{a} to obtain
k(\vec{a}\times\vec{r})+\vec{a}\times(\vec{r}\times\vec{a})=\vec{a}\times\vec{b}
Since \vec{a}\times(\vec{r}\times\vec{a})=a^2\vec{r}-(\vec{a}\cdot\vec{r})\vec{a}
So the above equation becomes
k(\vec{a}\times\vec{r})+a^2\vec{r}-(\vec{a}\cdot\vec{r})\vec{a}=\vec{a}\times\vec{b}
which gives us
k(\vec{r}\times\vec{a})=a^2\vec{r}-(\vec{a}\cdot\vec{r})\vec{a}-\vec{a}\times\vec{b} ------ (1)
Again the dot product with \vec{a} of the original equation, we get
k(\vec{a}\cdot \vec{r})=\vec{a}\cdot \vec{b}
So from (1) we get
\vec{r}\times \vec{a}=\dfrac{a^2}{k}\vec{r}-\dfrac{(\vec{a}\cdot\vec{b})}{k^2}\vec{a}-\dfrac{1}{k}(\vec{a}\times \vec{b})
Substitute in the original one to get the required result.