3

Given the polynomial:

$P\left(x\right)=x^{100}+x^{50}-2x^4-x^3+x+1$

What is the remainder of $\frac{P(X)}{x^3+x}$?

I don't think the long division is efficient the way to go, and the remainder theorem doesn't seem to be applicable here as $x^3+x$ is not linear. Could I have some hints on how to approach this? Thank you.

Alexander
  • 573
  • 4
  • 10

6 Answers6

2

We have $$ P(x) = Q(x)(x^3 + x) + r(x) $$ where $Q(x)$ and $r(x)$ are polynomials, and $r(x)$ has degree at most $2$. Now, considering that $Q(x)(x^3 + x)$ has roots at $x = -i, 0$ and $i$, we can use this to get information about $r(x)$, namely that $r(\pm i) = P(\pm i)$ and $r(0) = P(0)$. These three points together with what we know about the degree of $r$ is enough to find $r$ exactly.

Arthur
  • 204,511
  • That will work, but solving those equations is much more work than using modular arithmetic (which can be done mentally in under a minute, e.g. see my answer). – Bill Dubuque Aug 23 '17 at 14:23
2

$x^3+x=x(x+i)(x-i)$

Remainder of $P(x)/(x^3+x)$ is a (at most) second degree polynomial

$R(x)=a x^2+bx+c$

We have $P(i)=-1+2i$ and $R(i)=-a + i b + c$ so $-a + i b + c=-1+2i$

then $P(-i)=-1-2i$ and $R(-i)=-a - i b + c$ so $-a - i b + c=-1-2i$

and $P(0)=1$ and $R(0)=c$

So $c=1$. Substitute in the first two equations

$-a+ib+1=-1+2i;\;-a-ib+1=-1-2i$

add the two equations $-2a+2=-2$ then $a=2$

substitute and get $b=2$

Therefore the remainder is $R(x)=2x^2+2x+1$

Hope this helps

Raffaele
  • 26,731
  • The remainder should be $x^2 + 2x + 2$ – MCCCS Aug 23 '17 at 10:05
  • @MCCCS No. You are wrong. https://www.wolframalpha.com/input/?i=PolynomialRemainder%5Bx%5E100+%2B+x%5E50+-+2+x%5E4+-+x%5E3+%2B+x+%2B+1,+x%5E3+%2B+x,+x%5D – Raffaele Aug 23 '17 at 10:10
  • @MCCCS Above also concurs with the one-line computation in my answer (doing it this simple way often eliminates arithmetic errors arising in more complex computations such as those above). – Bill Dubuque Aug 23 '17 at 14:38
  • Yes you're right. – MCCCS Aug 23 '17 at 14:57
2

Applying: $\ fg\bmod fh\ =\ f\:(\,g\bmod h)\, =\, $ mod Distributive Law makes it very easy

$\quad \begin{align}P\!-1\,\bmod\, {x^{\large 3}\!+x}\, &=\, x\left(\dfrac{P\!-\!1}{x}\bmod\, \color{#c00}{x^{\large 2}+\,1}\right)\\[.3em] &=\,x\, (\,2x+2\,)\, \ {\rm by} \, \ \color{#c00}{x^{\large 2}\!\equiv -1}\,\Rightarrow\, x^{\large 49}\!\equiv x(x^{\large 4})^{\large 12}\!\equiv x\,1^{\large 12}\!\equiv x\ \ {\rm etc}\\[.3em] \end{align}$

Bill Dubuque
  • 282,220
1

Reduce the degree of polynomial using $x^3=-x$ from $d=100$ to $d=2$.

Ghartal
  • 4,348
  • 1
    That's exactly what long division does. Not that there's anything wrong with that. – Arthur Aug 23 '17 at 09:36
  • 1
    @arthur With traditional long division you would first replace $x^{100}$ with $-x^{98}$ by subtracting $x^{97}(x^3+x)=x^{100}+x^{98}$, then by $x^{96}$, etc, taking quite a few steps. Just working $\mod x^3-x$ allows you to say that $x^3 \equiv -x$ and directly replace $x^{100}$ by $x^{100} = (x^3)^{33} x \equiv (-x)^{33}x$. It may be equivalent, but it is much faster. – Jaap Scherphuis Aug 23 '17 at 09:48
  • @Jaap But it is much easier to first factor out $,x,,$, then reduce mod $,x^2+1,,$ using $,x^2\equiv -1,,$ yielding the result in less than a minute of mental arithmetic, e.g. see my answer. – Bill Dubuque Aug 23 '17 at 14:25
  • @BillDubuque Yes, I realised that after commenting. As long as you keep at least one factor $x$, you can use $x^2\equiv -1$ or $x^4 \equiv 1$, so $x^{100} \equiv x^4 \equiv -x^2$. – Jaap Scherphuis Aug 23 '17 at 15:10
  • @Jaap Yes, more precisely $\ xf\bmod x^3!+x, =, x,(f\bmod x^2!+1)\ $ by $!\bmod!$ distributivity. $\ \ $ – Bill Dubuque Aug 23 '17 at 15:46
  • @Arthur The point is that huge optimizations are possible via modular arithmetic - see my comments above. – Bill Dubuque Aug 23 '17 at 15:49
0

$P(x)=x^{100}+x^{50}-2x^4-x^3+x+1$

Let's divide $x^{100}+x^{50}$ by $x^3+x$

-> $Q=x^{97},r=-x^{98}+x^{50}$

Divide $-x^{98}+x^{50}$ by $x^3+x$

-> $Q=-x^{95}, r=x^{96}+x^{50}$

Divide $x^{96}+x^{50}$ by $x^3+x$

-> $Q=x^{93}, r=-x^{94}+x^{50}$

...

Can you see a pattern?

...

The pattern ends here:

Divide $x^{52}+x^{50}$ by $x^3+x$

-> $Q=x^{49}, r=0$


Now return to the original polynomial (without the first two term):

$-2x^4-x^3+x+1$

And do polynomial division as you do normally!

MCCCS
  • 1,695
-1

The remainder is $$\frac{x+2}{x^2+1}\:+\:\frac 1x\qquad\text{or}\quad2x^2+2x+1\;\;\text{respectively}\\[3ex]$$ obtained by taking a lazy approach: Feeding the command

apart((x**100+x**50-2*x**4-x**3+x+1)/(x**3+x))

into http://live.sympy.org/ , thus asking Python to go through the long division in short time, yields $$\frac{P(x)}{x(x^2+1)}\;=\;\sum_{m=48}^{24}(-1)^mx^{2m+1}-2x-1+\frac 1x+\frac{x+2}{x^2+1}\\[3ex]$$

Note that the $\,\sum\,$ equals $(x^{100}+x^{50})/(x^3+x)=x^{49}(x^{50}+1)/(x^2+1)\,$, whence no contribution to the remainder.

... did I fail to address the issue in question?

Hanno
  • 6,776