# The inverse of a function numerically with N-terms

15 views (last 30 days)
BeeTiaw on 28 Jan 2019
Edited: BeeTiaw on 28 Jan 2019
The correct answer has been provided that is by multipying the function with the highest exponent. For example, this function
can be transformed into polynomial by multpying it by the highest exponent of ζ, i.e. , which will gives
The solution for can be easily obtained using "roots".
Now, if the function is written in its generalised form
How do we find the generalised form of function, for example for or ?
I am trying to write a code that can take any number of terms.

Torsten on 28 Jan 2019
p = [b*fliplr(m((N+2)-N:(2*N)-N)),b+a*m(1),-z,a+b*m(1),b*m(N-(N-2):N-0)];
roots(p)
##### 2 CommentsShowHide 1 older comment
BeeTiaw on 28 Jan 2019
Edited: BeeTiaw on 28 Jan 2019
Torsten this is correct!
just one minor mistake that the frist component should be multiply with instead of
So, the correct code is
p = [a*fliplr(m((N+2)-N:(2*N)-N)),b+a*m(1),-z,a+b*m(1),b*m(N-(N-2):N-0)];
roots(p)
I have tried it even for N = 5, it gives me the correct coefficient!
Even for N = 11 and N = 17!
Thanks!
This is the real reason why I posted the question. It is not the same question as before! you have proved it!

John D'Errico on 28 Jan 2019
Edited: John D'Errico on 28 Jan 2019
I'm confused as to what your question is, since I answered the last question. Then you asked essentially the same question.
There is no general solution to this problem. In fact, it can be proved there can never be an analytical solution in general for an equation of degree 5 or higher. Why? because you can always resove the problem by multiplying by the largest negative exponent, which is valid as long as zeta is non-zero.
The result will be some general polynomial equation, but if the degree is higher than 4 (i.e., 5 or larger) then the Abel-Ruffini theorem comes into play, where it was proven that no algebraic solution will exist for that problem in terms of radicals. (Yes, there can be some relatively rare cases where a higher order polynomial does have a solution in terms of radicals. But those cases will be rare.)
So the very best you can do is multiply by some power of zeta. Colllect coefficients. Then call roots for any value of z you wish. There can be NO better solution. NO more general solution can ever exist, as long as the polynomial degree of your problem is 5 or greater.
Sorry, but asking the same question will not get you a better answer.
BeeTiaw on 28 Jan 2019
Edited: BeeTiaw on 28 Jan 2019
But the the general solution has been given by Torsten above.
Using his proposed solution, we can find the coefficient directly, without doing the algebra, for any number of N.
I have tried it even for N = 11 and it works.
This one is the general solution. Just one liner and it does the job.
p = [a*fliplr(m((N+2)-N:(2*N)-N)),b+a*m(1),-z,a+b*m(1),b*m(N-(N-2):N-0)];
roots(p)

### Categories

Find more on Linear Algebra in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by