Post Reply 
new way to make quadratic equations easy
07-31-2021, 10:19 AM (This post was last modified: 07-31-2021 10:47 AM by C.Ret.)
Post: #6
RE: new way to make quadratic equations easy
(07-31-2021 04:22 AM)Namir Wrote:  Seems to work with non-integers.

It also works for complex roots or complex coefficients, here is an illustration for a complex capable HP-15C:

Code:
IN :   Y:  c     X:  b       from reduced quadratic equation x²+b.x+c = 0  (EQ.1)

001-       2     2                                           009-43,30, 2   g x<0 ?    (Test 2)
002-      16     CHS                                         010-43, 4, 8   g SF 8     Automaticaly set complex mode in case of complex root(s)
003-      10     ÷        Compute m = (z1+z2)/2 = -b/2       011-      11     √x       Compute u=±√(m² - z1.z2) =±√(b²/4 - c)
004-      36     ENTER                                       012-      30     -        Compute z2=m-u
005-      36     ENTER                                       013-  43  33   g R↑     
006-  43  11   g x²                                          014-  43  36   g LSTx
007-  43  33   g R↑                                          015-      40     +        Compute z1=m+u
008-      30     -                    
                                                             OUT :   y: z2=m-u   X: z1=m+u  both solutions of (EQ.1)


Usage : Enter real or complex reduced coefficients c and b in stack at respectively level Y: and X: and run the code.
HP-15C 's complex mode automatically engage at complex value entries or when any of the two roots is complex.

This code, despite using a different method is really close to the one I post yesterday using old-school method.

Usage Example : \( (3-i).z^2+(-49+33i).z+120-90i = 0 \)

Enter c coefficient : [ 1 ][ 2 ][ 0 ][ENTER] [ 9 ][ 0 ][CHS] f[ I ] (note that the 'c' annunciators lit on)
Reduce c by a : [ 3 ][ENTER] [ 1 ][CHS] f[ I ] [ ÷ ] display reduced c : " 45.00000 c " Press f[(i)] to see imaginary part "-15.00000 c"
Enter b: [ 4 ][ 9 ][CHS][ENTER] [ 3 ][ 3 ] f[ I ]
Reduce b by a : g[LSTx] [ [ ÷ ] display reduced b : "-18.00000 c " Press f[(i)] to see imaginary part " 5.0000"

The reduced quadratic equation is now : \( z^2+(-18+5i).z+(45-15i)=0 \)

Press [R/S] to run code.
Real part of first root is " 15.00000 "
Press and hold f[(i)] key to see imaginary part of first root: "-5.00000 "
Press [X↔Y] to display the second root real part : " 3.00000 "
Press and hold f[(i)] to display the second root’s imaginary part: " 0.00000 "

The quadratic equation \( (3-i).z^2+(-49+33i).z+120-90i = 0 \) have one complex root \(z_1=15-5i\) and one real root \(x_2=3 \)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: new way to make quadratic equations easy - C.Ret - 07-31-2021 10:19 AM



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