# How do you find the compositions given f(x) = 2x + 3 and h(x) = 2x^2 + 2x + 1?

Feb 2, 2016

$f \left(h \left(x\right)\right) = 4 {x}^{2} + 4 x + 2$

$h \left(f \left(x\right)\right) = 8 {x}^{2} + 28 x + 25$

#### Explanation:

Let's start with the composition $f \left(h \left(x\right)\right)$.

To calculate this, you basically need to insert $h \left(x\right)$ for every occurence of $x$ in $f \left(x\right)$:

$f \left(\textcolor{v i o \le t}{x}\right) = 2 \textcolor{v i o \le t}{x} + 3$

$f \left(\textcolor{b l u e}{h \left(x\right)}\right) = 2 \textcolor{b l u e}{h \left(x\right)} + 3 = 2 \left(\textcolor{b l u e}{2 {x}^{2} + 2 x + 1}\right) = 4 {x}^{2} + 4 x + 2$

Now, let's do the other composition, $h \left(f \left(x\right)\right)$.

Similarly, here, you need to plug $f \left(x\right)$ for every occurence of $x$ in $h \left(x\right)$:

$h \left(\textcolor{v i o \le t}{x}\right) = 2 {\textcolor{v i o \le t}{x}}^{2} + 2 \textcolor{v i o \le t}{x} + 1$

$h \left(\textcolor{b l u e}{f \left(x\right)}\right) = 2 {\left[\textcolor{b l u e}{f \left(x\right)}\right]}^{2} + 2 \textcolor{b l u e}{f \left(x\right)} + 1$

$= 2 {\left(\textcolor{b l u e}{2 x + 3}\right)}^{2} + 2 \left(\textcolor{b l u e}{2 x + 3}\right) + 1$

$= 2 {\left(2 x + 3\right)}^{2} + 2 \left(2 x + 3\right) + 1$

... I'm using the formula ${\left(a + b\right)}^{2} = {a}^{2} + 2 a b + {b}^{2}$...

$= 2 \left(4 {x}^{2} + 2 \cdot 2 x \cdot 3 + {3}^{2}\right) + 4 x + 6 + 1$

$= 8 {x}^{2} + 24 x + 18 + 4 x + 6 + 1$

$= 8 {x}^{2} + 28 x + 25$