[b](a)[/b] Find all pairs $(n,x)$ of positive integers that satisfy the equation $2^n + 1 = x^2$.

[b](b)[/b] Find all pairs $(n,x)$ of positive integers that satisfy the equation $2^n = x^2 + 1$.
**(a)** Find all pairs \((n, x)\) of positive integers that satisfy the equation \(2^n + 1 = x^2\).

1. Start by rewriting the equation \(2^n + 1 = x^2\) as:
   \[
   2^n = x^2 - 1
   \]
   Notice that \(x^2 - 1\) can be factored as:
   \[
   2^n = (x - 1)(x + 1)
   \]

2. Since \(2^n\) is a power of 2, both \(x - 1\) and \(x + 1\) must also be powers of 2. Let:
   \[
   x - 1 = 2^a \quad \text{and} \quad x + 1 = 2^b
   \]
   where \(a\) and \(b\) are non-negative integers with \(a < b\).

3. From the equations \(x - 1 = 2^a\) and \(x + 1 = 2^b\), we can subtract the first from the second:
   \[
   (x + 1) - (x - 1) = 2^b - 2^a
   \]
   Simplifying, we get:
   \[
   2 = 2^b - 2^a
   \]

4. Factor out \(2^a\) from the right-hand side:
   \[
   2 = 2^a (2^{b-a} - 1)
   \]

5. Since \(2^a\) is a power of 2, the only way for the product to equal 2 is if \(2^a = 2\) and \(2^{b-a} - 1 = 1\). This gives:
   \[
   2^a = 2 \quad \Rightarrow \quad a = 1
   \]
   \[
   2^{b-a} - 1 = 1 \quad \Rightarrow \quad 2^{b-1} = 2 \quad \Rightarrow \quad b - 1 = 1 \quad \Rightarrow \quad b = 2
   \]

6. Substituting \(a = 1\) and \(b = 2\) back into the expressions for \(x\) and \(n\):
   \[
   x - 1 = 2^1 = 2 \quad \Rightarrow \quad x = 3
   \]
   \[
   x + 1 = 2^2 = 4 \quad \Rightarrow \quad x = 3
   \]
   \[
   n = a + b = 1 + 2 = 3
   \]

Thus, the only pair \((n, x)\) that satisfies the equation \(2^n + 1 = x^2\) is \((3, 3)\).

**(b)** Find all pairs \((n, x)\) of positive integers that satisfy the equation \(2^n = x^2 + 1\).

1. Consider the equation \(2^n = x^2 + 1\). Rearrange it as:
   \[
   2^n - 1 = x^2
   \]

2. Notice that for \(n > 1\), \(2^n \equiv 0 \pmod{4}\), so:
   \[
   2^n - 1 \equiv -1 \pmod{4}
   \]
   However, \(x^2 \equiv 0 \text{ or } 1 \pmod{4}\), which means \(2^n - 1\) cannot be a perfect square for \(n > 1\).

3. Therefore, the only possible value for \(n\) is \(n = 1\):
   \[
   2^1 = x^2 + 1 \quad \Rightarrow \quad 2 = x^2 + 1 \quad \Rightarrow \quad x^2 = 1 \quad \Rightarrow \quad x = 1
   \]

Thus, the only pair \((n, x)\) that satisfies the equation \(2^n = x^2 + 1\) is \((1, 1)\).

The final answer is \( \boxed{ (3, 3) } \) for part (a) and \((1, 1)\) for part (b).