# Algorithms for finding inverses

Backtracking

Backtracking or undoing the steps, which is often used as an introduction to solving equations, can also be used to find inverse functions.

Suppose you’re trying to find the inverse of $y = \frac{3x^2 - 3}{5}$. The right side of the equation should be thought of as a list of arithmetic manipulations that get performed on any input in this relationship. What are those manipulations to the input?

1. Square it
2. Multiply it by 3
3. Subtract 3
4. Divide it by 5

How do you undo the following set of instructions? Let’s look at a simpler example:

Hopefully not by taking off your socks and then taking off your shoes! So we need to reverse the steps and also reverse the order.

1. Multiply by 5
3. Divide by 3
4. Square root it

In other words, $\sqrt{\frac{5x+3}{3}}$, so our inverse function is $y = \sqrt{\frac{5x+3}{3}}$.

Swapping the y and the x

This one, I don’t like very much. My sense is that it’s the most common algorithm out there. It’s hard to get meaning out of it. But there’s a simple switch that gives this algorithm a lot more meaning.

Say you’re working with $y = 3x + 4$. The old way is to say “switch the y and the x, so you get $x = 3y + 4$ and then solve for y.”

The tweak is to put it in $f(x)$ form (which is not going to be obvious or easy for kids) so you have $f(x) = 3x + 4$ and then find $f(f^{-1}(x))$. This gets you $f(f^{-1}(x)) = 3(f^{-1}(x)) + 4$ and now you’re trying to solve for $f^{-1}(x)$.