HP Forums

Full Version: Solve across an interval
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Help for solve shows the possibility of searching for solutions within an interval using the syntax "a..b" When passing the example given in help to the command line and executing, the calculator produces an error relating to syntax. Is it possible to search for solutions over an interval?

Somewhat related, when using advanced graphing app and numerical table to show multiple solutions "X" for a given f(X), there are functions that take a lot of time to graph that result in the table not filling, yet the function graphs immediately in regular graphing app. An example is a function I had a thread on recently...

((Sqrt(tan X + 1)-sqrt(sin X + 1))/x^3
Which one of the solve examples do you have problems with?

I tried solve(x^2-x=1,x=1..2), and solve(x^2-x=1,x=0..-1) and it works fine, returning one solution only, as desired.
I just discovered that the interval works if one types it in with a space between each endpoint and the decimals: X=-1..2 produces syntax error concerning 2 decimal points while x=-1 .. 2 works, and will produce multiple results if a multiple of results are exist within the interval.
(12-02-2016 02:58 AM)lrdheat Wrote: [ -> ]I just discovered that the interval works if one types it in with a space between each endpoint and the decimals: X=-1..2 produces syntax error concerning 2 decimal points while x=-1 .. 2 works, and will produce multiple results if a multiple of results are exist within the interval.

What are your settings for the fraction mark? I am not able to cause a syntax error even when I do not specify the spaces like you mentioned.
I use "."s to indicate decimal
Are you passing the solve help example into the command line in the [Home] environment, by any chance? The help example works just fine in the [CAS] environment.

[attachment=4233]

[attachment=4234]
You are correct...I was in home, works in CAS.

Dumb question: why doesn't it (intervals) work in home? (Or is there another expected syntax?)
It's important to remember that case matters. Lowercase commands are CAS commands, and use lowercase variables. Home commands use uppercase names and variables. Syntax errors result when you get them wrong.
Hello,

Intervals are not implemented in home.

Cyrille
Reference URL's