Search code examples
numerical

Efficient computation of an implicitly defined function


I have a scalar function f(u) defined implicitly as follows:

pow( u, -f(u) ) + pow( u, f(u) ) = u

The function is approximately 1, but evidently not quite so. I am scratching my head for an efficient means of numerically computing values of this function. Any suggestions?

I hope the notation is clear btw, pow( a, b) = a^b is a raised to the power b.


Solution

  • If we write

     u = exp( log(u))   
    

    and remember that

     cosh( x) = (exp(x) + exp(-x))/2
    

    then your equation turns into

     cosh( log(u)*f(u)) = u/2
    

    since cosh(x) >= 1 for all real x, there can be no real solution for u<2, while for u>=2

    f(u) = acosh( u/2) / log(u)
    

    where acosh is the inverse of cosh.