# Find the remainder when $p(x)$ is divided by $x^2-a^2$ if $p(x)$ leaves remainders $a, -a$ when divided by $x+a, x-a$

Let $$a\neq0$$ and $$p(x)$$ be a polynomial of degree greater than $$2$$. If $$p(x)$$ leaves remainders $$a$$ and $$-a$$ when divided respectively by $$x+a$$ and $$x-a$$. Find the remainder when $$p(x)$$ is divided by $$x^2-a^2$$

$$p(x)=q(x).(x+a)+r_1=q(x).(x+a)+a\quad\big[r_1=p(-a)=a\big]\\ p(x)=s(x).(x-a)+r_2=s(x).(x-a)-a\quad\big[r_2=p(a)=-a\big]\\ p(x)=t(x).(x^2-a^2)+r=t(x).(x^2-a^2)+Ax+B\\ p(a)=aA+B=-a\\ p(-a)=-aA+B=a\\ B=0,\;A=-1\implies r=Ax+B=-x$$ I was wondering Is there another way to solve this problem ?

Hint $$\ \overbrace{ x\!-\!a,x\!+\!a\,\mid\, p\!+\!x\!}^{\large p(a)+a\ =\ 0\ =\ p(-a)-a\!\!\!\!\!}\!\iff\! (x\!-\!a)(x\!+\!a)\mid p\!+\!x\,$$ over a field where $$\,\color{#c00}{2a\neq 0}$$

since then we have the Bezout GCD equation $$\ x+a - (x-a)\, =\, \color{#c00}{2a}$$

which implies that $$\,x\!+\!a,\, x\!-\!a\,$$ are coprime, so their lcm = product.

Alternatively,  apply: $$\ fg\bmod fh = f(g\bmod h) =$$ mod Distributive Law (a form of CRT)

$$x\pm a\mid p\!+\!x\,\Rightarrow\, p\!+\!x\bmod x^2\!-\!a^2 = (x\!-\!a)\left[\dfrac{p\!+\!x}{x\!-\!a}\bmod x\!+\!a\right] = (x\!-\!a)[0] = 0$$

There are two of many ways to solve CCRT = Constant-case of CRT [Chinese Remainder Theorem]

Write $$p(x) = k(x)(x^2-a^2)+bx+c$$

for some $$b$$ and $$c$$. Since $$p(-a)=a \Longrightarrow a = -ab+c$$ and since $$p(a)=-a \Longrightarrow -a = ab+c$$

Solving thhis system we get $$\boxed{r(x) = -x}$$.

One possible approach would be to use partial fractions:

$$\frac{1}{x^2-a^2} = \frac{1}{2a} \left( \frac{1}{x-a} - \frac{1}{x+a}\right) .$$

On the other hand, by the given information,

$$\frac{p(x)}{x-a} = q_1(x) - \frac{a}{x-a}$$

and

$$\frac{p(x)}{x+a} = q_2(x) + \frac{a}{x+a}$$

for some quotient polynomials $$q_1, q_2$$.

Therefore,

$$\frac{p(x)}{x^2-a^2} = \frac{1}{2a} \left( \frac{p(x)}{x-a} - \frac{p(x)}{x+a} \right) = \frac{1}{2a} \left( q_1(x) - q_2(x) - \frac{a}{x-a} - \frac{a}{x+a} \right) = \\ q(x) - \frac{x}{x^2 - a^2}$$ where $$q(x) = \frac{1}{2a} (q_1(x) - q_2(x))$$ is a polynomial. It follows that the remainder of dividing $$p(x)$$ by $$x^2 - a^2$$ is $$-x$$.

.While your attempt is also right, there is this one, more in the spirit of the Chinese remainder theorem, which is a generalization of this problem.

A specific case of CRT which covers the above case is the following :

Let $$f(x)$$ and $$g(x)$$ (polynomials over a field, say) be relatively prime. Let $$s(x)$$ and $$t(x)$$ be polynomials satisfying $$s(x)f(x) + t(x)g(x) = 1$$ for all $$x$$. Then, for any pair of polynomials $$p(x),q(x)$$, the solution to the pair of polynomial equations: $$P(x) \equiv p(x) \mod f(x) \\ P(x) \equiv q(x) \mod g(x)$$ is given by: $$P(x) \equiv p(x)t(x)g(x) + q(x)s(x)f(x) \mod (fg(x))$$ where $$fg$$ is the product of $$f$$ and $$g$$.

Indeed, note that $$a \neq 0$$, so $$\frac 1a$$ is well defined. Next, we have: $$\frac 1{2a}(x+a) +\frac{-1}{2a}(x-a) = 1 \tag{1}$$

and now, we essentially want to solve for the system : $$p(x) \equiv a \mod (x+a) \\ p(x) \equiv -a \mod (x-a)$$

by the usual solution for such a pair of congruences given by CRT, from the equation $$(1)$$ we have : $$p(x) \equiv \left(a \times \frac {-1}{2a}(x-a)\right) + \left(-a \times \frac 1{2a}(x+a)\right) \mod (x^2-a^2)$$

which gives $$p(x) \equiv -x \mod (x^2 - a^2)$$.

What you did was use the structure of the remainder as $$Ax+B$$ and then find $$A$$ and $$B$$ via substitution. In case the polynomials $$f,g$$ are not linear, this won't be feasible, so you will need CRT for that.

NOTE : $$s(x),t(x)$$ can be found via the Euclidean algorithm for polynomials, more on that here.

The other answers give good elementary methods. Here's an approach from abstract algebra.

Assume that the allowable coefficients of $$p$$ are a field $$F$$ (e.g., $$\mathbb{R}$$ or $$\mathbb{C}$$). Define $$S = \{ p \in F[x]: p(\pm a) = \mp a\}$$. This set includes every polynomial of degree $$3$$ or higher that leaves the required remainders. Define $$I = \{ p \in F[x]: p(-a) = p(a) = 0\}$$. Note that $$S = I - x$$ (i.e., adding $$x$$ to any element of $$S$$ gives an element of $$I$$, and vice versa), and that $$I$$ is an ideal. $$F[x]$$ is a PID, so $$I$$ must contain all multiples of some primitive element. Linear primitive elements are easy to rule out, and clearly $$x^2 - a^2 \in I$$, so $$I = \langle x^2 - a^2\rangle$$. Thus, every element of $$S$$ is $$-x$$ plus a multiple of $$x^2 - a^2$$, and you're done.

This approach gives an obvious generalization:

Every polynomial $$p(x)$$ that satisfies $$p(x_1) = y_1, p(x_2) = y_2, \ldots, p(x_n) = y_n$$ for some fixed quantities $$x_i$$ and $$y_i$$ has the form $$p(x) = L(x) + \prod_{i=1}^n (x - x_i)$$, where $$L(x)$$ is the Lagrange interpolation polynomial.

• Downvoter: please explain? – Connor Harris Apr 12 at 19:03