Let #d(x)=y# and rewrite the equation in terms of #x# and #y#
#y=-2x-6#
When finding the inverse of a function, you are essentially solving for #x# but we could also simply switch the #x# and #y# variables in the equation above and solve for #y# like any other problem such that:
#y=-2x-6->x=-2y-6#
Next, solve for #y#
Isolate #y# by first adding #6# to both sides:
#x+color(red)6=-2ycolor(red)(cancel(-6+6)#
#x+6=-2y#
Finally, divide #-2# from both sides and simplify:
#x/color(red)(-2)+6/color(red)(-2)=color(red)(cancel(-2)/cancel(-2))y#
#-x/2-3=y# (This is our inverse function)
I mentioned earlier that finding the inverse means that you are solving for #x# but I also suggested that you could simply just switch #x# and #y# and solve for #y# instead. What I'm going to do now is to show the solution in which we solve for #x# instead of #y#. You'll find that the process is exactly the same with a little tweak at the end:
#y=-2x-6#
Solve for #x# by isolating the variable by first adding #6# to both sides:
#y+color(red)6=-2xcolor(red)(cancel(-6+6)#
#y+6=-2x#
Finally, divide #-2# from both sides and simplify:
#y/color(red)(-2)+6/color(red)(-2)=color(red)(cancel(-2)/cancel(-2))x#
#-y/2-3=x#
As you can see, the equation above is almost exactly the same as the other one we solved for except this function is written in terms of #x#. The tweak I was talking about is that you could choose to solve for #x# from the very beginning but you switch the variables #x# and #y# at the end so that your answer is expressed in terms of #y#. Thus,
#-y/2-3=x -> -x/2-3=y# (Which is our inverse function)
So in sort, when finding the inverse you can either:
#a)# Switch the #x# and #y# variables before solving anything and then solve for #y# instead of #x#
#or#
#b) #Solve for #x# from the very beginning but you switch the variables #x# and #y# at the end.
In the end, you should get the same result.