Let the magnitude of each vector be P, and let θ be the angle between P and Q.
The magnitude of P+Q is ∣P+Q∣=P2+Q2+2PQcosθ. Since P=Q, this becomes 2P2+2P2cosθ=P2(1+cosθ).
The magnitude of P−Q is ∣P−Q∣=P2+Q2−2PQcosθ=P2(1−cosθ).
Setting ∣P+Q∣=n∣P−Q∣ gives P2(1+cosθ)=nP2(1−cosθ), so 1+cosθ=n2(1−cosθ).
Solving: 1+cosθ=n2−n2cosθ, hence cosθ(1+n2)=n2−1, giving cosθ=n2+1n2−1.
Therefore the angle between the two vectors is θ=cos−1(n2+1n2−1).