# Given functions $f$ and the composition $h = f \circ g$, how to find $g$?

I have one question just want to be sure that I am correct.

Suppose we have two function $f(x)$ and $h(x)$, such that $f(x)$ is linear (i.e., $f(x)=m x+b$) and $h(x)$ is quadratic ($h(x)=ax^2+bx+c$). We are asked to find a $g(x)$ so that $f(g(x))$ is equal to $h(x)$.

I think that we first should determine what is the highest degree function and and for answer choose this kind of function (general form), put it into the given function and calculate coefficient. For example, consider two situation. In the first one, we are given $g(x)=2x+1$ and $h(x)=4x^2+4x+7$, we should find such $f$ so that $f(g(x))=h(x)$. For the second situation, we have $f(x)=3x+5$ and $h(x)=3x^2+3x+2$; find $g$ such that $f(g(x))=h$.

I think for first because degree of $h$ is $2$, we should choose $f$ as $ax^2+bx+c$; and for second also, quadratic form.

Am I correct? Please if something is incorrect in my logic, please inform me.

-
Note that in the problem you are given that the outside function $f(x)$ is linear; but in your example, you are given that the inside function $g(x)$ is linear. Which is it? –  Arturo Magidin Nov 16 '11 at 20:00
Also, you use $b$ in two places. –  Thomas Andrews Nov 16 '11 at 20:01
no they are different functions in first f(x) should be quadratic as i mention ,in second f(x) is linear,ones again consider these two f(x) seperately –  dato datuashvili Nov 16 '11 at 20:08
You're on the right track. It might be worthwhile to figure out the following more general problem. Suppose $f(x)$ is a polynomial of degree $d$ and $g(x)$ is a polynomial of degree $d'$. Show that $f(g(x))$ is a polynomial as well and figure out its degree in terms of $d$ and $d'$. It is important to note that you do not have to write out the polynomials completely to figure this out; just think about what the highest degree term you can get it is and make sure that there isn't any cancellation in that term (otherwise, the polynomial would have smaller degree). –  Michael Joyce Nov 16 '11 at 20:11

Hmm, why not simply try to begin with $\small f(g(x))=h(x) \to g(x)=f^{\circ -1}(h(x)$ (where $\small f^{\circ -1}$ means the inverse) and develop the formal inverse of f(x), which is only linear, with the formal argument "h(x)" ? Since f(x) is linear this should be very easy....