Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004
def synthetic_division(polynomial, x): value = 0 quotient = [] for coefficient in polynomial: value = value*x + coefficient quotient = quotient + [value] return quotient

Example 1  Long Division of Polynomials

Divide x2+10x+21x^2 + 10x + 21 by x+3x + 3.

x = -3 quotient = [] value = 0 for coefficient in [1, 10, 21]: value = value*x + coefficient quotient = quotient + [value] print quotient
[1] [1, 7] [1, 7, 0]
synthetic_division([1, 10, 21], -3)
[1, 7, 0]

http://www.wolframalpha.com/input/?i=(x^2+%2B+10x+%2B+21)%2F(x+%2B+3)

 

EXAMPLE 2  Long Division of Polynomials

Divide 45xx2+6x34 - 5x - x^2 + 6x^3 by 3x23x - 2.

synthetic_division([2, -1/3, -5/3, 4/3], 2/3)
[2, 1, -1, 2/3]

http://www.wolframalpha.com/input/?i=(4+-+5x+-+x^2+%2B+6x^3)%2F(3x+-+2)

 

The Division Algorithm:      

f(x)=q(x)d(x)+r(x)f(x) = q(x) \cdot d(x) + r(x)

r(x)r(x) will always be one less degree than d(x)d(x).

f(x)d(x)=q(x)+r(x)d(x)\frac{f(x)}{d(x)} = q(x) + \frac{r(x)}{d(x)}

 

EXAMPLE 3  Long Division of Polynomials

Divide 6x4+5x3+3x56x^4 + 5x^3 + 3x - 5 by 3x22x3x^2 - 2x.

(6*x^4 + 5*x^3 + 3*x - 5)/(3*x^2 - 2*x)

http://www.wolframalpha.com/input/?i=(6x^4+%2B+5x^3+%2B+3x+-+5)%2F(3x^2+-+2x)

EXAMPLE 4  Using Synthetic Division

Use synthetic division:  (5x3+6x+8)÷(x+2)(5x^3 + 6x + 8) ÷ (x + 2).

synthetic_division([5, 0, 6, 8], -2)
value = 0 quotient = [] x = -2
for coefficient in [5, 0, 6, 8]: value = value*x + coefficient quotient = quotient + [value] quotient

Remainder Theorem

Consider f(x)xc\frac{f(x)}{x - c}.

In terms of the Division Algorithm, f(x)=q(x)(xc)+r(x)f(x) = q(x) \cdot (x - c) + r(x).

Since r(x)r(x) will be one less degree than (xc)(x - c), r(x)r(x) is just some constant, rrf(x)=q(x)(xc)+rf(x) = q(x) \cdot (x - c) + r

If we evaluate f(c)f(c), f(c)=q(c)(cc)+rf(c) = q(c) \cdot (c - c) + r = rr.

Therefore, f(c)=rf(c) = r.

 

EXAMPLE 5  Using the Remainder Theorem to Evaluate a Polynomial Function

Use the Remainder Theorem to find f(2)f(2) where f(x)=x34x2+5x+3f(x) = x^3 - 4x^2 + 5x + 3.

x = 2 quotient = [] value = 0
for coefficient in [1, -4, 5, 3]: value = value*x + coefficient quotient = quotient + [value] quotient
synthetic_division([1, -4, 5, 3], 2)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_2.py", line 7, in <module> exec compile(ur'synthetic_division([_sage_const_1 , -_sage_const_4 , _sage_const_5 , _sage_const_3 ], _sage_const_2 )' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'synthetic_division' is not defined
f(x) = x^3 - 4*x^2 + 5*x + 3
f(2)

Factor Theorem

If f(x)f(x) is a polynomial:

If f(c)=0f(c) = 0, then (xc)(x - c) is a factor of f(x)f(x), and

if (xc)(x - c) is a factor of f(x)f(x), then f(c)=0f(c) = 0.

EXAMPLE 6  Using the Factor Theorem

f(x)=2x33x211x+6f(x) = 2x^3 - 3x^2 - 11x + 6.  Solve f(x)=0f(x) = 0 given that f(3)=0f(3) = 0.

x = 3 value = 0 quotient = []
for coefficient in [2, -3, -11, 6]: value = value*x + coefficient quotient = quotient + [value] quotient
x = 1/2 value = 0 quotient = [] for coefficient in [2, 3, -2]: value = value*x + coefficient quotient = quotient + [value] quotient
f(x) = 2*x^3 - 3*x^2 - 11*x + 6
factor(f)
solve(f == 0, x)
plot(f, -3, 4) + points([(-2, 0), (1/2, 0), (3, 0)], color = 'red')