Suppose that $f(x) = ax+b$ and $g(x) = -3x+5$. If $h(x) = f(g(x))$ and $h^{-1}(x) = x+7$, find $a-b$.
First let's find $h(x)$. That's just $f(g(x))$, so we know that $h(x) = f(-3x+5)$. And we know that $f(x)$ is $ax+b$, so we have $h(x) = a(-3x+5)+b$. So $h(x)$ is just $-3ax+5a+b$. Now we need to find the inverse of $h(x)$. Let's call it $h^{-1}(x)$. Right. So $h^{-1}(x)$ is $x+7$. Since $h^{-1}(x)$ is the inverse of $h(x)$, we have $h^{-1}(h(x)) = x$. If we substitute $h(x)$ with $-3ax+5a+b$, we get $h^{-1}(-3ax+5a+b) = x$. But $h^{-1}(x)$ is $x+7$, so we know that $h^{-1}(-3ax+5a+b) = -3ax+5a+b+7 = x$. If we set $-3ax+5a+b+7$ equal to $x$, we get $-3ax+5a+b+7 = x$. If we subtract $x$ from both sides, we get $-3ax+5a+b+7-x = 0$. If we group the $x$ terms, we get $-3ax-x+5a+b+7 = 0$. And if we combine the constants, we get $-3ax-x+5a+b+7 = 0$. And if we factor out $-x$, we get $-x(3a+1)+5a+b+7 = 0$. Right. So our equation is $-x(3a+1)+5a+b+7 = 0$. Since this is an identity, we know that $-x(3a+1)+5a+b+7$ is equal to $0$ for all values of $x$. So we know that $a$ is $-\frac{1}{3}$. Now we need to solve for $b$. Right. We know that $-x(3a+1)+5a+b+7 = 0$, so we can substitute $a$ to get $-x(3\left(-\frac{1}{3}\right)+1)+5\left(-\frac{1}{3}\right)+b+7 = 0$. That simplifies to $-x(0)+\left(-\frac{5}{3}\right)+b+7 = 0$. Or $-\frac{5}{3}+b+7 = 0$. If we subtract $7$ from both sides, we get $b-\frac{5}{3}=-7$. And if we add $\frac{5}{3}$ to both sides, we get $b=-\frac{16}{3}$. So the value of $b$ is $-\frac{16}{3}$. And the value of $a$ is $-\frac{1}{3}$. So $a-b$ is $\left(-\frac{1}{3}\right)-\left(-\frac{16}{3}\right)$ which is equal to $\frac{15}{3} = 5$. So $a-b = 5$.

