Given
color(white)("XXX")f(x)=4x+5XXXf(x)=4x+5
and
color(white)("XXX")g(x)=3x-8XXXg(x)=3x−8
The problem here usually occurs because xx appears in both function definitions. But xx is just an arbitrary place holder; we can replace it with any other variable.
Let's replace xx in the definition of f(x)f(x) with ww (another arbitrary variable). Then we have:
color(white)("XXX")f(color(red)(w))=4color(red)(w)+5XXXf(w)=4w+5
Now color(red)(w)w could be replaced with anything.
In particular we could replace it with color(blue)(g(x))g(x).
That is
color(white)("XXX")f(color(blue)(g(x)))=4color(blue)(g(x))+5XXXf(g(x))=4g(x)+5
But since color(blue)(g(x)) = color(blue)(3x-8)g(x)=3x−8
we have
color(white)("XXX")f(color(blue)(g(x)))=4color(blue)((3x-8))+5XXXf(g(x))=4(3x−8)+5
Simplifying
color(white)("XXX")f(g(x))=(12x-32)+5XXXf(g(x))=(12x−32)+5
color(white)("XXX")f(g(x))=12x-27XXXf(g(x))=12x−27