<s>[INST] Finding the angle between u and v. Struggling with the following Suppose that $u$ and $v$ are non-parallel unit vectors, $a=u+sv$ and $b=u-sv$, where $s$ is a real number. If the angle $\theta$ between $u$ and $v$ is the same as the angle between $a$ and $b$, show that:
$$\cos^{2}\theta= \frac {1-2s^{2}+s^{4}}{4s^{2}}$$
Hence find $s$ such that $\theta= \pi/4$ and $0<s<1$. 
Many thanks in advance.
 [/INST] The cosine of the angle between two vectors $x$ and $y$ is
$$\frac{x\cdot y}{\Vert x\Vert\Vert y\Vert}.$$
Since $u$ and $v$ are unit vectors, the cosine of the angle $\theta$ between them is $u\cdot v$.  
The angle between $u+sv$ and $u-sv$ is also $\theta$.
So we  calculate the cosine of the angle between $u+sv$ and $u-sv$. First find the dot product $(u+sv)\cdot(u-sv)$. Calculation gives, since $u$ and $v$ have norm $1$, that the dot product is $1-s^2$.
We also need the norms of $u+sv$ and $u-sv$. Take the dot product of $u+sv$ with itself. We get $1+s^2+2s\cos\theta$, since $u\cdot v=\cos\theta$. The norm is the square root of that. A similar expression can be found for the norm of $u-sv$.  We conclude that
$$\cos\theta=\frac{1-s^2}{ \sqrt{(1+s^2+2s\cos\theta)(1+s^2-2s\cos\theta) }}.$$ 
Square both sides. Some manipulation brings us to a quadratic equation for $\cos^2\theta$ that can be rewritten as
$$\left(4s^2\cos^2\theta-(1-s^2)^2\right)\left(\cos^2\theta-1\right)=0.$$
Since $\cos^2\theta\ne 1$, the desired result follows.
Finally, we find $s$ when $\theta=\pi/4$. There, the cosine is $1/\sqrt{2}$, and we arrive at the equation $s^4-4s^2+1=0$.  By the Quadratic Formula, $s^2=2\pm\sqrt{3}$.  Since $s$ is between $0$ and $1$, $s=\sqrt{2-\sqrt{3}}$.
</s>