This uses a form of the Pythagorean theorem (from "fun with the Pythagorean theorem" activity) and applies powers of x to it. The base function is just the square root of (a-b)^x, but this should work regardless of what a and b are, provided they are constants or functions of x. The only caveat is that this function only works for a greater than or equal to b, and both must be positive (the ratio inside the arccos function is negative otherwise, and a switches with b if both are negative, so those are both separate -but extremely similar- functions). Arccos has a domain constraint that causes all values of b greater than a to have no solution. There might be a way to get around this with complex numbers (as this form of the pythagorean theorem works with functions of y and x in the third dimension) but that would require a bit more work, and may or may not be possible.