[SOLVED] Does not give all solutions

07122016, 11:54 AM
(This post was last modified: 07142016 07:11 AM by CH3791.)
Post: #1




[SOLVED] Does not give all solutions
Hello,
This is a trigonometry question that I have been trying to solve: https://www.dropbox.com/s/3vl2r5uvfskowk...1.PNG?dl=0 In this example, there should be two solutions: 1.318 and 4.965. However, the HP Prime only gives 1.318. Why? 

07122016, 12:05 PM
(This post was last modified: 07122016 12:07 PM by Didier Lachieze.)
Post: #2




RE: Does not give all solutions (Trigonometry)
Try with 1/4 instead of 0.25 to get the exact solutions.
solve(cos(x) = 1/4)(x>0 AND x<2*π) => {acos(1/4),2*πacos(1/4)} 

07122016, 02:16 PM
Post: #3




RE: Does not give all solutions (Trigonometry)
(07122016 11:54 AM)CH3791 Wrote: However, the HP Prime only gives 1.318. Why? Specifically, when you put in the ".25" you are telling the CAS "I am doing this calculation in an approximate way using nonexact numbers". Thus when it starts solving things, it switches to a numerical method to isolate a result and you end up with one result within the range you gave. Numerical solution methods as a general rule work on the "try the calculation, check the result, scoot the input up/down a bit, check the result again" and so on until you converge to a numerical value that is close enough to a result. Any numerical value containing a decimal is a "nonexact" number. Thus something like 4 / 5 is actually very different then 4. / 5 from the CAS point of view. One is the fraction of two exact integer values and represents the "concept" of 4/5. The other is an approximated value of four, divided by the perfect integer value of 5 and the result of that calculation is and approximate value of .8 To ensure the CAS won't approximate, keep decimal approximations out of your inputs. Either put in 1/4 (which is an exact mathematical representation of that number), or surround your fraction with exact(.25) which converts the decimal to a fraction beforehand. TW Although I work for HP, the views and opinions I post here are my own. 

07142016, 07:09 AM
Post: #4




RE: Does not give all solutions (Trigonometry)
(07122016 02:16 PM)Tim Wessman Wrote:(07122016 11:54 AM)CH3791 Wrote: However, the HP Prime only gives 1.318. Why? Thanks man. 

07142016, 12:28 PM
Post: #5




RE: [SOLVED] Does not give all solutions
To Didier Lachieze,
In CAS, I typed in the line exactly as you did, namely, solve(cos(x) = 1/4)(x>0 AND x<2*π) and got the generic HP Prime error with the red circle and white X. Can you please tell me precisely how you entered this? In particular, what key did you press to enter the vertical bar? There is nothing in the description of solve in the user guide (p. 366) about this idea of adding a vertical bar followed by conditions. Where can I find more information about it? 

07142016, 02:04 PM
Post: #6




RE: [SOLVED] Does not give all solutions
(07142016 12:28 PM)JamesWilliams Wrote: To Didier Lachieze, You can find the vertical bar in the math template (the key to the right of the toolbox). You can also find it in the catalog after ztrans. Here is what the user's manual says about it p. 458: Quote: Found in the Catalog menu and the Template menu, the where command has several uses associated with variable declarations. For one, it is used to substitute values for one or more variables in an expression. It can also be used to define the domain of a variable. 

07142016, 09:08 PM
Post: #7




RE: [SOLVED] Does not give all solutions
Didier,
It works like a charm! I thought that where command was used only for derivatives. Thank you. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)