Remainder of a polynomial

  • Thread starter songoku
  • Start date
  • #1
1,344
51

Homework Statement:

When f(x) is divided by (x^2 + 4) the remainder is (2x + 1) and when f(x) is divided by (x^2 + 6) the remainder is (6x - 1). Given that the remainder of f(x) when divided by (x^4 + 10x^2 + 24) is r(x), find the value of r(4)

Relevant Equations:

f(x) = divisor * quotient + remainder

remainder theorem
f(x) = A(x) . (x2 + 4) + 2x + 1

f(x) = B(x). (x2 + 6) + 6x - 1

f(x) = C(x) . (x2 + 6) . (x2 + 4) + s(x)

Then I am stuck. What will be the next step?

Thanks
 
  • Like
Likes lurflurf

Answers and Replies

  • #2
WWGD
Science Advisor
Gold Member
2019 Award
5,338
3,263
Maybe consider evaluating at different values of x like x=0, to get data
. Then maybe try to compute p(-1/2) to get remainder 0 to sub in third equation.
 
  • Like
Likes songoku
  • #3
584
376
This exercise reminds me of Lagrange's interpolation polynomial, but in those kinds of problems we usually have it of the form
[tex]
\begin{align*}
f(x) &= (x-a)a(x) + r_1(x) \\
f(x) &= (x-b)b(x) + r_2(x) \\
f(x) &= (x-a)(x-b)c(x) + r_3(x)
\end{align*}
[/tex]
the idea being that for ##f(a),f(b) ## the first part of the RHS vanishes and we can reduce it to a problem of solving a system of equations determining coefficients of the polynomial ##r_3##.

We need some other type of sorcery here unless we aren't restricted to ##\mathbb R##.
 
  • Like
Likes songoku, lurflurf, WWGD and 1 other person
  • #4
epenguin
Homework Helper
Gold Member
3,737
781
$$\left( x^{2}+6\right) =\left( x^{2}+4\right) +2$$
Might be used to worm to worm out some relation between A and B?...
 
  • Like
Likes songoku and lurflurf
  • #5
rcgldr
Homework Helper
8,697
528
I don't know how this is supposed to be done, but doing two brute force reverse divisions starting with the remainders and working backwards to find one common f(x). I got this for f(x):

$$f(x) = x^6 + x^5 + 10 x^4 + 8 x^3 + 25 x^2 + 18 x + 5 $$
Expressing f(x) as quotient · divisor + remainder for the different divisors:

$$f(x) = (x^4 + x^3 + 6x^2 + 4x + 1)(x^2 + 4) + 2x + 1 $$
$$f(x)= (x^4 + x^3 + 4x^2 + 2x + 1)(x^2 + 6) + 6x - 1 $$
$$f(x) = (x^2 + x)(x^4 + 10x^2 + 24) -2 x^3 + x^2 - 6 x + 5 $$
$$r(x) = -2 x^3 + x^2 - 6 x + 5$$
$$r(4) = -131$$
 
Last edited:
  • Like
Likes songoku and lurflurf
  • #6
mathwonk
Science Advisor
Homework Helper
10,960
1,135
Since the third divisor is the product of the first two divisors, the given data determines the values of r at 4 points, namely the (complex) roots of X^2+4 and X^2+6. Since r has degree ≤ 3, this determines r by the lagrange formula.
 
  • Like
Likes songoku and lurflurf
  • #7
1,344
51
Maybe consider evaluating at different values of x like x=0, to get data
. Then maybe try to compute p(-1/2) to get remainder 0 to sub in third equation.
Sorry but I am not sure I get the hint. I tried for x = 0, x = 1, x = -1, x = -1/2, x = 1/6 and get but there are a lot of things I still don't know such as A(0), B(0), C(0), r(0), etc

This exercise reminds me of Lagrange's interpolation polynomial, but in those kinds of problems we usually have it of the form
[tex]
\begin{align*}
f(x) &= (x-a)a(x) + r_1(x) \\
f(x) &= (x-b)b(x) + r_2(x) \\
f(x) &= (x-a)(x-b)c(x) + r_3(x)
\end{align*}
[/tex]
the idea being that for ##f(a),f(b) ## the first part of the RHS vanishes and we can reduce it to a problem of solving a system of equations determining coefficients of the polynomial ##r_3##.

We need some other type of sorcery here unless we aren't restricted to ##\mathbb R##.
I am pretty sure it is restricted to ##\mathbb R##

$$\left( x^{2}+6\right) =\left( x^{2}+4\right) +2$$
Might be used to worm to worm out some relation between A and B?...
I tried it but I think I am not getting anything

I don't know how this is supposed to be done, but doing two brute force reverse divisions starting with the remainders and working backwards to find one common f(x). I got this for f(x):

$$f(x) = x^6 + x^5 + 10 x^4 + 8 x^3 + 25 x^2 + 18 x + 5 $$
Expressing f(x) as quotient · divisor + remainder for the different divisors:

$$f(x) = (x^4 + x^3 + 6x^2 + 4x + 1)(x^2 + 4) + 2x + 1 $$
$$f(x)= (x^4 + x^3 + 4x^2 + 2x + 1)(x^2 + 6) + 6x - 1 $$
$$f(x) = (x^2 + x)(x^4 + 10x^2 + 24) -2 x^3 + x^2 - 6 x + 5 $$
$$r(x) = -2 x^3 + x^2 - 6 x + 5$$
$$r(4) = -131$$
By brute force you mean first you assume f(x) has degree of 4 and assume:
$$A(x) = a_1 x^2 + a_2 x + a_3$$
$$B(x) = b_1 x^2 + b_2 x + b_3$$

Then try to find all the coefficients? If this does not work, assume f(x) has degree 5 and repeat the process?

Since the third divisor is the product of the first two divisors, the given data determines the values of r at 4 points, namely the (complex) roots of X^2+4 and X^2+6. Since r has degree ≤ 3, this determines r by the lagrange formula.
I will think about your hint


Thanks
 
  • #8
rcgldr
Homework Helper
8,697
528
I don't know how this is supposed to be done, but doing two brute force reverse divisions starting with the remainders and working backwards to find one common f(x). I got this for f(x):
$$f(x) = x^6 + x^5 + 10 x^4 + 8 x^3 + 25 x^2 + 18 x + 5 $$
By brute force you mean first you assume f(x) has degree of 4 and assume ... .
No assumptions. I did the two reverse divisions for the two divisors starting with the remainders. f(x)/(x^2+4) has remainder 2x+1, f(x)/(x^2+6) has remainder 6x-1. The first step is to note that the constant part of the remainder is +1 when dividing by (x^2+4), and -1 when dividing by (x^2+6), this leads to the last and constant term of f(x) = 5, and the last quotient term = 1, since 5-4=+1 and 5-6=-1. I then worked the division backwards, looking for common terms in f(x) to reverse solve both cases. Below is what the completed process looks like, which is polynomial division in long form and started from the bottom and worked upwards to determine a common f(x). The process stops when the potential 3 leading terms for f(x) for both cases are the same, in this case 1 1 10 (1x^6 + 1x^5 + 10 x^4). There is some trial and error involved, as a failure case may take one or two reverse steps to be recognized. For example, before choosing 25x^2, I tried 13x^2, but this failed later on. The rest of the terms worked out to be correct on the first try.

Code:
              1  1  6  4  1                   1  1  4  2  1
      ---------------------           ---------------------
1 0 4 | 1  1 10  8 25 18  5     1 0 6 | 1  1 10  8 25 18  5
        1  0  4                         1  0  6
           1  6  8                         1  4  8
           1  0  4                         1  0  6
              6  4 25                         4  2 25
              6  0 24                         4  0 24
                 4  1 18                         2  1 18      
                 4  0 16                         2  0 12
                    1  2  5                         1  6  5
                    1  0  4                         1  0  6
                       2  1                            6 -1
 
Last edited:
  • Like
Likes songoku
  • #9
rcgldr
Homework Helper
8,697
528
Since the third divisor is the product of the first two divisors, the given data determines the values of r at 4 points, namely the (complex) roots of X^2+4 and X^2+6. Since r has degree ≤ 3, this determines r by the Lagrange formula.
It might help to explain that f(x) evaluated at the 4 roots of (x^2+4)(x^2+6) result in (C(x) · 0) + r(x), f(x) evaluated at the 2 roots of (x^2+4) result in (A(x) · 0) + 2x + 1) = 2x + 1, f(x) evaluated at the 2 roots of (x^2+6) results in (B(x) · 0) + 6x - 1 = 6x - 1.

The 4 data points are:

Code:
     x              f(x)
0:    - (2)i,        - (4)i+1
1:    + (2)i,        + (4)i+1
2: -sqrt(6)i, - (6)sqrt(6)i-1
3: +sqrt(6)i, + (6)sqrt(6)i-1
Having to use Lagrange interpolation to solve for r(x) or to calculate r(4) seems complicated due to the complex numbers, and I'm not sure if this is the intended approach either.

Showing the calculation steps, skipping past the big grind to simplify all the complex terms:

Code:
r(x) = ((x-x1)(x-x2)(x-x3)(y0))/((x0-x1)(x0-x2)(x0-x3)) +
       ((x-x0)(x-x2)(x-x3)(y1))/((x1-x0)(x1-x2)(x1-x3)) +
       ((x-x0)(x-x1)(x-x3)(y2))/((x2-x0)(x2-x1)(x2-x3)) +
       ((x-x0)(x-x1)(x-x2)(y3))/((x3-x0)(x3-x1)(x3-x2)) +
         grinding the 4 terms leads to:
r(x) = (1/2 + i/8) (x^3 - 2 i x^2 + 6 x - 12 i) +
       (1/2 - i/8) (x^3 + 2 i x^2 + 6 x + 12 i) +
       1/24 (( i sqrt(6) - 36) x + 36 i sqrt(6) + 6) (x^2 + 4) +
       1/24 ((-i sqrt(6) - 36) x - 36 i sqrt(6) + 6) (x^2 + 4)
r(x) =    x^3 + 1/2 x^2 +  6 x + 3 +
       -3 x^3 + 1/2 x^2 - 12 x + 2
r(x) = -2 x^3 +     x^2 -  6 x + 5
Note this is the approach used in a prior similar but simpler thread:
https://www.physicsforums.com/threads/problem-with-a-product-of-2-remainders-polynomials.938354
 
Last edited:
  • Like
Likes songoku and lurflurf
  • #10
lurflurf
Homework Helper
2,432
132
From the op

f(x) = A(x) . (x^2 + 4) + 2x + 1

f(x) = B(x). (x^2 + 6) + 6x - 1

A key observation is that A=B (mod x^2)

we can observe all mod (x^2 + 4) (x^2 + 6)
f(x)=r(x)
=11r(x)-10r(x)
=11(A(x) . (x^2 + 4) + 2x + 1)-10( A(x). (x^2 + 6) + 6x - 1)
=(x^2-16)A(x)+11( 2x + 1)-10( 6x - 1)

so there is no need to find A(x) B(x) or r(x) if we only want to know r(4)
 
  • Like
Likes songoku and SammyS
  • #11
lurflurf
Homework Helper
2,432
132
If we did want to find r explicitly we could save a bit of trouble
by using interpolation in x^2 ie

$$r_i(x^2)=r_{a^2}\frac{x^2-b^2}{a^2-b^2}+r_{b^2}\frac{x^2-a^2}{b^2-a^2}$$
is the unique at most quartic polynomial such that if
$$r_i(a^2)=r_{a^2}$$
$$r_i(b^2)=r_{b^2}$$
 
  • Like
Likes songoku
  • #12
mathwonk
Science Advisor
Homework Helper
10,960
1,135
also the given implies that (ax+b)(x^2+6) + (6x-1) = r(x) = (cx+d)(x^2+4) + (2x+1). so multiplying out gives a system of 4 linear equations in the 4 unknowns a,b,c,d. this may be contained in the work of lurflurf. this gives r explicitly without using lagrange or complex roots.
 
  • Like
Likes songoku
  • #13
epenguin
Homework Helper
Gold Member
3,737
781
It seems to me that the OP was close to formulating that ##f(x)## is a polynomial of which the simplest example is
$$\left[ \left( x^{2}+4\right) +\left( 2x+1\right) \right] \left[ \left( x^{2}+6\right) +\left( 6x-1\right) \right] $$but did not quite get there. He should be able to write out the most general form of polynomial with the given properties. If I'm not mistaken the answer to the question is the same for all of them. It might be more convenient to work with this example, and look at the generalisation later.

The remainder on division of a polynomial by a quartic should in general be a cubic. I get
$$8x^{3}+12x^{2}+40x+1$$
Whose value when ##x=4## I get as 865. It would be useful to know if you have been given the answer.

I am prone to error and this is a get-up-in-the-middle-of-the-night calculation, but I think the basic idea works.

(I think I am also seeing that an algebraic remainder can be different from the arithmetical remainder when numbers are substituted if you know what I mean, but it is the wrong time of day for me to think about this.)
 
  • Like
Likes songoku
  • #14
rcgldr
Homework Helper
8,697
528
$$g(x) = \left[ \left( x^{2}+4\right) +\left( 2x+1\right) \right] \left[ \left( x^{2}+6\right) +\left( 6x-1\right) \right] $$
I've already shown an example for f(x) in post #5. I renamed your example to g(x) which doesn't match the original post statements as g(x) mod (x^2 + 4) = 8x - 47, instead of 4x + 1, and g(x) mod (x^2 + 6) = -8x - 71 instead of 6x - 1.

Also in posts #6 and #9, there are 4 data points corresponding to the roots of C(x)(x^2+4)(x^2+6), and this leads to the cubic equation shown in post #9.
 
  • Like
Likes songoku
  • #15
rcgldr
Homework Helper
8,697
528
also the given implies that (ax+b)(x^2+6) + (6x-1) = r(x) = (cx+d)(x^2+4) + (2x+1). so multiplying out gives a system of 4 linear equations in the 4 unknowns a,b,c,d.
(ax+b)(x^2+6)+(6x-1) = (cx+d)(x^2+4)+(2x+1)
a x^3 + b x^2 + (6 a + 6) x + 6 b - 1 = c x^3 + d x^2 + (4 c + 2) x+ 4 d + 1
equating the coefficients:
a = c
b = d
6 a + 6 = 4 c + 2
6 b - 1 = 4 d + 1
a = c = -2, b = d = 1
r(x) = -2x^3 + x^2 - 6x + 5
 
Last edited:
  • Like
Likes songoku
  • #17
rcgldr
Homework Helper
8,697
528
A key observation is that A=B (mod x^2)
From post #5, A(x) mod (x^2) = 4x + 1, B(x) mod (x^2) = 2x + 1, so A(x) ≠ B(x).
However, from posts #12 and #15, and letting D(x) = (ax + b) and E(x) = (cx + d), and reordering from the prior posts:

D(x)(x^2+4) + (2x+1) = r(x) = E(x)(x^2+6) + (6x-1)
(ax+b)(x^2+4) + (2x+1) = r(x) = (cx+d)(x^2+6) + (6x-1)
Looking at the coefficients for x^3, a == c, and for x^2 b == d, so D(x) = E(x).
Although it doesn't take much work to solve solve for a==c and b==d using the x and constant terms as seen in post #15, your approach can also be used with D(x):

we can observe all mod (x^2 + 4) (x^2 + 6)
f(x)=r(x)
=11r(x)-10r(x)
=11(D(x) . (x^2 + 4) + 2x + 1)-10( D(x). (x^2 + 6) + 6x - 1)
=(x^2-16)D(x)+11( 2x + 1)-10( 6x - 1)
for x = 4:
r(4)=(0)D(x)+11( 9)-10( 23) = -131
which agrees with the results of prior posts.
 
Last edited:
  • Like
Likes songoku
  • #18
543
155
$$\frac{f(x)}{x^2+4}=A(x)+\frac{2x+1}{x^2+4}$$ $$\frac{f(x)}{x^2+6}=B(x)+\frac{6x-1}{x^2+6}$$ Adding: $$ \frac{2f(x)(x^2+5)}{(x^2+4)(x^2+6)} = A(x) + B(x) + \frac{(2x+1)(x^2+6)+(6x-1)(x^2+4)}{(x^2+4)(x^2+6)} $$ $$ 2\left(C(x)+\frac{r(x)}{(x^2+4)(x^2+6)}\right)(x^2+5) = A(x) + B(x) + \frac{(2x+1)(x^2+6)+(6x-1)(x^2+4)}{(x^2+4)(x^2+6)} $$ And the possibly invalid 'guess' is: $$ 2C(x)(x^2+5)= A(x)+B(x) $$ and: $$ 2r(x)(x^2+5)=(2x+1)(x^2+6)+(6x-1)(x^2+4)$$ After which we can substitute x=4 to obtain a value for r(4).
 
  • Like
Likes songoku
  • #19
SammyS
Staff Emeritus
Science Advisor
Homework Helper
Gold Member
11,315
1,006
$$\frac{f(x)}{x^2+4}=A(x)+\frac{2x+1}{x^2+4}$$ $$\frac{f(x)}{x^2+6}=B(x)+\frac{6x-1}{x^2+6}$$ Adding: $$ \frac{2f(x)(x^2+5)}{(x^2+4)(x^2+6)} = A(x) + B(x) + \frac{(2x+1)(x^2+6)+(6x-1)(x^2+4)}{(x^2+4)(x^2+6)} $$
This gives the following.
##\displaystyle \frac{f(x)}{(x^2+4)(x^2+6)} = \frac{ A(x) + B(x)}{2(x^2+5)} + \frac{(2x+1)(x^2+6)+(6x-1)(x^2+4)}{2(x^2+5)(x^2+4)(x^2+6)} ##​

That looks unlikely to to give the correct result for a number of reasons.
 
  • Like
Likes songoku
  • #20
rcgldr
Homework Helper
8,697
528
Yet another approach
##f(x) = a(x)(x^2+4)+(2x+1)##
##f(x) = b(x)(x^2+6)+(6x-1)##
multiply 1st equation by ##(x^2+6)## and 2nd equation by ##(x^2+4)##
##f(x)(x^2+6) = a(x)(x^2+4)(x^2+6)+(2x+1)(x^2+6)##
##f(x)(x^2+4) = b(x)(x^2+4)(x^2+6)+(6x-1)(x^2+4)##
subtracting 4th equation from 3rd:
##2f(x) = a(x)(x^2+4)(x^2+6)+(2x+1)(x^2+6) - b(x)(x^2+4)(x^2+6)+(6x-1)(x^2+4)##
##f(x) = (1/2)(a(x)(x^2+4)(x^2+6)+(2x+1)(x^2+6) - b(x)(x^2+4)(x^2+6)+(6x-1)(x^2+4))##
##f(x)mod((x^2+4)(x^2+6)) = r(x) = (1/2)((2x+1)(x^2+6) - (6x-1)(x^2+4))##
##r(x) = -2x^3 + x^2 - 6x + 5##
 
Last edited:
  • Like
Likes songoku
  • #21
543
155
This gives the following.
##\displaystyle \frac{f(x)}{(x^2+4)(x^2+6)} = \frac{ A(x) + B(x)}{2(x^2+5)} + \frac{(2x+1)(x^2+6)+(6x-1)(x^2+4)}{2(x^2+5)(x^2+4)(x^2+6)} ##​

That looks unlikely to to give the correct result for a number of reasons.
Thanks for the correction. The rigours of Maths demand a little more than "wild guesses". Will avoid further.
 
  • Like
Likes songoku
  • #22
1,344
51
I am really really sorry for late reply

I will try to understand all the hint and working given. I have not learnt about mod and in the end the teacher skipped this question without giving any explanation of how to do it and also not giving the correct answer.

Thank you very much for all the help
 
  • #23
SammyS
Staff Emeritus
Science Advisor
Homework Helper
Gold Member
11,315
1,006
I am really really sorry for late reply

I will try to understand all the hint and working given. I have not learnt about mod and in the end the teacher skipped this question without giving any explanation of how to do it and also not giving the correct answer.

Thank you very much for all the help
It's good to hear back from you.

The following idea seems almost too simple.

Using your function names from the OP (noticing that what you called ##s(x)## is actually the remainder ##r(x)## ) we have the following.

##\text{Eqn. (1)}\quad\quad f(x) = A(x) (x^2 + 4) + 2x + 1##

##\text{Eqn. (2)}\quad\quad f(x) = B(x) (x^2 + 6) + 6x - 1##

##\text{Eqn. (3)}\quad\quad f(x) = C(x) (x^2 + 6) (x^2 + 4) + r(x) ##

Now use @epenguin's idea from Post #4 in the form of: ##(x^2+6)-(x^2+4)=2## .

Multiply Eqn. 1 by ##(x^2+6)## and multiply Eqn. 2 by ##-(x^2+4)##. Add the resulting equations to get an expression for ##2f(x)##. (Added in Edit: This is the approach suggested by @rcgldr in Post #20.)

Take it from there.
 
Last edited:
  • Like
Likes songoku and ehild
  • #24
rcgldr
Homework Helper
8,697
528
Multiply Eqn. 1 by ##(x^2+6)## and multiply Eqn. 2 by ##-(x^2+4)##. Add the resulting equations to get an expression for ##2f(x)##.
This was done in post #20.
 
  • Like
Likes songoku
  • #25
SammyS
Staff Emeritus
Science Advisor
Homework Helper
Gold Member
11,315
1,006
This was done in post #20.
Oh! I must have overlooked that. I'll edit my post to mention that.

However, OP did state:
...
I have not learnt about mod and in the end the teacher skipped this question without giving any explanation of how to do it and also not giving the correct answer.
So rewriting the expression you gave for ##2f(x)## may help get an answer, satisfactory to @songoku's understanding.

Reordering the terms, and factoring out ##(x^2+4)(x^2+6)## gives:

## 2f(x) = (A(x) - B(x))(x^2+4)(x^2+6)+(2x+1)(x^2+6) +(6x-1)(x^2+4) ## (There's a typo in this. See below.)

Added in Edit:
That must have been a bad couple of days for me. There is a typo in that last line above this. It should read as follows.
## 2f(x) = (A(x) - B(x))(x^2+4)(x^2+6)+(2x+1)(x^2+6) - (6x-1)(x^2+4) ##
 
Last edited:
  • Like
Likes songoku

Related Threads on Remainder of a polynomial

  • Last Post
Replies
7
Views
327
  • Last Post
Replies
2
Views
1K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
9
Views
787
  • Last Post
Replies
9
Views
3K
Replies
4
Views
764
Replies
4
Views
2K
Replies
3
Views
8K
Replies
3
Views
14K
Top