Given that $a+bi=p$ and $a^2-b^2=q$, how can I compute $ab+i$?
Note
$i=\sqrt{-1}$ is the complex number
$a$ and $b$ can be any integer
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityGiven that $a+bi=p$ and $a^2-b^2=q$, how can I compute $ab+i$?
Note
$i=\sqrt{-1}$ is the complex number
$a$ and $b$ can be any integer
$$p^2=a^2+2iab-b^2=q+2iab$$ Therefore $$ab+i=\frac{p^2-q}{2i} +i$$
Squaring the firtst equation we get $$a^2-b^2+2abi=p^2$$ so we get $$ab=-\left(\frac{p^2-q^2}{2}\right)i$$ Can you finish? We get $$ab+i=\left(-\left(\frac{p^2-q^2}{2}\right)+1\right)i$$
Square both sides, so $(a)^2+(bi)^2+2abi=p^2$. Since $i^2=-1$, $a^2-b^2+2abi=p^2$.
Substituting $q=a^2-b^2$, $q+2abi=p^2$, and $ab=\frac{p^2-q}{2i}$, so $ab+i=\frac{p^2-1}{2i}+i=\frac{p^2-q}{2i}+\frac{2i^2}{2i}=\frac{p^2-q-2}{2i}$