Optimal solution

If $f(x)$ is a given real valued function, then how to find the minimum value of $x>0$ such that either $\frac{1}{f(x)}>5$ or $f(x)=0.$ If no such $x$ exist then it should return $\infty$ as output. If anyone write the sage code for me by considering any real valued function it would be helpful for me. Thank you in advance.

Comments

Actually, I need to check different kinds of functions. So I need a sage program where I can input any kind of such functions to get the result. Simply you can consider $f(x)=x^3-2x^2-2x+4.$ But a general sage program will be more helpful. Thank you.

It is hard to do in complete generality. The set of values $x$ such that $1/f(x) > 5$ may also be non-empty but without a minimum, e.g. for $f(x) = 1/x$: there is no smallest real number greater than $5$. There may still be an infimum (greatest lower bound), e.g. $5$ in the preceding example. Would you want the infimum as output? Would you be satisfied with an answer for polynomials? Or for rational functions?

Most of my functions are not rationals., For example, I have some functions like $f(x)=4.12^x-4.9^x-7.8^x+8.4^x+8.3^x-4.$ Can you please write a program that works for the two functions that I have mentioned?

Here I need to find $\min { x>0: det(A_x)=0 \, or \, ||A_x^{-1}||=0 } ,$ where by $||M||$ we mean the sum of all entries of the matrix $M.$ If anyone helps me solving this problem using sage, this will be enough for me. Thank you

1 answer

var('a');
# a will be 2^x at some point
A = matrix( 4, 4, [ 0,1,1,1, 1,0,a,a, 1,a,0,a, 1,a,a,0 ] )
print "The matrix A is\n%s" % A
print "det(A) = %s" % A.det()
print "The inverse of A is\n%s" % A.inverse()
print "The sum of the entries in A.inverse() is %s" % sum( A.inverse().list() )

So for a value of $a$ different from zero we have $\det A\ne 0$. The vanishing ot the sum of the entries of $A^{-1}$ is then what we want, this happens for $a=3$, so the corresponding value of $x$ is the solution of $2^x=a=3$, this is $$x=\log_23\ .$$