To find a formula for the inverse of you switch the roles of and and then try to solve for . For example, to find the inverse of the function you first switch and : . Then you solve for : , or rewriting in standard form, .
Very often it is not possible to carry out the step of solving for , as there may be more than one solution. This means that the original function is not invertible on its natural domain. In such cases, it is usually possible to restrict the domain of the original function to one on which the solve step can be carried to completion.
For example, suppose you want to find the inverse, if it exists, of the function . Interchanging and and trying to solve for leads you to , so you can conclude that the original function, is not invertible on the entire real line. However, if you restrict the domain to non-negative numbers, so when , then the inverse will be . Note we could also restrict the domain to be non-positive numbers, so the function is when , in which case the inverse is . This illustrates that there is invariably some arbitrariness in the choice of restricted domain, and that there can be more than one—sometimes infinitely many—definitions of an "inverse" for a function which is not invertible on its natural domain.