# Remainder of a polynomial

#### songoku

Problem 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

Related Precalculus Mathematics Homework News on Phys.org

#### WWGD

Gold Member
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.

#### nuuskur

This exercise reminds me of Lagrange's interpolation polynomial, but in those kinds of problems we usually have it of the form
\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*}
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$.

#### epenguin

Homework Helper
Gold Member
$$\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?...

#### rcgldr

Homework Helper
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:

#### mathwonk

Homework Helper
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.

#### songoku

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
\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*}
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.

Thanks

#### rcgldr

Homework Helper
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:

#### rcgldr

Homework Helper
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:

Last edited:

#### lurflurf

Homework Helper
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)

#### lurflurf

Homework Helper
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}$$

#### mathwonk

Homework Helper
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.

#### epenguin

Homework Helper
Gold Member
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.)

#### rcgldr

Homework Helper
$$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.

#### rcgldr

Homework Helper
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:

#### neilparker62

Homework Helper
r(4)=47/3. Wild guess!

#### rcgldr

Homework Helper
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:

#### neilparker62

Homework Helper
$$\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).

#### SammyS

Staff Emeritus
Homework Helper
Gold Member
$$\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.

#### rcgldr

Homework Helper
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:

#### neilparker62

Homework Helper
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.

#### songoku

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

#### SammyS

Staff Emeritus
Homework Helper
Gold Member
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:

#### rcgldr

Homework Helper
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.

#### SammyS

Staff Emeritus
Homework Helper
Gold Member
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.)

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:

"Remainder of a polynomial"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving