Beruflich Dokumente
Kultur Dokumente
Engineering
Notes on polynomial operations
First, we define polynomias pol1 and pol2:
> pol1:=-x^5+9*x^4-18*x^3+x^2+19*x-10;
pol1 := −x5 + 9 x4 − 18 x3 + x2 + 19 x − 10
> pol2:=x-2;
pol2 := x − 2
To factor polynomial pol1 use:
> factor(pol1);
−( x − 1 ) ( x − 2 ) ( x + 1 ) ( x2 − 7 x + 5 )
Form a fraction with polynomial pol1 as numerator and polynomial pol2 as denominator:
> pol1/pol2;
−x5 + 9 x4 − 18 x3 + x2 + 19 x − 10
x−2
Function simplify can be used to simplify algebraic equations like the fraction formed above
> simplify(%);#Recall that % stands for "the last result"
− x4 + 7 x 3 − 4 x2 − 7 x + 5
Using function factor you can see that the factor (x-2) has been eliminated from the numerator
> factor(%);
−( x − 1 ) ( x + 1 ) ( x2 − 7 x + 5 )
Function divide can be used to determine if pol1 divides exactly by pol2. If that is the case, the result is true
and the quotient,pol1/pol2, gets stored in variable q:
> divide(pol1,pol2,'q');
true
To see the contents of q use:
> q;
− x4 + 7 x 3 − 4 x2 − 7 x + 5
Now, define pol3 and check if pol1 divides exactly into pol3. The results in this case is false, and the quotient
is not stored into q1
> pol3:=x-3;
pol3 := x − 3
> divide(pol1,pol3,'q1');
false
> q1;
q1
An attempt to simplify pol1/pol3 produces the following fraction:
> simplify(pol1/pol3);
x5 − 9 x4 + 18 x3 − x2 − 19 x + 10
−
x−3
Factoring out the fraction resulting from pol1/pol2 indicates that there are no common factors between the
numerator and denominator:
> factor(pol1/pol3);
( x − 1 ) ( x − 2 ) ( x + 1 ) ( x2 − 7 x + 5 )
−
x−3
Division of a polynomial p1 by another polynomial p2, when the degree of p1 is larger than that of p2, can be
written as:
p1 r
=q+ ,
p2 p2
where q is the quotient (a polynomial) and r is the residual (another polynomial).
To obtain an expansion involving quotient and residual as shown above, use the function convert as follows:
> F:=convert(pol1/pol3,parfrac,x);
56
F := −x4 + 6 x3 + x + 22 +
x−3
In this call to function convert we use three arguments: the fraction to be simplified (in this case, pol1/pol3),
the option parfrac -- which stands for partial fractions --, and the independent variable for the polynomials (in
this case, x).
A second example of expanding a fraction using convert and parfrac is follow next:
> p1:=x^4+y^3+x*y; p2:=x-3;
p1 := x4 + y3 + x y
p2 := x − 3
> convert(p1/p2,parfrac,x);
y3 + 3 y + 81
x3 + 3 x2 + 9 x + y + 27 +
x−3
To find more information about function convert use:
> ?convert
∞ [n]
( x − a )n
∑
f
f( x ) =
n=0
n!
[n] dn [0]
where f stands for n
= f( x ).
f( x ) evaluated at x=a, with f
dx
A Taylor series is an expression containing an infinite number of components. For practical calculations we can
write
m f[ n ] ( x − a )n
f( x ) = ∑ + R( x ),
n=0 n!
where R(x) is referred to as the residual or error in the expansion. The residual or error is typically expressed
by an order of magnitude, so that we write
m f[ n ] ( x − a )n
f( x ) = ∑ O( x( m + 1 ) ) .
+
n=0 n!
The summation corresponding to the first term in the right-hand side of this equation is referred to as a Taylor
polynomial, so that f(x) is approximated by this polynomial of order m, i.e.,
[n]
( x − a )n
m
∑
f
f( x ) ~ p( x ) =
n=0
n!
(m + 1) (m + 1)
The term O( x ) indicates that the error in the approximation f(x)~p(x) is of the order of x .
Complex numbers
There was a question related to complex numbers at this point in the lecture. The unit imaginary number in
Maple is given by the upper-case letter I:
> I;
I
Here is an example of a complex number in Maple:
> z1:=3+5*I;
z1 := 3 + 5 I
Functions of complex numbers are available in Maple, howver, being a symbolic environment, symbolic
solutions -- like the next -- are more likely:
> log(z1);
ln( 3 + 5 I )
To obtain the value of the function use evalf (evaluate as a floating point number):
> evalf(%);
1.763180262 + 1.030376826 I
Simultaneous solution of f(x,y) = 0 and g(x,y) = 0 to find points of intersection -- Note that the solution is given
in terms of the function RootOf. To get actual solutions out of RootOf use the function allvalues:
> solve({f(x,y)=0,g(x,y)=0},{x,y});
{ x = RootOf( _Z2 − 15 ), y = RootOf( −10 + _Z2 ) }
> allvalues(%);
{y = 10 , x = 15 }, { y = − 10 , x = 15 }, { y = 10 , x = − 15 }, { y = − 10 , x = − 15 }