HP 50g HP 50g_user's manual_English_HDPSG49AEM8.pdf - Page 81

Polynomials, The HORNER function, The variable VX

Page 81 highlights

Polynomials Polynomials are algebraic expressions consisting of one or more terms containing decreasing powers of a given variable. For example, 'X^3+2*X^2-3*X+2' is a third-order polynomial in X, while 'SIN(X)^2-2' is a second-order polynomial in SIN(X). Functions COLLECT and EXPAND, shown earlier, can be used on polynomials. Other applications of polynomial functions are presented next: The HORNER function The function HORNER („Þ, POLYNOMIAL, HORNER) produces the Horner division, or synthetic division, of a polynomial P(X) by the factor (Xa), i.e., HORNER(P(X),a) = {Q(X), a, P(a)}, where P(X) = Q(X)(X-a)+P(a). For example, HORNER('X^3+2*X^2-3*X+1',2) = {X^2+4*X+5 2 11} i.e., X3+2X2-3X+1 = (X2+4X+5)(X-2)+11. Also, HORNER('X^6-1',-5)= {X^5-5*X^4+25*X^3-125*X^2+625*X-3125 -5 15624} i.e., X6-1 = (X5-5*X4+25X3-125X2+625X-3125)(X+5)+15624. The variable VX Most polynomial examples above were written using variable X. This is because a variable called VX exists in the calculator's {HOME CASDIR} directory that takes, by default, the value of 'X'. This is the name of the preferred independent variable for algebraic and calculus applications. Avoid using the variable VX in your programs or equations, so as to not get it confused with the CAS' VX. For additional information on the CAS variable see Appendix C in the calculator's user's guide. The PCOEF function Given an array containing the roots of a polynomial, the function PCOEF generates an array containing the coefficients of the corresponding polynomial. The coefficients correspond to decreasing order of the independent variable. For example: PCOEF([-2, -1, 0 ,1, 1, 2]) = [1. -1. -5. 5. 4. -4. 0.], which represents the polynomial X6-X5-5X4+5X3+4X2-4X. Page 5-8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184

Page 5-8
Polynomials
Polynomials are algebraic expressions consisting of one or more terms
containing decreasing powers of a given variable.
For example,
‘X^3+2*X^2-3*X+2’ is a third-order polynomial in X, while ‘SIN(X)^2-2’ is
a second-order polynomial in SIN(X).
Functions COLLECT and EXPAND,
shown earlier, can be used on polynomials.
Other applications of
polynomial functions are presented next:
The HORNER function
The function HORNER (
„Þ
, POLYNOMIAL, HORNER) produces the
Horner division, or synthetic division, of a polynomial P(X) by the factor (X-
a
), i.e., HORNER(P(X),a) = {Q(X), a, P(a)}, where P(X) = Q(X)(X-a)+P(a).
For example,
HORNER(‘X^3+2*X^2-3*X+1’,2) = {X^2+4*X+5
2
11}
i.e., X
3
+2X
2
-3X+1 = (X
2
+4X+5)(X-2)+11.
Also,
HORNER(‘X^6-1’,-5)=
{X^5-5*X^4+25*X^3-125*X^2+625*X-3125
-5
15624}
i.e., X
6
-1 = (X
5
-5*X
4
+25X
3
-125X
2
+625X-3125)(X+5)+15624.
The variable VX
Most polynomial examples above were written using variable X.
This is
because a variable called VX exists in the calculator’s {HOME CASDIR}
directory that takes, by default, the value of ‘X’.
This is the name of the
preferred independent variable for algebraic and calculus applications.
Avoid using the variable VX in your programs or equations, so as to not
get it confused with the CAS’ VX.
For additional information on the CAS
variable see Appendix C in the calculator’s user’s guide.
The PCOEF function
Given an array containing the roots of a polynomial, the function PCOEF
generates an array containing the coefficients of the corresponding
polynomial.
The coefficients correspond to decreasing order of the
independent variable.
For example:
PCOEF([-2, –1, 0 ,1, 1, 2]) = [1. –1. –5. 5. 4. –4. 0.],
which represents the polynomial X
6
-X
5
-5X
4
+5X
3
+4X
2
-4X.