Question 1144347
<br>
{{{f(x) = x^2+2x+2 = (x^2+2x+1)+1 = (x+1)^2+1}}}<br>
{{{f(g(x)) = x^2-4x+5 = (x^2-4x+4)+1 = (x-2)^2+1 = ((x-3)+1)^2+1}}}<br>
Therefore<br>
{{{g(x) = x-3}}}
{{{f(x) = (x+1)^2+1}}}<br>
It takes some experience with this kind of problem to see how the above process works.<br>
Here is another way to solve the problem.<br>
The given function f(x) contains a term in x^2; that means somewhere along the way the function f has to square the input.  So as above we can write f(x) as<br>
{{{f(x) = x^2+2x+2 = (x^2+2x+1)+1 = (x+1)^2+1}}}<br>
Then since f(x) is quadratic and f(g(x)) is also quadratic, we know that g(x) must be linear.<br>
So let g(x) = ax+b.  Then<br>
{{{f(g(x)) = f(ax+b) = (ax+b)^2+2(ax+b)+2 = a^2x^2 + 2abx + b^2 + 2ax + 2b + 2 = a^2x^2 + (2ab+2a)x + (b^2+2b+2)}}}<br>
Then since f(g(x)) = x^2-4x+5, equating coefficients gives us<br>
(1) {{{a^2=1}}}
(2) {{{2ab+2a = -4}}}
(3) {{{b^2+2b+2 = 5}}}<br>
(1) gives us a=1<br>
Substituting a=1 in (2) gives us
{{{2b+2 = -4}}}
{{{2b = -6}}}
{{{b = -3}}}<br>
And now we know the linear function g(x) is ax+b = x-3.<br>
ANSWER:
{{{f(x) = (x+1)^2+1}}}
{{{g(x) = x-3}}}