Let $\mathbf{a}$ and $\mathbf{b}$ be two nonzero vectors such that $\mathbf{a} + \mathbf{b}$ and $\mathbf{b}$ are orthogonal, and $\mathbf{a} + 2 \mathbf{b}$ and $\mathbf{a}$ are orthogonal.  Find $\frac{\|\mathbf{a}\|}{\|\mathbf{b}\|}.$
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Let $\mathbf{a}$ and $\mathbf{b}$ be two nonzero vectors such that $\mathbf{a} + \mathbf{b}$ and $\mathbf{b}$ are orthogonal, and $\mathbf{a} + 2 \mathbf{b}$ and $\mathbf{a}$ are orthogonal.  Find $\frac{\|\mathbf{a}\|}{\|\mathbf{b}\|}.$
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
\sqrt{2}
Let $\mathbf{a}$ and $\mathbf{b}$ be two nonzero vectors such that $\mathbf{a} + \mathbf{b}$ and $\mathbf{b}$ are orthogonal, and $\mathbf{a} + 2 \mathbf{b}$ and $\mathbf{a}$ are orthogonal.  Find $\frac{\|\mathbf{a}\|}{\|\mathbf{b}\|}.$
train