Go to CCP Homepage Go to Materials Page Go to Integral Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page

Maple Tutor

Part 11: Algebraic Operations

In this part we examine algebraic operations that are useful in dealing with polynomials and quotients of polynomials, i.e., rational functions.

  1. If necessary, unassign x:
    x:='x';

    Then enter the polynomial
    P:=3*x^5-18*x^4-7*x^3+42*x^2-40*x+240;

    Use the following command to factor P
    factor(P);

    Maple will not break quadratic factors into linear ones if the corresponding roots are not rational, e.g., square roots or complex numbers with nonzero imaginary parts.

  2. We may use the solve command to obtain a complete factorization. Enter the following
    S:=solve(P=0,x);

    Notice in the complex roots that Maple uses a capital I for the imaginary unit -- rather than just i.

  3. Next convert S into a list. Enter
    rootList:=[S];

    We may check our work by multiplying the linear factors together with a scalar factor of 3. Enter
    3*product((x-rootList[k]),k=1..5);

    Use the expand command to put this back in the original form
    expand(%);

  4. Enter a new polynomial
    P2:=x^7+6*x^6-3*x^5-x^4+2*x^3-x^2+5*x-1;

    What happens when you try the factor and solve commands on this polynomial?

    Maple is not always able to determine the exact roots of a polynomial of degree greater than four. We may obtain approximate roots using the fsolve command.
    fsolve(P2=0);

    Notice that this command only returned three real roots. The other roots have nonzero imaginary parts. To obtain them, we must specify that we want complex roots. The following command obtains all seven roots and forms them into a list:
    allroots:=[fsolve(P2=0,x,complex)];

    Check your work by multiplying out the linear factors.
    k:='k';
    product((x - allroots[k]), k=1..7);
    A := expand(%);

    The result should be approximately the polynomial you started with. We can make the result look better by rounding everything off to two significant digits
    fnormal(A, 2);

  5. Now we turn to operations on quotients of polynomials. Enter the following rational expression
    Q := 2/(1+3*x) + x/(1 + x^2) + 1/(2 - x);

    Put Q in "normal" form
    Q2 := normal(Q);

    "Normal" for Maple means writing the rational expression as a quotient with all common factors canceled.

    Suppose you want to expand out the denominator. First pick off the numerator and denominator of Q2.
    Top := numer(Q2);
    Bottom := denom(Q2);

    Now expand out the denominator.
    Bottom2 := expand(Bottom);

    Now reassemble the expression
    Q3 := Top/Bottom2;

  6. Now we go in the other direction. If we expand Q3 in partial fractions, we should wind up back where we started. Enter the following:
    convert(Q3,parfrac,x);

    Is this what you started with? Is it equivalent to what you started with?

Go to CCP Homepage Go to Materials Page Go to Integral Calculus Materials Go to Table of Contents
Go Back One Page Go Forward One Page


modules at math.duke.edu Copyright CCP and the author(s), 2000