Given two planes find the value of k such that the angle between two planes is ${\frac\pi3}$

How can we determine the coefficients of the components of a plane when given the angle?

I am given two planes $$\Pi_1: 2x-y+2z=5$$ $$\Pi_2: x+2y+kz=3$$

and asked to find the value of k such that the angle between the planes is $${\frac\pi3}$$.

I know how to find the angle when given planes (with all of the coefficients) but I can't find any examples of how to find k when given the angle.

I think I'm supposed to use the equation $$cos\theta=\frac{\vec{n_1}\cdot\vec{n_2}}{||{\vec{n_1}||||\vec{n_2}}||}$$

$$\theta={\frac\pi3}$$

The normal vectors are $$\vec{n_1}=<2,-1,2>$$, $$\vec{n_2}=<1,2,k>$$

The dot product between the two normal vectors is $${\vec{n_1}\cdot\vec{n_2}}=2k$$

The magnitudes are

$$||\vec{n_1}||=3$$

$$||\vec{n_2}||=\sqrt{5+k^2}$$

So if I put all of it together I have $$\frac\pi3=\cos^{-1}\frac{2k}{3\sqrt{5+k^2}}$$ And I'm stuck here, I'm not even sure that the work above is what I was supposed to do, but if it is correct where should I go from here?

Any advice would be greatly appreciated.

Thank you,

You're correct so far, all that is left is to solve for $$k$$. $$cos(\frac{\pi}3) = \frac{2k}{3\sqrt{5+k^2}}$$ $$\frac{1}2 = \frac{2k}{3\sqrt{5+k^2}}$$ Squaring both sides, $$\frac{1}4 = \frac{4k^2}{9(5+k^2)}$$ $$\frac{1}4 = \frac{4k^2}{45+9k^2}$$ Multiplying both sides by $$45+9k^2$$, $$\frac{45+9k^2}4 = 4k^2$$ Multiplying both sides by $$4$$, $$45+9k^2 = 16k^2$$ Simplifying, $$45=7k^2$$ $$\frac{45}7 = k^2$$ $$k = \pm\sqrt{\frac{45}7} = \pm3\sqrt{\frac{5}7}$$
$$\frac{2k}{3\sqrt{5+k^2}}=\cos\frac\pi3=\frac{1}{2}$$