Monday, December 1, 2008

Inverting Functions

Inverting functions is probably something we've all learnt in high school. Unfortunately, high-school techniques don't always work. (If only they do...)

From high school/first-year calculus: a (nice, simple, single-variable) function from (say) A to R, A a subset of R, y = f(x), is invertible iff it is one-to-one. Thus it's usually easy to tell whether a function is invertible or not - just find out whether it's one-to-one. Even visual inspection works, sometimes.

A blunt way to find inverses is to take the equation y = f(x), and solve for x. Another way to go is by using integrals and the inverse function theorem (roughly speaking*: dx/dy = 1/(dy/dx)), but integrating to give a closed form is, in general, not easy. Related to using integrals is to use differential equations, which is probably even harder than just using integrals directly.

Well, so now I have a function. It's a composite function, actually, so y = g(f(x)). Given y and a strictly-decreasing g(x), I want to find f(x). (I even have the values for x.)

Obviously, invert g.

But I can't invert g! It just won't invert! Argh!

Well. If I feel inclined to be all about approximations, I suppose I can use power series, assuming that g plays nice (I think it does, actually, but the number-crunching will be brutal).

All this is actually just a roundabout way for me to slack off so I can put off writing more reports - I need the function for one of the lower-priority projects, you see. Stupid reports. (I've missed my first deadline already. Sigh. Second deadline: everything by end of this week *fingers crossed*.)

(Incidentally: all those Wikipedia links are there because I've been doing chemistry for so long, I need reminders. It's a terrible thing, to be so math-deprived...)

*The multivariable versions of these things are bloody complicated and I've forgotten all about them (ahh, the joys of multivariable calculus**...). In truth, for many functions (multivariable or not) it's impossible to find a closed form for the inverse. I was hoping that this isn't the case for my function. Sigh.
**Actually, multivariable calculus was fun, partly because my class pretty much always proved and used theorems in full generality - no sordid number crunching!

No comments: