To find the compositions of the functions \( f \) and \( g \), we need to substitute one function into the other. Specifically:
(a) For \( f \circ g \), substitute \( g(x) \) into \( f(x) \).
(b) For \( g \circ f \), substitute \( f(x) \) into \( g(x) \).
Step 1: Find \( f \circ g \)
To find \( f \circ g \), we substitute \( g(x) = x^2 \) into \( f(x) = \sqrt{x + 1} \):
\[
f \circ g = f(g(x)) = f(x^2) = \sqrt{x^2 + 1}
\]
Step 2: Find \( g \circ f \)
Next, we find \( g \circ f \) by substituting \( f(x) = \sqrt{x + 1} \) into \( g(x) = x^2 \):
\[
g \circ f = g(f(x)) = g(\sqrt{x + 1}) = (\sqrt{x + 1})^2 = x + 1
\]
Final Answer
The results of the compositions are:
\( f \circ g = \sqrt{x^2 + 1} \)
\( g \circ f = x + 1 \)
Thus, the final answers are:
\[
\boxed{f \circ g = \sqrt{x^2 + 1}}
\]
\[
\boxed{g \circ f = x + 1}
\]