Answer
$\text{a) }
f(g(5))=170
\\\\\text{b) }
g(f(5))=490$
Work Step by Step
$\bf{\text{Solution Outline:}}$
With
\begin{array}{l}\require{cancel}
f(x)=
3x+5
\\g(x)=
x^2+4x+10
,\end{array}
to find $
f(g(5))
,$ find first $
g(5)
.$ Then substitute the result in $f.$
To find $
g(f(5))
,$ find first $
f(5)
.$ Then substitute the result in $g.$
$\bf{\text{Solution Details:}}$
a) Replacing $x$ with $
5
$ in $g$ results to
\begin{array}{l}\require{cancel}
g(x)=x^2+4x+10
\\\\
g(5)=(5)^2+4(5)+10
\\\\
g(5)=25+20+10
\\\\
g(5)=55
.\end{array}
Replacing $x$ with the result above in $f$ results to
\begin{array}{l}\require{cancel}
f(x)=3x+5
\\\\
f(55)=3(55)+5
\\\\
f(55)=165+5
\\\\
f(55)=170
.\end{array}
Hence, $
f(g(5))=170
.$
b) Replacing $x$ with $
5
$ in $f$ results to
\begin{array}{l}\require{cancel}
f(x)=3x+5
\\\\
f(5)=3(5)+5
\\\\
f(5)=15+5
\\\\
f(5)=20
.\end{array}
Replacing $x$ with the result above in $g$ results to
\begin{array}{l}\require{cancel}
g(x)=x^2+4x+10
\\\\
g(20)=(20)^2+4(20)+10
\\\\
g(20)=400+80+10
\\\\
g(20)=490
.\end{array}
Hence, $
g(f(5))=490
.$
Therefore,
\begin{array}{l}\require{cancel}
\text{a) }
f(g(5))=170
\\\\\text{b) }
g(f(5))=490
.\end{array}