257
4
6
2
4
6
4
6
or
2
2
5 or 1
x
±
=
+
−
=
=
−
Eg. Solve
2
4
5
0
x
x
−
− =
Use
QUAD(X
2
-4X-5,X)
Answer:
(4+S1*6)/2
It is now up to you to interpret this algebraically as:
If you are simply after the roots of the quadratic then it is far better to use the
POLYROOT
function (page 284). If you would like a solution such as
3
5
2
+
rather than 2.6180 then the advantage of
QUAD
is that you can
COPY
the
result, edit the line to remove all but the decimal root and square it to find the
original discriminant.
The
QUAD
function does have one advantage
over other methods, in that it will give a
complex number solution to quadratics which
have complex roots. This may well make it
worth using in problems where a complex
answer is acceptable or required. Complex numbers are expressed on the
hp 39g+ in the form (a, b) representing
a + bi
. Thus the answer to the
second quadratic shown above would represent
2
112
6
− ± −
with the
112
−
written as a complex number.
See also:
QUOTE(var.name)
Intended for use mainly by programmers. Programmers sometimes want to
store a function such as
X
2
-4
into one of F1(X)…F9(X) using
. It turns
out that if you use F1(
X
2
-4
) then it won’t be entered symbolically. Instead,
the contents of
X
(a number) is entered substituted and the expression
evaluated to give a numeric result. The
QUOTE
function fixes this. For
example,
QUOTE(X)
2
-4 F1(X)
will ensure a symbolic result.
An easier method of storing a function into an aplet in a program is to
enclose it in single quotes. For example
'(X)
2
-4' F1(X)
would serve the
same purpose as
QUOTE(X)
2
-4 F1(X).
On the other hand, entering
F1('X')
will not work but
F1(QUOTE(X))
will. See Example 1 on page 217
in the chapter “Programming on the hp 39g+” for an example of use.