### Lesson Objectives:

- Find the composition of two functions and its domain.- Decompose a function as a composition of two functions.

A composite function is a function which depends on the output of another function for its input.

The composition of f and g, is defined as `(f@g)(x)`, which is the same as `f(g(x))`, where x is the domain of g, and g(x) is the domain of f.

Given three functions, `f(x) = 2x+1`, `g(x) = x^2-3x-8` and `h(x) = x^3`.

Find `(f@g)(-1)`. `f(g(-1))`. We have to find what `g(-1)` is first. So plug -1 into g(x), and get `-1^2-3(-1)-8`. So we get `1+3-8`, which is equal to -4. So now we need to find `f(-4)`, by plugging -4 into f(x). So `f(-4)` is `2(-4)+1`, which `-8+1`, which is -7. So `(f@g)(-1) = -7`

Next let's find `(h@h)(x)`. This is the same as `h(h(x))`, so since `h(x) = x^3`, we have to plug `x^3` into h(x). So `h(x^3)` is the same as `(x^3)^3`. We have to multiply `3*3` to get 9, so it's equal to `x^9`. `(h@h)(x) = x^9`.

Now find `(f@g)(x)` and `(g@h)(x)` and their domains. `(f@g)(x)` is the same as `f(g(x))`, where g(x) is `x^2-3x-8`. So now we have to plug all of that in over here, and get `2(x^2-3x-8)+1`, which is `2x^2-6x-16+1`, which is `2x^2-6x-15`. Since this function does not have a radical or a fraction, that means that the domain is all real numbers, `(-oo, oo)`.

Now, `(g@h)(x)` is the same as `g(h(x))`, where h(x) is `x^3`. So `g(x^3)`, we have to plug in `x^3` in for x over here. And we get `(x^3)^2-3(x^3)-8` or `x^6-3x^3-8`. And since once again we don't have a radical or a fraction, the domain is all real numbers, `(-oo, oo)`.

Find f(x) and g(x) such that `h(x) = (f@g)(x)`. Answers may vary.

So `h(x) = (5+2x)^7`. We're trying to find `(f@g)(x)`, which is the same as `f(g(x))`.

So `g(x) = 5+2x` and `f(x) = x^7`, then this will make `h(x) = (f@g)(x)`.

Now if `h(x) = 1/((x-4)^2)`, and we want this to equal `(f@g)(x)`, which is the same as `f(g(x))`, then we have to let `g(x) = x-4` and `f(x) = 1/(x^2)` for `h(x) = (f@g)(x)`.