I am using FindMaximum
to find the maxima and maximum value of a simple function sqrt{3-x^2}
as follows:
FindMaximum({(3-x^2)^(1/2),{1<x<4}},{x,1})
.
I don’t get any answer and the code slowly consumes all my RAM (8 GB; usually it runs as about 3-4 GB) and just keeps on running. But, instead, if I modify the function to (3-x^2)^1
then the code runs and gives the expected {2., {x -> 1.}}
.
FindMaximum({(3-x^2)^1,{1<x<4}},{x,1})
So, I tried (3-x^2)^2
instead, thinking that the square root might be an issue but even this function just keeps on running forever and eats up all my RAM slowly. In fact any other power that tried just kept on running forever and slowly consuming all my RAM.
On the other hand if I try FindMaximum({(x^2-3)^(1/2),{1<x<4}},{x,4})
I get the expected {3.60555, {x -> 4.}}
.
I am not sure what the issue is here. I have closed Mathematica, restarted my computer and stuff and this issue still persists. Every other code seems to be working as expected. Thanks.