Given a function $f(x)$, transform into $g(x)$, using domain and range Given a function $f(x)$ with domain of $[-5,7]$ and range of $[-2,4]$, write a function $g(x)$ as a transformation of $f(x)$, with a domain of $[-8,4]$ and a range of $[1,13]$.
It's been 30+ years since I did this... any pointers appreciated. thanks! 
 A: You could do $$g(x) = 2f(x + 3) + 5$$
You basically want to think about how you need to "shift" the domain and range of $f(x)$ so that they match your desired intervals. $f(x)$ can only take things in $[-5, 7]$, which means $f(x + 3)$ must only be allowed to take things in $[-8, 4]$. This being because after you add add $3$ to anything in $[-8, 4]$, you get something in $[-5, 7]$, which means $f(x)$ ultimately still only gets values in $[-5, 7]$, as it should.
As for the ranges, $f(x + 3)$ by itself still only has a range of $[-2, 4]$. So we want to manipulate the output to get a range of $[1, 13]$. Clearly the desired range is twice as large, hence we multiply by two. $2f(x + 3)$ has a range of $[-4, 8]$. After then adding $5$ we get our desired range.
You want to put terms to manipulate the range outside the function parentheses. Terms that manipulate the domain go inside the function parentheses.
As Andrew Chin mentioned in the comments, another viable answer is $$g(x) = -2 f(x+3) + 9$$
Let's break down why this also works. The $f(x+3)$ is the same so $g(x)$ still has our desired domain of $[-8,4]$. Once again, the range of $f(x+3)$ is still $[-2, 4]$. To see what the range of $-2 f(x+3)$ is, we can multiply the bounds of the range of $f(x+3)$ by $-2$. This gives us $[-8, 4]$. Note that the order of the numbers in the bounds flipped since we are multiplying by a negative number instead of a positive like in the first example. Then we add $9$, which gives us our desired range of $[1, 13]$.
